Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement QuickLoop (SOFIE-2878) #1112

Merged
merged 48 commits into from
Sep 26, 2024
Merged

Conversation

ianshade
Copy link
Contributor

@ianshade ianshade commented Jan 8, 2024

About the Contributor

This pull request is posted on behalf of the BBC.

Type of Contribution

This is a:

Feature

Current Behavior

Currently Sofie allows looping of an entire Rundown Playlist. Whether the playlist should be looping can only be set by the Blueprints (usually done according to properties coming from the NRCS).

New Behavior

What it does:

  • The QuickLoop feature enables users to define a looping section within Rundown Playlists using Start and End markers.
  • Automatically loops between a designated section.

How to use it:

  1. Set Markers:

    • Right-click on a part within the Rundown Playlist.
    • Choose "Set as QuickLoop Start" or "Set as QuickLoop End" from the context menu.
  2. Activate QuickLoop:

    • QuickLoop mode will automatically trigger when any part between the Start and End markers is taken.
    • If configured, parts within the QuickLoop will progress automatically.
  3. Modify the QuickLoop:

    • Set new markers (by context-clicking) to extend or shorten the QuickLoop section.
    • Execute adlibs without interrupting the QuickLoop.
    • Ensure logical marker placement to prevent errors.
  4. Exit QuickLoop Mode:

    • Clear the markers using the context menu, or set a part outside of the QuickLoop as Next.
    • Playback continues seamlessly after exiting QuickLoop Mode.

Deviations from the RFC, and some more details:

  • A Rundown Playlist with user-defined QuickLoop has similar indication in the Lobby and Rundown View as a looping Playlist.
  • Setting a Start marker on a part after the End marker results in clearing the End marker, and vice versa.
  • Clearing/exiting the QuickLoop by the use of a hotkey or AdLib Action is not implemented.
  • The following settings are available in the Generic properties of a Studio:
    • Enable QuickLoop (enables QuickLoop context menu options, but doesn't affect Playlist looping enabled by the NRCS/blueprints)
    • Force Auto in a Loop, with three available options:
      • Disabled (default - consistent with existing Playlist loop behaviour)
      • Enabled, but skipping parts with undefined or 0 duration
      • Enabled on all Parts, applying QuickLoop Fallback Part Duration if needed
    • QuickLoop Fallback Part Duration
  • The QuickLoop section is indicated as shown below
    image
    image
    image

Testing Instructions

Setting and Clearing Markers:

  1. Open Sofie GUI and navigate to a Rundown Playlist that does not have looping enabled by the NRCS.
  2. Right-click on a Part (as long as it is not marked as invalid) and verify that you can set a Start marker.
  3. Right-click on another Part (as long as it is not marked as invalid) and set the End marker.
  4. Ensure that setting a Start marker after the End marker will clear the previous End marker, and vice versa.
  5. Verify that you can clear the Start and End markers from the context menu.
  6. Test that setting the Start and End markers on the same Part creates a single-part loop.

Loop Mode Functionality:

  1. Set the Start and End markers within a Rundown Playlist.
  2. Take a Part within the defined loop section.
  3. Verify that the Loop Mode is triggered and subsequent Parts progress automatically.
  4. Check that Parts within the loop show the AUTO indicator in the GUI.
  5. Ensure that when the end of the loop is reached, the first item in the loop becomes Next and an Auto Take occurs.
  6. Test exiting the Loop Mode using the dedicated hotkey, AdLib Action, or context menu item.
  7. Confirm that played adlibs are removed each time the loop starts over.
  8. Verify behavior when a dynamic part is inserted while playing the End part of the loop.
  9. Test for Parts with a duration of 0 seconds or undefined within the looping section and verify the default behavior or any custom settings applied.
  10. Check that all Parts outside of the loop are dimmed but retain functionality.
  11. Verify the indication showing that the Loop Mode is active.

Additional Scenarios:

  1. Test setting Start/End markers on different Parts to modify the looping section in the Loop Mode.
  2. Verify that setting a Part outside of the looping section as Next and taking it exits the Loop Mode.
  3. Ensure that ingest operations altering the order of Segments and Parts or removing Parts containing markers stop the Loop Mode and delete the markers.
  4. Test ingest operations hiding the Segment containing marked parts and verify Loop Mode behavior.

Testing Instructions for Studio Settings:

Enable QuickLoop:

  1. Verify that enabling QuickLoop in the Studio settings enables corresponding context menu options.

Force Auto in a Loop:

  1. Test each option for "Force Auto in a Loop" to ensure they behave as described:
  • Verify that the "Disabled" option maintains consistency with existing Playlist loop behavior, not applying auto-next.
  • Validate the behavior of the "Enabled, but skipping parts with undefined or 0 duration" option.
  • Confirm that the "Enabled on all Parts, applying QuickLoop Fallback Part Duration if needed" option functions correctly.

QuickLoop Fallback Part Duration:

  1. Verify that the QuickLoop Fallback Part Duration setting is applied appropriately in conjunction with corresponding Force Auto in a Loop value.

Regression testing instructions for the existing Playlist Looping Feature:

  1. Validate that existing Blueprints continue to function without requiring modifications for Playlist looping.
  2. Verify that Playlist looping enabled by the NRCS/Blueprints functions as expected and is indicated in the GUI as it used to be.
  3. Confirm that Start and End markers are correctly locked to the Playlist start and end and the user can not override them.

Other Information

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

@jstarpl jstarpl added the Contribution from BBC Contributions sponsored by BBC (bbc.co.uk) label Jan 9, 2024
@jstarpl jstarpl self-assigned this Jan 9, 2024
Copy link

codecov bot commented Jan 11, 2024

Codecov Report

Attention: Patch coverage is 40.06381% with 1315 lines in your changes missing coverage. Please review.

Project coverage is 60.68%. Comparing base (8e16b94) to head (1d87ef1).
Report is 39 commits behind head on release52.

Files with missing lines Patch % Lines
...server/publications/partInstancesUI/publication.ts 0.00% 235 Missing and 1 partial ⚠️
meteor/server/publications/partsUI/publication.ts 0.00% 218 Missing and 1 partial ⚠️
...ker/src/playout/model/services/QuickLoopService.ts 23.72% 180 Missing ⚠️
meteor/server/publications/lib/quickLoop.ts 0.00% 147 Missing and 1 partial ⚠️
...ckages/webui/src/client/lib/rundownPlaylistUtil.ts 53.01% 148 Missing ⚠️
...ications/partInstancesUI/rundownContentObserver.ts 0.00% 78 Missing and 1 partial ⚠️
...ver/publications/partsUI/rundownContentObserver.ts 0.00% 71 Missing and 1 partial ⚠️
...blications/partInstancesUI/reactiveContentCache.ts 0.00% 51 Missing and 1 partial ⚠️
...erver/publications/partsUI/reactiveContentCache.ts 0.00% 50 Missing and 1 partial ⚠️
meteor/server/api/rest/v1/typeConversion.ts 0.00% 44 Missing ⚠️
... and 15 more
Additional details and impacted files
@@              Coverage Diff              @@
##           release52    #1112      +/-   ##
=============================================
- Coverage      61.36%   60.68%   -0.68%     
=============================================
  Files            449      459      +10     
  Lines          76483    78126    +1643     
  Branches        4936     3599    -1337     
=============================================
+ Hits           46933    47414     +481     
- Misses         29422    30516    +1094     
- Partials         128      196      +68     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jstarpl jstarpl changed the title feat: Implement QuickLoop feat: Implement QuickLoop (SOFIE-2878) Jan 22, 2024
@nytamin nytamin self-requested a review April 4, 2024 09:35
@jstarpl
Copy link
Member

jstarpl commented Apr 22, 2024

A workshop has been held on 2024/04/12 and the contributor will still address the comments above.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty file

}
}

