Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/git-moss/DrivenByMoss
Browse files Browse the repository at this point in the history
  • Loading branch information
git-moss committed Dec 15, 2024
2 parents 1c297d1 + 0563e9f commit d191efc
Showing 1 changed file with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ public void execute (final ButtonEvent event, final int velocity)
return;
}

// Set sequencer resolution
if (this.surface.isPressed (ButtonID.GROOVE))
{
final IView active = this.surface.getViewManager ().getActive ();
if (active instanceof final AbstractSequencerView<?, ?> sequencerView)
sequencerView.setResolutionIndex (this.index);
return;
}

final ITrackBank trackBank = this.model.getCurrentTrackBank ();
final ITrack track = trackBank.getItem (this.index);
if (!track.doesExist ())
Expand Down Expand Up @@ -110,15 +119,6 @@ public void execute (final ButtonEvent event, final int velocity)
return;
}

// Set sequencer resolution
if (this.surface.isPressed (ButtonID.GROOVE))
{
final IView active = this.surface.getViewManager ().getActive ();
if (active instanceof final AbstractSequencerView<?, ?> sequencerView)
sequencerView.setResolutionIndex (this.index);
return;
}

// Track selection or group expansion
track.selectOrExpandGroup ();
}
Expand Down Expand Up @@ -152,6 +152,14 @@ public int getButtonColor ()
return MaschineColorManager.COLOR_BLACK;
}

if (this.surface.isPressed (ButtonID.GROOVE))
{
final IView active = this.surface.getViewManager ().getActive ();
if (active instanceof final AbstractSequencerView<?, ?> sequencerView)
return sequencerView.getResolutionIndex () == this.index ? MaschineColorManager.COLOR_GREEN : MaschineColorManager.COLOR_DARK_GREY;
return MaschineColorManager.COLOR_BLACK;
}

final ITrack track = trackBank.getItem (this.index);

if (!track.doesExist ())
Expand All @@ -166,13 +174,6 @@ public int getButtonColor ()
if (this.surface.isPressed (ButtonID.RECORD))
return track.isRecArm () ? MaschineColorManager.COLOR_RED : MaschineColorManager.COLOR_DARK_GREY;

if (this.surface.isPressed (ButtonID.GROOVE))
{
final IView active = this.surface.getViewManager ().getActive ();
if (active instanceof final AbstractSequencerView<?, ?> sequencerView)
return sequencerView.getResolutionIndex () == this.index ? MaschineColorManager.COLOR_GREEN : MaschineColorManager.COLOR_DARK_GREY;
return MaschineColorManager.COLOR_BLACK;
}

// Track selection
return ((MaschineColorManager) this.model.getColorManager ()).dimOrHighlightColor (track.getColor (), track.isSelected ());
Expand Down

0 comments on commit d191efc

Please sign in to comment.