|
|
|
03-02-2021, 12:43 PM
|
#1
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
|
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.
|
|
|
03-02-2021, 01:45 PM
|
#3
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
|
Thanks you, Meo-Ada!
|
|
|
03-02-2021, 01:49 PM
|
#4
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
|
Ahh, cool, it's offlineinact. Rad.
|
|
|
04-15-2021, 03:18 PM
|
#5
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
|
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.
|
|
|
04-15-2021, 03:50 PM
|
#6
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
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
|
|
|
04-16-2021, 06:43 AM
|
#7
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
|
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
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?
|
|
|
04-16-2021, 07:59 AM
|
#8
|
Human being with feelings
Join Date: Feb 2017
Posts: 4,813
|
is audio buffer setting editable with this?
|
|
|
04-16-2021, 01:17 PM
|
#10
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
|
Hey Deeb, check through this long list. You might find what you're looking for.
Quote:
Originally Posted by Meo-Ada Mespotine
|
|
|
|
04-16-2021, 01:25 PM
|
#11
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,623
|
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.
|
|
|
12-29-2021, 01:59 PM
|
#12
|
Human being with feelings
Join Date: Apr 2019
Posts: 62
|
Thanks for the great script.
Independently (!) of that, the setting jumps back to unticked with every DAW launch. Any idea why?
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 10:13 PM.
|