Start up Functions.

Home Forums General Programming Start up Functions.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #8932
    Bomma72
    Participant
    • Topics: 20
    • Replies: 68
    • Total: 88

    Is there a way to stop the functions attached to buttons from firing when you start up Ctrlr?

     

     

    #8946
    atom
    Keymaster
    • Topics: 159
    • Replies: 2945
    • Total: 3104
    • ★★★★★

    You can disable Lua in Ctrlr (Edit->Preferences->Lua is disabled). You can also always clear the method assignment in the panel/modulator preferences.

    #8948
    Bomma72
    Participant
    • Topics: 20
    • Replies: 68
    • Total: 88

    Hey Atom,

    I don’t want to disable it completely but just when to stop it from firing when I load the panel.

    • This reply was modified 9 years ago by Bomma72.
    #8952
    atom
    Keymaster
    • Topics: 159
    • Replies: 2945
    • Total: 3104
    • ★★★★★

    Like i said just remove the assignments from modulators/panel. If you do that Ctrlr will not execute any code when that event occurs, you can always re-assign the same or a new method to that event.

    There is no way to stop events that are triggered from Timers, unless you never start those timers. You can always implement simple runtime checks in your methods, like a DEVELOPMENT flag that’s checked in your every method, or better a method that checks that and just paste that method on top of each other method, that way you can set that/unset that flag when you are working on a panel and when you want to release it.

    #8956
    Hecticcc
    Participant
    • Topics: 25
    • Replies: 160
    • Total: 185
    • ★★

    Yup, just use some variable as means of control.

    I put a variable in the init script and reference that @ the beginning of each script that can fire something off. Can be anything; for axemple i do this in the luaPanelLoaded script:

    `loaded = 1`

    And then in any script that can trigger something (timers/midimessages…) i do

    `if loaded == 1 then
    — your script here
    end`

    This way the startup triggering will be muted until the panel is fully loaded, and once it’s loaded no more stuff gets “triggered” by the loading process (normally).

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Programming’ is closed to new topics and replies.
There is currently 0 users and 61 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