| @@ -405,13 +405,12 @@ struct MIDI_MapDisplay : MidiWidget { | |||||
| } | } | ||||
| void step() override { | void step() override { | ||||
| if (!module) | |||||
| return; | |||||
| int mapLen = module->mapLen; | |||||
| for (int id = 0; id < MAX_CHANNELS; id++) { | |||||
| choices[id]->visible = (id < mapLen); | |||||
| separators[id]->visible = (id < mapLen); | |||||
| if (module) { | |||||
| int mapLen = module->mapLen; | |||||
| for (int id = 0; id < MAX_CHANNELS; id++) { | |||||
| choices[id]->visible = (id < mapLen); | |||||
| separators[id]->visible = (id < mapLen); | |||||
| } | |||||
| } | } | ||||
| MidiWidget::step(); | MidiWidget::step(); | ||||
| @@ -74,8 +74,10 @@ struct CcChoice : LedDisplayChoice { | |||||
| } | } | ||||
| void step() override { | void step() override { | ||||
| if (!module) | |||||
| if (!module) { | |||||
| text = string::f("%d", id); | |||||
| return; | return; | ||||
| } | |||||
| if (module->learningId == id) { | if (module->learningId == id) { | ||||
| if (0 <= focusCc) | if (0 <= focusCc) | ||||
| text = string::f("%d", focusCc); | text = string::f("%d", focusCc); | ||||
| @@ -155,8 +157,10 @@ struct NoteChoice : LedDisplayChoice { | |||||
| } | } | ||||
| void step() override { | void step() override { | ||||
| if (!module) | |||||
| if (!module) { | |||||
| text = "C4"; | |||||
| return; | return; | ||||
| } | |||||
| if (module->learningId == id) { | if (module->learningId == id) { | ||||
| text = "LRN"; | text = "LRN"; | ||||
| color.a = 0.5; | color.a = 0.5; | ||||
| @@ -36,7 +36,7 @@ struct AudioDriverChoice : LedDisplayChoice { | |||||
| if (port) | if (port) | ||||
| text = port->getDriverName(port->driver); | text = port->getDriverName(port->driver); | ||||
| else | else | ||||
| text = ""; | |||||
| text = "Audio driver"; | |||||
| } | } | ||||
| }; | }; | ||||
| @@ -85,7 +85,7 @@ struct AudioDeviceChoice : LedDisplayChoice { | |||||
| } | } | ||||
| void step() override { | void step() override { | ||||
| if (!port) { | if (!port) { | ||||
| text = ""; | |||||
| text = "Audio device"; | |||||
| return; | return; | ||||
| } | } | ||||
| text = port->getDeviceDetail(port->device, port->offset); | text = port->getDeviceDetail(port->device, port->offset); | ||||
| @@ -133,7 +133,7 @@ struct AudioSampleRateChoice : LedDisplayChoice { | |||||
| if (port) | if (port) | ||||
| text = string::f("%g kHz", port->sampleRate / 1000.f); | text = string::f("%g kHz", port->sampleRate / 1000.f); | ||||
| else | else | ||||
| text = ""; | |||||
| text = "44.1 kHz"; | |||||
| } | } | ||||
| }; | }; | ||||
| @@ -172,7 +172,7 @@ struct AudioBlockSizeChoice : LedDisplayChoice { | |||||
| if (port) | if (port) | ||||
| text = string::f("%d", port->blockSize); | text = string::f("%d", port->blockSize); | ||||
| else | else | ||||
| text = ""; | |||||
| text = "256"; | |||||
| } | } | ||||
| }; | }; | ||||
| @@ -34,7 +34,7 @@ struct MidiDriverChoice : LedDisplayChoice { | |||||
| } | } | ||||
| void step() override { | void step() override { | ||||
| if (!port) { | if (!port) { | ||||
| text = ""; | |||||
| text = "MIDI driver"; | |||||
| return; | return; | ||||
| } | } | ||||
| text = port->getDriverName(port->driverId); | text = port->getDriverName(port->driverId); | ||||
| @@ -83,7 +83,7 @@ struct MidiDeviceChoice : LedDisplayChoice { | |||||
| } | } | ||||
| void step() override { | void step() override { | ||||
| if (!port) { | if (!port) { | ||||
| text = ""; | |||||
| text = "MIDI device"; | |||||
| return; | return; | ||||
| } | } | ||||
| text = port->getDeviceName(port->deviceId); | text = port->getDeviceName(port->deviceId); | ||||
| @@ -126,7 +126,7 @@ struct MidiChannelChoice : LedDisplayChoice { | |||||
| if (port) | if (port) | ||||
| text = port->getChannelName(port->channel); | text = port->getChannelName(port->channel); | ||||
| else | else | ||||
| text = ""; | |||||
| text = "MIDI channel"; | |||||
| } | } | ||||
| }; | }; | ||||