Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 12-05-2021, 09:28 AM   #1
MonkeyBars
Human being with feelings
 
MonkeyBars's Avatar
 
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
Default Difference between GetSetObjectState() & GetItemStateChunk() / Set...()

I picked up an old incomplete script project from another author from 6 years ago, and he's using SNM_GetSetObjectState() with SNM faststring functions.

Should I be changing them to use state chunks instead? What actually is the difference between GetSetObjectState() and the state chunk functions? The descriptions sound very similar.
MonkeyBars is offline   Reply With Quote
Old 12-05-2021, 03:07 PM   #2
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

I think SNM_GetSetObjectState() was added to overcome the former limit of the native chunk functions (they truncated at ~4 MB, old example thread).

Since this is no longer the case, no need to use the SWS/SNM function anymore I think.
nofish is offline   Reply With Quote
Old 12-05-2021, 03:22 PM   #3
MonkeyBars
Human being with feelings
 
MonkeyBars's Avatar
 
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
Default

Thanks!

But what is the difference between the state chunk functions and native GetSetObjectState()?
MonkeyBars is offline   Reply With Quote
Old 12-05-2021, 03:39 PM   #4
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

After a bit off digging, I think this is the answer:
https://forum.cockos.com/showpost.ph...8&postcount=12
nofish is offline   Reply With Quote
Old 12-05-2021, 03:55 PM   #5
MonkeyBars
Human being with feelings
 
MonkeyBars's Avatar
 
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
Default

Quote:
Originally Posted by nofish View Post
After a bit off digging, I think this is the answer:
https://forum.cockos.com/showpost.ph...8&postcount=12
Okayyyy... I'm not really clear on what this old post is saying. Should we totally avoid using GetSetObjectState()?
MonkeyBars is offline   Reply With Quote
Old 12-06-2021, 08:40 AM   #6
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

As I read it, GetSetObjectState() only worked/works (? haven't ever used it, have you?) from C++, that's why they added the GetTrack/Item/../State() functions for ReaScript.
nofish is offline   Reply With Quote
Old 12-06-2021, 08:41 AM   #7
MonkeyBars
Human being with feelings
 
MonkeyBars's Avatar
 
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
Default

That's very strange, as it's listed in the ReaScript API with function calls in LUA etc.
MonkeyBars is offline   Reply With Quote
Old 12-06-2021, 09:09 AM   #8
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

That might be because afaik the API doc is generated automatically for C++ and ReaSript.
nofish is offline   Reply With Quote
Old 12-06-2021, 09:11 AM   #9
MonkeyBars
Human being with feelings
 
MonkeyBars's Avatar
 
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
Default

Seems like you're guessing!

But you have implied the answer my main question, which is whether they're basically dealing with the same type of data (state chunks). Thanks!
MonkeyBars 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 12:51 PM.


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