Home › Forums › General › Programming › Restoring of a panel
- This topic has 6 replies, 3 voices, and was last updated 11 years, 7 months ago by TK..
-
AuthorPosts
-
July 25, 2012 at 10:10 pm #676
hi
build 1078
i often use in lua scripts ( lua scripts linked to Called when the modulator value changed )
if modulator:isRestoring() then return end
–or do some codeto avoid to fire a action on panel creation / loading
this seems to be brokennote:
the modulator also set to
modualtor does not output any midi during statup .. mute
Dont send this modulator during sanapshot … dont sendmaybe i can find a workaround on setting a global varibale on init and set switch this bag on the last modulator creation
lg widy
July 26, 2012 at 7:43 am #4691"Widy75":e22s0rdp wrote:maybe i can find a workaround on setting a global variable on init and set switch this bag on the last modulator creation [/quote:e22s0rdp]This is what I do. I set a variable "panel_loaded" to 0 in then "Called before any modulators are created" method and on each lua method I check if this variable is 1 to be executed.
Once the panel has created all modulators I set in "Called when the panel has finished loading" method the variable to 1
July 26, 2012 at 11:13 am #4692hi
i just thougth if there is a api function for it i should use this one instead of hacking ” title=”Smile” />
but this seems a solution to port my panels vom 925 -> 1080 and export sandalone vst’s
lg widyJuly 26, 2012 at 4:22 pm #4693try this out at the moment ..seems not realy working for me
because after finish loading the modulators get assigned to there values an trigger the lua stuff i implementedthe handling before seems that after first assigning of the value the restore falg was set and after assignment reseted
hm maybe atom can take a look at thislg widy
July 26, 2012 at 6:04 pm #4694if i call on lua script on load finish e.g
while modulators_sequencer_settings ~= nil dolocal modulator = panel:getModulatorByName(modulators_sequencer_settings)
if modulator ~= nil then
local value = modulator:getModulatorValue()
debugConsole(string.format("Assign Modulator:’%s’ value:",modulators_sequencer_settings,value))i get the result
Assign Modulator:’SEQUENCER MODE’ value:
Assign Modulator:’TEMPO’ value:
Assign Modulator:’GROOVE TEMPLATE’ value:but should be
Assign Modulator:’SEQUENCER MODE’ value:1
Assign Modulator:’TEMPO’ value:67
Assign Modulator:’GROOVE TEMPLATE’ value:22so after finish loading the mods are created but has no values
lg widyJuly 26, 2012 at 6:16 pm #4695shit shit shit … missing one %s
srySeptember 2, 2012 at 11:12 pm #4696I had a similar issue with my MIDIboxFM and MIDIboxSID panel, and debugged the Ctrlr code today to understand the root cause and to find a solution.
The reason for this issue: due to the (new) asynchronous event handling, which was introduced after r946, the "luaPanelLoaded" callback will be executed before all value changes have been processed.
The fix: in CtrlModulator.cpp, at the end of CtrlrModulator::restoreState, before calling the setRestoreState function, insert following function call:
[code:fv5tyjta]
void CtrlrModulator::restoreState (const ValueTree &savedState)
{
...
processor.handleUpdateNowIfNeeded(); // TK: synchronous update requrired
setRestoreState(false);
}
[/code:fv5tyjta]This will process the code in CtrlrModulatorProcessor::handleAsyncUpdate() immediately before the "luaPanelLoaded" callback is executed.
Atom will add this change into Ctrlr, it will solve at least the Lua runtime errors (during load) of my own panels. ” title=”Smile” />
Best Regards, Thorsten.
-
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.