RPR GetCursorPositionEx
From CockosWiki
(Difference between revisions)
(→Examples) |
(→C++) |
||
Line 11: | Line 11: | ||
==Examples== | ==Examples== | ||
===C++=== | ===C++=== | ||
- | <source lang=cpp> | + | <source lang=cpp highlight=6> |
+ | void DoJumpEditCursorByRandomAmount(COMMAND_T*) | ||
+ | { | ||
+ | double RandomMean; | ||
+ | RandomMean=g_command_params.EditCurRndMean; | ||
+ | double RandExp=-log((1.0/RAND_MAX)*rand())*RandomMean; | ||
+ | double NewCurPos=GetCursorPosition()+RandExp; | ||
+ | SetEditCurPos(NewCurPos,false,false); | ||
+ | } | ||
</source> | </source> | ||
+ | |||
===Perl=== | ===Perl=== | ||
<source lang=perl> | <source lang=perl> |
Latest revision as of 21:32, 29 January 2010
Main Page > REAPER Documentation > ReaScript > ReaScript API, Functions > RPR GetCursorPositionEx
Main Page > REAPER Documentation > REAPER API > REAPER API Functions > RPR GetCursorPositionEx
Contents |
GetCursorPositionEx()
double GetCursorPosition()
double GetCursorPositionEx(void* proj)
Get the edit cursor position
Parameters
void* proj - unless called as GetCursorPositionEx
Returns
double - the edit cursor position in the project
Examples
C++
void DoJumpEditCursorByRandomAmount(COMMAND_T*) { double RandomMean; RandomMean=g_command_params.EditCurRndMean; double RandExp=-log((1.0/RAND_MAX)*rand())*RandomMean; double NewCurPos=GetCursorPosition()+RandExp; SetEditCurPos(NewCurPos,false,false); }
Perl
Python
See Also
cursor: GetCursorPosition, GetCursorPositionEx, MoveEditCursor,
(Section automatically generated, edits may be overwritten.)
Stuff
Main Page > REAPER Documentation > ReaScript > ReaScript API, Functions > RPR GetCursorPositionEx
Main Page > REAPER Documentation > REAPER API > REAPER API Functions > RPR GetCursorPositionEx