summaryrefslogtreecommitdiffstats
path: root/src/controllers/midi/midicontroller.h
diff options
context:
space:
mode:
authorRJ Ryan <rryan@mixxx.org>2014-03-29 01:43:58 -0400
committerRJ Ryan <rryan@mixxx.org>2014-03-29 02:40:34 -0400
commit8ceba823487c521df76b9e7c7ba3ebeb457172ce (patch)
tree226e7284ecd0f7ea5b99607443133f7ac5b8c0b0 /src/controllers/midi/midicontroller.h
parent9cf7923c3afd949a15a9080c27794936e485a767 (diff)
Pay down some technical debt.
* Switch to a single standard representation for MIDI input and output mappings. * Delete MixxxControl. * Support multiple input mappings per message. * Remove double-hash lookup for input mappings. * Clean up MIDI XML parsing/writing. We don't have tests for any of this code (except LearningUtils) but I compared the input and output mappings stored to XML after loading a bundled preset and they were the same (modulo order changing).
Diffstat (limited to 'src/controllers/midi/midicontroller.h')
-rw-r--r--src/controllers/midi/midicontroller.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/controllers/midi/midicontroller.h b/src/controllers/midi/midicontroller.h
index f2a14dd90f..0fb68aaa2a 100644
--- a/src/controllers/midi/midicontroller.h
+++ b/src/controllers/midi/midicontroller.h
@@ -73,19 +73,22 @@ class MidiController : public Controller {
void receive(const QByteArray data);
virtual int close();
- void clearInputMappings();
- void clearOutputMappings();
-
private slots:
// Initializes the engine and static output mappings.
void applyPreset(QList<QString> scriptPaths);
- void learnTemporaryInputMappings(const MixxxControl& control,
- const MidiKeyAndOptionsList& mappings);
+ void learnTemporaryInputMappings(const MidiInputMappings& mappings);
void clearTemporaryInputMappings();
void commitTemporaryInputMappings();
private:
+ void processInputMapping(const MidiInputMapping& mapping,
+ unsigned char status,
+ unsigned char control,
+ unsigned char value);
+ void processInputMapping(const MidiInputMapping& mapping,
+ const QByteArray& data);
+
virtual void sendWord(unsigned int word) = 0;
double computeValue(MidiOptions options, double _prevmidivalue, double _newmidivalue);
void createOutputHandlers();
@@ -98,7 +101,7 @@ class MidiController : public Controller {
return &m_preset;
}
- QHash<uint16_t, QPair<MixxxControl, MidiOptions> > m_temporaryInputMappings;
+ QHash<uint16_t, MidiInputMapping> m_temporaryInputMappings;
QList<MidiOutputHandler*> m_outputs;
MidiControllerPreset m_preset;
SoftTakeover m_st;