Skip to content

Lua Model Functions

Damjan Adamic edited this page Apr 23, 2014 · 5 revisions

Model functions

model.getTimer(timer)

Returns model timer

    Parameters:      timer    (number) timer number
    Return value:    nil      unknown timer number
                     value    (table) timer data

    Timer table format: { mode, start, value, countdownBeep, minuteBeep, persistent }
                     mode     (number) timer trigger source: off, abs, stk, 
                              stk%, sw/!sw, !m_sw/!m_sw
                     start    (number) start value [seconds], 0 for up timer,
                              0> down timer 
                     value    (number) current value [seconds]
                     countdownBeep  (number) count down beep 
                                    (0-silent, 1-beeps, 2-voice) 
                     minuteBeep     (boolean) minute beep
                     persistent     (number) persistent timer

model.setTimer(timer, data)

Sets model timer

    Parameters:      timer    (number) timer number
                     data     (table) new timer data 
    Return value:    none

    Timer table format: { mode, start, value, countdownBeep, minuteBeep, persistent }
                     mode     (number) timer trigger source: off, abs, stk, 
                              stk%, sw/!sw, !m_sw/!m_sw
                     start    (number) start value [seconds], 0 for up timer,
                              0> down timer 
                     value    (number) current value [seconds]
                     countdownBeep  (number) count down beep 
                                    (0-silent, 1-beeps, 2-voice) 
                     minuteBeep     (boolean) minute beep
                     persistent     (number) persistent timer

model.getInputsCount(input)

Returns number of lines for given input

    Parameters:      input    (unsigned number) input number (0 - max inputs-1)
    Return value:    value    (unsigned number) number of configured lines 
                              for given input

model.getInput(input, line)

Returns input data for given input and line number

    Parameters:      input    (unsigned number) input number (0 - max inputs-1)
                     line     (unsigned number) input line (0 - max lines-1)
    Return value:    value    (table) input data

    input data table format: { name, source, weight, offset }
                     name     (string) input line name
                     source   (number) input source index
                     weight   (number) input weight
                     offset   (number) input offset

model.insertInput()

model.deleteInput()

model.getMixesCount()

model.getMix()

model.insertMix()

model.deleteMix()

model.getLogicalSwitch()

model.setLogicalSwitch()

model.getCustomFunction()

model.setCustomFunction()

model.getOutput()

model.setOutput()