changeset 31:88287c1c2c92

Added an auxiliary MIDI input control, and moved the logging out of the window into the menu to make space in the GUI. Also updated the main window to be rescalable vertically for showing more mappings.
author Andrew McPherson <andrewm@eecs.qmul.ac.uk>
date Thu, 20 Mar 2014 00:14:00 +0000
parents f2797a9d3d20
children 5f25a9b0139e
files Source/GUI/ControlWindowMainComponent.cpp Source/GUI/ControlWindowMainComponent.h Source/GUI/KeyboardZoneComponent.cpp Source/GUI/MainWindow.cpp Source/GUI/MainWindow.h Source/MainApplicationController.h Source/TouchKeys/MidiInputController.cpp Source/TouchKeys/MidiInputController.h
diffstat 8 files changed, 308 insertions(+), 238 deletions(-) [+]
line wrap: on
line diff
--- a/Source/GUI/ControlWindowMainComponent.cpp	Sat Mar 08 16:27:09 2014 +0000
+++ b/Source/GUI/ControlWindowMainComponent.cpp	Thu Mar 20 00:14:00 2014 +0000
@@ -31,9 +31,6 @@
 ControlWindowMainComponent::ControlWindowMainComponent ()
     : controller_(0)
 {
-    addAndMakeVisible (dataLoggingGroupComponent = new GroupComponent ("MIDI input group",
-                                                                       "Data Logging"));
-
     addAndMakeVisible (midiInputGroupComponent = new GroupComponent ("MIDI input group",
                                                                      "MIDI Input"));
 
@@ -45,7 +42,7 @@
     midiInputDeviceComboBox->addListener (this);
 
     addAndMakeVisible (label = new Label ("new label",
-                                          "Device:"));
+                                          "Keyboard:"));
     label->setFont (Font (15.00f, Font::plain));
     label->setJustificationType (Justification::centredLeft);
     label->setEditable (false, false, false);
@@ -150,10 +147,6 @@
     touchkeyOctaveComboBox->setTextWhenNoChoicesAvailable ("(no choices)");
     touchkeyOctaveComboBox->addListener (this);
 
-    addAndMakeVisible (loggingButton = new TextButton ("logging button"));
-    loggingButton->setButtonText ("Start Logging");
-    loggingButton->addListener (this);
-
     addAndMakeVisible (oscInputGroupComponent = new GroupComponent ("MIDI input group",
                                                                     "OSC Input"));
 
@@ -178,10 +171,6 @@
     oscInputPortTextEditor->setPopupMenuEnabled (true);
     oscInputPortTextEditor->setText ("8001");
 
-    addAndMakeVisible (playLogButton = new TextButton ("play log button"));
-    playLogButton->setButtonText ("Play Log...");
-    playLogButton->addListener (this);
-
     addAndMakeVisible (keyboardZoneTabbedComponent = new TabbedComponent (TabbedButtonBar::TabsAtTop));
     keyboardZoneTabbedComponent->setTabBarDepth (30);
     keyboardZoneTabbedComponent->setCurrentTabIndex (-1);
@@ -198,9 +187,25 @@
     touchkeyAutodetectButton->setButtonText ("Detect");
     touchkeyAutodetectButton->addListener (this);
 
+    addAndMakeVisible (midiInputAuxDeviceComboBox = new ComboBox ("MIDI input aux combo box"));
+    midiInputAuxDeviceComboBox->setEditableText (false);
+    midiInputAuxDeviceComboBox->setJustificationType (Justification::centredLeft);
+    midiInputAuxDeviceComboBox->setTextWhenNothingSelected (String::empty);
+    midiInputAuxDeviceComboBox->setTextWhenNoChoicesAvailable ("(no choices)");
+    midiInputAuxDeviceComboBox->addListener (this);
+
+    addAndMakeVisible (label5 = new Label ("new label",
+                                           "Aux:"));
+    label5->setFont (Font (15.00f, Font::plain));
+    label5->setJustificationType (Justification::centredRight);
+    label5->setEditable (false, false, false);
+    label5->setColour (TextEditor::textColourId, Colours::black);
+    label5->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
+
 
     //[UserPreSize]
     lastSelectedMidiInputID_ = -1;
+    lastSelectedMidiAuxInputID_ = -1;
     lastSegmentUniqueIdentifier_ = -1;
 
     // Add octave labels to combo box
@@ -224,7 +229,6 @@
     //[Destructor_pre]. You can add your own custom destruction code here..
     //[/Destructor_pre]
 
-    dataLoggingGroupComponent = nullptr;
     midiInputGroupComponent = nullptr;
     midiInputDeviceComboBox = nullptr;
     label = nullptr;
@@ -243,16 +247,16 @@
     oscEnableRawButton = nullptr;
     label4 = nullptr;
     touchkeyOctaveComboBox = nullptr;
-    loggingButton = nullptr;
     oscInputGroupComponent = nullptr;
     oscInputEnableButton = nullptr;
     label6 = nullptr;
     oscInputPortTextEditor = nullptr;
-    playLogButton = nullptr;
     keyboardZoneTabbedComponent = nullptr;
     addZoneButton = nullptr;
     removeZoneButton = nullptr;
     touchkeyAutodetectButton = nullptr;
+    midiInputAuxDeviceComboBox = nullptr;
+    label5 = nullptr;
 
 
     //[Destructor]. You can add your own custom destruction code here..
