Old 03-02-2021, 12:43 PM   #1
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
Default Toggling REAPER preferences?

Hey gang,
Is it possible to toggle REAPER's settings from a script?

I want to toggle the option Media>Media settings>Set media items offline when application is not active.

Different to toggling take offline/online.

Any thoughts on what I could look at as an example?


Cheers!
Dax.
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere is offline   Reply With Quote
Old 03-02-2021, 12:56 PM   #2
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,623
Default

Have a look at here:

https://mespotin.uber.space/Ultrasch...Variables.html

This is a description of the settings that can be set at runtime and how to do it.
__________________
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 03-02-2021, 01:45 PM   #3
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
Default

Thanks you, Meo-Ada!
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere is offline   Reply With Quote
Old 03-02-2021, 01:49 PM   #4
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
Default

Ahh, cool, it's offlineinact. Rad.
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere is offline   Reply With Quote
Old 04-15-2021, 03:18 PM   #5
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
Default

Hey Meo-Ada,
I read your document and tried a couple things, but wasn't able to work out what I needed to do to toggle the setting for media offline when REAPER is not active.
I don't suppose you could share a similar script that I can modify with the offlineinact line, is there?

All the best,
Dax.
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere is offline   Reply With Quote
Old 04-15-2021, 03:50 PM   #6
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

This should work (also contains code to assign script to a toolbar button to light when enabled):
Needs SWS installed.

Code:
reaper.SNM_SetIntConfigVar("offlineinact", reaper.SNM_GetIntConfigVar("offlineinact", -666)~1) -- bitwise NOT, flip bit

-- set toolbar state
_,_,section_ID,cmd_ID,_,_,_ = reaper.get_action_context()
reaper.SetToggleCommandState(section_ID, cmd_ID, reaper.SNM_GetIntConfigVar("offlineinact", -666)&1) -- bitwise AND, check bit
edit:
When script is assigned to a toolbar button, the state is not persistent and could go out of sync when quitting/restarting Reaper, script would need addition to fix that, but not sure you need this?

Last edited by nofish; 04-15-2021 at 04:13 PM. Reason: correction
nofish is offline   Reply With Quote
Old 04-16-2021, 06:43 AM   #7
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
Default

Thank you so much, Nofish, your script is great. And I should be able to learn enough from it to toggle other things in future as well. Talk about "Give a man a fish!" XD

Quote:
Originally Posted by nofish View Post
edit: When script is assigned to a toolbar button, the state is not persistent and could go out of sync when quitting/restarting Reaper, script would need addition to fix that, but not sure you need this?
Not 100% necessary, thought it would be nice, however there is another action that I have a toolbar icon for which often gets out of sync. It's a cycle action that is used to create a toggle between _BR_OPTIONS_ENV_TRIM_NEVER and _BR_OPTIONS_ENV_TRIM_ALWAYS
Any idea for that?
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere is offline   Reply With Quote
Old 04-16-2021, 07:59 AM   #8
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,813
Default

is audio buffer setting editable with this?
deeb is offline   Reply With Quote
Old 04-16-2021, 09:42 AM   #9
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by deeb View Post
is audio buffer setting editable with this?
https://forum.cockos.com/showthread.php?t=247743
vitalker is offline   Reply With Quote
Old 04-16-2021, 01:17 PM   #10
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
Default

Hey Deeb, check through this long list. You might find what you're looking for.

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Have a look at here:

https://mespotin.uber.space/Ultrasch...Variables.html

This is a description of the settings that can be set at runtime and how to do it.
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere is offline   Reply With Quote
Old 04-16-2021, 01:25 PM   #11
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,623
Default

Everything in the Prefs-page "Device" is not settable. Unfortunately

Only via hacks, that mimic opening prefs and clicking around.
But that's not really a good solution.

But just in case, JS-extension is the place to go to code that.
__________________
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 12-29-2021, 01:59 PM   #12
Juljan
Human being with feelings
 
Join Date: Apr 2019
Posts: 62
Default

Thanks for the great script.

Independently (!) of that, the setting jumps back to unticked with every DAW launch. Any idea why?
Juljan 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 10:13 PM.


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