Browse Source

Clean up AudioWidget/MidiWidget default state. Re-enable JACK in RtAudio dep.

tags/v1.0.0
Andrew Belt 5 years ago
parent
commit
e4db0bf892
4 changed files with 30 additions and 24 deletions
  1. +2
    -1
      Makefile
  2. +1
    -1
      dep/Makefile
  3. +24
    -8
      src/app/AudioWidget.cpp
  4. +3
    -14
      src/app/MidiWidget.cpp

+ 2
- 1
Makefile View File

@@ -18,7 +18,8 @@ SOURCES += $(wildcard src/*.cpp src/*/*.cpp)

ifdef ARCH_LIN
SOURCES += dep/osdialog/osdialog_gtk2.c
CFLAGS += $(shell pkg-config --cflags gtk+-2.0)
build/dep/osdialog/osdialog_gtk2.c.o: FLAGS += $(shell pkg-config --cflags gtk+-2.0)

LDFLAGS += -rdynamic \
dep/lib/libglfw3.a dep/lib/libGLEW.a dep/lib/libjansson.a dep/lib/libspeexdsp.a dep/lib/libzip.a dep/lib/libz.a dep/lib/librtmidi.a dep/lib/librtaudio.a dep/lib/libcurl.a dep/lib/libssl.a dep/lib/libcrypto.a \
-lpthread -lGL -ldl -lX11 -lasound -ljack \


+ 1
- 1
dep/Makefile View File

@@ -151,7 +151,7 @@ ifdef ARCH_WIN
RTAUDIO_FLAGS += -DRTAUDIO_API_DS=ON -DRTAUDIO_API_WASAPI=ON -DRTAUDIO_API_ASIO=ON
endif
ifdef ARCH_LIN
RTAUDIO_FLAGS += -DRTAUDIO_API_ALSA=ON -DRTAUDIO_API_JACK=OFF -DRTAUDIO_API_PULSE=OFF -DRTAUDIO_API_OSS=OFF
RTAUDIO_FLAGS += -DRTAUDIO_API_ALSA=ON -DRTAUDIO_API_JACK=ON -DRTAUDIO_API_PULSE=OFF -DRTAUDIO_API_OSS=OFF
endif

$(rtaudio):


+ 24
- 8
src/app/AudioWidget.cpp View File

@@ -33,9 +33,15 @@ struct AudioDriverChoice : LedDisplayChoice {
}
}
void step() override {
text = (!port || box.size.x >= 200.0) ? "Driver: " : "";
if (port) {
text += port->getDriverName(port->driverId);
text = (box.size.x >= 200.0) ? "Driver: " : "";
std::string driverName = (port) ? port->getDriverName(port->driverId) : "";
if (driverName != "") {
text += driverName;
color.a = 1.f;
}
else {
text += "(No driver)";
color.a = 0.5f;
}
}
};
@@ -84,12 +90,16 @@ struct AudioDeviceChoice : LedDisplayChoice {
}
}
void step() override {
text = (!port || box.size.x >= 200.0) ? "Device: " : "";
if (port) {
std::string detail = port->getDeviceDetail(port->deviceId, port->offset);
text = (box.size.x >= 200.0) ? "Device: " : "";
std::string detail = (port) ? port->getDeviceDetail(port->deviceId, port->offset) : "";
if (detail != "") {
text += detail;
color.a = (detail == "") ? 0.5f : 1.f;
}
else {
text += "(No device)";
color.a = 0.5f;
}
}
};

@@ -124,10 +134,13 @@ struct AudioSampleRateChoice : LedDisplayChoice {
}
}
void step() override {
text = (!port || box.size.x >= 100.0) ? "Rate: " : "";
text = (box.size.x >= 100.0) ? "Rate: " : "";
if (port) {
text += string::f("%g kHz", port->sampleRate / 1000.0);
}
else {
text += "0 kHz";
}
}
};

@@ -163,10 +176,13 @@ struct AudioBlockSizeChoice : LedDisplayChoice {
}
}
void step() override {
text = (!port || box.size.x >= 100.0) ? "Block size: " : "";
text = (box.size.x >= 100.0) ? "Block size: " : "";
if (port) {
text += string::f("%d", port->blockSize);
}
else {
text += "0";
}
}
};



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

@@ -33,11 +33,7 @@ struct MidiDriverChoice : LedDisplayChoice {
}
}
void step() override {
if (!port) {
text = "MIDI driver";
return;
}
text = port->getDriverName(port->driverId);
text = port ? port->getDriverName(port->driverId) : "";
if (text.empty()) {
text = "(No driver)";
color.a = 0.5f;
@@ -82,11 +78,7 @@ struct MidiDeviceChoice : LedDisplayChoice {
}
}
void step() override {
if (!port) {
text = "MIDI device";
return;
}
text = port->getDeviceName(port->deviceId);
text = port ? port->getDeviceName(port->deviceId) : "";
if (text.empty()) {
text = "(No device)";
color.a = 0.5f;
@@ -123,10 +115,7 @@ struct MidiChannelChoice : LedDisplayChoice {
}
}
void step() override {
if (port)
text = port->getChannelName(port->channel);
else
text = "MIDI channel";
text = port ? port->getChannelName(port->channel) : "Channel 1";
}
};



Loading…
Cancel
Save