Restoring of a panel

Home Forums General Programming Restoring of a panel

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #676
    Widy75
    Participant
      • Topics: 10
      • Replies: 61
      • Total: 71

      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 code

      to avoid to fire a action on panel creation / loading
      this seems to be broken

      note:
      the modulator also set to
      modualtor does not output any midi during statup .. mute
      Dont send this modulator during sanapshot … dont send

      maybe i can find a workaround on setting a global varibale on init and set switch this bag on the last modulator creation

      lg widy

      #4691
      dasfaker
      Keymaster
        • Topics: 80
        • Replies: 793
        • Total: 873
        • ★★★
        "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

        #4692
        Widy75
        Participant
          • Topics: 10
          • Replies: 61
          • Total: 71

          hi

          i just thougth if there is a api function for it i should use this one instead of hacking <img decoding=” title=”Smile” />
          but this seems a solution to port my panels vom 925 -> 1080 and export sandalone vst’s
          lg widy

          #4693
          Widy75
          Participant
            • Topics: 10
            • Replies: 61
            • Total: 71

            try 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 implemented

            the 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 this

            lg widy

            #4694
            Widy75
            Participant
              • Topics: 10
              • Replies: 61
              • Total: 71

              if i call on lua script on load finish e.g
              while modulators_sequencer_settings ~= nil do

              local 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:22

              so after finish loading the mods are created but has no values
              lg widy

              #4695
              Widy75
              Participant
                • Topics: 10
                • Replies: 61
                • Total: 71

                shit shit shit … missing one %s
                sry

                #4696
                TK.
                Participant
                  • Topics: 6
                  • Replies: 42
                  • Total: 48

                  I 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. <img decoding=” title=”Smile” />

                  Best Regards, Thorsten.

                Viewing 7 posts - 1 through 7 (of 7 total)
                • The forum ‘Programming’ is closed to new topics and replies.
                There is currently 0 users and 93 guests online
                No users are currently active
                Forum Statistics
                Threads: 2,495, Posts: 17,374, Members: 77,605
                Most users ever online was 12 on January 22, 2019 3:47 pm
                Ctrlr