function stringsToIndexLookup(strings: string[]): Record<string, number> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be nicer if this returned a Map, then it could preserve the RundownId or whatever ProtectedString typings

this publication, similarly to uiParts, contains some overrides applied to support QuickLoop

TODO: apply these overrides during playout instead of modifying the actual part instances
@jstarpl jstarpl changed the base branch from release51 to release52 September 17, 2024 08:55
@mint-dewit
Copy link
Contributor

After testing this in a Production System, BBC have found a couple of bugs in this PR that we'd like to address before this gets merged. It would probably be good if you could hold off on merging until we've been able to address as we are aiming to fix these in our R51 version first.

The following bugs have been brought to my attention:

  • Removing the start part while in the loop
  • Removing the end part while in the loop
  • Resetting the rundown sometimes clears the loop
  • Starting a loop while a part has been playing for a while causes the loop to skip parts

@jstarpl
Copy link
Member

jstarpl commented Sep 17, 2024

Thanks for keeping us posted. I'm going to change this to a draft then.

@jstarpl jstarpl marked this pull request as draft September 17, 2024 14:22
@mint-dewit mint-dewit marked this pull request as ready for review September 19, 2024 13:53
@mint-dewit
Copy link
Contributor

The aforementioned issues have all been addressed now

@jstarpl jstarpl merged commit 8c154af into nrkno:release52 Sep 26, 2024
43 of 46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contribution from BBC Contributions sponsored by BBC (bbc.co.uk) Contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFC: Updating the Looping Feature with Per-Part Looping
5 participants