Browse Source

Add default text for AudioWidgets and MidiWidgets.

tags/v1.0.0
Andrew Belt 5 years ago
parent
commit
009ff12a0b
4 changed files with 19 additions and 16 deletions
  1. +6
    -7
      src/Core/MIDI_Map.cpp
  2. +6
    -2
      src/Core/plugin.hpp
  3. +4
    -4
      src/app/AudioWidget.cpp
  4. +3
    -3
      src/app/MidiWidget.cpp

+ 6
- 7
src/Core/MIDI_Map.cpp View File

@@ -405,13 +405,12 @@ struct MIDI_MapDisplay : MidiWidget {
}

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();


+ 6
- 2
src/Core/plugin.hpp View File

@@ -74,8 +74,10 @@ struct CcChoice : LedDisplayChoice {
}

void step() override {
if (!module)
if (!module) {
text = string::f("%d", id);
return;
}
if (module->learningId == id) {
if (0 <= focusCc)
text = string::f("%d", focusCc);
@@ -155,8 +157,10 @@ struct NoteChoice : LedDisplayChoice {
}

void step() override {
if (!module)
if (!module) {
text = "C4";
return;
}
if (module->learningId == id) {
text = "LRN";
color.a = 0.5;


+ 4
- 4
src/app/AudioWidget.cpp View File

@@ -36,7 +36,7 @@ struct AudioDriverChoice : LedDisplayChoice {
if (port)
text = port->getDriverName(port->driver);
else
text = "";
text = "Audio driver";
}
};

@@ -85,7 +85,7 @@ struct AudioDeviceChoice : LedDisplayChoice {
}
void step() override {
if (!port) {
text = "";
text = "Audio device";
return;
}
text = port->getDeviceDetail(port->device, port->offset);
@@ -133,7 +133,7 @@ struct AudioSampleRateChoice : LedDisplayChoice {
if (port)
text = string::f("%g kHz", port->sampleRate / 1000.f);
else
text = "";
text = "44.1 kHz";
}
};

@@ -172,7 +172,7 @@ struct AudioBlockSizeChoice : LedDisplayChoice {
if (port)
text = string::f("%d", port->blockSize);
else
text = "";
text = "256";
}
};



+ 3
- 3
src/app/MidiWidget.cpp View File

@@ -34,7 +34,7 @@ struct MidiDriverChoice : LedDisplayChoice {
}
void step() override {
if (!port) {
text = "";
text = "MIDI driver";
return;
}
text = port->getDriverName(port->driverId);
@@ -83,7 +83,7 @@ struct MidiDeviceChoice : LedDisplayChoice {
}
void step() override {
if (!port) {
text = "";
text = "MIDI device";
return;
}
text = port->getDeviceName(port->deviceId);
@@ -126,7 +126,7 @@ struct MidiChannelChoice : LedDisplayChoice {
if (port)
text = port->getChannelName(port->channel);
else
text = "";
text = "MIDI channel";
}
};



Loading…
Cancel
Save