-
Notifications
You must be signed in to change notification settings - Fork 50
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
Collection cue status reporting #266
base: develop
Are you sure you want to change the base?
Collection cue status reporting #266
Conversation
The original behavior was intended, the idea is that the collection cue is simply a trigger for multiple cues at once. First, I'd like to preserve the old behavior, we can provide a flag to enable a "tracking" mode, or if you have a better name feel free to use it. We should keep the old as the default, for compatibility reasons. Second, the current implementation is going to miss some "events", you should also connect the "stopped", "interrupted", and the "error" signal. If some cue is stopped before it reach the end, you will not count it. Third, the stop behavior might be equally confusing, someone might expect that all the cues would stop. I'm not sure if we even need it in it's current form? |
Thanks for the review!
Agreed! Tracking mode is a nice name, but I'm not sure if that requires some further explanation for user. Maybe writing few sentences about it in documentation would be enough?
That's something I realized today while messing with the app more. I'm not sure if simply connecting more events would be enough, but that's to be tested.
You mean stopping the collection cue alone? Yes, that would be logical consequence of the cue being tracked, but there's no control in UI for this as far as I see, and that's also the case with other types of cues like 'command'. I think we can implement it just to make it easier if one day such control was introduced. Correct me if I'm wrong or if you had something else in mind. |
Alright, I tested the app and am unable to find any problems or misbehaviors. @FrancescoCeruti if you see something that could be improved in the code, I'm happy to make adjustments. I thought to maybe change the simplistic logic with counter to more precise ID comparison and maybe check additionally if a child que is actually in stopped state, but at the same time I cannot think about any circumstance that this makes a problem. Moreover I prefer simpler solutions. |
Thanks, I'll look and let you know :) |
Would it be preferable to count down when cues end instead of up? For instance: say I have a (tracking) collection cue containing two audio cues, and I Go the collection. Whilst it's still running, I edit the collection and add a third audio cue. When the two running audio cues finish, the collection cue does not enter a stopped state, because it is now expecting three cues to finish, not two. Counting down - "I started two cues, so I'm waiting for two cues to finish" - would prevent this. On the other hand, starting a (tracking) collection cue (that counts down as cues end) with three cues and removing one of them whilst the collection is running does mean that it now waits for a cue that's no longer part of the collection to finish before entering a stop state... Admittedly I wouldn't expect to remove or add cues to collections under show conditions, but it is a scenario I could see users getting into when building or editing a show.
Setting (And setting it to a value between |
Isn't / Wasn't (in 0.5) there an option to trigger cues on starting a cue? ("AutoNext" or something like this allowed this IIRC). Maybe instead use a generic way to either start a following cue on cue start or end, instead of creating a specific setting.
This problem should be prevented properly IMHO, thank you for bringing this up. I had similar problem in QLC+ recently, where I edited something in the wrong moment and had a function literally never stop. If you don't know why it doesn't work and you are stressed, it's the worst kind of experience. Can adding / removing cues potentially alter the counter in the right direction? |
The option is still there, but it's not a substitute for the current behavior, i think you could emulate it using triggers
Yes, it will behave like the cue is still in the collection (until it's finished) ... a lot better than a deadlock. The only gripe is still the "stop" ... someone might want to do the same as the "start" action and to choose what action to trigger on the other cue, but we could add that at a later point to keep things easier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As noted we should use a countdown, which will prevent "deadlocks" if a cue is added to the collection.
@@ -82,12 +111,20 @@ def __init__(self, **kwargs): | |||
self.collectionView.setAlternatingRowColors(True) | |||
self.collectionGroup.layout().addWidget(self.collectionView) | |||
|
|||
self.bottomBarGroup = QWidget(self) | |||
self.bottomBarGroup.setLayout(QHBoxLayout()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.bottomBarGroup.setLayout(QHBoxLayout()) | |
self.bottomBarGroup.setLayout(QHBoxLayout()) | |
self.bottomBarGroup.layout().setContentsMargins(0, 0, 0, 0) |
We can remove the margins of the inner layout
|
||
class CollectionCueSettings(SettingsPage): | ||
Name = QT_TRANSLATE_NOOP("SettingsPageName", "Edit Collection") | ||
Tracking = QT_TRANSLATE_NOOP("CollectionTracking", "Collection tracking") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that "Tracking mode" could be a better description for the option
def __stop__(self, fade=False): | ||
for target_id, action in self.targets: | ||
target_cue = self.app.cue_model.get(target_id) | ||
target_cue.end.disconnect(self.mark_as_done) | ||
target_cue.stopped.disconnect(self.mark_as_done) | ||
target_cue.interrupted.disconnect(self.mark_as_done) | ||
target_cue.error.disconnect(self.mark_as_done) | ||
target_cue.stop() | ||
self.ended_cues_count = 0 | ||
|
||
return True | ||
|
||
def mark_as_done(self, cue): | ||
self.ended_cues_count += 1 | ||
if self.ended_cues_count == len(self.targets): | ||
self.ended_cues_count = 0 | ||
self._ended() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't stop tracking the cue when we "mark (it) as done", if the cue is started again, the counting will be off
When I first gave LiSP a shot, I found the behavior of Collection cue unexpected - it only executes other cues and immediately ends, so it's completely asynchronous. Because of that when setting up triggers on "Ended" event, it actually fires when the cue is started, so it works exactly like "Started" event and thus it feels more like a bug than intentional behavior.
With this change:
If for some reason the original behavior is expected, please explain, I'm open for discussion as this is a feature that I'd actually like to see here.
Please also review the implementation. The change is quite simple and it works fine in my testing, but I don't know the application very well and maybe I didn't test some use-cases.
On a side note, this feature relies on ended cues count. We can make it more strict by comparing those targets identifiers, but it's enough for PoC.