RPR UpdateTimeline
From CockosWiki
Main Page > REAPER Documentation > ReaScript > ReaScript API, Functions > RPR UpdateTimeline
Main Page > REAPER Documentation > REAPER API > REAPER API Functions > RPR UpdateTimeline
Contents |
UpdateTimeline()
void UpdateTimeline()
Use this function to update the display if, after updating more than one object, an automatic update is not triggered.
Parameters
Returns
void
Examples
C++
void DoInsRndFileEx(bool RndLen,bool RndOffset,bool UseTimeSel) { if (g_filenames->GetSize()>0) { int filenameindex=rand() % g_filenames->GetSize(); t_vect_of_Reaper_tracks TheTracks; XenGetProjectTracks(TheTracks,true); if (TheTracks.size()>0) { PCM_source *NewPCM=PCM_Source_CreateFromFile(g_filenames->Get(filenameindex)); MediaItem *NewItem=AddMediaItemToTrack(TheTracks[0]); MediaItem_Take *NewTake=AddTakeToMediaItem(NewItem); double TimeSelStart=0.0; double TimeSelEnd=NewPCM->GetLength(); GetSet_LoopTimeRange(false,false,&TimeSelStart,&TimeSelEnd,false); double ItemPos=TimeSelStart; double ItemLen=NewPCM->GetLength(); double MediaOffset=0.0; if (RndOffset) { MediaOffset=(NewPCM->GetLength()/RAND_MAX)*rand(); ItemLen-=MediaOffset; } if (RndLen) ItemLen=((NewPCM->GetLength()-MediaOffset)/RAND_MAX)*rand(); if (UseTimeSel) ItemLen=TimeSelEnd-TimeSelStart; if (!UseTimeSel) ItemPos=GetCursorPosition(); GetSetMediaItemTakeInfo(NewTake,"P_SOURCE",NewPCM); GetSetMediaItemTakeInfo(NewTake,"D_STARTOFFS",&MediaOffset); GetSetMediaItemInfo(NewItem,"D_POSITION",&ItemPos); GetSetMediaItemInfo(NewItem,"D_LENGTH",&ItemLen); Main_OnCommand(40047,0); // build any missing peaks SetEditCurPos(ItemPos+ItemLen,false,false); Undo_OnStateChangeEx("Insert random file (Extended)",4,-1); UpdateTimeline(); } } }
Perl
Python
See Also
time: GetProjectTimeSignature, GetProjectTimeSignature2, GetSet_LoopTimeRange, GetSet_LoopTimeRange2, IsInRealTimeAudio, Master_GetPlayRateAtTime, TimeMap2_GetDividedBpmAtTime, TimeMap2_GetNextChangeTime, TimeMap2_QNToTime, TimeMap2_beatsToTime, TimeMap2_timeToBeats, TimeMap2_timeToQN, TimeMap_GetDividedBpmAtTime, TimeMap_QNToTime, TimeMap_timeToQN, UpdateTimeline, format_timestr, format_timestr_len, format_timestr_pos, parse_timestr, parse_timestr_len, parse_timestr_pos,
(Section automatically generated, edits above this line may be overwritten.)
Stuff
Main Page > REAPER Documentation > ReaScript > ReaScript API, Functions > RPR UpdateTimeline
Main Page > REAPER Documentation > REAPER API > REAPER API Functions > RPR UpdateTimeline