diff --git a/Makefile b/Makefile index 3bf6d7db..1780121e 100644 --- a/Makefile +++ b/Makefile @@ -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 \ diff --git a/dep/Makefile b/dep/Makefile index 5f0cd941..3c7a4208 100755 --- a/dep/Makefile +++ b/dep/Makefile @@ -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): diff --git a/src/app/AudioWidget.cpp b/src/app/AudioWidget.cpp index 4b0679f9..e0994f75 100644 --- a/src/app/AudioWidget.cpp +++ b/src/app/AudioWidget.cpp @@ -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"; + } } }; diff --git a/src/app/MidiWidget.cpp b/src/app/MidiWidget.cpp index f30d455d..02d93b23 100644 --- a/src/app/MidiWidget.cpp +++ b/src/app/MidiWidget.cpp @@ -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"; } };