Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Feature Requests

Reply
 
Thread Tools
Old 05-21-2023, 01:50 PM   #1
lexaproductions
Human being with feelings
 
Join Date: Jan 2013
Posts: 1,255
Default API: GetProjectTimeOffset -> GetProjectMeasureOffset

Hello Devs. We have:
Code:
GetProjectTimeOffset
but we don't have
Code:
GetProjectMeasureOffset
Right now there are 2 ways of getting this data but both have shortcomings:
  1. Using this works:
    Code:
    reaper.SNM_GetIntConfigVar("projmeasoffs", 0)
    But it only works with the foremost project tab without access to the background tabs

  2. Reading an rpp and getting the value from:
    Code:
    'PROJOFFS'
    works great but the value does not get written until saving the project, so this can be unreliable.

More info here.
https://forum.cockos.com/showpost.ph...9&postcount=12

I hope this could be a simple thing to do?
lexaproductions is offline   Reply With Quote
Old 05-21-2023, 01:53 PM   #2
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 5,583
Default

A native API would be good, otherwise it's possible to add a SNM_GetIntConfigVarEx in SWS that accepts a ReaProject parameter.
cfillion is offline   Reply With Quote
Old 05-21-2023, 01:54 PM   #3
lexaproductions
Human being with feelings
 
Join Date: Jan 2013
Posts: 1,255
Default

That would also be neat. But wouldn't that function still get the "last saved" version of the parm?
lexaproductions is offline   Reply With Quote
Old 05-21-2023, 01:56 PM   #4
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 5,583
Default

No, it would behave like the current SNM_GetIntConfigVar but in any opened project tab.
cfillion is offline   Reply With Quote
Old 05-21-2023, 01:57 PM   #5
lexaproductions
Human being with feelings
 
Join Date: Jan 2013
Posts: 1,255
Default

...Then you could be my savior!
lexaproductions is offline   Reply With Quote
Old 05-21-2023, 03:19 PM   #6
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 5,583
Default

Here you go: https://github.com/reaper-oss/sws/pull/1759. Builds should complete in about an hour and be posted there.
cfillion is offline   Reply With Quote
Old 05-21-2023, 04:04 PM   #7
lexaproductions
Human being with feelings
 
Join Date: Jan 2013
Posts: 1,255
Default

lexaproductions is offline   Reply With Quote
Old 05-21-2023, 06:09 PM   #8
lexaproductions
Human being with feelings
 
Join Date: Jan 2013
Posts: 1,255
Default

Works great! I'm really grateful, many thanks
  1. This SWS build seems to have the same version number as the last dev build, how can I difference them? Asides from the doing a check with:
    Code:
    reaper.APIExists('SNM_GetIntConfigVarEx')
  2. Now when would this be in the official release so that I don't have to direct people to an unreleased build if they want to use REALIVE?
lexaproductions is offline   Reply With Quote
Old 05-21-2023, 06:29 PM   #9
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 5,583
Default

  1. The about dialog shows 'projconfigvarapi' though that's not accessible via the API.
    Feature detection is the better approach for this kind of thing rather than version checks. No need for APIExists, a simple "if reaper.SNM_GetIntConfigVarEx then" does the same trick faster.
  2. No idea for a stable release. New pre-releases usually when there's arbitrarily enough patches queued to warrant one, REAPER breaking changes, or major bugfixes...

Last edited by cfillion; 05-21-2023 at 06:44 PM.
cfillion is offline   Reply With Quote
Reply

Thread Tools

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 11:30 PM.


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