@@ -273,36 +277,41 @@
 
 void ControlWindowMainComponent::resized()
 {
-    dataLoggingGroupComponent->setBounds (8, 392, 304, 64);
-    midiInputGroupComponent->setBounds (8, 144, 304, 64);
-    midiInputDeviceComboBox->setBounds (72, 168, 224, 24);
-    label->setBounds (16, 168, 55, 24);
+    midiInputGroupComponent->setBounds (8, 144, 304, 96);
+    midiInputDeviceComboBox->setBounds (80, 168, 216, 24);
+    label->setBounds (16, 168, 64, 24);
     groupComponent->setBounds (8, 8, 304, 128);
     label2->setBounds (16, 32, 60, 24);
     touchkeyDeviceComboBox->setBounds (72, 32, 224, 24);
     label3->setBounds (16, 96, 60, 24);
     touchkeyStartButton->setBounds (216, 96, 79, 24);
     touchkeyStatusLabel->setBounds (72, 96, 136, 24);
-    oscGroupComponent->setBounds (8, 288, 304, 96);
-    label7->setBounds (16, 344, 55, 24);
-    oscHostTextEditor->setBounds (64, 344, 128, 24);
-    label8->setBounds (200, 344, 40, 24);
-    oscPortTextEditor->setBounds (240, 344, 56, 24);
-    oscEnableButton->setBounds (24, 312, 144, 24);
-    oscEnableRawButton->setBounds (176, 312, 144, 24);
+    oscGroupComponent->setBounds (8, 320, 304, 96);
+    label7->setBounds (16, 376, 55, 24);
+    oscHostTextEditor->setBounds (64, 376, 128, 24);
+    label8->setBounds (200, 376, 40, 24);
+    oscPortTextEditor->setBounds (240, 376, 56, 24);
+    oscEnableButton->setBounds (24, 344, 144, 24);
+    oscEnableRawButton->setBounds (176, 344, 144, 24);
     label4->setBounds (16, 64, 104, 24);
     touchkeyOctaveComboBox->setBounds (120, 64, 88, 24);
-    loggingButton->setBounds (24, 416, 128, 24);
-    oscInputGroupComponent->setBounds (8, 216, 304, 64);
-    oscInputEnableButton->setBounds (24, 240, 152, 24);
-    label6->setBounds (200, 240, 40, 24);
-    oscInputPortTextEditor->setBounds (240, 240, 56, 24);
-    playLogButton->setBounds (168, 416, 128, 24);
+    oscInputGroupComponent->setBounds (8, 248, 304, 64);
+    oscInputEnableButton->setBounds (24, 272, 152, 24);
+    label6->setBounds (200, 272, 40, 24);
+    oscInputPortTextEditor->setBounds (240, 272, 56, 24);
     keyboardZoneTabbedComponent->setBounds (320, 0, 552, 464);
     addZoneButton->setBounds (776, 4, 38, 20);
     removeZoneButton->setBounds (824, 4, 38, 20);
     touchkeyAutodetectButton->setBounds (216, 64, 79, 24);
+    midiInputAuxDeviceComboBox->setBounds (80, 200, 216, 24);
+    label5->setBounds (24, 200, 55, 24);
     //[UserResized] Add your own custom resize handling here..
+    
+    // Resize KeyboardZoneComponent to fit new bounds
+    Rectangle<int> const& ourBounds = getBounds();
+    Rectangle<int> keyboardZoneBounds = keyboardZoneTabbedComponent->getBounds();
+    keyboardZoneBounds.setHeight(ourBounds.getHeight() - keyboardZoneBounds.getY());
+    keyboardZoneTabbedComponent->setBounds(keyboardZoneBounds);
     //[/UserResized]
 }
 
@@ -323,18 +332,17 @@
         if(selection == 1 - kMidiInputDeviceComboBoxOffset) {   // Disabled
             if(controller_->midiTouchkeysStandaloneModeIsEnabled())
                 controller_->midiTouchkeysStandaloneModeDisable();
-            controller_->disableAllMIDIInputPorts();
+            controller_->disablePrimaryMIDIInputPort();
         }
         else if(selection == 2 - kMidiInputDeviceComboBoxOffset) {  // Standalone mode
-            controller_->disableAllMIDIInputPorts();
+            controller_->disablePrimaryMIDIInputPort();
             controller_->midiTouchkeysStandaloneModeEnable();
         }
         else if(selection >= 0 && selection < midiInputDeviceIDs_.size()) {
             int deviceId = midiInputDeviceIDs_[selection];
             if(controller_->midiTouchkeysStandaloneModeIsEnabled())
                 controller_->midiTouchkeysStandaloneModeDisable();
-            controller_->disableAllMIDIInputPorts();
-            controller_->enableMIDIInputPort(deviceId);
+            controller_->enableMIDIInputPort(deviceId, true);
         }
         //[/UserComboBoxCode_midiInputDeviceComboBox]
     }
@@ -354,6 +362,29 @@
             controller_->touchkeyDeviceSetLowestMidiNote((octave + 1)*12);
         //[/UserComboBoxCode_touchkeyOctaveComboBox]
     }
+    else if (comboBoxThatHasChanged == midiInputAuxDeviceComboBox)
+    {
+        //[UserComboBoxCode_midiInputAuxDeviceComboBox] -- add your combo box handling code here..
+        
+        // Look up the selected ID, remembering that Juce indices start at 1 and the first of
+        // these is "Disabled"
+        int selection = midiInputAuxDeviceComboBox->getSelectedId() - kMidiInputDeviceComboBoxOffset;
+        if(selection == 1 - kMidiInputDeviceComboBoxOffset) {   // Disabled
+            // Disable all aux ports
+            controller_->disableAllMIDIInputPorts(true);
+        }
+        else if(selection == 2 - kMidiInputDeviceComboBoxOffset) {
+            // Shouldn't happen; standalone mode not an aux feature
+            controller_->disableAllMIDIInputPorts(true);
+        }
+        else if(selection >= 0 && selection < midiInputDeviceIDs_.size()) {
+            int deviceId = midiInputDeviceIDs_[selection];
+            // Enable this aux port
+            controller_->disableAllMIDIInputPorts(true);
+            controller_->enableMIDIInputPort(deviceId, false);
+        }
+        //[/UserComboBoxCode_midiInputAuxDeviceComboBox]
+    }
 
     //[UsercomboBoxChanged_Post]
     //[/UsercomboBoxChanged_Post]
@@ -403,26 +434,12 @@
         controller_->oscTransmitSetRawDataEnabled(oscEnableRawButton->getToggleState());
         //[/UserButtonCode_oscEnableRawButton]
     }
-    else if (buttonThatWasClicked == loggingButton)
-    {
-        //[UserButtonCode_loggingButton] -- add your button handler code here..
-        if(controller_->isLogging())
-            controller_->stopLogging();
-        else
-            controller_->startLogging();
-        //[/UserButtonCode_loggingButton]
-    }
     else if (buttonThatWasClicked == oscInputEnableButton)
     {
         //[UserButtonCode_oscInputEnableButton] -- add your button handler code here..
         controller_->oscReceiveSetEnabled(oscInputEnableButton->getToggleState());
         //[/UserButtonCode_oscInputEnableButton]
     }
