RPR GetCursorPositionEx
From CockosWiki
(Difference between revisions)
(→Perl) |
(→C++) |
||
(2 intermediate revisions not shown) | |||
Line 11: | Line 11: | ||
==Examples== | ==Examples== | ||
===C++=== | ===C++=== | ||
- | < | + | <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> | ||
+ | ===Perl=== | ||
+ | <source lang=perl> | ||
+ | </source> | ||
===Python=== | ===Python=== | ||
- | < | + | <source lang=python> |
- | </ | + | </source> |
+ | |||
==See Also== | ==See Also== | ||
- | {{ | + | {{SeeAlso_cursor}} |
+ | |||
+ | ''(Section automatically generated, edits may be overwritten.)'' | ||
==Stuff== | ==Stuff== |
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