Old 05-21-2017, 06:43 PM   #1
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
Default How to set arrange view bounds by time?

On today's episode of Things About Reaper's API that make no sense ...

reaper.GetSet_ArrangeView2 gets the arrange view start/end position in time, but sets them in screen coordinates.

How can I set the arrange view bounds based on time codes? Or perhaps the question could be phrased as how can I convert between times and screen coordinates?

Many thanks.
tack is offline   Reply With Quote
Old 05-23-2017, 02:45 PM   #2
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 2,173
Default

Hi tack, have you tried:

Code:
C: void BR_SetArrangeView(ReaProject* proj, double startTime, double endTime)

EEL: extension_api("BR_SetArrangeView", ReaProject proj, startTime, endTime)

Lua: reaper.BR_SetArrangeView(ReaProject proj, number startTime, number endTime)

Python: BR_SetArrangeView(ReaProject proj, Float startTime, Float endTime)

[BR] Deprecated, see GetSet_ArrangeView2 (REAPER v5.12pre4+) -- Set start and end time position of arrange view. To get arrange view instead, see BR_GetArrangeView.
?
FnA is offline   Reply With Quote
Old 05-23-2017, 06:59 PM   #3
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
Default

Ah thanks for that, FnA. I frequently miss the SWS APIs because I tend to mainly use the API docs from Reaper's site. I should have known better.

Surprised though to see the note that BR_SetArrangeView is deprecated in favor of GetSet_ArrangeView2. Either the author of that comment didn't understand GetSet_ArrangeView2's limitations, or I'm not seeing a way to convert between time (float) and screen coordinates (int).
tack is offline   Reply With Quote
Old 05-23-2017, 07:28 PM   #4
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 2,173
Default

Blew my mind too. Had to go with the BR function. Seems to work reliably for my simple purposes.
FnA is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:04 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.