@@ -229,12 +229,12 @@ all: $(TARGETS) | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
$(BINDIR)/carla: $(OBJS) | |||
$(BINDIR)/carla: $(OBJS) $(OBJDIR)/carla.cpp.o | |||
-@mkdir -p $(BINDIR) | |||
@echo "Linking carla" | |||
$(CXX) $(OBJS) $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $@ | |||
$(CXX) $^ $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $@ | |||
$(BINDIR)/carla_%: $(OBJS) $(OBJDIR)/carla_%_app.cpp.o | |||
$(BINDIR)/carla-%: $(OBJS) $(OBJDIR)/carla_%_app.cpp.o | |||
-@mkdir -p $(BINDIR) | |||
@echo "Linking carla_$*" | |||
$(CXX) $^ $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $@ | |||
@@ -20,6 +20,13 @@ | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Global) | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
#endif | |||
#include <QtCore/QCoreApplication> | |||
#include <QtCore/QDir> | |||
@@ -28,6 +35,10 @@ | |||
#include <QtWidgets/QApplication> | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
#endif | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Custom) | |||
@@ -58,13 +69,11 @@ CarlaApplication::CarlaApplication(const QString appName, int& argc, char* argv[ | |||
QCarlaString stylesDir; | |||
// Use binary dir as library path | |||
/* | |||
if (QDir(pathBinaries).exists()) | |||
{ | |||
QApplication::addLibraryPath(pathBinaries); | |||
stylesDir = pathBinaries; | |||
} | |||
*/ | |||
// base settings | |||
const QSafeSettings settings("falkTX", appName); | |||
@@ -21,9 +21,22 @@ | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Global) | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
#endif | |||
#include <QtCore/QCoreApplication> | |||
#include <QtCore/QString> | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
#endif | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
class QApplication; | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
@@ -20,18 +20,35 @@ | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Global) | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
#endif | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
#include <QtCore/QDir> | |||
#include <QtCore/QFileInfo> | |||
#include <QtWidgets/QPushButton> | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Custom) | |||
#include "ui_carla_add_jack.hpp" | |||
#include "ui_carla_database.hpp" | |||
#include "ui_carla_refresh.hpp" | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
#endif | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Custom) | |||
#include "carla_host.hpp" | |||
#include "CarlaHost.h" | |||
@@ -110,6 +127,8 @@ struct SearchPluginsThread::PrivateData { | |||
fSomethingChanged(false) | |||
{ | |||
} | |||
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PrivateData) | |||
}; | |||
SearchPluginsThread::SearchPluginsThread(QObject* parent, const QString pathBinaries) | |||
@@ -138,7 +157,8 @@ struct PluginRefreshW::PrivateData { | |||
QPixmap fIconNo; | |||
PrivateData(PluginRefreshW* const refreshDialog, const CarlaHost& host) | |||
: fThread(refreshDialog, host.pathBinaries), | |||
: ui(), | |||
fThread(refreshDialog, host.pathBinaries), | |||
fIconYes(":/16x16/dialog-ok-apply.svgz"), | |||
fIconNo(":/16x16/dialog-error.svgz") | |||
{ | |||
@@ -157,6 +177,8 @@ struct PluginRefreshW::PrivateData { | |||
void loadSettings() | |||
{ | |||
} | |||
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PrivateData) | |||
}; | |||
PluginRefreshW::PluginRefreshW(QWidget* const parent, const CarlaHost& host) | |||
@@ -240,6 +262,8 @@ struct PluginDatabaseW::PrivateData { | |||
PrivateData(void*) | |||
{ | |||
} | |||
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PrivateData) | |||
}; | |||
PluginDatabaseW::PluginDatabaseW(QWidget* parent, const CarlaHost& host, bool hasCanvas, bool hasCanvasGL) | |||
@@ -342,11 +366,11 @@ struct JackApplicationW::PrivateData { | |||
ui.le_command->setText(settings.valueString("Command", "")); | |||
ui.le_name->setText(settings.valueString("Name", "")); | |||
ui.sb_audio_ins->setValue(settings.valueUInt("NumAudioIns", 2)); | |||
ui.sb_audio_ins->setValue(settings.valueUInt("NumAudioIns", 2)); | |||
ui.sb_audio_outs->setValue(settings.valueUInt("NumAudioOuts", 2)); | |||
ui.sb_midi_ins->setValue(settings.valueUInt("NumMidiIns", 0)); | |||
ui.sb_midi_outs->setValue(settings.valueUInt("NumMidiOuts", 0)); | |||
ui.sb_audio_ins->setValue(settings.valueIntPositive("NumAudioIns", 2)); | |||
ui.sb_audio_ins->setValue(settings.valueIntPositive("NumAudioIns", 2)); | |||
ui.sb_audio_outs->setValue(settings.valueIntPositive("NumAudioOuts", 2)); | |||
ui.sb_midi_ins->setValue(settings.valueIntPositive("NumMidiIns", 0)); | |||
ui.sb_midi_outs->setValue(settings.valueIntPositive("NumMidiOuts", 0)); | |||
ui.cb_manage_window->setChecked(settings.valueBool("ManageWindow", true)); | |||
ui.cb_capture_first_window->setChecked(settings.valueBool("CaptureFirstWindow", false)); | |||
ui.cb_out_midi_mixdown->setChecked(settings.valueBool("MidiOutMixdown", false)); | |||
@@ -368,6 +392,8 @@ struct JackApplicationW::PrivateData { | |||
settings.setValue("CaptureFirstWindow", ui.cb_capture_first_window->isChecked()); | |||
settings.setValue("MidiOutMixdown", ui.cb_out_midi_mixdown->isChecked()); | |||
} | |||
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PrivateData) | |||
}; | |||
JackApplicationW::JackApplicationW(QWidget* parent) | |||
@@ -21,10 +21,21 @@ | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Global) | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
#endif | |||
#include <QtCore/QThread> | |||
#include <QtWidgets/QDialog> | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
#endif | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Custom) | |||
@@ -20,6 +20,16 @@ | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Global) | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
#endif | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
#include <QtCore/QDir> | |||
#include <QtCore/QStringList> | |||
#include <QtCore/QTimer> | |||
@@ -32,10 +42,18 @@ | |||
#include <QtWidgets/QMessageBox> | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Custom) | |||
#include "ui_carla_host.hpp" | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
#endif | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Custom) | |||
#include "carla_database.hpp" | |||
#include "carla_settings.hpp" | |||
#include "carla_skin.hpp" | |||
@@ -48,12 +66,13 @@ | |||
#include "CarlaString.hpp" | |||
// FIXME put in right place | |||
/* | |||
static QString fixLogText(QString text) | |||
{ | |||
//v , Qt::CaseSensitive | |||
return text.replace("\x1b[30;1m", "").replace("\x1b[31m", "").replace("\x1b[0m", ""); | |||
} | |||
*/ | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Session Management support | |||
@@ -102,7 +121,7 @@ enum CustomActions { | |||
}; | |||
struct CachedSavedSettings { | |||
uint _CARLA_KEY_MAIN_REFRESH_INTERVAL = 0; | |||
int _CARLA_KEY_MAIN_REFRESH_INTERVAL = 0; | |||
bool _CARLA_KEY_MAIN_CONFIRM_EXIT = false; | |||
bool _CARLA_KEY_CANVAS_FANCY_EYE_CANDY = false; | |||
}; | |||
@@ -924,8 +943,8 @@ struct CarlaHostWindow::PrivateData { | |||
fSavedSettings._CARLA_KEY_MAIN_CONFIRM_EXIT = settings.valueBool(CARLA_KEY_MAIN_CONFIRM_EXIT, | |||
CARLA_DEFAULT_MAIN_CONFIRM_EXIT); | |||
fSavedSettings._CARLA_KEY_MAIN_REFRESH_INTERVAL = settings.valueUInt(CARLA_KEY_MAIN_REFRESH_INTERVAL, | |||
CARLA_DEFAULT_MAIN_REFRESH_INTERVAL); | |||
fSavedSettings._CARLA_KEY_MAIN_REFRESH_INTERVAL = settings.valueIntPositive(CARLA_KEY_MAIN_REFRESH_INTERVAL, | |||
CARLA_DEFAULT_MAIN_REFRESH_INTERVAL); | |||
fSavedSettings._CARLA_KEY_CANVAS_FANCY_EYE_CANDY = settings.valueBool(CARLA_KEY_CANVAS_FANCY_EYE_CANDY, | |||
CARLA_DEFAULT_CANVAS_FANCY_EYE_CANDY); | |||
@@ -1026,15 +1045,15 @@ struct CarlaHostWindow::PrivateData { | |||
{ | |||
fLastTransportFrame = frame; | |||
const uint32_t time = frame / fSampleRate; | |||
const uint32_t secs = time % 60; | |||
const uint32_t mins = (time / 60) % 60; | |||
const uint32_t hrs = (time / 3600) % 60; | |||
const uint64_t time = frame / static_cast<uint32_t>(fSampleRate); | |||
const uint64_t secs = time % 60; | |||
const uint64_t mins = (time / 60) % 60; | |||
const uint64_t hrs = (time / 3600) % 60; | |||
ui.l_transport_time->setText(QString("%1:%2:%3").arg(hrs, 2, 10, QChar('0')).arg(mins, 2, 10, QChar('0')).arg(secs, 2, 10, QChar('0'))); | |||
const uint32_t frame1 = frame % 1000; | |||
const uint32_t frame2 = (frame / 1000) % 1000; | |||
const uint32_t frame3 = (frame / 1000000) % 1000; | |||
const uint64_t frame1 = frame % 1000; | |||
const uint64_t frame2 = (frame / 1000) % 1000; | |||
const uint64_t frame3 = (frame / 1000000) % 1000; | |||
ui.l_transport_frame->setText(QString("%1'%2'%3").arg(frame3, 3, 10, QChar('0')).arg(frame2, 3, 10, QChar('0')).arg(frame1, 3, 10, QChar('0'))); | |||
const int32_t bar = timeInfo->bar; | |||
@@ -1161,9 +1180,9 @@ struct CarlaHostWindow::PrivateData { | |||
//----------------------------------------------------------------------------------------------------------------- | |||
// timer event | |||
void refreshRuntimeInfo(const float load, const int xruns) | |||
void refreshRuntimeInfo(const float load, const uint xruns) | |||
{ | |||
const QString txt1(xruns >= 0 ? QString("%1").arg(xruns) : QString("--")); | |||
const QString txt1(xruns == 0 ? QString("%1").arg(xruns) : QString("--")); | |||
const QString txt2(xruns == 1 ? "" : "s"); | |||
ui.b_xruns->setText(QString("%1 Xrun%2").arg(txt1).arg(txt2)); | |||
ui.pb_dsp_load->setValue(int(load)); | |||
@@ -1269,7 +1288,7 @@ struct CarlaHostWindow::PrivateData { | |||
QColor pad_color; | |||
if (carla_isNotZero(bg_value) && bg_value < min_value) | |||
pad_color = bg_color.lighter(100*min_value/bg_value*value_fix); | |||
pad_color = bg_color.lighter(static_cast<int>(100*min_value/bg_value*value_fix)); | |||
else | |||
pad_color = QColor::fromHsvF(0.0, 0.0, min_value*value_fix); | |||
@@ -1317,6 +1336,8 @@ struct CarlaHostWindow::PrivateData { | |||
QMessageBox::Yes|QMessageBox::No) == QMessageBox::No; | |||
return false; | |||
} | |||
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PrivateData) | |||
}; | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
@@ -1437,7 +1458,7 @@ CarlaHostWindow::CarlaHostWindow(CarlaHost& host, const bool withCanvas, QWidget | |||
connect(&host, SIGNAL(SIGUSR1()), SLOT(slot_handleSIGUSR1())); | |||
connect(&host, SIGNAL(SIGTERM()), SLOT(slot_handleSIGTERM())); | |||
connect(&host, SIGNAL(EngineStartedCallback(uint, int, int, int, float, QString)), SLOT(slot_handleEngineStartedCallback(uint, int, int, int, float, QString))); | |||
connect(&host, SIGNAL(EngineStartedCallback(uint, int, int, uint, float, QString)), SLOT(slot_handleEngineStartedCallback(uint, int, int, uint, float, QString))); | |||
connect(&host, SIGNAL(EngineStoppedCallback()), SLOT(slot_handleEngineStoppedCallback())); | |||
connect(&host, SIGNAL(TransportModeChangedCallback()), SLOT(slot_handleTransportModeChangedCallback())); | |||
connect(&host, SIGNAL(BufferSizeChangedCallback()), SLOT(slot_handleBufferSizeChangedCallback())); | |||
@@ -1746,8 +1767,8 @@ void CarlaHostWindow::slot_engineConfig() | |||
else | |||
{ | |||
carla_set_engine_option(ENGINE_OPTION_AUDIO_DEVICE, 0, audioDevice.toUtf8()); | |||
carla_set_engine_option(ENGINE_OPTION_AUDIO_BUFFER_SIZE, bufferSize, ""); | |||
carla_set_engine_option(ENGINE_OPTION_AUDIO_SAMPLE_RATE, sampleRate, ""); | |||
carla_set_engine_option(ENGINE_OPTION_AUDIO_BUFFER_SIZE, static_cast<int>(bufferSize), ""); | |||
carla_set_engine_option(ENGINE_OPTION_AUDIO_SAMPLE_RATE, static_cast<int>(sampleRate), ""); | |||
} | |||
} | |||
@@ -1766,7 +1787,7 @@ bool CarlaHostWindow::slot_engineStopTryAgain() | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Engine (host callbacks) | |||
void CarlaHostWindow::slot_handleEngineStartedCallback(uint pluginCount, int processMode, int transportMode, int bufferSize, float sampleRate, QString driverName) | |||
void CarlaHostWindow::slot_handleEngineStartedCallback(uint pluginCount, int processMode, int transportMode, uint bufferSize, float sampleRate, QString driverName) | |||
{ | |||
self->ui.menu_PluginMacros->setEnabled(true); | |||
self->ui.menu_Canvas->setEnabled(true); | |||
@@ -1819,7 +1840,7 @@ void CarlaHostWindow::slot_handleEngineStartedCallback(uint pluginCount, int pro | |||
self->ui.cb_transport_link->setChecked(self->host.transportExtra.contains(":link:")); | |||
self->updateBufferSize(bufferSize); | |||
self->updateSampleRate(int(sampleRate)); | |||
self->updateSampleRate(sampleRate); | |||
self->refreshRuntimeInfo(0.0, 0); | |||
self->startTimers(); | |||
@@ -2196,9 +2217,11 @@ void CarlaHostWindow::slot_transportBackwards() | |||
if (self->host.isPlugin || ! carla_is_engine_running()) | |||
return; | |||
int64_t newFrame = carla_get_current_transport_frame() - 100000; | |||
uint64_t newFrame = carla_get_current_transport_frame(); | |||
if (newFrame < 0) | |||
if (newFrame > 100000) | |||
newFrame -= 100000; | |||
else | |||
newFrame = 0; | |||
carla_transport_relocate(newFrame); | |||
@@ -2214,7 +2237,7 @@ void CarlaHostWindow::slot_transportForwards() | |||
if (carla_isZero(self->fSampleRate) || self->host.isPlugin || ! carla_is_engine_running()) | |||
return; | |||
const int64_t newFrame = carla_get_current_transport_frame() + int(self->fSampleRate*2.5); | |||
const uint64_t newFrame = carla_get_current_transport_frame() + uint64_t(self->fSampleRate*2.5); | |||
carla_transport_relocate(newFrame); | |||
} | |||
@@ -2350,7 +2373,8 @@ void CarlaHostWindow::slot_handleSIGTERM() | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Canvas callback | |||
void _canvasCallback(void* const ptr, const int action, int value1, int value2, QString valueStr) | |||
/* | |||
static void _canvasCallback(void* const ptr, const int action, int value1, int value2, QString valueStr) | |||
{ | |||
CarlaHost* const host = (CarlaHost*)(ptr); | |||
CARLA_SAFE_ASSERT_RETURN(host != nullptr,); | |||
@@ -2359,11 +2383,12 @@ void _canvasCallback(void* const ptr, const int action, int value1, int value2, | |||
{ | |||
} | |||
} | |||
*/ | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Engine callback | |||
void _engineCallback(void* const ptr, const EngineCallbackOpcode action, uint pluginId, int value1, int value2, int value3, float valuef, const char* const valueStr) | |||
static void _engineCallback(void* const ptr, const EngineCallbackOpcode action, uint pluginId, int value1, int value2, int value3, float valuef, const char* const valueStr) | |||
{ | |||
/* | |||
carla_stdout("_engineCallback(%p, %i:%s, %u, %i, %i, %i, %f, %s)", | |||
@@ -2394,7 +2419,8 @@ void _engineCallback(void* const ptr, const EngineCallbackOpcode action, uint pl | |||
switch (action) | |||
{ | |||
case ENGINE_CALLBACK_ENGINE_STARTED: | |||
emit host->EngineStartedCallback(pluginId, value1, value2, value3, valuef, valueStr); | |||
CARLA_SAFE_ASSERT_INT_RETURN(value3 >= 0, value3,); | |||
emit host->EngineStartedCallback(pluginId, value1, value2, static_cast<uint>(value3), valuef, valueStr); | |||
break; | |||
case ENGINE_CALLBACK_ENGINE_STOPPED: | |||
emit host->EngineStoppedCallback(); | |||
@@ -2498,7 +2524,11 @@ CarlaHost& initHost(const QString initName, const bool isControl, const bool isP | |||
carla_set_engine_option(ENGINE_OPTION_PATH_RESOURCES, 0, pathResources.toUtf8()); | |||
if (! isControl) | |||
host.nsmOK = carla_nsm_init(getpid(), initName.toUtf8()); | |||
{ | |||
const pid_t pid = getpid(); | |||
if (pid > 0) | |||
host.nsmOK = carla_nsm_init(static_cast<uint64_t>(pid), initName.toUtf8()); | |||
} | |||
} | |||
// ---------------------------------------------------------------------------------------------------------------- | |||
@@ -2578,7 +2608,7 @@ void loadHostSettings(CarlaHost& host) | |||
void setHostSettings(const CarlaHost& host) | |||
{ | |||
carla_set_engine_option(ENGINE_OPTION_FORCE_STEREO, host.forceStereo, ""); | |||
carla_set_engine_option(ENGINE_OPTION_MAX_PARAMETERS, host.maxParameters, ""); | |||
carla_set_engine_option(ENGINE_OPTION_MAX_PARAMETERS, static_cast<int>(host.maxParameters), ""); | |||
carla_set_engine_option(ENGINE_OPTION_PREFER_PLUGIN_BRIDGES, host.preferPluginBridges, ""); | |||
carla_set_engine_option(ENGINE_OPTION_PREFER_UI_BRIDGES, host.preferUIBridges, ""); | |||
carla_set_engine_option(ENGINE_OPTION_PREVENT_BAD_BEHAVIOUR, host.preventBadBehaviour, ""); | |||
@@ -2666,14 +2696,14 @@ QString setEngineSettings(CarlaHost& host) | |||
else if (settings.valueBool(CARLA_KEY_OSC_TCP_PORT_RANDOM, CARLA_DEFAULT_OSC_TCP_PORT_RANDOM)) | |||
portNumTCP = 0; | |||
else | |||
portNumTCP = settings.valueUInt(CARLA_KEY_OSC_TCP_PORT_NUMBER, CARLA_DEFAULT_OSC_TCP_PORT_NUMBER); | |||
portNumTCP = settings.valueIntPositive(CARLA_KEY_OSC_TCP_PORT_NUMBER, CARLA_DEFAULT_OSC_TCP_PORT_NUMBER); | |||
if (! settings.valueBool(CARLA_KEY_OSC_UDP_PORT_ENABLED, CARLA_DEFAULT_OSC_UDP_PORT_ENABLED)) | |||
portNumUDP = -1; | |||
else if (settings.valueBool(CARLA_KEY_OSC_UDP_PORT_RANDOM, CARLA_DEFAULT_OSC_UDP_PORT_RANDOM)) | |||
portNumUDP = 0; | |||
else | |||
portNumUDP = settings.valueUInt(CARLA_KEY_OSC_UDP_PORT_NUMBER, CARLA_DEFAULT_OSC_UDP_PORT_NUMBER); | |||
portNumUDP = settings.valueIntPositive(CARLA_KEY_OSC_UDP_PORT_NUMBER, CARLA_DEFAULT_OSC_UDP_PORT_NUMBER); | |||
carla_set_engine_option(ENGINE_OPTION_OSC_ENABLED, oscEnabled ? 1 : 0, ""); | |||
carla_set_engine_option(ENGINE_OPTION_OSC_PORT_TCP, portNumTCP, ""); | |||
@@ -2686,8 +2716,8 @@ QString setEngineSettings(CarlaHost& host) | |||
const bool optWineAutoPrefix = settings.valueBool(CARLA_KEY_WINE_AUTO_PREFIX, CARLA_DEFAULT_WINE_AUTO_PREFIX); | |||
const QString optWineFallbackPrefix = settings.valueString(CARLA_KEY_WINE_FALLBACK_PREFIX, CARLA_DEFAULT_WINE_FALLBACK_PREFIX); | |||
const bool optWineRtPrioEnabled = settings.valueBool(CARLA_KEY_WINE_RT_PRIO_ENABLED, CARLA_DEFAULT_WINE_RT_PRIO_ENABLED); | |||
const uint optWineBaseRtPrio = settings.valueUInt(CARLA_KEY_WINE_BASE_RT_PRIO, CARLA_DEFAULT_WINE_BASE_RT_PRIO); | |||
const uint optWineServerRtPrio = settings.valueUInt(CARLA_KEY_WINE_SERVER_RT_PRIO, CARLA_DEFAULT_WINE_SERVER_RT_PRIO); | |||
const int optWineBaseRtPrio = settings.valueIntPositive(CARLA_KEY_WINE_BASE_RT_PRIO, CARLA_DEFAULT_WINE_BASE_RT_PRIO); | |||
const int optWineServerRtPrio = settings.valueIntPositive(CARLA_KEY_WINE_SERVER_RT_PRIO, CARLA_DEFAULT_WINE_SERVER_RT_PRIO); | |||
carla_set_engine_option(ENGINE_OPTION_WINE_EXECUTABLE, 0, optWineExecutable.toUtf8()); | |||
carla_set_engine_option(ENGINE_OPTION_WINE_AUTO_PREFIX, optWineAutoPrefix ? 1 : 0, ""); | |||
@@ -2713,8 +2743,8 @@ QString setEngineSettings(CarlaHost& host) | |||
// driver options | |||
const QString prefix(QString("%1%2").arg(CARLA_KEY_ENGINE_DRIVER_PREFIX).arg(audioDriver)); | |||
const QString audioDevice = settings.valueString(QString("%1/Device").arg(prefix), ""); | |||
const uint audioBufferSize = settings.valueUInt(QString("%1/BufferSize").arg(prefix), CARLA_DEFAULT_AUDIO_BUFFER_SIZE); | |||
const uint audioSampleRate = settings.valueUInt(QString("%1/SampleRate").arg(prefix), CARLA_DEFAULT_AUDIO_SAMPLE_RATE); | |||
const int audioBufferSize = settings.valueIntPositive(QString("%1/BufferSize").arg(prefix), CARLA_DEFAULT_AUDIO_BUFFER_SIZE); | |||
const int audioSampleRate = settings.valueIntPositive(QString("%1/SampleRate").arg(prefix), CARLA_DEFAULT_AUDIO_SAMPLE_RATE); | |||
const bool audioTripleBuffer = settings.valueBool(QString("%1/TripleBuffer").arg(prefix), CARLA_DEFAULT_AUDIO_TRIPLE_BUFFER); | |||
// Only setup audio things if engine is not running | |||
@@ -21,8 +21,19 @@ | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Global) | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
#endif | |||
#include <QtWidgets/QMainWindow> | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
#endif | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Custom) | |||
@@ -81,8 +92,11 @@ signals: | |||
void SignalSave(); | |||
// Engine stuff | |||
void EngineStartedCallback(uint, int, int, int, float, QString); | |||
void EngineStartedCallback(uint, int, int, uint, float, QString); | |||
void EngineStoppedCallback(); | |||
private: | |||
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaHost) | |||
}; | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
@@ -163,7 +177,7 @@ private slots: | |||
//----------------------------------------------------------------------------------------------------------------- | |||
// Engine (host callbacks) | |||
void slot_handleEngineStartedCallback(uint pluginCount, int processMode, int transportMode, int bufferSize, float sampleRate, QString driverName); | |||
void slot_handleEngineStartedCallback(uint pluginCount, int processMode, int transportMode, uint bufferSize, float sampleRate, QString driverName); | |||
void slot_handleEngineStoppedCallback(); | |||
void slot_handleTransportModeChangedCallback(int transportMode, QString transportExtra); | |||
void slot_handleBufferSizeChangedCallback(int newBufferSize); | |||
@@ -20,21 +20,38 @@ | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Global) | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
#endif | |||
// -------------------------------------------------------------------------------------------------------------------- | |||
#include <QtCore/QStringList> | |||
#include <QtWidgets/QFileDialog> | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Custom) | |||
// -------------------------------------------------------------------------------------------------------------------- | |||
#include "ui_carla_settings.hpp" | |||
#include "ui_carla_settings_driver.hpp" | |||
// -------------------------------------------------------------------------------------------------------------------- | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
#endif | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Custom) | |||
#include "carla_host.hpp" | |||
#include "patchcanvas/theme.hpp" | |||
#include "CarlaHost.h" | |||
#include "CarlaUtils.hpp" | |||
#include "CarlaMathUtils.hpp" | |||
// -------------------------------------------------------------------------------------------------------------------- | |||
@@ -101,14 +118,16 @@ struct DriverSettingsW::PrivateData { | |||
ui.cb_buffersize->setCurrentIndex(fBufferSizes.size()/2); | |||
if (audioSampleRate != 0 && fSampleRates.contains(audioSampleRate)) | |||
ui.cb_samplerate->setCurrentIndex(fSampleRates.indexOf(audioSampleRate)); | |||
else if (fSampleRates == SAMPLE_RATE_LIST) | |||
ui.cb_samplerate->setCurrentIndex(SAMPLE_RATE_LIST.indexOf(CARLA_DEFAULT_AUDIO_SAMPLE_RATE)); | |||
ui.cb_samplerate->setCurrentIndex(getIndexOfQDoubleListValue(fSampleRates, audioSampleRate)); | |||
else if (isQDoubleListEqual(fSampleRates, SAMPLE_RATE_LIST)) | |||
ui.cb_samplerate->setCurrentIndex(getIndexOfQDoubleListValue(SAMPLE_RATE_LIST, CARLA_DEFAULT_AUDIO_SAMPLE_RATE)); | |||
else | |||
ui.cb_samplerate->setCurrentIndex(fSampleRates.size()/2); | |||
ui.cb_triple_buffer->setChecked(audioTripleBuffer && ui.cb_triple_buffer->isEnabled()); | |||
} | |||
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PrivateData) | |||
}; | |||
DriverSettingsW::DriverSettingsW(QWidget* const parent, const uint driverIndex, const QString driverName) | |||
@@ -245,6 +264,8 @@ struct RuntimeDriverSettingsW::PrivateData { | |||
{ | |||
ui.setupUi(self); | |||
} | |||
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PrivateData) | |||
}; | |||
RuntimeDriverSettingsW::RuntimeDriverSettingsW(QWidget* const parent) | |||
@@ -325,7 +346,7 @@ RuntimeDriverSettingsW::RuntimeDriverSettingsW(QWidget* const parent) | |||
const QString ssrate(QString("%1").arg(srate)); | |||
self->ui.cb_samplerate->addItem(ssrate); | |||
if (driverDeviceInfo->sampleRate == srate) | |||
if (carla_isEqual(driverDeviceInfo->sampleRate, srate)) | |||
self->ui.cb_samplerate->setCurrentIndex(self->ui.cb_samplerate->count()-1); | |||
} | |||
} | |||
@@ -443,8 +464,8 @@ struct CarlaSettingsW::PrivateData { | |||
ui.cb_main_theme_color->setCurrentIndex(ui.cb_main_theme_color->findText(settings.valueString(CARLA_KEY_MAIN_PRO_THEME_COLOR, | |||
CARLA_DEFAULT_MAIN_PRO_THEME_COLOR))); | |||
ui.sb_main_refresh_interval->setValue(settings.valueUInt(CARLA_KEY_MAIN_REFRESH_INTERVAL, | |||
CARLA_DEFAULT_MAIN_REFRESH_INTERVAL)); | |||
ui.sb_main_refresh_interval->setValue(settings.valueIntPositive(CARLA_KEY_MAIN_REFRESH_INTERVAL, | |||
CARLA_DEFAULT_MAIN_REFRESH_INTERVAL)); | |||
ui.ch_main_confirm_exit->setChecked(settings.valueBool(CARLA_KEY_MAIN_CONFIRM_EXIT, | |||
CARLA_DEFAULT_MAIN_CONFIRM_EXIT)); | |||
@@ -556,7 +577,7 @@ struct CarlaSettingsW::PrivateData { | |||
else | |||
ui.cb_engine_process_mode_other->setCurrentIndex(0); | |||
ui.sb_engine_max_params->setValue(host.maxParameters); | |||
ui.sb_engine_max_params->setValue(static_cast<int>(host.maxParameters)); | |||
ui.ch_engine_manage_uis->setChecked(host.manageUIs); | |||
ui.ch_engine_prefer_ui_bridges->setChecked(host.preferUIBridges); | |||
ui.sb_engine_ui_bridges_timeout->setValue(host.uiBridgesTimeout); | |||
@@ -578,11 +599,11 @@ struct CarlaSettingsW::PrivateData { | |||
ui.group_osc_udp_port->setChecked(settings.valueBool(CARLA_KEY_OSC_UDP_PORT_ENABLED, | |||
CARLA_DEFAULT_OSC_UDP_PORT_ENABLED)); | |||
ui.sb_osc_tcp_port_number->setValue(settings.valueUInt(CARLA_KEY_OSC_TCP_PORT_NUMBER, | |||
CARLA_DEFAULT_OSC_TCP_PORT_NUMBER)); | |||
ui.sb_osc_tcp_port_number->setValue(settings.valueIntPositive(CARLA_KEY_OSC_TCP_PORT_NUMBER, | |||
CARLA_DEFAULT_OSC_TCP_PORT_NUMBER)); | |||
ui.sb_osc_udp_port_number->setValue(settings.valueUInt(CARLA_KEY_OSC_UDP_PORT_NUMBER, | |||
CARLA_DEFAULT_OSC_UDP_PORT_NUMBER)); | |||
ui.sb_osc_udp_port_number->setValue(settings.valueIntPositive(CARLA_KEY_OSC_UDP_PORT_NUMBER, | |||
CARLA_DEFAULT_OSC_UDP_PORT_NUMBER)); | |||
if (settings.valueBool(CARLA_KEY_OSC_TCP_PORT_RANDOM, CARLA_DEFAULT_OSC_TCP_PORT_RANDOM)) | |||
{ | |||
@@ -703,11 +724,11 @@ struct CarlaSettingsW::PrivateData { | |||
ui.group_wine_realtime->setChecked(settings.valueBool(CARLA_KEY_WINE_RT_PRIO_ENABLED, | |||
CARLA_DEFAULT_WINE_RT_PRIO_ENABLED)); | |||
ui.sb_wine_base_prio->setValue(settings.valueUInt(CARLA_KEY_WINE_BASE_RT_PRIO, | |||
CARLA_DEFAULT_WINE_BASE_RT_PRIO)); | |||
ui.sb_wine_base_prio->setValue(settings.valueIntPositive(CARLA_KEY_WINE_BASE_RT_PRIO, | |||
CARLA_DEFAULT_WINE_BASE_RT_PRIO)); | |||
ui.sb_wine_server_prio->setValue(settings.valueUInt(CARLA_KEY_WINE_SERVER_RT_PRIO, | |||
CARLA_DEFAULT_WINE_SERVER_RT_PRIO)); | |||
ui.sb_wine_server_prio->setValue(settings.valueIntPositive(CARLA_KEY_WINE_SERVER_RT_PRIO, | |||
CARLA_DEFAULT_WINE_SERVER_RT_PRIO)); | |||
// ------------------------------------------------------------------------------------------------------------ | |||
// Experimental | |||
@@ -21,8 +21,19 @@ | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Global) | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
#endif | |||
#include <QtWidgets/QDialog> | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
#endif | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Custom) | |||
@@ -20,12 +20,25 @@ | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Global) | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
#endif | |||
#include <QtGui/QFontMetrics> | |||
#include <QtWidgets/QFileDialog> | |||
#include <QtWidgets/QGridLayout> | |||
#include <QtWidgets/QLineEdit> | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
#endif | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
#ifdef CARLA_OS_UNIX | |||
# include <signal.h> | |||
#endif | |||
@@ -234,7 +247,7 @@ QString getAndSetPath(QWidget* const parent, QLineEdit* const lineEdit) | |||
void fillQStringListFromStringArray(QStringList& list, const char* const* const stringArray) | |||
{ | |||
uint count = 0; | |||
int count = 0; | |||
// count number of strings first | |||
for (; stringArray[count] != nullptr; ++count) {} | |||
@@ -249,7 +262,7 @@ void fillQStringListFromStringArray(QStringList& list, const char* const* const | |||
void fillQDoubleListFromDoubleArray(QList<double>& list, const double* const doubleArray) | |||
{ | |||
uint count = 0; | |||
int count = 0; | |||
// count number of strings first | |||
for (; carla_isNotZero(doubleArray[count]); ++count) {} | |||
@@ -264,7 +277,7 @@ void fillQDoubleListFromDoubleArray(QList<double>& list, const double* const dou | |||
void fillQUIntListFromUIntArray(QList<uint>& list, const uint* const uintArray) | |||
{ | |||
uint count = 0; | |||
int count = 0; | |||
// count number of strings first | |||
for (; uintArray[count] != 0; ++count) {} | |||
@@ -303,6 +316,38 @@ bool stringArrayContainsString(const char* const* const stringArray, const char* | |||
return false; | |||
} | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Get index of a QList<double> value | |||
int getIndexOfQDoubleListValue(const QList<double>& list, const double value) | |||
{ | |||
if (list.size() > 0) | |||
{ | |||
for (QList<double>::const_iterator n = list.cbegin(), e = list.cend(); n != e; ++n) | |||
if (carla_isEqual(*n, value)) | |||
return int(n - list.cbegin()); | |||
} | |||
return -1; | |||
} | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Check if two QList<double> instances match | |||
bool isQDoubleListEqual(const QList<double>& list1, const QList<double>& list2) | |||
{ | |||
if (list1.size() != list2.size()) | |||
return false; | |||
if (list1.isEmpty()) | |||
return true; | |||
for (QList<double>::const_iterator l1n = list1.cbegin(), l2n = list2.cbegin(), l1e = list1.cend(); l1n != l1e; ++l1n, ++l2n) | |||
if (carla_isNotEqual(*l1n, *l2n)) | |||
return false; | |||
return true; | |||
} | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Custom QMessageBox which resizes itself to fit text | |||
@@ -365,6 +410,24 @@ Qt::CheckState QSafeSettings::valueCheckState(const QString key, const Qt::Check | |||
} | |||
} | |||
int QSafeSettings::valueIntPositive(const QString key, const int defaultValue) const | |||
{ | |||
CARLA_SAFE_ASSERT_INT(defaultValue >= 0, defaultValue); | |||
QVariant var(value(key, defaultValue)); | |||
if (var.isNull()) | |||
return defaultValue; | |||
CARLA_SAFE_ASSERT_RETURN(var.convert(QVariant::Int), defaultValue); | |||
CARLA_SAFE_ASSERT_RETURN(var.isValid(), defaultValue); | |||
const int value = var.toInt(); | |||
CARLA_SAFE_ASSERT_RETURN(value >= 0, defaultValue); | |||
return value; | |||
} | |||
uint QSafeSettings::valueUInt(const QString key, const uint defaultValue) const | |||
{ | |||
QVariant var(value(key, defaultValue)); | |||
@@ -21,6 +21,13 @@ | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Global) | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
#endif | |||
#include <QtCore/QSettings> | |||
#include <QtCore/QStringList> | |||
@@ -28,6 +35,12 @@ | |||
#include <QtWidgets/QMessageBox> | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
#endif | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
class CarlaHost; | |||
class QFontMetrics; | |||
class QLineEdit; | |||
@@ -408,6 +421,16 @@ int fontMetricsHorizontalAdvance(const QFontMetrics& fm, const QString& s); | |||
bool stringArrayContainsString(const char* const* const stringArray, const char* const string) noexcept; | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Get index of a QList<double> value | |||
int getIndexOfQDoubleListValue(const QList<double>& list, const double value); | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Check if two QList<double> instances match | |||
bool isQDoubleListEqual(const QList<double>& list1, const QList<double>& list2); | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Custom QString class with a few extra methods | |||
@@ -461,6 +484,7 @@ public: | |||
bool valueBool(const QString key, const bool defaultValue) const; | |||
Qt::CheckState valueCheckState(const QString key, const Qt::CheckState defaultValue) const; | |||
int valueIntPositive(const QString key, const int defaultValue) const; | |||
uint valueUInt(const QString key, const uint defaultValue) const; | |||
double valueDouble(const QString key, const double defaultValue) const; | |||
QString valueString(const QString key, const QString defaultValue) const; | |||
@@ -20,15 +20,32 @@ | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Global) | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
#endif | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
#include <QtWidgets/QDialog> | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Custom) | |||
#include "ui_carla_about.hpp" | |||
#include "ui_carla_about_juce.hpp" | |||
#include "ui_carla_parameter.hpp" | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
#endif | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Custom) | |||
#include "carla_host.hpp" | |||
#include "CarlaHost.h" | |||
@@ -163,6 +180,8 @@ struct CarlaAboutW::PrivateData { | |||
aboutWindow->adjustSize(); | |||
ui.tabWidget->setCurrentIndex(0); | |||
} | |||
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PrivateData) | |||
}; | |||
CarlaAboutW::CarlaAboutW(QWidget* parent, const CarlaHost& host) | |||
@@ -197,6 +216,8 @@ struct JuceAboutW::PrivateData { | |||
ui.l_text2->setText(tr("This program uses JUCE version %1.").arg(carla_get_juce_version())); | |||
} | |||
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PrivateData) | |||
}; | |||
JuceAboutW::JuceAboutW(QWidget* const parent) | |||
@@ -243,6 +264,7 @@ struct PluginParameter::PrivateData { | |||
} | |||
*/ | |||
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PrivateData) | |||
}; | |||
PluginParameter::PluginParameter(QWidget* const parent, const CarlaHost& host) | |||
@@ -21,8 +21,19 @@ | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Global) | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
#endif | |||
#include <QtWidgets/QDialog> | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
#endif | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Custom) | |||
@@ -102,6 +113,7 @@ private: | |||
class PluginEditParentMeta | |||
{ | |||
protected: | |||
virtual ~PluginEditParentMeta() {}; | |||
virtual void editDialogVisibilityChanged(int pluginId, bool visible) = 0; | |||
virtual void editDialogPluginHintsChanged(int pluginId, int hints) = 0; | |||
virtual void editDialogParameterValueChanged(int pluginId, int parameterId, float value) = 0; | |||
@@ -20,10 +20,21 @@ | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Global) | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
#endif | |||
#include <QtGui/QColor> | |||
#include <QtGui/QFont> | |||
#include <QtGui/QPen> | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
#endif | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
struct Theme::PrivateData { | |||
@@ -54,7 +65,7 @@ struct Theme::PrivateData { | |||
// Ports | |||
QPen port_text; | |||
int port_text_ypos = 12; | |||
int port_text_ypos; | |||
// port_bg_pixmap = None; | |||
QString port_font_name; | |||
int port_font_size; | |||
@@ -113,7 +124,71 @@ struct Theme::PrivateData { | |||
//----------------------------------------------------------------------------------------------------------------- | |||
PrivateData(const Theme::List id) | |||
: idx(id) | |||
: idx(id), | |||
canvas_bg(), | |||
box_pen(), | |||
box_pen_sel(), | |||
box_bg_1(), | |||
box_bg_2(), | |||
box_shadow(), | |||
box_header_height(), | |||
box_header_spacing(), | |||
box_text(), | |||
box_text_sel(), | |||
box_text_ypos(), | |||
box_font_name(), | |||
box_font_size(), | |||
box_font_state(), | |||
box_bg_type(), | |||
box_use_icon(), | |||
port_text(), | |||
port_text_ypos(), | |||
port_font_name(), | |||
port_font_size(), | |||
port_font_state(), | |||
port_mode(), | |||
port_audio_jack_pen(), | |||
port_audio_jack_pen_sel(), | |||
port_midi_jack_pen(), | |||
port_midi_jack_pen_sel(), | |||
port_midi_alsa_pen(), | |||
port_midi_alsa_pen_sel(), | |||
port_parameter_pen(), | |||
port_parameter_pen_sel(), | |||
port_audio_jack_bg(), | |||
port_audio_jack_bg_sel(), | |||
port_midi_jack_bg(), | |||
port_midi_jack_bg_sel(), | |||
port_midi_alsa_bg(), | |||
port_midi_alsa_bg_sel(), | |||
port_parameter_bg(), | |||
port_parameter_bg_sel(), | |||
port_audio_jack_text(), | |||
port_audio_jack_text_sel(), | |||
port_midi_jack_text(), | |||
port_midi_jack_text_sel(), | |||
port_midi_alsa_text(), | |||
port_midi_alsa_text_sel(), | |||
port_parameter_text(), | |||
port_parameter_text_sel(), | |||
port_height(), | |||
port_offset(), | |||
port_spacing(), | |||
port_spacingT(), | |||
line_audio_jack(), | |||
line_audio_jack_sel(), | |||
line_audio_jack_glow(), | |||
line_midi_jack(), | |||
line_midi_jack_sel(), | |||
line_midi_jack_glow(), | |||
line_midi_alsa(), | |||
line_midi_alsa_sel(), | |||
line_midi_alsa_glow(), | |||
line_parameter(), | |||
line_parameter_sel(), | |||
line_parameter_glow(), | |||
rubberband_pen(), | |||
rubberband_brush() | |||
{ | |||
switch (idx) | |||
{ | |||
@@ -540,6 +615,8 @@ struct Theme::PrivateData { | |||
break; | |||
} | |||
} | |||
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PrivateData) | |||
}; | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
@@ -21,6 +21,11 @@ | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Global) | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
// Imports (Custom) | |||
#include "CarlaJuceUtils.hpp" | |||
//--------------------------------------------------------------------------------------------------------------------- | |||
class Theme | |||
@@ -51,6 +56,8 @@ public: | |||
private: | |||
struct PrivateData; | |||
PrivateData* const self; | |||
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Theme) | |||
}; | |||
//--------------------------------------------------------------------------------------------------------------------- | |||