-    else if (buttonThatWasClicked == playLogButton)
-    {
-        //[UserButtonCode_playLogButton] -- add your button handler code here..
-        //[/UserButtonCode_playLogButton]
-    }
     else if (buttonThatWasClicked == addZoneButton)
     {
         //[UserButtonCode_addZoneButton] -- add your button handler code here..
@@ -516,21 +533,31 @@
     midiInputDeviceIDs_.clear();
     midiInputDeviceComboBox->addItem("Disabled", 1);
     midiInputDeviceComboBox->addItem("TouchKeys Standalone", 2);
+    
+    midiInputAuxDeviceComboBox->clear();
+    midiInputAuxDeviceComboBox->addItem("Disabled", 1);
+    
     counter = kMidiInputDeviceComboBoxOffset;
-    
+
     // Check whether the currently selected ID still exists while
     // we build the list
     bool lastSelectedDeviceExists = false;
+    bool lastSelectedAuxDeviceExists = false;
     for(it = devices.begin(); it != devices.end(); ++it) {
         midiInputDeviceComboBox->addItem((*it).second.c_str(), counter);
+        midiInputAuxDeviceComboBox->addItem((*it).second.c_str(), counter);
         midiInputDeviceIDs_.push_back(it->first);
         if(it->first == lastSelectedMidiInputID_)
             lastSelectedDeviceExists = true;
+        if(it->first == lastSelectedMidiAuxInputID_)
+            lastSelectedAuxDeviceExists = true;
         counter++;
     }
-    
+
     if(!lastSelectedDeviceExists)
-        controller_->disableAllMIDIInputPorts();
+        controller_->disablePrimaryMIDIInputPort();
+    if(!lastSelectedAuxDeviceExists)
+        controller_->disableAllMIDIInputPorts(true);
 }
 
 void ControlWindowMainComponent::updateOscHostPort()
