ReaScript API

From CockosWiki

Revision as of 21:31, 12 December 2009 by MikeLacey (Talk | contribs)
Jump to: navigation, search

Back to main ReaScript page
Back to main REAPER API page

Contents

ReaScript API Documentation

Don't forget - Call API functions using RPR_functionname() - Don't forget the RPR_

Using these functions

These functions each map onto a C++ function. C++ allows "pass by reference", which lets you pass a variable to a function in the parameter list and have the function change that parameter, so after this function call:

x = MyFunc(&var);

the var variable might well have a different value to the one it started with...

Perl and Python don't have compatible pass by reference mechanisms so when ReaScript sees a modifiable variable in the parameter list it returns all the values in the parameter list and the return value (if there is one) in an array, as in GetUserInputs() Go and look at it now if you haven't already done so. It will bite you if you don't understand it.

Specific REAPER type pointers, like MediaItem*, are not considered modifiable by ReaScript when deciding whether to return a scalar or array from a particular function.

Who is Allowed to Add to and Edit this Documentation?

You.

No, really - you are. Don't hesitate to get stuck in if you think you know something that even might be of help to some poor muso feeling his or her way around the API.

Anything in the API documentation that is marked with a '?' is an assumption - or something the writer just isn't sure about. If you happen to know whatever it is for certain - please correct or confirm the entry.

Please add a brief note or correction if you see anything that's wrong or incomplete or if you've used the function and know something that might be of use to the next user.

