|
|
|
06-11-2010, 11:56 AM
|
#1
|
Human being with feelings
Join Date: Apr 2008
Location: Cambridge, Ontario
Posts: 2,644
|
Access the new Nudge function through API?
This was mentioned in the FR section but maybe it fits better here...
Here's an excerpt from the original post explaining the goal:
Quote:
RPR_Main_OnCommand(nudge-function, type, what, count, countof, direction, snap)
Type=0,1 (nudge, set, other)
What=0-6 (seven possibilities of what or how to nudge)
count=numerical time indication
countof=0-9 (what mode or timebase)
direction=0,1 (left or right)
snap=0,1 (off, on)
|
Basically this would allow us to write scripts that run a very specific combination of the nudge dialog settings, using one action to do it all.
I could write a script that was like so:
RPR_Main_OnCommand([nudge_action_ID], 0, 3, 5, 1, 1, 0)
Which would nudge the left edge of any selected items right by 5ms with no snapping.
Is this possible or something that might be considered in the future? It would be amazing to be able to do the same thing with the Quantize dialog for example.
|
|
|
06-11-2010, 02:59 PM
|
#2
|
Human being with feelings
Join Date: Feb 2009
Location: Dunedin, New Zealand
Posts: 205
|
Quote:
Originally Posted by AdamWathan
Is this possible or something that might be considered in the future?
|
I would have thought something like nudge could already be achieved using the current API set. Maybe I'm wrong. Certainly, I have written some of my own nudge-type actions in the past. The new nudge features would seem to bring something new to typical end-users rather than DIY action builders and users.
I'm all for expansion of the API but would personally prefer the REAPER team to focus on expanding the API to provide a comprehensive set of building blocks that let's us build whatever we like, however we like.
|
|
|
06-13-2010, 12:25 AM
|
#3
|
Human being with feelings
Join Date: Feb 2009
Location: Dunedin, New Zealand
Posts: 205
|
Then again... this looks way easier than building your own. (From the ReaScript docs)
Code:
nudgeflag: &1=set to value (otherwise nudge by value), &2=snap
nudgewhat: 0=position, 1=left trim, 2=left edge, 3=right edge, 4=contents, 5=duplicate, 6=edit cursor
nudgeunit: 0=ms, 1=seconds, 2=grid, 3=256th notes, ..., 15=whole notes, 16=measures.beats (1.15 = 1 measure + 1.5 beats), 17=samples, 18=frames, 19=pixels, 20=item lengths, 21=item selections
value: amount to nudge by, or value to set to
reverse: in nudge mode, nudges left (otherwise ignored)
copies: in nudge duplicate mode, number of copies (otherwise ignored)
bool ApplyNudge(ReaProject* project, int nudgeflag, int nudgewhat, int nudgeunits, double value, bool reverse, int copies)
Enjoy!
|
|
|
06-14-2010, 06:08 AM
|
#4
|
Human being with feelings
Join Date: Apr 2008
Location: Cambridge, Ontario
Posts: 2,644
|
Yup very excited to see we got it! Already putting it to good use!
One thing I'm confused about though, this parameter:
ReaProject* project
...I've just been using 0 because I don't know what else to put here, what exactly is it expecting?
Edit: Also, the "nudgeflag", what does the &1 for set and &2 for snap mean? It's just an integer no? The & sign has me a bit confused... Sorry for being a noob.
Last edited by AdamWathan; 06-14-2010 at 06:17 AM.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 07:47 PM.
|