Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Q&A, Tips, Tricks and Howto

Reply
 
Thread Tools Display Modes
Old 12-17-2014, 02:02 PM   #1
jrp
Human being with feelings
 
Join Date: Nov 2014
Posts: 194
Default little script for toggle exclusive solo track under mouse

I had a little more fun playing with my beginners python skills:

This will unsolo all tracks and solo the track under the mouse - exclusive solo.

It works so fast that you cannot hear the tracks being unsoloed. No clicks or artefacts.
EDIT: Sorry, that´s not true. I added some workaround to the script, first muting all tracks, unmuting after the exclusive solo is done. Original mute states are also recalled.


This is easily doable with a custom action.

But it cannot toggle solo when done with custom actions - the custom action cannot know if the track under mouse was soloed to beginn with or not.

But python can know:

Code:
RPR_Main_OnCommand(40296, 0) # select all tracks
RPR_Main_OnCommand(RPR_NamedCommandLookup("_SWS_SAVEMUTES"), 0); # store mutes

###############################################################################

RPR_Main_OnCommand(41110, 0) # select track under mouse
tr = RPR_GetSelectedTrack(0, 0) 
s = RPR_GetMediaTrackInfo_Value(tr, "I_SOLO") #is track soloed?
RPR_Main_OnCommand(40341, 0) # mute all tracks
RPR_Main_OnCommand(40340, 0) # unsolo all tracks

if (s != 0): #track is soloed    
       RPR_SetMediaTrackInfo_Value(tr, "I_SOLO", 0) #unsolo track

if (s == 0): #track is not soloed    
       RPR_SetMediaTrackInfo_Value(tr, "I_SOLO", 2) # solo in place

##############################################################################

RPR_Main_OnCommand(40339, 0) # unmute all tracks
RPR_Main_OnCommand(40296, 0) # select all tracks
RPR_Main_OnCommand(RPR_NamedCommandLookup("_SWS_RESTRMUTES"), 0); # recall mutes
RPR_Main_OnCommand(41110, 0) # select track under mouse

Last edited by jrp; 12-17-2014 at 03:07 PM.
jrp is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:56 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.