Don't worry about making it look good if you're hurried; someone will be along in a while with the time. (Don't hesitate to make it look good if you *do* have the time... :o)

The ReaScript API Functions

Generated from 3.1459 by mkReaScriptAPITable.pl

AddMediaItemToTrack format_timestr GetTrackEnvelope plugin_getImportableProjectFilterList
AddProjectMarker format_timestr_len GetTrackEnvelopeByName PluginWantsAlwaysRunFx
AddTakeToMediaItem format_timestr_pos GetTrackGUID projectconfig_var_addr
adjustZoom genGuid GetTrackMediaItem projectconfig_var_getoffs
APITest get_config_var GetTrackMIDINoteName ReaperGetPitchShiftAPI
Audio_IsPreBuffer get_ini_file GetTrackMIDINoteNameEx relative_fn
Audio_IsRunning GetActiveTake GetTrackNumMediaItems Resample_EnumModes
Audio_RegHardwareHook GetColorThemeStruct GetTrackState Resampler_Create
BypassFxAllTracks GetCursorPosition GetTrackUIVolPan resolve_fn
CalculatePeaks GetCursorPositionEx GetUserInputs screenset_register
ClearAllRecArmed GetEnvelopeName GSC_mainwnd screenset_unregister
ClearPeakCache GetExePath guidToString screenset_unregisterByParam
CountMediaItems GetHZoomLevel HasTrackMIDIPrograms SelectProjectInstance
CountSelectedMediaItems GetIconThemePointer HasTrackMIDIProgramsEx SetAutomationMode
CountSelectedTracks GetIconThemeStruct HiresPeaksFromSource SetEditCurPos
CountTakes GetInputChannelName InsertMedia SetEditCurPos2
CountTrackEnvelopes GetItemProjectContext InsertTrackAtIndex SetMediaItemInfo_Value
CountTrackMediaItems GetLastTouchedTrack IsInRealTimeAudio SetMediaItemTakeInfo_Value
CountTracks GetMainHwnd IsMediaExtension SetMediaTrackInfo_Value
CreateMIDIInput GetMasterMuteSoloFlags kbd_OnMidiEvent SetProjectMarker
CreateMIDIOutput GetMaxMidiInputs kbd_OnMidiList SetProjectMarker2
CSurf_FlushUndo GetMaxMidiOutputs LICE_Blit SetTrackAutomationMode
CSurf_GetTouchState GetMediaItem LICE_ClipLine SetTrackMIDINoteName
CSurf_GoEnd GetMediaItem_Track LICE_Line SetTrackMIDINoteNameEx
CSurf_GoStart GetMediaItemInfo_Value LICE_LineInt SetTrackSelected
CSurf_NumTracks GetMediaItemNumTakes Main_OnCommand ShowActionList
CSurf_OnArrow GetMediaItemTake Main_OnCommandEx ShowConsoleMsg
CSurf_OnFwd GetMediaItemTake_Item Main_openProject ShowMessageBox
CSurf_OnFXChange GetMediaItemTake_Source Main_UpdateLoopInfo SLIDER2DB
CSurf_OnMuteChange GetMediaItemTake_Track Master_GetPlayRateAtTime SoloAllTracks
CSurf_OnPanChange GetMediaItemTakeInfo_Value MB SplitMediaItem
CSurf_OnPanChangeEx GetMediaTrackInfo_Value MIDI_eventlist_Create StopPreview
CSurf_OnPlay GetMidiInput MIDI_eventlist_Destroy StopTrackPreview
CSurf_OnRecArmChange GetMIDIInputName MIDIEditor_GetActive StopTrackPreview2
CSurf_OnRecord GetMidiOutput MIDIEditor_GetMode stringToGuid
CSurf_OnRew GetMIDIOutputName MIDIEditor_OnCommand TimeMap2_beatsToTime
CSurf_OnSelectedChange GetNumMIDIInputs mkpanstr TimeMap2_GetDividedBpmAtTime
CSurf_OnSoloChange GetNumMIDIOutputs mkvolpanstr TimeMap2_GetNextChangeTime
CSurf_OnStop GetNumTracks mkvolstr TimeMap2_QNToTime
CSurf_OnTrackSelection GetOutputChannelName MoveEditCursor TimeMap2_timeToBeats
CSurf_OnVolumeChange GetOutputLatency MoveMediaItemToTrack TimeMap2_timeToQN
CSurf_OnVolumeChangeEx GetPeakFileName MuteAllTracks TimeMap_GetDividedBpmAtTime
CSurf_ResetAllCachedVolPanStates GetPeaksBitmap my_getViewport TimeMap_QNToTime
CSurf_ScrubAmt GetPlayPosition NamedCommandLookup TimeMap_timeToQN
CSurf_SetAutoMode GetPlayPosition2 OnPauseButton Track_GetPeakInfo
CSurf_SetPlayState GetPlayPosition2Ex OnPauseButtonEx TrackFX_FormatParamValue
CSurf_SetRepeatState GetPlayPositionEx OnPlayButton TrackFX_GetCount
CSurf_SetSurfaceMute GetPlayState OnPlayButtonEx TrackFX_GetFXName
CSurf_SetSurfacePan GetPlayStateEx OnStopButton TrackFX_GetNumParams
CSurf_SetSurfaceRecArm GetProjectPath OnStopButtonEx TrackFX_GetParam
CSurf_SetSurfaceSelected GetProjectPathEx parse_timestr TrackFX_GetParamName
CSurf_SetSurfaceSolo GetProjectTimeSignature parse_timestr_len TrackFX_SetParam
CSurf_SetSurfaceVolume GetProjectTimeSignature2 parse_timestr_pos TrackList_AdjustWindows
CSurf_SetTrackListChange GetSelectedMediaItem parsepanstr TrackList_UpdateAllExternalSurfaces
CSurf_TrackFromID GetSelectedTrack PCM_Sink_Create Undo_BeginBlock
CSurf_TrackToID GetSelectedTrackEnvelope PCM_Sink_CreateEx Undo_BeginBlock2
DB2SLIDER GetSet_ArrangeView2 PCM_Sink_CreateMIDIFile Undo_CanRedo2
DeleteProjectMarker GetSet_LoopTimeRange PCM_Sink_CreateMIDIFileEx Undo_CanUndo2
DeleteTrack GetSet_LoopTimeRange2 PCM_Sink_Enum Undo_DoRedo2
DeleteTrackMediaItem GetSetEnvelopeState PCM_Sink_GetExtension Undo_DoUndo2
DockWindowActivate GetSetItemState PCM_Sink_ShowConfig Undo_EndBlock
DockWindowAdd GetSetMediaItemTakeInfo_String PCM_Source_CreateFromFile Undo_EndBlock2
DockWindowRemove GetSetMediaTrackInfo_String PCM_Source_CreateFromFileEx Undo_OnStateChange
EnsureNotCompletelyOffscreen GetSetRepeat PCM_Source_CreateFromSimple Undo_OnStateChange2
EnumPitchShiftModes GetSetRepeatEx PCM_Source_CreateFromType Undo_OnStateChange_Item
EnumPitchShiftSubModes GetSetTrackState PeakBuild_Create Undo_OnStateChangeEx
EnumProjectMarkers GetTake PeakGet_Create Undo_OnStateChangeEx2
EnumProjectMarkers2 GetTakeEnvelopeByName PlayPreview UpdateItemInProject
EnumProjects GetTooltipWindow PlayTrackPreview UpdateTimeline
EnumTrackMIDIProgramNames GetTrack PlayTrackPreview2 ValidatePtr
EnumTrackMIDIProgramNamesEx GetTrackAutomationMode plugin_getFilterList WDL_VirtualWnd_ScaledBlitBG
Personal tools