RPR GetTrackAutomationMode
From CockosWiki
(→Python) |
(→Python) |
||
Line 28: | Line 28: | ||
# | # | ||
# comments by gofer. Which means, comments are from a complete | # comments by gofer. Which means, comments are from a complete | ||
- | # | + | # scripting noob, made as I went along trying to understand what the heck |
# goes on in these lines. Hope this helps others that are about to try | # goes on in these lines. Hope this helps others that are about to try | ||
# and get a grip of how logic shows up and works in Python scripts. | # and get a grip of how logic shows up and works in Python scripts. | ||
Line 35: | Line 35: | ||
# Initializing variables | # Initializing variables | ||
- | MIXED_MODE=-1 # These are | + | MIXED_MODE=-1 # These are obviously also the integer values you get as return from |
TRIMREAD_MODE=0 # calling GetTrackAutomationMode. (except maybe the mixed mode, which | TRIMREAD_MODE=0 # calling GetTrackAutomationMode. (except maybe the mixed mode, which | ||
READ_MODE=1 # might not exist as only one track at a time is tested? Not sure here, must ask.) | READ_MODE=1 # might not exist as only one track at a time is tested? Not sure here, must ask.) |
Revision as of 12:54, 18 February 2010
Main Page > REAPER Documentation > ReaScript > ReaScript API, Functions > RPR GetTrackAutomationMode
Main Page > REAPER Documentation > REAPER API > REAPER API Functions > RPR GetTrackAutomationMode
Contents |
GetTrackAutomationMode()
int GetTrackAutomationMode(MediaTrack* tr)
Parameters
MediaTrack* tr
Returns
int
Examples
C++
Perl
Python
# envelope cycle TrimReadTouch.py # # Cycles automation mode of selected tracks between those three modes. # Multiple selected tracks will be set to one common mode. # # Kindly written by Schwa (thanks again) # # comments by gofer. Which means, comments are from a complete # scripting noob, made as I went along trying to understand what the heck # goes on in these lines. Hope this helps others that are about to try # and get a grip of how logic shows up and works in Python scripts. # # Use at your own risk # Initializing variables MIXED_MODE=-1 # These are obviously also the integer values you get as return from TRIMREAD_MODE=0 # calling GetTrackAutomationMode. (except maybe the mixed mode, which READ_MODE=1 # might not exist as only one track at a time is tested? Not sure here, must ask.) TOUCH_MODE=2 # Also: It kind of indicates latch mode would return 3 and write mode 4. envmode = MIXED_MODE # This variable actually does all the work. Inits to MIXED_MODE, for reasons following. n = RPR_CountSelectedTracks(0) # Find out: do selected tracks share the same mode? if yes which? for i in range(0,n): track = RPR_GetSelectedTrack(0,i) # Asking for automation modes of selected tracks tmode = RPR_GetTrackAutomationMode(track) if envmode == MIXED_MODE: envmode = tmode # First iteration of "for" loop always gives the current track mode, as envmode inits to MIXED_MODE. elif envmode != tmode: # If any of the following iterations results in any other track mode, envmode = MIXED_MODE # the variable is set to MIXED_MODE and break # the script immediately leaves the "for" loop. # Setting the envmode variable for actual mode-cycling if envmode == TRIMREAD_MODE: envmode = READ_MODE elif envmode == READ_MODE: envmode = TOUCH_MODE else: envmode = TRIMREAD_MODE # Else can mean TOUCH, MIXED, latch or write, so they all cycle to trimread. # Here the cycling is finally executed for i in range(0,n): track = RPR_GetSelectedTrack(0,i) RPR_SetTrackAutomationMode(track, envmode)
See Also
track: GetLastTouchedTrack, GetMediaItemTake_Track, GetMediaItem_Track, GetMediaTrackInfo_Value, GetNumTracks, GetSelectedTrack, GetSelectedTrackEnvelope, GetSetMediaTrackInfo_String, GetSetTrackState, GetTrack, GetTrackAutomationMode, GetTrackEnvelope, GetTrackEnvelopeByName, GetTrackGUID, GetTrackMIDINoteName, GetTrackMIDINoteNameEx, GetTrackMediaItem, GetTrackNumMediaItems, GetTrackState, GetTrackUIVolPan, HasTrackMIDIPrograms, HasTrackMIDIProgramsEx, InsertTrackAtIndex, MoveMediaItemToTrack, MuteAllTracks, PlayTrackPreview, PlayTrackPreview2, SetMediaTrackInfo_Value, SetTrackAutomationMode, SetTrackMIDINoteName, SetTrackMIDINoteNameEx, SetTrackSelected, SoloAllTracks, StopTrackPreview, StopTrackPreview2, TrackFX_FormatParamValue, TrackFX_GetCount, TrackFX_GetFXName, TrackFX_GetNumParams, TrackFX_GetParam, TrackFX_GetParamName, TrackFX_SetParam, TrackList_AdjustWindows, TrackList_UpdateAllExternalSurfaces, Track_GetPeakInfo, AddMediaItemToTrack, BypassFxAllTracks, CSurf_NumTracks, CSurf_OnTrackSelection, CSurf_SetTrackListChange, CSurf_TrackFromID, CSurf_TrackToID, CountSelectedTracks, CountTrackEnvelopes, CountTrackMediaItems, CountTracks, DeleteTrack, DeleteTrackMediaItem, EnumTrackMIDIProgramNames, EnumTrackMIDIProgramNamesEx,
(Section automatically generated, edits may be overwritten.)
Stuff
Main Page > REAPER Documentation > ReaScript > ReaScript API, Functions > RPR GetTrackAutomationMode
Main Page > REAPER Documentation > REAPER API > REAPER API Functions > RPR GetTrackAutomationMode