@@ -548,9 +575,9 @@
 void ControlWindowMainComponent::synchronize() {
     if(controller_ == 0)
         return;
-    
+
     bool devicesUpdated = false;
-    
+
     if(controller_->devicesShouldUpdate() != lastControllerUpdateDeviceCount_) {
         lastControllerUpdateDeviceCount_ = controller_->devicesShouldUpdate();
         updateInputDeviceList();
@@ -584,24 +611,53 @@
         midiInputDeviceComboBox->setSelectedId(2, dontSendNotification);
     }
     else {
-        const std::vector<int>& selectedMidiInputDevices(controller_->selectedMIDIInputPorts());
-        if(selectedMidiInputDevices.empty()) {
+        // First query the primary port
+        int selectedPrimaryPort = controller_->selectedMIDIPrimaryInputPort();
+        if(selectedPrimaryPort < 0) {
             midiInputDeviceComboBox->setSelectedId(1, dontSendNotification);
         }
-        else if(selectedMidiInputDevices.front() != lastSelectedMidiInputID_ || devicesUpdated){
+        else if(selectedPrimaryPort != lastSelectedMidiInputID_ || devicesUpdated){
             // Input has changed from before. Find it in vector
             // If there is more than one selected ID, we will only take the first one for
             // the current UI. This affects the display but not the functionality.
             for(int i = 0; i < midiInputDeviceIDs_.size(); i++) {
-                if(midiInputDeviceIDs_[i] == selectedMidiInputDevices.front()) {
+                if(midiInputDeviceIDs_[i] == selectedPrimaryPort) {
                     midiInputDeviceComboBox->setSelectedId(i + kMidiInputDeviceComboBoxOffset, dontSendNotification);
                     break;
                 }
             }
             // ...and cache this as the last ID so we don't search again next time
-            lastSelectedMidiInputID_ = selectedMidiInputDevices.front();
+            lastSelectedMidiInputID_ = selectedPrimaryPort;
+            
+            // Now disable this item in the auxiliary combo box
+            for(int i = 0; i < midiInputAuxDeviceComboBox->getNumItems(); i++) {
+                int itemId = midiInputAuxDeviceComboBox->getItemId(i) - kMidiInputDeviceComboBoxOffset;
+                if(itemId >= 0) {
+                    midiInputAuxDeviceComboBox->setItemEnabled(midiInputAuxDeviceComboBox->getItemId(i),
+                                                               (itemId != selectedPrimaryPort));
+                }
+            }
         }
     }
+        
+    // Then get all aux ports and display the first one
+    const std::vector<int>& selectedMidiInputDevices(controller_->selectedMIDIAuxInputPorts());
+    if(selectedMidiInputDevices.empty()) {
+        midiInputAuxDeviceComboBox->setSelectedId(1, dontSendNotification);
+    }
+    else if(selectedMidiInputDevices.front() != lastSelectedMidiAuxInputID_ || devicesUpdated){
+        // Input has changed from before. Find it in vector
+        // If there is more than one selected ID, we will only take the first one for
+        // the current UI. This affects the display but not the functionality.
+        for(int i = 0; i < midiInputDeviceIDs_.size(); i++) {
+            if(midiInputDeviceIDs_[i] == selectedMidiInputDevices.front()) {
+                midiInputAuxDeviceComboBox->setSelectedId(i + kMidiInputDeviceComboBoxOffset, dontSendNotification);
+                break;
+            }
+        }
+        // ...and cache this as the last ID so we don't search again next time
+        lastSelectedMidiAuxInputID_ = selectedMidiInputDevices.front();
+    }
 
     // Update OSC status
     oscEnableButton->setToggleState(controller_->oscTransmitEnabled(), dontSendNotification);
@@ -647,13 +703,6 @@
         touchkeyAutodetectButton->setButtonText("Detect");
     }
 
-    // Set the text on the logging button
-    if(controller_->isLogging()) {
-        loggingButton->setButtonText("Stop Logging");
-    }
-    else
-        loggingButton->setButtonText("Start Logging");
-
     // Update segments list if it has changed
     if(lastSegmentUniqueIdentifier_ != controller_->midiSegmentUniqueIdentifier())
         updateKeyboardSegments();
@@ -792,19 +841,17 @@
 <JUCER_COMPONENT documentType="Component" className="ControlWindowMainComponent"
                  componentName="" parentClasses="public Component, public TextEditor::Listener"
                  constructorParams="" variableInitialisers="controller_(0)" snapPixels="8"
-                 snapActive="1" snapShown="1" overlayOpacity="0.330" fixedSize="1"
+                 snapActive="1" snapShown="1" overlayOpacity="0.330" fixedSize="0"
                  initialWidth="872" initialHeight="444">
   <BACKGROUND backgroundColour="ffd2d2d2"/>
-  <GROUPCOMPONENT name="MIDI input group" id="87491da999138aa9" memberName="dataLoggingGroupComponent"
-                  virtualName="" explicitFocusOrder="0" pos="8 392 304 64" title="Data Logging"/>
   <GROUPCOMPONENT name="MIDI input group" id="ce80a86ee6475cd9" memberName="midiInputGroupComponent"
-                  virtualName="" explicitFocusOrder="0" pos="8 144 304 64" title="MIDI Input"/>
+                  virtualName="" explicitFocusOrder="0" pos="8 144 304 96" title="MIDI Input"/>
   <COMBOBOX name="MIDI input combo box" id="def32c74505cfa50" memberName="midiInputDeviceComboBox"
-            virtualName="" explicitFocusOrder="0" pos="72 168 224 24" editable="0"
+            virtualName="" explicitFocusOrder="0" pos="80 168 216 24" editable="0"
             layout="33" items="" textWhenNonSelected="" textWhenNoItems="(no choices)"/>
   <LABEL name="new label" id="ad7bc4640d8023b7" memberName="label" virtualName=""
-         explicitFocusOrder="0" pos="16 168 55 24" edTextCol="ff000000"
-         edBkgCol="0" labelText="Device:" editableSingleClick="0" editableDoubleClick="0"
+         explicitFocusOrder="0" pos="16 168 64 24" edTextCol="ff000000"
+         edBkgCol="0" labelText="Keyboard:" editableSingleClick="0" editableDoubleClick="0"
          focusDiscardsChanges="0" fontname="Default font" fontsize="15"
          bold="0" italic="0" justification="33"/>
   <GROUPCOMPONENT name="new group" id="9106305fd2211185" memberName="groupComponent"
@@ -831,30 +878,30 @@
          editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
          fontsize="15" bold="0" italic="0" justification="33"/>
   <GROUPCOMPONENT name="OSC group" id="8268119e22809825" memberName="oscGroupComponent"
-                  virtualName="" explicitFocusOrder="0" pos="8 288 304 96" title="OSC Output"/>
+                  virtualName="" explicitFocusOrder="0" pos="8 320 304 96" title="OSC Output"/>
   <LABEL name="new label" id="896c0c48a1cf50a" memberName="label7" virtualName=""
-         explicitFocusOrder="0" pos="16 344 55 24" edTextCol="ff000000"
+         explicitFocusOrder="0" pos="16 376 55 24" edTextCol="ff000000"
          edBkgCol="0" labelText="Host:" editableSingleClick="0" editableDoubleClick="0"
          focusDiscardsChanges="0" fontname="Default font" fontsize="15"
          bold="0" italic="0" justification="33"/>
   <TEXTEDITOR name="new text editor" id="84778d0bbebedd36" memberName="oscHostTextEditor"
-              virtualName="" explicitFocusOrder="0" pos="64 344 128 24" initialText="127.0.0.1"
+              virtualName="" explicitFocusOrder="0" pos="64 376 128 24" initialText="127.0.0.1"
               multiline="0" retKeyStartsLine="0" readonly="0" scrollbars="1"
               caret="1" popupmenu="1"/>
   <LABEL name="new label" id="157c85bf83a7f936" memberName="label8" virtualName=""
-         explicitFocusOrder="0" pos="200 344 40 24" edTextCol="ff000000"
+         explicitFocusOrder="0" pos="200 376 40 24" edTextCol="ff000000"
          edBkgCol="0" labelText="Port:" editableSingleClick="0" editableDoubleClick="0"
          focusDiscardsChanges="0" fontname="Default font" fontsize="15"
          bold="0" italic="0" justification="33"/>
   <TEXTEDITOR name="new text editor" id="7c21f0c238812d11" memberName="oscPortTextEditor"
-              virtualName="" explicitFocusOrder="0" pos="240 344 56 24" initialText="8000"
+              virtualName="" explicitFocusOrder="0" pos="240 376 56 24" initialText="8000"
               multiline="0" retKeyStartsLine="0" readonly="0" scrollbars="1"
               caret="1" popupmenu="1"/>
   <TOGGLEBUTTON name="OSC enable button" id="ccd52591cfd0b632" memberName="oscEnableButton"
-                virtualName="" explicitFocusOrder="0" pos="24 312 144 24" buttonText="Enable OSC output"
+                virtualName="" explicitFocusOrder="0" pos="24 344 144 24" buttonText="Enable OSC output"
                 connectedEdges="0" needsCallback="1" radioGroupId="0" state="0"/>
   <TOGGLEBUTTON name="OSC enable raw button" id="4aaf8f80edaff24" memberName="oscEnableRawButton"
-                virtualName="" explicitFocusOrder="0" pos="176 312 144 24" buttonText="Send raw frames"
+                virtualName="" explicitFocusOrder="0" pos="176 344 144 24" buttonText="Send raw frames"
                 connectedEdges="0" needsCallback="1" radioGroupId="0" state="0"/>
   <LABEL name="new label" id="c5873c6498f8156d" memberName="label4" virtualName=""
          explicitFocusOrder="0" pos="16 64 104 24" edTextCol="ff000000"
@@ -864,26 +911,20 @@
   <COMBOBOX name="TouchKeys octave box" id="36ace32027c81d30" memberName="touchkeyOctaveComboBox"
             virtualName="" explicitFocusOrder="0" pos="120 64 88 24" editable="0"
             layout="33" items="" textWhenNonSelected="" textWhenNoItems="(no choices)"/>
-  <TEXTBUTTON name="logging button" id="44705422dd1cb795" memberName="loggingButton"
-              virtualName="" explicitFocusOrder="0" pos="24 416 128 24" buttonText="Start Logging"
-              connectedEdges="0" needsCallback="1" radioGroupId="0"/>
   <GROUPCOMPONENT name="MIDI input group" id="bb54712f78382055" memberName="oscInputGroupComponent"
-                  virtualName="" explicitFocusOrder="0" pos="8 216 304 64" title="OSC Input"/>
+                  virtualName="" explicitFocusOrder="0" pos="8 248 304 64" title="OSC Input"/>
   <TOGGLEBUTTON name="OSC input enable button" id="22a196770a440560" memberName="oscInputEnableButton"
-                virtualName="" explicitFocusOrder="0" pos="24 240 152 24" buttonText="Enable OSC input"
+                virtualName="" explicitFocusOrder="0" pos="24 272 152 24" buttonText="Enable OSC input"
                 connectedEdges="0" needsCallback="1" radioGroupId="0" state="0"/>
   <LABEL name="new label" id="c680c2da87cdcbf2" memberName="label6" virtualName=""
-         explicitFocusOrder="0" pos="200 240 40 24" edTextCol="ff000000"
+         explicitFocusOrder="0" pos="200 272 40 24" edTextCol="ff000000"
          edBkgCol="0" labelText="Port:" editableSingleClick="0" editableDoubleClick="0"
          focusDiscardsChanges="0" fontname="Default font" fontsize="15"
          bold="0" italic="0" justification="33"/>
   <TEXTEDITOR name="new text editor" id="d4a91e8bff5b6bc9" memberName="oscInputPortTextEditor"
-              virtualName="" explicitFocusOrder="0" pos="240 240 56 24" initialText="8001"
+              virtualName="" explicitFocusOrder="0" pos="240 272 56 24" initialText="8001"
               multiline="0" retKeyStartsLine="0" readonly="0" scrollbars="1"
               caret="1" popupmenu="1"/>
-  <TEXTBUTTON name="play log button" id="44858f01a66d263d" memberName="playLogButton"
-              virtualName="" explicitFocusOrder="0" pos="168 416 128 24" buttonText="Play Log..."
-              connectedEdges="0" needsCallback="1" radioGroupId="0"/>
   <TABBEDCOMPONENT name="keyboard zone tabbed component" id="33da3d6583cdacbf" memberName="keyboardZoneTabbedComponent"
                    virtualName="" explicitFocusOrder="0" pos="320 0 552 464" orientation="top"
                    tabBarDepth="30" initialTab="-1"/>
@@ -896,6 +937,14 @@
   <TEXTBUTTON name="TouchKeys autodetect button" id="6e19894bc11d0276" memberName="touchkeyAutodetectButton"
               virtualName="" explicitFocusOrder="0" pos="216 64 79 24" buttonText="Detect"
               connectedEdges="0" needsCallback="1" radioGroupId="0"/>
+  <COMBOBOX name="MIDI input aux combo box" id="1b77c934a4790942" memberName="midiInputAuxDeviceComboBox"
+            virtualName="" explicitFocusOrder="0" pos="80 200 216 24" editable="0"
+            layout="33" items="" textWhenNonSelected="" textWhenNoItems="(no choices)"/>
+  <LABEL name="new label" id="7409cb92cfa3b9f2" memberName="label5" virtualName=""
+         explicitFocusOrder="0" pos="24 200 55 24" edTextCol="ff000000"
+         edBkgCol="0" labelText="Aux:" editableSingleClick="0" editableDoubleClick="0"
+         focusDiscardsChanges="0" fontname="Default font" fontsize="15"
+         bold="0" italic="0" justification="34"/>
 </JUCER_COMPONENT>
 
 END_JUCER_METADATA
--- a/Source/GUI/ControlWindowMainComponent.h	Sat Mar 08 16:27:09 2014 +0000
+++ b/Source/GUI/ControlWindowMainComponent.h	Thu Mar 20 00:14:00 2014 +0000
@@ -89,13 +89,13 @@
     MainApplicationController *controller_; // Pointer to the main application controller
     std::vector<int> midiInputDeviceIDs_;
     int lastSelectedMidiInputID_;
+    int lastSelectedMidiAuxInputID_;
     int lastSegmentUniqueIdentifier_;
-    
+
     int lastControllerUpdateDeviceCount_;
     //[/UserVariables]
 
     //==============================================================================
-    ScopedPointer<GroupComponent> dataLoggingGroupComponent;
     ScopedPointer<GroupComponent> midiInputGroupComponent;
     ScopedPointer<ComboBox> midiInputDeviceComboBox;
     ScopedPointer<Label> label;
@@ -114,16 +114,16 @@
     ScopedPointer<ToggleButton> oscEnableRawButton;
     ScopedPointer<Label> label4;
     ScopedPointer<ComboBox> touchkeyOctaveComboBox;
-    ScopedPointer<TextButton> loggingButton;
     ScopedPointer<GroupComponent> oscInputGroupComponent;
     ScopedPointer<ToggleButton> oscInputEnableButton;
     ScopedPointer<Label> label6;
     ScopedPointer<TextEditor> oscInputPortTextEditor;
-    ScopedPointer<TextButton> playLogButton;
     ScopedPointer<TabbedComponent> keyboardZoneTabbedComponent;
     ScopedPointer<TextButton> addZoneButton;
     ScopedPointer<TextButton> removeZoneButton;
     ScopedPointer<TextButton> touchkeyAutodetectButton;
+    ScopedPointer<ComboBox> midiInputAuxDeviceComboBox;
+    ScopedPointer<Label> label5;
 
 
     //==============================================================================
--- a/Source/GUI/KeyboardZoneComponent.cpp	Sat Mar 08 16:27:09 2014 +0000
+++ b/Source/GUI/KeyboardZoneComponent.cpp	Thu Mar 20 00:14:00 2014 +0000
@@ -276,7 +276,15 @@
     label9->setBounds (24, 68, 104, 24);
     pitchWheelRangeEditor->setBounds (128, 68, 48, 24);
     keyboardControllersButton->setBounds (24, 100, 152, 20);
+    
     //[UserResized] Add your own custom resize handling here..
+    
+    // Resize the mapping list to fit the bottom of the window
+    Rectangle<int> const& ourBounds = getBounds();
+    Rectangle<int> mappingBounds = mappingListComponent->getBounds();
+    mappingBounds.setHeight(ourBounds.getHeight() - mappingBounds.getY());
+    mappingListComponent->setBounds(mappingBounds);
+    
     //[/UserResized]
 }
 
@@ -424,12 +432,12 @@
 {
     if(keyboardSegment_ == 0 || controller_ == 0)
         return;
-    
+
     if(forceUpdates) {
         // Update the controls to reflect the current state
         updateOutputDeviceList();
     }
-        
+
     // Update note ranges
     std::pair<int, int> range = keyboardSegment_->noteRange();
     if(!rangeLowComboBox->hasKeyboardFocus(true) || forceUpdates) {
@@ -578,7 +586,7 @@
     snprintf(virtualPortName, 24, "Virtual Port (%d)", keyboardSegment_->outputPort());
 	midiOutputDeviceComboBox->addItem(virtualPortName, 2);
 #endif
-    
+
     // Check whether the currently selected ID still exists while
     // we build the list
     bool lastSelectedDeviceExists = false;
@@ -592,7 +600,7 @@
             lastSelectedDeviceExists = true;
         counter++;
     }
-    
+
     if(!lastSelectedDeviceExists) {
 #ifndef JUCE_WINDOWS
         if(lastSelectedMidiOutputID_ != MidiOutputController::kMidiVirtualOutputPortNumber)
@@ -629,7 +637,7 @@
     PopupMenu menu;
 
     menu.addItem(kKeyboardControllerSendPitchWheelRange, "Send Pitchwheel Range RPN", true, false);
-    menu.addSeparator();    
+    menu.addSeparator();
     menu.addItem(MidiKeyboardSegment::kControlPitchWheel, "Retransmit from Keyboard:", false);
     menu.addSeparator();
     menu.addItem(MidiKeyboardSegment::kControlPitchWheel, "Pitch Wheel", true, keyboardSegment_->usesKeyboardPitchWheel());
@@ -697,7 +705,7 @@
                  parentClasses="public Component, public TextEditor::Listener"
                  constructorParams="" variableInitialisers="controller_(0), keyboardSegment_(0)"
                  snapPixels="8" snapActive="1" snapShown="1" overlayOpacity="0.330"
-                 fixedSize="1" initialWidth="552" initialHeight="400">
+                 fixedSize="0" initialWidth="552" initialHeight="400">
   <BACKGROUND backgroundColour="ffd2d2d2"/>
   <JUCERCOMP name="mapping list" id="4d5d007374cdad00" memberName="mappingListComponent"
              virtualName="MappingListComponent" explicitFocusOrder="0" pos="0 168 552 260"
--- a/Source/GUI/MainWindow.cpp	Sat Mar 08 16:27:09 2014 +0000
+++ b/Source/GUI/MainWindow.cpp	Thu Mar 20 00:14:00 2014 +0000
@@ -64,6 +64,11 @@
     
     centreWithSize (getWidth(), getHeight());
     setUsingNativeTitleBar(true);
+    
+    // Allow resizing to be larger vertically
+    setResizable(true, true);
+    setResizeLimits(getWidth(), getHeight(), getWidth(), 2048);
+    
     setVisible (true);
 }
 
@@ -117,6 +122,9 @@
     else if(menuIndex == 2) { // Control
         menu.addCommandItem(&commandManager_, kCommandRescanDevices);
         menu.addSeparator();
+        menu.addCommandItem(&commandManager_, kCommandLoggingStartStop);
+        menu.addCommandItem(&commandManager_, kCommandLoggingPlay);
+        menu.addSeparator();
         menu.addCommandItem(&commandManager_, kCommandEnableExperimentalMappings);
 #ifdef ENABLE_TOUCHKEYS_SENSOR_TEST
         menu.addCommandItem(&commandManager_, kCommandTestTouchkeySensors);
@@ -157,6 +165,8 @@
         StandardApplicationCommandIDs::selectAll,
         // Control
         kCommandRescanDevices,
+        kCommandLoggingStartStop,
+        kCommandLoggingPlay,
         kCommandEnableExperimentalMappings,
 #ifdef ENABLE_TOUCHKEYS_SENSOR_TEST
         kCommandTestTouchkeySensors,
@@ -255,6 +265,16 @@
             result.setActive(true);
             result.addDefaultKeypress ('R', ModifierKeys::commandModifier);
             break;
+        case kCommandLoggingStartStop:
+            result.setInfo("Record Log File", "Records TouchKeys and MIDI data to file", controlCategory, 0);
+            result.setTicked(controller_.isLogging());
+            result.setActive(true);
+            break;
+        case kCommandLoggingPlay:
+            result.setInfo("Play Log...", "Plays TouchKeys and MIDI from file", controlCategory, 0);
+            result.setTicked(false);
+            result.setActive(false);
+            break;
         case kCommandEnableExperimentalMappings:
             result.setInfo("Enable Experimental Mappings", "Enables mappings which are still experimental", controlCategory, 0);
             result.setTicked(controller_.experimentalMappingsEnabled());
@@ -292,6 +312,15 @@
         case kCommandRescanDevices:
             controller_.tellDevicesToUpdate();
             break;
+        case kCommandLoggingStartStop:
+            if(controller_.isLogging())
+                controller_.stopLogging();
+            else
+                controller_.startLogging();
+            break;
+        case kCommandLoggingPlay:
+            // TODO
+            break;
         case kCommandEnableExperimentalMappings:
             controller_.setExperimentalMappingsEnabled(!controller_.experimentalMappingsEnabled());
             break;
--- a/Source/GUI/MainWindow.h	Sat Mar 08 16:27:09 2014 +0000
+++ b/Source/GUI/MainWindow.h	Thu Mar 20 00:14:00 2014 +0000
@@ -49,6 +49,8 @@
         
         // Control menu
         kCommandRescanDevices = 0x2020,
+        kCommandLoggingStartStop,
+        kCommandLoggingPlay,
         kCommandEnableExperimentalMappings,
         kCommandTestTouchkeySensors,
         
--- a/Source/MainApplicationController.h	Sat Mar 08 16:27:09 2014 +0000
+++ b/Source/MainApplicationController.h	Thu Mar 20 00:14:00 2014 +0000
@@ -172,17 +172,20 @@
     void midiSegmentRemove(MidiKeyboardSegment *segment);
 
     // Select MIDI input/output devices
-    void enableMIDIInputPort(int portNumber) {
-        midiInputController_.enablePort(portNumber);
+    void enableMIDIInputPort(int portNumber, bool isPrimary) {
+        midiInputController_.enablePort(portNumber, isPrimary);
     }
-    void enableAllMIDIInputPorts() {
-        midiInputController_.enableAllPorts();
+    void enableAllMIDIInputPorts(int primaryPortNumber) {
+        midiInputController_.enableAllPorts(primaryPortNumber);
     }
     void disableMIDIInputPort(int portNumber) {
         midiInputController_.disablePort(portNumber);
     }
-    void disableAllMIDIInputPorts() {
-        midiInputController_.disableAllPorts();
+    void disablePrimaryMIDIInputPort() {
+        midiInputController_.disablePrimaryPort();
+    }
+    void disableAllMIDIInputPorts(bool auxiliaryOnly) {
+        midiInputController_.disableAllPorts(auxiliaryOnly);
     }
     void enableMIDIOutputPort(int identifier, int deviceNumber) {
         midiOutputController_.enablePort(identifier, deviceNumber);
@@ -200,8 +203,11 @@
     }
     
     // Get selected MIDI input/output devices by ID
-    std::vector<int> selectedMIDIInputPorts() {
-        return midiInputController_.activePorts();
+    int selectedMIDIPrimaryInputPort() {
+        return midiInputController_.primaryActivePort();
+    }
+    std::vector<int> selectedMIDIAuxInputPorts() {
+        return midiInputController_.auxiliaryActivePorts();
     }
     int selectedMIDIOutputPort(int identifier) {
         return midiOutputController_.enabledPort(identifier);
--- a/Source/TouchKeys/MidiInputController.cpp	Sat Mar 08 16:27:09 2014 +0000
+++ b/Source/TouchKeys/MidiInputController.cpp	Thu Mar 20 00:14:00 2014 +0000
@@ -27,12 +27,14 @@
 #include "MidiOutputController.h"
 #include "../Mappings/MappingFactory.h"
 
+#define DEBUG_MIDI_INPUT_CONTROLLER
 #undef MIDI_INPUT_CONTROLLER_DEBUG_RAW
 
 // Constructor
 
 MidiInputController::MidiInputController(PianoKeyboard& keyboard) 
-: keyboard_(keyboard), midiOutputController_(0), segmentUniqueIdentifier_(0)
+: keyboard_(keyboard), midiOutputController_(0), primaryActivePort_(-1),
+  segmentUniqueIdentifier_(0)
 {    
     logFileCreated = false;
     loggingActive = false;
@@ -120,37 +122,70 @@
 // Enable a new MIDI port according to its index (returned from availableMidiDevices())
 // Returns true on success.
 
-bool MidiInputController::enablePort(int portNumber) {
+bool MidiInputController::enablePort(int portNumber, bool isPrimary) {
 	if(portNumber < 0)
 		return false;
+    // If this is already the primary port, nothing to do
+    if(isPrimary && primaryActivePort_ == portNumber)
+        return true;
+    
+    // If this port is active already but we are not making it primary,
+    // then fail: can't override primary with aux
+    if(!isPrimary)
+        if(activePorts_.count(portNumber) > 0)
+            return false;
 	
-    MidiInput *device = MidiInput::openDevice(portNumber, this);
+    // If there is already a (different) primary active port, disable it
+    if(isPrimary && primaryActivePort_ >= 0 && activePorts_.count(primaryActivePort_) > 0)
+        disablePort(primaryActivePort_);
+    
+    // Enable the port if it hasn't been already
+    if(activePorts_.count(portNumber) == 0) {
+        MidiInput *device = MidiInput::openDevice(portNumber, this);
+            
+        if(device == 0) {
+#ifdef DEBUG_MIDI_INPUT_CONTROLLER
+            cout << "Failed to enable MIDI input port " << portNumber << ")\n";
+#endif
+            return false;
+        }
         
-    if(device == 0) {
-        cout << "Failed to enable MIDI input port " << portNumber << ")\n";
-        return false;
+        
+#ifdef DEBUG_MIDI_INPUT_CONTROLLER
+        cout << "Enabling MIDI input port " << portNumber << " (" << device->getName() << ")\n";
+#endif
+        device->start();
+
+        // Save the device in the set of ports
+        activePorts_[portNumber] = device;
+    }
+    else {
+#ifdef DEBUG_MIDI_INPUT_CONTROLLER
+        cout << "MIDI input port " << portNumber << " already enabled\n";
+#endif
     }
     
-    //cout << "Enabling MIDI input port " << portNumber << " (" << device->getName() << ")\n";
-    device->start();
-
-    // Save the device in the set of ports
-    activePorts_[portNumber] = device;
-
+    if(isPrimary)
+        primaryActivePort_ = portNumber;
+    
 	return true;
 }
 
 // Enable all current MIDI ports
 
-bool MidiInputController::enableAllPorts() {
+bool MidiInputController::enableAllPorts(int primaryPortNumber) {
 	bool enabledPort = false;
 	vector<pair<int, string> > ports = availableMidiDevices();
 	vector<pair<int, string> >::iterator it = ports.begin();
 	
+#ifdef DEBUG_MIDI_INPUT_CONTROLLER
+    cout << "Enabling all MIDI input ports\n";
+#endif
+    
 	while(it != ports.end()) {
 		// Don't enable MIDI input from our own virtual output
 		if(it->second != string(kMidiVirtualOutputName.toUTF8()))
-			enabledPort |= enablePort((it++)->first);
+			enabledPort |= enablePort((it++)->first, it->first == primaryPortNumber);
 		else
 			it++;
 	}
@@ -169,20 +204,36 @@
     if(device == 0)
         return;
     
-	//cout << "Disabling MIDI input port " << portNumber << " (" << device->getName() << ")\n";
+#ifdef DEBUG_MIDI_INPUT_CONTROLLER
+	cout << "Disabling MIDI input port " << portNumber << " (" << device->getName() << ")\n";
+#endif
+    
     device->stop();
     delete device;
     
 	activePorts_.erase(portNumber);
+    if(primaryActivePort_ == portNumber)
+        primaryActivePort_ = -1;
+}
+
+// Remove the primary MIDI input source
+
+void MidiInputController::disablePrimaryPort() {
+    if(primaryActivePort_ < 0)
+        return;
+    disablePort(primaryActivePort_);
 }
 
 // Remove all MIDI input sources and free associated memory
 
-void MidiInputController::disableAllPorts() {
+void MidiInputController::disableAllPorts(bool auxiliaryOnly) {
 	map<int, MidiInput*>::iterator it;
+	MidiInput* primaryPort = 0;
 	
-	//cout << "Disabling all MIDI input ports\n";
-	
+#ifdef DEBUG_MIDI_INPUT_CONTROLLER
+    cout << "Disabling all MIDI input ports\n";
+#endif
+    
 	it = activePorts_.begin();
 	
 	while(it != activePorts_.end()) {
@@ -190,22 +241,45 @@
             it++;
             continue;
         }
-		it->second->stop();                     // disable port
-		delete it->second;						// free MidiInputCallback
+        
+        // Save primary port?
+        if(it->first == primaryActivePort_ && auxiliaryOnly)
+            primaryPort = it->second;
+        else {
+            it->second->stop();                     // disable port
+            delete it->second;						// free MidiInputCallback
+        }
 		it++;
 	}
 	
-	activePorts_.clear();
+    // Clear all ports including primary
+    activePorts_.clear();
+    
+    // But did we save the priamry port?
+    if(auxiliaryOnly && primaryPort != 0) {
+        // Re-insert primary only
+        activePorts_[primaryActivePort_] = primaryPort;
+    }
+    else
+        primaryActivePort_ = -1;
 }
 
-// Return a list of active ports
+// Return the primary active port corresponding to the TK keyboard
 
-vector<int> MidiInputController::activePorts() {
+int MidiInputController::primaryActivePort() {
+    return primaryActivePort_;
+}
+
+// Return a list of active ports other than the primary
+
+vector<int> MidiInputController::auxiliaryActivePorts() {
     vector<int> ports;
     
 	map<int, MidiInput*>::iterator it;
     
     for(it = activePorts_.begin(); it != activePorts_.end(); ++it) {
+        if(it->first == primaryActivePort_)
+            continue;
         ports.push_back(it->first);
     }
     
@@ -339,6 +413,6 @@
     if(logFileCreated) {
         midiLog.close();
     }
-	disableAllPorts();
+	disableAllPorts(false);
     removeAllSegments();
 }
--- a/Source/TouchKeys/MidiInputController.h	Sat Mar 08 16:27:09 2014 +0000
+++ b/Source/TouchKeys/MidiInputController.h	Thu Mar 20 00:14:00 2014 +0000
@@ -64,28 +64,6 @@
 
 class MidiInputController : public MidiInputCallback {
 public:
-    /*
-	// Operating modes for MIDI input
-	enum {
-		ModeOff = 0,
-		ModePassThrough,
-		ModeMonophonic,
-		ModePolyphonic,
-		ModeChannelSelect,
-		ModeConstantControllers
-	};
-	
-	// Switch types for Channel Select mode
-	enum {
-		ChannelSelectSwitchTypeUnknown = 0,
-		ChannelSelectSwitchTypeLocation,
-		ChannelSelectSwitchTypeSize,
-		ChannelSelectSwitchTypeNumTouches,
-		ChannelSelectSwitchTypeAngle
-	};
-     */
-	
-public:
 	// Constructor
 	MidiInputController(PianoKeyboard& keyboard);
 
@@ -95,23 +73,14 @@
 	
 	// Add/Remove MIDI input ports;
 	// Enable methods return true on success (at least one port enabled) 
-	bool enablePort(int portNumber);
-	bool enableAllPorts();
+	bool enablePort(int portNumber, bool isPrimary);
+	bool enableAllPorts(int primaryPortNumber);
 	void disablePort(int portNumber);
-	void disableAllPorts();
-	vector<int> activePorts();
+    void disablePrimaryPort();
+	void disableAllPorts(bool auxiliaryOnly);
+    int primaryActivePort();
+	vector<int> auxiliaryActivePorts();
 
-    //void touchkeyStandaloneTouchBegan(int noteNumber,  Node<KeyTouchFrame>* touchBuffer);
-    //void touchkeyStandaloneTouchEnded(int noteNumber);
-    
-    /*
-	// Set which channels we listen to
-	bool enableChannel(int channelNumber);
-	bool enableAllChannels();
-	void disableChannel(int channelNumber);
-	void disableAllChanels();
-	*/
-    
 	// Set/query the output controller
 	MidiOutputController* midiOutputController() { return midiOutputController_; }
 	void setMidiOutputController(MidiOutputController* ct);
@@ -144,21 +113,6 @@
     void removeSegment(MidiKeyboardSegment* segment);
     void removeAllSegments();
     
-    /*
-	// Change or query the operating mode of the controller
-	int mode() { return mode_; }
-	void setModeOff();
-	void setModePassThrough();
-    void setModeMonophonic();
-	void setModePolyphonic();
-	void setModeChannelSelect(int switchType, int numDivisions, int defaultChannel);
-
-    int polyphony() { return retransmitMaxPolyphony_; }
-    void setPolyphony(int polyphony);
-    bool voiceStealingEnabled() { return useVoiceStealing_; }
-    void setVoiceStealingEnabled(bool enable) { useVoiceStealing_ = enable; }
-    */
-    
     // Juce MIDI callbacks
     void handleIncomingMidiMessage(MidiInput* source, const MidiMessage& message);
     void handlePartialSysexMessage(MidiInput* source,
@@ -182,72 +136,20 @@
 	~MidiInputController();
 	
 private:
-	// Filtering by channel: return whether this message concerns one of the active channels
-	// we're listening to.
-	// bool messageIsForActiveChannel(const MidiMessage& message);
-	
-    /*
-	// Mode-specific MIDI input handlers
-	void modePassThroughHandler(MidiInput* source, const MidiMessage& message);	
-	void modeMonophonicHandler(MidiInput* source, const MidiMessage& message);
-
-	void modePolyphonicHandler(MidiInput* source, const MidiMessage& message);
-	void modePolyphonicNoteOn(unsigned char note, unsigned char velocity);
-	void modePolyphonicNoteOff(unsigned char note);
-	void modePolyphonicNoteOnCallback(const char *path, const char *types, int numValues, lo_arg **values);
-	
-	void modeChannelSelectHandler(MidiInput* source, const MidiMessage& message);
-	void modeChannelSelectNoteOn(unsigned char note, unsigned char velocity);
-	void modeChannelSelectNoteOff(unsigned char note);
-	void modeChannelSelectNoteOnCallback(const char *path, const char *types, int numValues, lo_arg **values);
-	
-	void modeConstantControllersHandler(MidiInput* source, const MidiMessage& message);
-	
-    // Helper functions for polyphonic mode
-    void modePolyphonicSetupHelper();
-    int oldestNote();
-    int newestNote();
-     */
-    
 	// ***** Member Variables *****
 	
 	PianoKeyboard& keyboard_;						// Reference to main keyboard data
     MidiOutputController *midiOutputController_;	// Destination for MIDI output
     
 	map<int, MidiInput*> activePorts_;              // Sources of MIDI data
+    int primaryActivePort_;                         // Which source is primary
     
     vector<MidiKeyboardSegment*> segments_;         // Segments of the keyboard
     CriticalSection segmentsMutex_;                 // Mutex protecting the segments list
     int segmentUniqueIdentifier_;                   // Identifier of when segment structure has changed
     
-
-    /*
-
-	
-	// Current operating mode of the controller
-	int mode_;
-	
-	// Mapping between input notes and output channels.  Depending on the mode of operation,
-	// each note may be rebroadcast on its own MIDI channel.  Need to keep track of what goes where.
-	// key is MIDI note #, value is output channel (0-15)
-	map<int, int> retransmitChannelForNote_;
-	set<int> retransmitChannelsAvailable_;
-	int retransmitMaxPolyphony_;
-    bool useVoiceStealing_;
-    map<int, timestamp_type> noteOnsetTimestamps_; // When each currently active note began, for stealing
-	
-	// Parameters for Channel Select mode of operation
-	int channelSelectSwitchType_;
-	int channelSelectNumberOfDivisions_;
-	int channelSelectDefaultChannel_;
-	int channelSelectLastOnsetChannel_;
-    */
-    
     // for logging
     ofstream midiLog;
-    
-    // for generating timestamps
-    // Scheduler eventScheduler_;
 };
 
 #endif /* MIDI_INPUT_CONTROLLER_H */
\ No newline at end of file