Skip to content

Commit

Permalink
Minor changes, mainly formatting
Browse files Browse the repository at this point in the history
Formatted code to conform to overall project and based on additional suggestions by @jcsteh in PR jcsteh#1073.

Removed keymap entries from config and readme due to ongoing discussion about possible reassignment (see issue jcsteh#1076).
  • Loading branch information
day-garwood committed May 14, 2024
1 parent 04b197a commit daaca4c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
1 change: 0 additions & 1 deletion config/windows/reaper-kb.ini
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ KEY 5 80 _OSARA_FXPARAMSMASTER 0 # Main : Shift+P : OSARA: View FX parameters
KEY 25 32804 _OSARA_GOTOFIRSTTRACK 0 # Main : Ctrl+Alt+HOME : OSARA: Go to first track
KEY 25 32803 _OSARA_GOTOLASTTRACK 0 # Main : Ctrl+Alt+END : OSARA: Go to last track
KEY 29 32804 _OSARA_GOTOMASTERTRACK 0 # Main : Ctrl+Alt+Shift+HOME : OSARA: Go to master track
KEY 5 67 _OSARA_MANAGETEMPOTIMESIGMARKERS 0 # Main : Shift+C : OVERRIDE DEFAULT : OSARA: Report tempo and time signature at play cursor (press twice to add/edit tempo marker)
KEY 25 77 _OSARA_MOVESTRETCH 0 # Main : Ctrl+Alt+M : OVERRIDE DEFAULT : OSARA: Move last focused stretch marker to current edit cursor position
KEY 17 75 _OSARA_NEXTENVPOINT 0 # Main : Alt+K : OSARA: Move to next envelope point
KEY 21 75 _OSARA_NEXTENVPOINTKEEPSEL 0 # Main : Alt+Shift+K : OSARA: Move to next envelope point (leaving other points selected)
Expand Down
3 changes: 1 addition & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,7 @@ SWS/FNG: Time stretch selected items (fine): Control+Alt+=
- Markers: Insert region from time selection: Shift+R

#### Time Signature/Tempo Markers
- OSARA: Report tempo and time signature at play cursor (press twice to add/edit tempo marker): Shift+C
- Move edit cursor to previous tempo or time signature change: Shift+;
- Move edit cursor to previous tempo or time signature change: Shift+;
- Move edit cursor to next tempo or time signature change: Shift+'

#### Automation
Expand Down
27 changes: 13 additions & 14 deletions src/reaper_osara.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3584,23 +3584,22 @@ void cmdUnselAllTracksItemsPoints(Command* command) {
}

void reportTempoTimeSig() {
ReaProject* proj=EnumProjects(-1, nullptr, 0);
if(proj==nullptr) return;
double tempo=0;
int timesig1=0;
int timesig2=0;
double pos=GetPlayPosition();
TimeMap_GetTimeSigAtTime(proj, pos, &timesig1, &timesig2, &tempo);
outputMessage(formatDouble(tempo, 1, false)+", "+to_string(timesig1)+"/"+to_string(timesig2));
ReaProject* proj=EnumProjects(-1, nullptr, 0);
if(proj==nullptr) return;
double tempo=0;
int timesig_num=0;
int timesig_denom=0;
double pos=GetPlayPosition();
TimeMap_GetTimeSigAtTime(proj, pos, &timesig_num, &timesig_denom, &tempo);
outputMessage(format("{}, {}/{}", formatDouble(tempo, 1, false), timesig_num, timesig_denom));
}

void cmdManageTempoTimeSigMarkers(Command* command) {
if(lastCommandRepeatCount==0)
{
reportTempoTimeSig();
return;
}
Main_OnCommand(40256, 0);
if(lastCommandRepeatCount==0) {
reportTempoTimeSig();
return;
}
Main_OnCommand(40256, 0); // Tempo envelope: Insert tempo/time signature change marker at edit cursor...
}

void cmdSwitchProjectTab(Command* command) {
Expand Down

0 comments on commit daaca4c

Please sign in to comment.