~mixxxdevelopers/mixxx/features_multi-track

« back to all changes in this revision

Viewing changes to mixxx/src/midi/mididevice.cpp

  • Committer: RJ Ryan
  • Date: 2011-12-17 05:59:20 UTC
  • mfrom: (2837.1.163 mixxx-1.10)
  • Revision ID: rryan@mit.edu-20111217055920-5h1spw480f1l8r0e
MergingĀ fromĀ lp:mixxx/1.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include "midimessage.h"
24
24
#include "mixxxcontrol.h"
25
25
#include "controlobject.h"
 
26
#include "midiledhandler.h"
26
27
 
27
28
#ifdef __MIDISCRIPT__
28
29
#include "midiscriptengine.h"
47
48
        m_pMidiMapping = new MidiMapping(this);
48
49
    }
49
50
 
 
51
    // TODO: Should this be in MidiDeviceManager instead?
50
52
    // Get --midiDebug command line option
51
53
    QStringList commandLineArgs = QApplication::arguments();
52
54
    m_midiDebug = commandLineArgs.contains("--midiDebug", Qt::CaseInsensitive);
95
97
#ifdef __MIDISCRIPT__
96
98
    m_pMidiMapping->shutdownScriptEngine();
97
99
#endif
 
100
    MidiLedHandler::destroyHandlers(this);
98
101
    setReceiveInhibit(false);
99
102
}
100
103
 
179
182
      .arg(QString::number((status & 255)>>4, 16).toUpper())
180
183
      .arg(QString::number(control, 16).toUpper().rightJustified(2,'0'))
181
184
      .arg(QString::number(value, 16).toUpper().rightJustified(2,'0'));
182
 
    
 
185
 
183
186
    // some status bytes can have the channel encoded in them. Take out the
184
187
    // channel when necessary. We do this because later bits of this
185
188
    // function (and perhaps its callchain) assume the channel nibble to be
231
234
    //qDebug() << "MidiDevice: " << mixxxControl.getControlObjectGroup() << mixxxControl.getControlObjectValue();
232
235
 
233
236
    ConfigKey configKey(mixxxControl.getControlObjectGroup(), mixxxControl.getControlObjectValue());
234
 
    
 
237
 
235
238
    MidiOption currMidiOption = mixxxControl.getMidiOption();
236
239
 
237
240
#ifdef __MIDISCRIPT__
284
287
                                                                       // computed differently.
285
288
            default: break;
286
289
        }
287
 
        
 
290
 
288
291
        // Soft-takeover is processed in addition to any other options
289
292
        if (currMidiOption == MIDI_OPT_SOFT_TAKEOVER) {
290
293
            m_st.enable(mixxxControl);  // This is the only place to enable it if it isn't already.
291
294
            if (m_st.ignore(mixxxControl,newValue,true)) return;
292
295
        }
293
 
        
 
296
 
294
297
        ControlObject::sync();
295
298
 
296
299
        //Super dangerous cast here... Should be fine once MidiCategory is replaced with MidiStatusByte permanently.
355
358
}
356
359
#endif
357
360
 
358
 
bool MidiDevice::midiDebugging()
359
 
{
360
 
    //Assumes a lock is already held. :/
361
 
    bool debug = m_midiDebug;
362
 
    return debug;
 
361
bool MidiDevice::midiDebugging() {
 
362
    // Assumes a lock is already held. :/
 
363
    return m_midiDebug;
363
364
}
364
365
 
365
366
void MidiDevice::setReceiveInhibit(bool inhibit)