~raskolnikov/mixxx/round-bpm

« back to all changes in this revision

Viewing changes to mixxx/src/midi/midiscriptengine.h

  • Committer: Juan Pedro BolĂ­var Puente
  • Date: 2012-01-07 15:16:52 UTC
  • mfrom: (2592.1.391 mixxx-trunk)
  • Revision ID: raskolnikov@gnu.org-20120107151652-rpbwukn0xpikdn7e
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
                                    QString function, bool disconnect = false);
60
60
    Q_INVOKABLE void trigger(QString group, QString name);
61
61
    Q_INVOKABLE void log(QString message);
62
 
    Q_INVOKABLE int beginTimer(int interval, QString scriptCode, bool oneShot = false);
 
62
    Q_INVOKABLE int beginTimer(int interval, QScriptValue scriptCode, bool oneShot = false);
63
63
    Q_INVOKABLE void stopTimer(int timerId);
64
64
    Q_INVOKABLE void scratchEnable(int deck, int intervalsPerRev, float rpm, float alpha, float beta);
65
65
    Q_INVOKABLE void scratchTick(int deck, int interval);
97
97
  private:
98
98
    // Only call these with the scriptEngineLock
99
99
    bool safeEvaluate(QString scriptName, QList<QString> scriptPaths);
100
 
    bool internalExecute(QString scriptCode);
 
100
    bool internalExecute(QScriptValue thisObject, QString scriptCode);
101
101
    bool safeExecute(QString function);
102
102
    bool safeExecute(QString function, QString data);
103
103
    bool safeExecute(QString function, const unsigned char data[], unsigned int length);
104
104
    bool safeExecute(QString function, char channel,
105
105
                     char control, char value, MidiStatusByte status, QString group);
 
106
    bool safeExecute(QScriptValue thisObject, QScriptValue functionObject);
106
107
    void initializeScriptEngine();
107
108
 
108
109
    void scriptErrorDialog(QString detailedError);
121
122
    QMap<QString,QStringList> m_scriptErrors;
122
123
    QMutex m_scriptEngineLock;
123
124
    QHash<ConfigKey, ControlObjectThread*> m_controlCache;
124
 
    QHash<int, QPair<QString, bool> > m_timers;
 
125
    struct TimerInfo {
 
126
        QScriptValue callback;
 
127
        QScriptValue context;
 
128
        bool oneShot;
 
129
    };
 
130
    QHash<int, TimerInfo> m_timers;
125
131
    SoftTakeover m_st;
126
132
 
127
133
    // Scratching functions & variables