Skip to content

Commit 77dfae0

Browse files
SG-40929: Continued fixes based on QA. (AcademySoftwareFoundation#963)
### Summarize your change. It turns out there were a few big holes in my previous PR for SG-40182. * in rvui.mu and elsewhere, many bind() calls for keyboard events _(or mouse inputs)_ that dont have equivalent menu item also needed categorizations. There was a missing bind() overload in app_utils.mu. to do this so it was added. This is by far the largest change. * in app_utils.mu, calling the "compositeStateFunc()" could return garbage (yet another mu bug, which I'm not fixing here) causing the event func to be called even if the category was disabled. It was replaced with a more straightforward check. (the bug seemed to happen mostly if the handler func defined in menuItem() started with a leading "~" before its name, eg, "~togglePlay") * in mode_manager.mu, needed to add equivalent protections to filterLiveReviewEvents() which got removed without an equivalent in the shuffle. * in annotate_mode.mu, needed to make disappear the paint tools if we are in LR presenter mode (eg: annotate_categories is disabled) * in scrub_offset.mu, needed to guard on scrubbing if playcontrol category is disabled. * more filterLiveReviewEvents were removed, and replaced with the appropriate binding (or alternative to bind funcs) --- Things to test, *_when in viewer mode:...._* - fix: stepForward 1 or 100 frames is now blocked - fix: stepBackward 1 or 100 frames is now blocked - fix: motion scope popup menu is blocked - fix: clicking and dragging in timeline/ motion scope is blocked - fix: marking frames in timeline is blocked - fix: setting point in timeline is blocked - fix: annotate panel is closed - fix: cannot scrub in scrub_offset mode - fix: rotate ibage is blocked - fix: mousewheel to scrub is disabled - fix: dragging in main view to scrub is blocked - fix: doing space to play is blocked. viewmode categories: ViewMode Categories were off in viewer mode before, but enabled now. (toggle this category in live_review.py) viewmode key shortcuts: - fix: kbd keys are blocked: M, alt-r, alt-l, shift-l, shift-r, ctrl-m, down, p, pgup, pgdn. - fix: kbd keys are blocked : aldkspmzvh,.<>OSorcR/ when in nudge mode... - fix: kbd keys are blocked : left,right,up,down, control and shift variations. - fix: kbd keys are blocked : z, ctrl-z, alt-n, ### Describe the reason for the change. Stephen reported a few problems reported with being able to do some things in LR that he shouldnt be able to do when in muc presenter mode. (participant = viewer) ### Describe what you have tested and on which operating system. macOS ### Add a list of changes, and note any that might need special attention during the review. ### If possible, provide screenshots. --------- Signed-off-by: Patrick Bergeron <patrick.bergeron@autodesk.com>
1 parent c03e7b1 commit 77dfae0

File tree

11 files changed

+202
-184
lines changed

11 files changed

+202
-184
lines changed

src/lib/app/mu_rvui/app_utils.mu

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ MenuStateFunc := (int;);
2525
\: (void; Event ignored) { f(); };
2626
}
2727

