| @@ -39,8 +39,8 @@ endif | |||||
| ifeq ($(HAVE_PULSEAUDIO),true) | ifeq ($(HAVE_PULSEAUDIO),true) | ||||
| WANT_RTAUDIO = true | WANT_RTAUDIO = true | ||||
| CARLA_CXX_FLAGS += $(shell pkg-config --cflags libpulse-simple) -D__LINUX_PULSE__ | |||||
| CARLA_LD_FLAGS += $(shell pkg-config --libs libpulse-simple) | |||||
| CARLA_CXX_FLAGS += $(shell pkg-config --cflags libpulse-simple) -D__LINUX_PULSE__ | |||||
| CARLA_LD_FLAGS += $(shell pkg-config --libs libpulse-simple) | |||||
| endif | endif | ||||
| ifeq ($(HAVE_FLUIDSYNTH),true) | ifeq ($(HAVE_FLUIDSYNTH),true) | ||||
| @@ -82,6 +82,9 @@ endif | |||||
| all: carla_backend.so | all: carla_backend.so | ||||
| doc: carla_backend.doxygen | |||||
| doxygen $< | |||||
| carla_backend.so: $(OBJS) | carla_backend.so: $(OBJS) | ||||
| $(CXX) $^ $(CARLA_LD_FLAGS) -o $@ && strip $@ | $(CXX) $^ $(CARLA_LD_FLAGS) -o $@ && strip $@ | ||||
| @@ -281,9 +281,7 @@ bool CarlaEngine::removePlugin(const unsigned short id) | |||||
| plugin->setEnabled(false); | plugin->setEnabled(false); | ||||
| processUnlock(); | processUnlock(); | ||||
| if (m_checkThread.isRunning()) | |||||
| m_checkThread.stopNow(); | |||||
| m_checkThread.stopNow(); | |||||
| delete plugin; | delete plugin; | ||||
| m_carlaPlugins[id] = nullptr; | m_carlaPlugins[id] = nullptr; | ||||
| @@ -291,13 +289,13 @@ bool CarlaEngine::removePlugin(const unsigned short id) | |||||
| if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | ||||
| { | { | ||||
| for (unsigned short i=id; i < MAX_PLUGINS; i++) | |||||
| for (unsigned short i=id; i < MAX_PLUGINS-1; i++) | |||||
| { | { | ||||
| m_carlaPlugins[i] = m_carlaPlugins[i+1]; | m_carlaPlugins[i] = m_carlaPlugins[i+1]; | ||||
| m_uniqueNames[i] = m_uniqueNames[i+1]; | m_uniqueNames[i] = m_uniqueNames[i+1]; | ||||
| if (m_carlaPlugins[i]) | if (m_carlaPlugins[i]) | ||||
| m_carlaPlugins[i]->setId(i+1); | |||||
| m_carlaPlugins[i]->setId(i); | |||||
| } | } | ||||
| } | } | ||||
| @@ -992,8 +990,7 @@ void CarlaEngine::osc_send_set_parameter_ranges(const int32_t pluginId, const in | |||||
| void CarlaEngine::osc_send_set_parameter_midi_cc(const int32_t pluginId, const int32_t index, const int32_t cc) | void CarlaEngine::osc_send_set_parameter_midi_cc(const int32_t pluginId, const int32_t index, const int32_t cc) | ||||
| { | { | ||||
| qDebug("CarlaEngine::osc_send_set_parameter_midi_cc(%i, %i, %i)", pluginId, index, cc); | qDebug("CarlaEngine::osc_send_set_parameter_midi_cc(%i, %i, %i)", pluginId, index, cc); | ||||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||||
| Q_ASSERT(oscData); | |||||
| Q_ASSERT(m_oscData); | |||||
| Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | ||||
| Q_ASSERT(index >= 0); | Q_ASSERT(index >= 0); | ||||
| @@ -202,6 +202,11 @@ public: | |||||
| m_carlaPlugins[id] = plugin; | m_carlaPlugins[id] = plugin; | ||||
| } | } | ||||
| CarlaPlugin* __getPlugin(const unsigned short id) const | |||||
| { | |||||
| return m_carlaPlugins[id]; | |||||
| } | |||||
| // ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
| // Information (base) | // Information (base) | ||||
| @@ -80,9 +80,13 @@ static void carla_jack_shutdown_callback(void* arg) | |||||
| // ------------------------------------------------------------------------------------------------------------------- | // ------------------------------------------------------------------------------------------------------------------- | ||||
| // Carla Engine (JACK) | // Carla Engine (JACK) | ||||
| CarlaEngineJack::CarlaEngineJack() : | |||||
| CarlaEngine(), | |||||
| rackJackPorts{nullptr} | |||||
| CarlaEngineJack::CarlaEngineJack() | |||||
| #ifdef Q_COMPILER_INITIALIZER_LISTS | |||||
| : CarlaEngine(), | |||||
| rackJackPorts{nullptr} | |||||
| #else | |||||
| : CarlaEngine() | |||||
| #endif | |||||
| { | { | ||||
| qDebug("CarlaEngineJack::CarlaEngineJack()"); | qDebug("CarlaEngineJack::CarlaEngineJack()"); | ||||
| @@ -94,6 +98,11 @@ CarlaEngineJack::CarlaEngineJack() : | |||||
| procThread = nullptr; | procThread = nullptr; | ||||
| memset(&pos, 0, sizeof(jack_position_t)); | memset(&pos, 0, sizeof(jack_position_t)); | ||||
| #ifndef Q_COMPILER_INITIALIZER_LISTS | |||||
| for (unsigned short i=0; i < rackPortCount; i++) | |||||
| rackJackPorts[i] = nullptr; | |||||
| #endif | |||||
| } | } | ||||
| CarlaEngineJack::~CarlaEngineJack() | CarlaEngineJack::~CarlaEngineJack() | ||||
| @@ -308,7 +317,7 @@ void CarlaEngineJack::handleProcessCallback(uint32_t nframes) | |||||
| { | { | ||||
| for (unsigned short i=0; i < MAX_PLUGINS; i++) | for (unsigned short i=0; i < MAX_PLUGINS; i++) | ||||
| { | { | ||||
| CarlaPlugin* const plugin = getPlugin(i); | |||||
| CarlaPlugin* const plugin = __getPlugin(i); | |||||
| if (plugin && plugin->enabled()) | if (plugin && plugin->enabled()) | ||||
| { | { | ||||
| @@ -357,7 +366,57 @@ void CarlaEngineJack::handleProcessCallback(uint32_t nframes) | |||||
| // initialize control input | // initialize control input | ||||
| memset(rackControlEventsIn, 0, sizeof(CarlaEngineControlEvent)*MAX_ENGINE_CONTROL_EVENTS); | memset(rackControlEventsIn, 0, sizeof(CarlaEngineControlEvent)*MAX_ENGINE_CONTROL_EVENTS); | ||||
| { | { | ||||
| // TODO | |||||
| jack_midi_event_t jackEvent; | |||||
| const uint32_t jackEventCount = jack_midi_get_event_count(controlIn); | |||||
| uint32_t carlaEventIndex = 0; | |||||
| for (uint32_t jackEventIndex=0; jackEventIndex < jackEventCount; jackEventIndex++) | |||||
| { | |||||
| if (jack_midi_event_get(&jackEvent, controlIn, jackEventIndex) != 0) | |||||
| continue; | |||||
| CarlaEngineControlEvent* const carlaEvent = &rackControlEventsIn[carlaEventIndex++]; | |||||
| uint8_t midiStatus = jackEvent.buffer[0]; | |||||
| uint8_t midiChannel = midiStatus & 0x0F; | |||||
| carlaEvent->time = jackEvent.time; | |||||
| carlaEvent->channel = midiChannel; | |||||
| if (MIDI_IS_STATUS_CONTROL_CHANGE(midiStatus)) | |||||
| { | |||||
| uint8_t midiControl = jackEvent.buffer[1]; | |||||
| if (MIDI_IS_CONTROL_BANK_SELECT(midiControl)) | |||||
| { | |||||
| uint8_t midiBank = jackEvent.buffer[2]; | |||||
| carlaEvent->type = CarlaEngineEventMidiBankChange; | |||||
| carlaEvent->value = midiBank; | |||||
| } | |||||
| else if (midiControl == MIDI_CONTROL_ALL_SOUND_OFF) | |||||
| { | |||||
| carlaEvent->type = CarlaEngineEventAllSoundOff; | |||||
| } | |||||
| else if (midiControl == MIDI_CONTROL_ALL_NOTES_OFF) | |||||
| { | |||||
| carlaEvent->type = CarlaEngineEventAllNotesOff; | |||||
| } | |||||
| else | |||||
| { | |||||
| uint8_t midiValue = jackEvent.buffer[2]; | |||||
| carlaEvent->type = CarlaEngineEventControlChange; | |||||
| carlaEvent->controller = midiControl; | |||||
| carlaEvent->value = double(midiValue)/127; | |||||
| } | |||||
| } | |||||
| else if (MIDI_IS_STATUS_PROGRAM_CHANGE(midiStatus)) | |||||
| { | |||||
| uint8_t midiProgram = jackEvent.buffer[1]; | |||||
| carlaEvent->type = CarlaEngineEventMidiProgramChange; | |||||
| carlaEvent->value = midiProgram; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| // initialize midi input | // initialize midi input | ||||
| @@ -392,7 +451,7 @@ void CarlaEngineJack::handleProcessCallback(uint32_t nframes) | |||||
| // process plugins | // process plugins | ||||
| for (unsigned short i=0; i < MAX_PLUGINS; i++) | for (unsigned short i=0; i < MAX_PLUGINS; i++) | ||||
| { | { | ||||
| CarlaPlugin* const plugin = getPlugin(i); | |||||
| CarlaPlugin* const plugin = __getPlugin(i); | |||||
| if (plugin && plugin->enabled()) | if (plugin && plugin->enabled()) | ||||
| { | { | ||||
| @@ -445,6 +504,12 @@ void CarlaEngineJack::handleProcessCallback(uint32_t nframes) | |||||
| } | } | ||||
| } | } | ||||
| // if plugin has no midi output, add previous midi input | |||||
| if (plugin->midiOutCount() == 0) | |||||
| { | |||||
| memcpy(rackMidiEventsOut, rackMidiEventsIn, sizeof(CarlaEngineMidiEvent)*MAX_ENGINE_MIDI_EVENTS); | |||||
| } | |||||
| processed = true; | processed = true; | ||||
| } | } | ||||
| } | } | ||||
| @@ -463,7 +528,50 @@ void CarlaEngineJack::handleProcessCallback(uint32_t nframes) | |||||
| // output control | // output control | ||||
| { | { | ||||
| // TODO | |||||
| jack_midi_clear_buffer(controlOut); | |||||
| for (unsigned short i=0; i < MAX_ENGINE_CONTROL_EVENTS; i++) | |||||
| { | |||||
| CarlaEngineControlEvent* const event = &rackControlEventsOut[i]; | |||||
| if (event->type == CarlaEngineEventControlChange && MIDI_IS_CONTROL_BANK_SELECT(event->controller)) | |||||
| event->type = CarlaEngineEventMidiBankChange; | |||||
| uint8_t data[4] = { 0 }; | |||||
| switch (event->type) | |||||
| { | |||||
| case CarlaEngineEventNull: | |||||
| break; | |||||
| case CarlaEngineEventControlChange: | |||||
| data[0] = MIDI_STATUS_CONTROL_CHANGE + event->channel; | |||||
| data[1] = event->controller; | |||||
| data[2] = event->value * 127; | |||||
| jack_midi_event_write(controlOut, event->time, data, 3); | |||||
| break; | |||||
| case CarlaEngineEventMidiBankChange: | |||||
| data[0] = MIDI_STATUS_CONTROL_CHANGE + event->channel; | |||||
| data[1] = MIDI_CONTROL_BANK_SELECT; | |||||
| data[2] = event->value; | |||||
| jack_midi_event_write(controlOut, event->time, data, 3); | |||||
| break; | |||||
| case CarlaEngineEventMidiProgramChange: | |||||
| data[0] = MIDI_STATUS_PROGRAM_CHANGE + event->channel; | |||||
| data[1] = event->value; | |||||
| jack_midi_event_write(controlOut, event->time, data, 2); | |||||
| break; | |||||
| case CarlaEngineEventAllSoundOff: | |||||
| data[0] = MIDI_STATUS_CONTROL_CHANGE + event->channel; | |||||
| data[1] = MIDI_CONTROL_ALL_SOUND_OFF; | |||||
| jack_midi_event_write(controlOut, event->time, data, 2); | |||||
| break; | |||||
| case CarlaEngineEventAllNotesOff: | |||||
| data[0] = MIDI_STATUS_CONTROL_CHANGE + event->channel; | |||||
| data[1] = MIDI_CONTROL_ALL_NOTES_OFF; | |||||
| jack_midi_event_write(controlOut, event->time, data, 2); | |||||
| break; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| // output midi | // output midi | ||||
| @@ -207,7 +207,7 @@ void CarlaEngineRtAudio::handleProcessCallback(void* outputBuffer, void* inputBu | |||||
| // process plugins | // process plugins | ||||
| for (unsigned short i=0; i < MAX_PLUGINS; i++) | for (unsigned short i=0; i < MAX_PLUGINS; i++) | ||||
| { | { | ||||
| CarlaPlugin* const plugin = getPlugin(i); | |||||
| CarlaPlugin* const plugin = __getPlugin(i); | |||||
| if (plugin && plugin->enabled()) | if (plugin && plugin->enabled()) | ||||
| { | { | ||||
| @@ -265,7 +265,7 @@ int CarlaOsc::handle_register(const int argc, const lo_arg* const* const argv, c | |||||
| for (unsigned short i=0; i < CarlaBackend::MAX_PLUGINS; i++) | for (unsigned short i=0; i < CarlaBackend::MAX_PLUGINS; i++) | ||||
| { | { | ||||
| CarlaBackend::CarlaPlugin* const plugin = engine->getPlugin(i); | |||||
| CarlaBackend::CarlaPlugin* const plugin = engine->__getPlugin(i); | |||||
| if (plugin && plugin->enabled()) | if (plugin && plugin->enabled()) | ||||
| plugin->registerToOsc(); | plugin->registerToOsc(); | ||||
| @@ -1802,7 +1802,7 @@ public: | |||||
| case PluginPostEventNoteOn: | case PluginPostEventNoteOn: | ||||
| // Update OSC based UIs | // Update OSC based UIs | ||||
| if (true) | |||||
| if (osc.data.target) | |||||
| { | { | ||||
| uint8_t midiData[4] = { 0 }; | uint8_t midiData[4] = { 0 }; | ||||
| midiData[1] = MIDI_STATUS_NOTE_ON + event->value1; | midiData[1] = MIDI_STATUS_NOTE_ON + event->value1; | ||||
| @@ -1820,7 +1820,7 @@ public: | |||||
| case PluginPostEventNoteOff: | case PluginPostEventNoteOff: | ||||
| // Update OSC based UIs | // Update OSC based UIs | ||||
| if (true) | |||||
| if (osc.data.target) | |||||
| { | { | ||||
| uint8_t midiData[4] = { 0 }; | uint8_t midiData[4] = { 0 }; | ||||
| midiData[1] = MIDI_STATUS_NOTE_OFF + event->value1; | midiData[1] = MIDI_STATUS_NOTE_OFF + event->value1; | ||||
| @@ -58,7 +58,7 @@ void CarlaCheckThread::run() | |||||
| { | { | ||||
| for (unsigned short i=0; i < CarlaBackend::MAX_PLUGINS; i++) | for (unsigned short i=0; i < CarlaBackend::MAX_PLUGINS; i++) | ||||
| { | { | ||||
| CarlaBackend::CarlaPlugin* const plugin = engine->getPlugin(i); | |||||
| CarlaBackend::CarlaPlugin* const plugin = engine->__getPlugin(i); | |||||
| if (plugin && plugin->enabled()) | if (plugin && plugin->enabled()) | ||||
| { | { | ||||
| @@ -1224,21 +1224,15 @@ public: | |||||
| for (i=0; i < count; i++) | for (i=0; i < count; i++) | ||||
| { | { | ||||
| // Dry/Wet and Volume | |||||
| if (do_drywet || do_volume) | |||||
| // Dry/Wet | |||||
| if (do_drywet) | |||||
| { | { | ||||
| for (k=0; k < frames; k++) | for (k=0; k < frames; k++) | ||||
| { | { | ||||
| if (do_drywet) | |||||
| { | |||||
| if (aout.count == 1 && ! h2) | |||||
| outBuffer[i][k] = (outBuffer[i][k]*x_drywet)+(inBuffer[0][k]*(1.0-x_drywet)); | |||||
| else | |||||
| outBuffer[i][k] = (outBuffer[i][k]*x_drywet)+(inBuffer[i][k]*(1.0-x_drywet)); | |||||
| } | |||||
| if (do_volume) | |||||
| outBuffer[i][k] *= x_vol; | |||||
| if (aout.count == 1 && ! h2) | |||||
| outBuffer[i][k] = (outBuffer[i][k]*x_drywet)+(inBuffer[0][k]*(1.0-x_drywet)); | |||||
| else | |||||
| outBuffer[i][k] = (outBuffer[i][k]*x_drywet)+(inBuffer[i][k]*(1.0-x_drywet)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1268,6 +1262,13 @@ public: | |||||
| } | } | ||||
| } | } | ||||
| // Volume | |||||
| if (do_volume) | |||||
| { | |||||
| for (k=0; k < frames; k++) | |||||
| outBuffer[i][k] *= x_vol; | |||||
| } | |||||
| // Output VU | // Output VU | ||||
| for (k=0; i < 2 && k < frames; k++) | for (k=0; i < 2 && k < frames; k++) | ||||
| { | { | ||||
| @@ -1128,7 +1128,7 @@ public: | |||||
| CARLA_PROCESS_CONTINUE_CHECK; | CARLA_PROCESS_CONTINUE_CHECK; | ||||
| // -------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------- | ||||
| // Post-processing (volume and balance) | |||||
| // Post-processing (balance and volume) | |||||
| if (m_active) | if (m_active) | ||||
| { | { | ||||
| @@ -1139,9 +1139,6 @@ public: | |||||
| for (i=0; i < aout.count; i++) | for (i=0; i < aout.count; i++) | ||||
| { | { | ||||
| // Volume, using fluidsynth internals | |||||
| fluid_synth_set_gain(f_synth, x_vol); | |||||
| // Balance | // Balance | ||||
| if (do_balance) | if (do_balance) | ||||
| { | { | ||||
| @@ -1168,6 +1165,9 @@ public: | |||||
| } | } | ||||
| } | } | ||||
| // Volume, using fluidsynth internals | |||||
| fluid_synth_set_gain(f_synth, x_vol); | |||||
| // Output VU | // Output VU | ||||
| for (k=0; i < 2 && k < frames; k++) | for (k=0; i < 2 && k < frames; k++) | ||||
| { | { | ||||
| @@ -887,21 +887,15 @@ public: | |||||
| for (i=0; i < count; i++) | for (i=0; i < count; i++) | ||||
| { | { | ||||
| // Dry/Wet and Volume | |||||
| if (do_drywet || do_volume) | |||||
| // Dry/Wet | |||||
| if (do_drywet) | |||||
| { | { | ||||
| for (k=0; k < frames; k++) | for (k=0; k < frames; k++) | ||||
| { | { | ||||
| if (do_drywet) | |||||
| { | |||||
| if (aout.count == 1 && ! h2) | |||||
| outBuffer[i][k] = (outBuffer[i][k]*x_drywet)+(inBuffer[0][k]*(1.0-x_drywet)); | |||||
| else | |||||
| outBuffer[i][k] = (outBuffer[i][k]*x_drywet)+(inBuffer[i][k]*(1.0-x_drywet)); | |||||
| } | |||||
| if (do_volume) | |||||
| outBuffer[i][k] *= x_vol; | |||||
| if (aout.count == 1 && ! h2) | |||||
| outBuffer[i][k] = (outBuffer[i][k]*x_drywet)+(inBuffer[0][k]*(1.0-x_drywet)); | |||||
| else | |||||
| outBuffer[i][k] = (outBuffer[i][k]*x_drywet)+(inBuffer[i][k]*(1.0-x_drywet)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -931,6 +925,13 @@ public: | |||||
| } | } | ||||
| } | } | ||||
| // Volume | |||||
| if (do_volume) | |||||
| { | |||||
| for (k=0; k < frames; k++) | |||||
| outBuffer[i][k] *= x_vol; | |||||
| } | |||||
| // Output VU | // Output VU | ||||
| for (k=0; i < 2 && k < frames; k++) | for (k=0; i < 2 && k < frames; k++) | ||||
| { | { | ||||
| @@ -410,13 +410,6 @@ public: | |||||
| for (i=0; i < aout.count; i++) | for (i=0; i < aout.count; i++) | ||||
| { | { | ||||
| // Volume | |||||
| if (do_volume) | |||||
| { | |||||
| for (k=0; k < frames; k++) | |||||
| outBuffer[i][k] *= x_vol; | |||||
| } | |||||
| // Balance | // Balance | ||||
| if (do_balance) | if (do_balance) | ||||
| { | { | ||||
| @@ -443,6 +436,13 @@ public: | |||||
| } | } | ||||
| } | } | ||||
| // Volume | |||||
| if (do_volume) | |||||
| { | |||||
| for (k=0; k < frames; k++) | |||||
| outBuffer[i][k] *= x_vol; | |||||
| } | |||||
| // Output VU | // Output VU | ||||
| for (k=0; i < 2 && k < frames; k++) | for (k=0; i < 2 && k < frames; k++) | ||||
| { | { | ||||
| @@ -2137,21 +2137,15 @@ public: | |||||
| for (i=0; i < count; i++) | for (i=0; i < count; i++) | ||||
| { | { | ||||
| // Dry/Wet and Volume | |||||
| if (do_drywet || do_volume) | |||||
| // Dry/Wet | |||||
| if (do_drywet) | |||||
| { | { | ||||
| for (k=0; k < frames; k++) | for (k=0; k < frames; k++) | ||||
| { | { | ||||
| if (do_drywet) | |||||
| { | |||||
| if (aout.count == 1 && ! h2) | |||||
| outBuffer[i][k] = (outBuffer[i][k]*x_drywet)+(inBuffer[0][k]*(1.0-x_drywet)); | |||||
| else | |||||
| outBuffer[i][k] = (outBuffer[i][k]*x_drywet)+(inBuffer[i][k]*(1.0-x_drywet)); | |||||
| } | |||||
| if (do_volume) | |||||
| outBuffer[i][k] *= x_vol; | |||||
| if (aout.count == 1 && ! h2) | |||||
| outBuffer[i][k] = (outBuffer[i][k]*x_drywet)+(inBuffer[0][k]*(1.0-x_drywet)); | |||||
| else | |||||
| outBuffer[i][k] = (outBuffer[i][k]*x_drywet)+(inBuffer[i][k]*(1.0-x_drywet)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -2181,6 +2175,13 @@ public: | |||||
| } | } | ||||
| } | } | ||||
| // Volume | |||||
| if (do_volume) | |||||
| { | |||||
| for (k=0; k < frames; k++) | |||||
| outBuffer[i][k] *= x_vol; | |||||
| } | |||||
| // Output VU | // Output VU | ||||
| for (k=0; i < 2 && k < frames; k++) | for (k=0; i < 2 && k < frames; k++) | ||||
| { | { | ||||
| @@ -1085,21 +1085,15 @@ public: | |||||
| for (i=0; i < aout.count; i++) | for (i=0; i < aout.count; i++) | ||||
| { | { | ||||
| // Dry/Wet and Volume | |||||
| // Dry/Wet | |||||
| if (do_drywet || do_volume) | if (do_drywet || do_volume) | ||||
| { | { | ||||
| for (k=0; k < frames; k++) | for (k=0; k < frames; k++) | ||||
| { | { | ||||
| if (do_drywet) | |||||
| { | |||||
| if (aout.count == 1) | |||||
| outBuffer[i][k] = (outBuffer[i][k]*x_drywet)+(inBuffer[0][k]*(1.0-x_drywet)); | |||||
| else | |||||
| outBuffer[i][k] = (outBuffer[i][k]*x_drywet)+(inBuffer[i][k]*(1.0-x_drywet)); | |||||
| } | |||||
| if (do_volume) | |||||
| outBuffer[i][k] *= x_vol; | |||||
| if (aout.count == 1) | |||||
| outBuffer[i][k] = (outBuffer[i][k]*x_drywet)+(inBuffer[0][k]*(1.0-x_drywet)); | |||||
| else | |||||
| outBuffer[i][k] = (outBuffer[i][k]*x_drywet)+(inBuffer[i][k]*(1.0-x_drywet)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1129,6 +1123,13 @@ public: | |||||
| } | } | ||||
| } | } | ||||
| // Volume | |||||
| if (do_volume) | |||||
| { | |||||
| for (k=0; k < frames; k++) | |||||
| outBuffer[i][k] *= x_vol; | |||||
| } | |||||
| // Output VU | // Output VU | ||||
| for (k=0; i < 2 && k < frames; k++) | for (k=0; i < 2 && k < frames; k++) | ||||
| { | { | ||||
| @@ -49,7 +49,7 @@ | |||||
| const uint32_t bufferSize = 512; | const uint32_t bufferSize = 512; | ||||
| const double sampleRate = 44100.0; | const double sampleRate = 44100.0; | ||||
| // Since discovery can find multi-architecture binaries, don't print ELF related errors | |||||
| // Since discovery can find multi-architecture binaries, don't print ELF/EXE related errors | |||||
| void print_lib_error(const char* const filename) | void print_lib_error(const char* const filename) | ||||
| { | { | ||||
| const char* const error = lib_error(filename); | const char* const error = lib_error(filename); | ||||
| @@ -428,15 +428,12 @@ public: | |||||
| return; | return; | ||||
| if (abs_f(m_cursor->x() - m_smooth_x) <= 0.0005f) | if (abs_f(m_cursor->x() - m_smooth_x) <= 0.0005f) | ||||
| { | |||||
| m_smooth_x = m_cursor->x(); | m_smooth_x = m_cursor->x(); | ||||
| return; | |||||
| } | |||||
| if (abs_f(m_cursor->y() - m_smooth_y) <= 0.0005f) | if (abs_f(m_cursor->y() - m_smooth_y) <= 0.0005f) | ||||
| { | |||||
| m_smooth_y = m_cursor->y(); | m_smooth_y = m_cursor->y(); | ||||
| if (m_cursor->x() == m_smooth_x && m_cursor->y() == m_smooth_y) | |||||
| return; | return; | ||||
| } | |||||
| float newX = float(m_smooth_x + m_cursor->x()*7) / 8; | float newX = float(m_smooth_x + m_cursor->x()*7) / 8; | ||||
| float newY = float(m_smooth_y + m_cursor->y()*7) / 8; | float newY = float(m_smooth_y + m_cursor->y()*7) / 8; | ||||
| @@ -1239,24 +1239,32 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||||
| pwidget = self.m_plugin_list[plugin_id] | pwidget = self.m_plugin_list[plugin_id] | ||||
| pwidget.edit_dialog.close() | pwidget.edit_dialog.close() | ||||
| if (pwidget.gui_dialog): | |||||
| if pwidget.gui_dialog: | |||||
| pwidget.gui_dialog.close() | pwidget.gui_dialog.close() | ||||
| if (Carla.Host.remove_plugin(plugin_id)): | |||||
| if Carla.Host.remove_plugin(plugin_id): | |||||
| pwidget.close() | pwidget.close() | ||||
| pwidget.deleteLater() | pwidget.deleteLater() | ||||
| self.w_plugins.layout().removeWidget(pwidget) | self.w_plugins.layout().removeWidget(pwidget) | ||||
| self.m_plugin_list[plugin_id] = None | self.m_plugin_list[plugin_id] = None | ||||
| else: | |||||
| if (showError): | |||||
| CustomMessageBox(self, QMessageBox.Critical, self.tr("Error"), self.tr("Failed to remove plugin"), | |||||
| cString(Carla.Host.get_last_error()), QMessageBox.Ok, QMessageBox.Ok) | |||||
| elif showError: | |||||
| CustomMessageBox(self, QMessageBox.Critical, self.tr("Error"), self.tr("Failed to remove plugin"), cString(Carla.Host.get_last_error()), QMessageBox.Ok, QMessageBox.Ok) | |||||
| # push all plugins 1 slot if rack mode | |||||
| if Carla.processMode == PROCESS_MODE_CONTINUOUS_RACK: | |||||
| for i in range(MAX_PLUGINS-1): | |||||
| if i < plugin_id: continue | |||||
| self.m_plugin_list[i] = self.m_plugin_list[i+1] | |||||
| if self.m_plugin_list[i]: | |||||
| self.m_plugin_list[i].setId(i) | |||||
| self.m_plugin_list[MAX_PLUGINS-1] = None | |||||
| # check if there are still plugins | |||||
| for i in range(MAX_PLUGINS): | for i in range(MAX_PLUGINS): | ||||
| if self.m_plugin_list[i] != None: | |||||
| self.act_plugin_remove_all.setEnabled(True) | |||||
| break | |||||
| if self.m_plugin_list[i]: break | |||||
| else: | else: | ||||
| self.act_plugin_remove_all.setEnabled(False) | self.act_plugin_remove_all.setEnabled(False) | ||||
| @@ -1601,8 +1609,23 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||||
| @pyqtSlot() | @pyqtSlot() | ||||
| def slot_remove_all(self): | def slot_remove_all(self): | ||||
| for i in range(MAX_PLUGINS): | for i in range(MAX_PLUGINS): | ||||
| if self.m_plugin_list[i]: | |||||
| self.remove_plugin(i, False) | |||||
| pwidget = self.m_plugin_list[i] | |||||
| if not pwidget: | |||||
| continue | |||||
| pwidget.edit_dialog.close() | |||||
| if pwidget.gui_dialog: | |||||
| pwidget.gui_dialog.close() | |||||
| if Carla.Host.remove_plugin(i): | |||||
| pwidget.close() | |||||
| pwidget.deleteLater() | |||||
| self.w_plugins.layout().removeWidget(pwidget) | |||||
| self.m_plugin_list[i] = None | |||||
| self.act_plugin_remove_all.setEnabled(False) | |||||
| @pyqtSlot() | @pyqtSlot() | ||||
| def slot_configureCarla(self): | def slot_configureCarla(self): | ||||
| @@ -1798,8 +1821,8 @@ if __name__ == '__main__': | |||||
| dname = cString(Carla.Host.get_engine_driver_name(i)) | dname = cString(Carla.Host.get_engine_driver_name(i)) | ||||
| print("%i - %s" % (i, dname)) | print("%i - %s" % (i, dname)) | ||||
| #if not Carla.Host.engine_init("JACK", "Carla"): | |||||
| if not Carla.Host.engine_init("PulseAudio", "Carla"): | |||||
| if not Carla.Host.engine_init("JACK", "Carla"): | |||||
| #if not Carla.Host.engine_init("PulseAudio", "Carla"): | |||||
| CustomMessageBox(None, QMessageBox.Critical, "Error", "Could not connect to Audio backend, possible reasons:", | CustomMessageBox(None, QMessageBox.Critical, "Error", "Could not connect to Audio backend, possible reasons:", | ||||
| cString(Carla.Host.get_last_error()), QMessageBox.Ok, QMessageBox.Ok) | cString(Carla.Host.get_last_error()), QMessageBox.Ok, QMessageBox.Ok) | ||||
| sys.exit(1) | sys.exit(1) | ||||
| @@ -1332,6 +1332,10 @@ class PluginWidget(QFrame, ui_carla_plugin.Ui_PluginWidget): | |||||
| self.dial_b_right.setStatusTip(message) | self.dial_b_right.setStatusTip(message) | ||||
| Carla.gui.statusBar().showMessage(message) | Carla.gui.statusBar().showMessage(message) | ||||
| def setId(self, idx): | |||||
| self.m_pluginId = idx | |||||
| self.edit_dialog.m_pluginId = idx | |||||
| def setWidgetColor(self, color): | def setWidgetColor(self, color): | ||||
| if color == PALETTE_COLOR_WHITE: | if color == PALETTE_COLOR_WHITE: | ||||
| r = 110 | r = 110 | ||||