@@ -516,8 +516,19 @@ bool isPosInItem(double pos, MediaItem* item) {
516
516
return (start <= pos && pos <= end);
517
517
}
518
518
519
- bool isFreeItemPositioningEnabled (MediaTrack* track) {
520
- return *(bool *)GetSetMediaTrackInfo (track, " B_FREEMODE" , nullptr );
519
+ enum class FreeMode {
520
+ none,
521
+ free,
522
+ fixed
523
+ };
524
+
525
+ FreeMode getTrackFreeMode (MediaTrack* track) {
526
+ int * freeMode = (int *)GetSetMediaTrackInfo (track, " I_FREEMODE" , nullptr );
527
+ if (freeMode) {
528
+ return static_cast <FreeMode>(*freeMode);
529
+ } else {// Reaper before version 7
530
+ return *(bool *)GetSetMediaTrackInfo (track, " B_FREEMODE" , nullptr ) ? FreeMode::free : FreeMode::none;
531
+ }
521
532
}
522
533
523
534
const char * automationModeAsString (int mode) {
@@ -726,11 +737,13 @@ const char* (*NF_GetSWSTrackNotes)(MediaTrack* track) = nullptr;
726
737
*/
727
738
728
739
bool shouldMoveToAutoItem = false ;
740
+ int trackFixedLane = -1 ;
729
741
730
742
void postGoToTrack (int command, MediaTrack* track) {
731
743
fakeFocus = FOCUS_TRACK;
732
744
selectedEnvelopeIsTake = false ;
733
745
shouldMoveToAutoItem = false ;
746
+ trackFixedLane = -1 ;
734
747
SetCursorContext (0 , NULL );
735
748
if (!track)
736
749
return ;
@@ -830,8 +843,19 @@ void postGoToTrack(int command, MediaTrack* track) {
830
843
s << " " << format (translate_plural (" {} item" , " {} items" , itemCount),
831
844
itemCount);
832
845
}
833
- if (isFreeItemPositioningEnabled (track)) {
834
- s << " " << translate (" free item positioning" );
846
+ switch (getTrackFreeMode (track)) {
847
+ case FreeMode::free: {
848
+ s << " " << translate (" free item positioning" );
849
+ break ;
850
+ }
851
+ case FreeMode::fixed: {
852
+ int laneCount = *(int *)GetSetMediaTrackInfo (track, " I_NUMFIXEDLANES" , nullptr );
853
+ s << " " << format (
854
+ translate_plural (" {} Fixed item lane" , " {} fixed item lanes" , laneCount), laneCount);
855
+ break ;
856
+ }
857
+ case FreeMode::none:
858
+ break ;
835
859
}
836
860
}
837
861
int count;
@@ -2868,6 +2892,9 @@ void moveToItem(int direction, bool clearSelection=true, bool select=true) {
2868
2892
pos = *(double *)GetSetMediaItemInfo (item, " D_POSITION" , NULL );
2869
2893
if (direction == 1 ? pos < cursor : pos > cursor)
2870
2894
continue ; // Not the right direction.
2895
+ if (trackFixedLane >= 0 && (int )GetMediaItemInfo_Value (item, " I_FIXEDLANE" ) != trackFixedLane){
2896
+ continue ; // skip item not in focused lane
2897
+ }
2871
2898
currentItem = item;
2872
2899
if ((clearSelection || select ) && makeUndoPoint)
2873
2900
Undo_BeginBlock ();
@@ -4202,6 +4229,31 @@ void cmdReportRegionMarkerItems(Command* command) {
4202
4229
}
4203
4230
}
4204
4231
4232
+ void MoveToFixedLane (int direction) {
4233
+ MediaTrack* track = GetLastTouchedTrack ();
4234
+ if (getTrackFreeMode (track) != FreeMode::fixed) {
4235
+ outputMessage (" Track not in fixed lane mode" );
4236
+ return ;
4237
+ }
4238
+ int laneCount = (int )GetMediaTrackInfo_Value (track, " I_NUMFIXEDLANES" );
4239
+ trackFixedLane += direction;
4240
+ if (trackFixedLane < 0 ) {
4241
+ trackFixedLane = laneCount-1 ;
4242
+ }
4243
+ if (trackFixedLane >= laneCount) {
4244
+ trackFixedLane = 0 ;
4245
+ }
4246
+ outputMessage (format (translate (" Lane {}" ), trackFixedLane + 1 ));
4247
+ }
4248
+
4249
+ void cmdNextLane (Command* cmd) {
4250
+ MoveToFixedLane (1 );
4251
+ }
4252
+
4253
+ void cmdPreviousLane (Command* cmd) {
4254
+ MoveToFixedLane (-1 );
4255
+ }
4256
+
4205
4257
#define DEFACCEL {0 , 0 , 0 }
4206
4258
4207
4259
Command COMMANDS[] = {
@@ -4372,6 +4424,8 @@ Command COMMANDS[] = {
4372
4424
{ MAIN_SECTION, {DEFACCEL, _t (" OSARA: Toggle track/take pan envelope visibility (depending on focus)" )}, " OSARA_TOGGLEPANENVELOPE" , cmdTogglePanEnvelope},
4373
4425
{ MAIN_SECTION, {DEFACCEL, _t (" OSARA: Toggle track/take mute envelope visibility (depending on focus)" )}, " OSARA_TOGGLEMUTEENVELOPE" , cmdToggleMuteEnvelope},
4374
4426
{ MAIN_SECTION, {DEFACCEL, _t (" OSARA: Toggle track pre-FX pan or take pitch envelope visibility (depending on focus)" )}, " OSARA_TOGGLEPREFXPANTAKEPITCHENVELOPE" , cmdTogglePreFXPanOrTakePitchEnvelope},
4427
+ { MAIN_SECTION, {DEFACCEL, _t (" OSARA: Next fixed item lane" )}, " OSARA_NEXTLANE" , cmdNextLane},
4428
+ { MAIN_SECTION, {DEFACCEL, _t (" OSARA: Previous fixed item lane" )}, " OSARA_PREVIOUSLANE" , cmdPreviousLane},
4375
4429
{MIDI_EDITOR_SECTION, {DEFACCEL, _t (" OSARA: Enable noncontiguous selection/toggle selection of current chord/note" )}, " OSARA_MIDITOGGLESEL" , cmdMidiToggleSelection},
4376
4430
{MIDI_EDITOR_SECTION, {DEFACCEL, _t (" OSARA: Move to next chord" )}, " OSARA_NEXTCHORD" , cmdMidiMoveToNextChord},
4377
4431
{MIDI_EDITOR_SECTION, {DEFACCEL, _t (" OSARA: Move to previous chord" )}, " OSARA_PREVCHORD" , cmdMidiMoveToPreviousChord},
0 commit comments