28+
29+
\: checkAndBlockEventCategory(bool; string category)
30+
{
31+
if (!commands.isEventCategoryEnabled("category"))
32+
{
33+
sendInternalEvent("category-event-blocked", category);
34+
return false;
35+
}
36+
return true;
37+
}
38+
2839
\: makeCategoryEventFunc (EventFunc; string category, EventFunc f) {
2940
\: (void; Event ev) {
3041
if (!commands.isEventCategoryEnabled(category))
@@ -49,6 +60,11 @@ operator: ~ (EventFunc; VoidFunc f)
4960
bind(mode, table, event, makeCategoryEventFunc(category, makeEventFunc(F)), doc);
5061
}
5162

63+
\: bind (void; string mode, string table, string event, string category, EventFunc F, string doc="")
64+
{
65+
bind(mode, table, event, makeCategoryEventFunc(category, F), doc);
66+
}
67+
5268
\: bind (void; string ev, VoidFunc F, string doc="")
5369
{
5470
bind("default", "global", ev, F, doc);
@@ -209,7 +225,7 @@ operator: ~ (EventFunc; VoidFunc f)
209225

210226
// create composite function that checks if the category is enabled and then calls the function
211227
let compositeFunc = \: (void; Event ev) {
212-
if (compositeStateFunc() == DisabledMenuState)
228+
if (!commands.isEventCategoryEnabled(category))
213229
sendInternalEvent("category-event-blocked", category);
214230
else
215231
func(ev);

src/lib/app/mu_rvui/extra_commands.mu

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ use glyph;
9191
use gl;
9292
use glu;
9393
use io;
94+
use app_utils;
9495
use mode_manager;
9596
require system;
9697

@@ -384,20 +385,20 @@ require system;
384385

385386
\: toggleForwardsBackwards (void;)
386387
{
387-
if (filterLiveReviewEvents()) {
388-
sendInternalEvent("live-review-blocked-event");
388+
if (!checkAndBlockEventCategory("playcontrol_category"))
389+
{
389390
return;
390391
}
392+
391393
setInc(-inc());
392394
redraw();
393395
}
394396

395397
\: toggleRealtime (void;)
396398
{
397-
if (filterLiveReviewEvents()) {
398-
sendInternalEvent("live-review-blocked-event");
399+
if (!checkAndBlockEventCategory("playcontrol_category"))
399400
return;
400-
}
401+
401402
State state = data();
402403

403404
if (isRealtime())
@@ -462,10 +463,8 @@ require system;
462463

463464
\: toggleFilter (void;)
464465
{
465-
if (filterLiveReviewEvents()) {
466-
sendInternalEvent("live-review-blocked-event");
466+
if (!checkAndBlockEventCategory("viewmode_category"))
467467
return;
468-
}
469468

470469
State state = data();
471470
setFiltering(if getFiltering() == GL_NEAREST then GL_LINEAR else GL_NEAREST);
@@ -487,10 +486,9 @@ require system;
487486

488487
\: stepForward (void; int n)
489488
{
490-
if (filterLiveReviewEvents()) {
491-
sendInternalEvent("live-review-blocked-event");
489+
if (!checkAndBlockEventCategory("playcontrol_category"))
492490
return;
493-
}
491+
494492
let f = frame(),
495493
newFrame = frame() + n,
496494
inInOut = (inPoint() <= f && outPoint() >= f),
@@ -512,10 +510,9 @@ require system;
512510

513511
\: stepBackward (void; int n)
514512
{
515-
if (filterLiveReviewEvents()) {
516-
sendInternalEvent("live-review-blocked-event");
513+
if(!checkAndBlockEventCategory("playcontrol_category"))
517514
return;
518-
}
515+
519516
let f = frame(),
520517
newFrame = frame() - n,
521518
inInOut = (inPoint() <= f && outPoint() >= f),

src/lib/app/mu_rvui/mode_manager.mu

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,24 @@ class: ModeManagerMode : MinorMode
213213
{
214214
\: (int; )
215215
{
216-
if (filterLiveReviewEvents())
217-
then DisabledMenuState
218-
else if entry.mode eq nil
219-
then UncheckedMenuState
220-
else if entry.mode._active
221-
then CheckedMenuState
222-
else UncheckedMenuState;
216+
// Special handling of mode toggling if certain categories of actions are disabled.
217+
if (!commands.isEventCategoryEnabled("annotate_category") && entry.name == "annotate_mode")
218+
{
219+
sendInternalEvent("category-event-blocked", "annotate_category");
220+
return DisabledMenuState;
221+
}
222+
223+
if (!commands.isEventCategoryEnabled("media_category") && entry.name == "session_manager")
224+
{
225+
sendInternalEvent("category-event-blocked", "media_category");
226+
return DisabledMenuState;
227+
}
228+
229+
if entry.mode eq nil
230+
then UncheckedMenuState
231+
else if entry.mode._active
232+
then CheckedMenuState
233+
else UncheckedMenuState;
223234
};
224235
}
225236

@@ -426,6 +437,19 @@ class: ModeManagerMode : MinorMode
426437

427438
\: toggleModeEntry (void; Event event, ModeEntry entry, ModeManagerMode mm)
428439
{
440+
// Special handling of mode toggling if certain categories of actions are disabled.
441+
if (!commands.isEventCategoryEnabled("annotate_category") && entry.name == "annotate_mode")
442+
{
443+
sendInternalEvent("category-event-blocked", "annotate_category");
444+
return;
445+
}
446+
447+
if (!commands.isEventCategoryEnabled("media_category") && entry.name == "session_manager")
448+
{
449+
sendInternalEvent("category-event-blocked", "media_category");
450+
return;
451+
}
452+
429453
mm.toggleEntry(entry);
430454
}
431455

src/lib/app/mu_rvui/motion_scope.mu

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,6 @@ class: MotionScope : Widget
376376

377377
method: clickFunction (void; Event event, (void;int,int,int) F)
378378
{
379-
if (filterLiveReviewEvents()) {
380-
sendInternalEvent("live-review-blocked-event");
381-
return;
382-
}
383379
deb ("clickFunction");
384380

385381
// Disregard drag events if we didn't mouse-down in this widget.
@@ -704,11 +700,6 @@ class: MotionScope : Widget
704700

705701
method: popupOpts (void; Event event)
706702
{
707-
if (filterLiveReviewEvents()) {
708-
sendInternalEvent("live-review-blocked-event");
709-
return;
710-
}
711-
712703
if (isCurrentFrameIncomplete() ||!_pointerInMotionScope)
713704
{
714705
event.reject();
@@ -890,11 +881,11 @@ class: MotionScope : Widget
890881

891882
_frameMap = int[]();
892883
init(name,
893-
[ ("pointer-1--push", clickFunction(,setFrameOrNudge), "Set Frame On Magnifier"),
894-
("pointer-1--drag", clickFunction(,scrubSetFrame), "Drag Frame On Magnifier"),
895-
("pointer-1--shift--push", clickFunction(,setInOutPointDelayed("in",,,)), "Set In Point on Magnifier"),
896-
("pointer-1--shift--drag", clickFunction(,setInOutPointDelayed("out",,,)), "Select In/Out Region on Magnifier"),
897-
("pointer-3--push", popupOpts, "Popup Magnifier Options"),
884+
[ ("pointer-1--push", makeCategoryEventFunc("playcontrol_category", clickFunction(,setFrameOrNudge)), "Set Frame On Magnifier"),
885+
("pointer-1--drag", makeCategoryEventFunc("playcontrol_category", clickFunction(,scrubSetFrame)), "Drag Frame On Magnifier"),
886+
("pointer-1--shift--push", makeCategoryEventFunc("playcontrol_category", clickFunction(,setInOutPointDelayed("in",,,))), "Set In Point on Magnifier"),
887+
("pointer-1--shift--drag", makeCategoryEventFunc("playcontrol_category", clickFunction(,setInOutPointDelayed("out",,,))), "Select In/Out Region on Magnifier"),
888+
("pointer-3--push", makeCategoryEventFunc("playcontrol_category", popupOpts), "Popup Magnifier Options"),
898889
("pointer--move", handleMotion, ""),
899890
("pointer--leave", handleLeave, "Track pointer leave"),
900891
("pointer-1--shift--release", releaseDrag, ""),

0 commit comments

Comments
 (0)