Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- === modified file 'mixxx/src/SConscript'
- --- mixxx/src/SConscript 2012-03-14 03:30:52 +0000
- +++ mixxx/src/SConscript 2012-03-26 16:12:57 +0000
- @@ -34,7 +34,7 @@
- [sources, env.RES('#src/mixxx.rc')],
- LINKCOM = [env['LINKCOM'], 'mt.exe -nologo -manifest ${TARGET}.manifest -outputresource:$TARGET;1'])
- else:
- - mixxx_bin = env.Program('mixxx', sources)
- + mixxx_bin = env.Program('mixxx', sources, CCFLAGS='-msse -mmmx -msse2')
- def build_tests():
- test_files = Glob('test/*.cpp', strings=True)
- @@ -53,7 +53,7 @@
- env.Append(LIBPATH="#lib/gmock-1.5.0/lib")
- env.Append(LIBS = 'gmock')
- - env.Program(target='mixxx-test', source=test_sources)
- + env.Program(target='mixxx-test', source=test_sources, CCFLAGS='-msse -mmmx -msse2')
- Command("../mixxx-test", "./mixxx-test", Copy("$TARGET", "$SOURCE"))
- === modified file 'mixxx/src/controllers/midi/midicontroller.cpp'
- --- mixxx/src/controllers/midi/midicontroller.cpp 2012-03-18 09:17:24 +0000
- +++ mixxx/src/controllers/midi/midicontroller.cpp 2012-03-26 16:20:25 +0000
- @@ -193,7 +193,6 @@
- // if (m_bReceiveInhibit) return;
- - QPair<ConfigKey, MidiOptions> controlOptions;
- MidiKey mappingKey;
- mappingKey.status = status;
- @@ -211,57 +210,63 @@
- }
- // If no control is bound to this MIDI message, return
- if (!m_mappings.contains(mappingKey.key)) return;
- - controlOptions = m_mappings.value(mappingKey.key);
- -
- - ConfigKey ckey = controlOptions.first;
- - MidiOptions options = controlOptions.second;
- -
- - if (options.script) {
- - if (m_pEngine == NULL) return;
- -
- - QScriptValueList args;
- - args << QScriptValue(status & 0x0F);
- - args << QScriptValue(control);
- - args << QScriptValue(value);
- - args << QScriptValue(status);
- - args << QScriptValue(ckey.group);
- -
- - m_pEngine->execute(ckey.item, args);
- - return;
- - }
- -
- - ControlObject * p = ControlObject::getControl(ckey);
- -
- - if (p) //Only pass values on to valid ControlObjects.
- - {
- - double currMixxxControlValue = p->GetMidiValue();
- -
- - double newValue = value;
- -
- +
- + //Since multiple controls can be mapped to a single MIDI message use iterator
- + QMultiHash<uint16_t,QPair<ConfigKey, MidiOptions> >::iterator m_controlOptions = m_mappings.find(mappingKey.key);
- + while(m_controlOptions != m_mappings.end() and m_controlOptions.key() == mappingKey.key) {
- + QPair<ConfigKey, MidiOptions> controlOptions = m_mappings.value(mappingKey.key);
- +
- + ConfigKey ckey = controlOptions.first;
- + MidiOptions options = controlOptions.second;
- +
- + if (options.script) {
- + if (m_pEngine == NULL) return;
- +
- + QScriptValueList args;
- + args << QScriptValue(status & 0x0F);
- + args << QScriptValue(control);
- + args << QScriptValue(value);
- + args << QScriptValue(status);
- + args << QScriptValue(ckey.group);
- +
- + m_pEngine->execute(ckey.item, args);
- + return;
- + }
- +
- + ControlObject * p = ControlObject::getControl(ckey);
- +
- + if (p) //Only pass values on to valid ControlObjects.
- + {
- + double currMixxxControlValue = p->GetMidiValue();
- +
- + double newValue = value;
- +
- // qDebug() << "MIDI Options" << QString::number(options.all, 2).rightJustified(16,'0');
- // compute 14-bit number for pitch bend messages
- - if (opCode == MIDI_PITCH_BEND) {
- - unsigned int ivalue;
- - ivalue = (value << 7) | control;
- -
- - currMixxxControlValue = p->get();
- -
- - // Range is 0x0000..0x3FFF center @ 0x2000, i.e. 0..16383 center @ 8192
- - newValue = (ivalue-8192)/8191;
- - // computeValue not done on pitch messages because it all assumes 7-bit numbers
- - }
- - else newValue = computeValue(options, currMixxxControlValue, value);
- -
- - if (options.soft_takeover) {
- - m_st.enable(ckey.group,ckey.item); // This is the only place to enable it if it isn't already.
- - if (m_st.ignore(ckey.group,ckey.item,newValue,true)) return;
- - }
- -
- - ControlObject::sync();
- -
- - p->queueFromMidi(static_cast<MidiOpCode>(opCode), newValue);
- - }
- + if (opCode == MIDI_PITCH_BEND) {
- + unsigned int ivalue;
- + ivalue = (value << 7) | control;
- +
- + currMixxxControlValue = p->get();
- +
- + // Range is 0x0000..0x3FFF center @ 0x2000, i.e. 0..16383 center @ 8192
- + newValue = (ivalue-8192)/8191;
- + // computeValue not done on pitch messages because it all assumes 7-bit numbers
- + }
- + else newValue = computeValue(options, currMixxxControlValue, value);
- +
- + if (options.soft_takeover) {
- + m_st.enable(ckey.group,ckey.item); // This is the only place to enable it if it isn't already.
- + if (m_st.ignore(ckey.group,ckey.item,newValue,true)) return;
- + }
- +
- + ControlObject::sync();
- +
- + p->queueFromMidi(static_cast<MidiOpCode>(opCode), newValue);
- + }
- + m_controlOptions++; //next mapped control
- + }
- return;
- }
- @@ -854,4 +859,4 @@
- tagNode.appendChild(text);
- parentNode.appendChild(tagNode);
- }
- -}
- \ No newline at end of file
- +}
- === modified file 'mixxx/src/controllers/midi/midicontroller.h'
- --- mixxx/src/controllers/midi/midicontroller.h 2012-03-18 09:17:24 +0000
- +++ mixxx/src/controllers/midi/midicontroller.h 2012-03-26 16:21:44 +0000
- @@ -77,7 +77,7 @@
- QDomElement m_bindings;
- QList<MidiOutputHandler*> m_outputs;
- - QHash<uint16_t, QPair<ConfigKey, MidiOptions> > m_mappings;
- + QMultiHash<uint16_t, QPair<ConfigKey, MidiOptions> > m_mappings;
- QHash<ConfigKey, MidiOutput> m_outputMappings;
- SoftTakeover m_st;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement