Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 11-24-2019, 03:05 AM   #1
Embass
Human being with feelings
 
Embass's Avatar
 
Join Date: Jan 2014
Posts: 923
Default API function GetSet_ArrangeView2 bug?

API documentation:
number start_time, number end_time = reaper.GetSet_ArrangeView2(ReaProject proj, boolean isSet, integer screen_x_start, integer screen_x_end)
Gets or sets the arrange view start/end time for screen coordinates. use screen_x_start=screen_x_end=0 to use the full arrange view's start/end time

I want to set arrange start/end time but nothing happens..
reaper.GetSet_ArrangeView2(0, true,10, 20)
Embass is offline   Reply With Quote
Old 11-24-2019, 05:26 AM   #2
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

This is a bug in the documentation. GetSet_ArrangeView2 actually has 6 parameters and start_time/end_time are the last two. screen_x_start and screen_x_end are screen coordinates in pixels.

Code:
void GetSet_ArrangeView2(
  ReaProject* proj,
  bool isSet,
  int screen_x_start,
  int screen_x_end,
  double* start_timeOut,
  double* end_timeOut
)
Use it in Lua like this:

Code:
reaper.GetSet_ArrangeView2(0, true, 0, 0, 10.0, 20.0)
cfillion is offline   Reply With Quote
Old 11-24-2019, 09:50 AM   #3
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,241
Default

interesting.
I'm trying to get the screen_x_start and screen_x_end coordinates in lua but it seems it always gets nil
Code:
local s1, e1, x_start, x_end = reaper.GetSet_ArrangeView2(0, false, 0, 0, 0.0, 0.0)
s1 and e1 are ok. time in seconds.
x_start is nil
x_end is nil
heda is offline   Reply With Quote
Old 11-24-2019, 10:00 AM   #4
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

screen_x_start and screen_x_end are not return values. They are for specifying where start_time and stop_time should be on the screen when non-zero.

For example, to set the 10 second mark to be at 300px from the left of the screen and the 20 second mark at 600px:
Code:
reaper.GetSet_ArrangeView2(0, true, 300, 600, 10.0, 20.0)
cfillion is offline   Reply With Quote
Old 11-25-2019, 03:06 AM   #5
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,241
Default

thank you cfillion
Then it would be a feature request. Having the pixel coordinates of the arrange area then I think it would be possible to fix this:
I am trying to avoid having to manually resize the graph area of the script like this
heda is offline   Reply With Quote
Old 11-28-2019, 09:23 AM   #6
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by cfillion View Post
This is a bug in the documentation. GetSet_ArrangeView2 actually has 6 parameters and start_time/end_time are the last two. screen_x_start and screen_x_end are screen coordinates in pixels.
Thanks for pointing that out. Will add that to my API-docs.

@devs
Could you add that to the official docs too, please?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-31-2021, 12:11 AM   #7
nvk
Human being with feelings
 
nvk's Avatar
 
Join Date: Jul 2019
Posts: 156
Default

Just ran into this bug. Thanks for the thread, would be nice to get the documentation fixed.
nvk is offline   Reply With Quote
Old 05-31-2021, 10:00 AM   #8
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by nvk View Post
Just ran into this bug. Thanks for the thread, would be nice to get the documentation fixed.
You can use my docs, where I usually try to add stuff like this:
https://mespotin.uber.space/Ultrasch...AutomationItem
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine 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 05:01 AM.


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