| @@ -244,44 +244,44 @@ install: | |||
| install -m 644 data/*.desktop $(DESTDIR)$(PREFIX)/share/applications/ | |||
| # Install icons, 16x16 | |||
| install -m 644 src/icons/16x16/cadence.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/ | |||
| install -m 644 src/icons/16x16/catarina.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/ | |||
| install -m 644 src/icons/16x16/catia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/ | |||
| install -m 644 src/icons/16x16/claudia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/ | |||
| install -m 644 src/icons/16x16/claudia-launcher.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/ | |||
| install -m 644 src/icons/16x16/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/ | |||
| install -m 644 resources/16x16/cadence.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/ | |||
| install -m 644 resources/16x16/catarina.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/ | |||
| install -m 644 resources/16x16/catia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/ | |||
| install -m 644 resources/16x16/claudia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/ | |||
| install -m 644 resources/16x16/claudia-launcher.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/ | |||
| install -m 644 resources/16x16/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/ | |||
| # Install icons, 48x48 | |||
| install -m 644 src/icons/48x48/cadence.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/ | |||
| install -m 644 src/icons/48x48/catarina.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/ | |||
| install -m 644 src/icons/48x48/catia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/ | |||
| install -m 644 src/icons/48x48/claudia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/ | |||
| install -m 644 src/icons/48x48/claudia-launcher.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/ | |||
| install -m 644 src/icons/48x48/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/ | |||
| install -m 644 resources/48x48/cadence.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/ | |||
| install -m 644 resources/48x48/catarina.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/ | |||
| install -m 644 resources/48x48/catia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/ | |||
| install -m 644 resources/48x48/claudia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/ | |||
| install -m 644 resources/48x48/claudia-launcher.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/ | |||
| install -m 644 resources/48x48/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/ | |||
| # Install icons, 128x128 | |||
| install -m 644 src/icons/128x128/cadence.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/ | |||
| install -m 644 src/icons/128x128/catarina.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/ | |||
| install -m 644 src/icons/128x128/catia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/ | |||
| install -m 644 src/icons/128x128/claudia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/ | |||
| install -m 644 src/icons/128x128/claudia-launcher.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/ | |||
| install -m 644 src/icons/128x128/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/ | |||
| install -m 644 resources/128x128/cadence.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/ | |||
| install -m 644 resources/128x128/catarina.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/ | |||
| install -m 644 resources/128x128/catia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/ | |||
| install -m 644 resources/128x128/claudia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/ | |||
| install -m 644 resources/128x128/claudia-launcher.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/ | |||
| install -m 644 resources/128x128/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/ | |||
| # Install icons, 256x256 | |||
| install -m 644 src/icons/256x256/cadence.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/ | |||
| install -m 644 src/icons/256x256/catarina.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/ | |||
| install -m 644 src/icons/256x256/catia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/ | |||
| install -m 644 src/icons/256x256/claudia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/ | |||
| install -m 644 src/icons/256x256/claudia-launcher.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/ | |||
| install -m 644 src/icons/256x256/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/ | |||
| install -m 644 resources/256x256/cadence.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/ | |||
| install -m 644 resources/256x256/catarina.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/ | |||
| install -m 644 resources/256x256/catia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/ | |||
| install -m 644 resources/256x256/claudia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/ | |||
| install -m 644 resources/256x256/claudia-launcher.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/ | |||
| install -m 644 resources/256x256/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/ | |||
| # Install icons, scalable | |||
| install -m 644 src/icons/scalable/cadence.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/ | |||
| install -m 644 src/icons/scalable/catarina.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/ | |||
| install -m 644 src/icons/scalable/catia.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/ | |||
| install -m 644 src/icons/scalable/claudia.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/ | |||
| install -m 644 src/icons/scalable/claudia-launcher.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/ | |||
| install -m 644 src/icons/scalable/carla.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/ | |||
| install -m 644 resources/scalable/cadence.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/ | |||
| install -m 644 resources/scalable/catarina.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/ | |||
| install -m 644 resources/scalable/catia.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/ | |||
| install -m 644 resources/scalable/claudia.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/ | |||
| install -m 644 resources/scalable/claudia-launcher.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/ | |||
| install -m 644 resources/scalable/carla.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/ | |||
| # Install main code | |||
| install -m 755 src/*.py $(DESTDIR)$(PREFIX)/share/cadence/src/ | |||
| @@ -837,211 +837,212 @@ void CarlaEngineMidiPort::writeEvent(uint32_t time, uint8_t* data, uint8_t size) | |||
| // ------------------------------------------------------------------------------------------------------------------- | |||
| // Carla Engine OSC stuff | |||
| void CarlaEngine::osc_send_add_plugin(int plugin_id, const char* plugin_name) | |||
| void CarlaEngine::osc_send_add_plugin(const int32_t pluginId, const char* const pluginName) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_add_plugin(%i, %s)", plugin_id, plugin_name); | |||
| qDebug("CarlaEngine::osc_send_add_plugin(%i, \"%s\")", pluginId, pluginName); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | |||
| if (oscData->target) | |||
| { | |||
| char target_path[strlen(oscData->path)+12]; | |||
| strcpy(target_path, oscData->path); | |||
| strcat(target_path, "/add_plugin"); | |||
| lo_send(oscData->target, target_path, "is", plugin_id, plugin_name); | |||
| lo_send(oscData->target, target_path, "is", pluginId, pluginName); | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_remove_plugin(int plugin_id) | |||
| void CarlaEngine::osc_send_remove_plugin(const int32_t pluginId) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_remove_plugin(%i)", plugin_id); | |||
| qDebug("CarlaEngine::osc_send_remove_plugin(%i)", pluginId); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| if (oscData->target) | |||
| { | |||
| char target_path[strlen(oscData->path)+15]; | |||
| strcpy(target_path, oscData->path); | |||
| strcat(target_path, "/remove_plugin"); | |||
| lo_send(oscData->target, target_path, "i", plugin_id); | |||
| lo_send(oscData->target, target_path, "i", pluginId); | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_set_plugin_data(int plugin_id, int type, int category, int hints, const char* name, const char* label, const char* maker, const char* copyright, long unique_id) | |||
| void CarlaEngine::osc_send_set_plugin_data(const int32_t pluginId, const int32_t type, const int32_t category, const int32_t hints, | |||
| const char* const realName, const char* const label, const char* const maker, const char* const copyright, const int64_t uniqueId) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_set_plugin_data(%i, %i, %i, %i, %s, %s, %s, %s, %li)", plugin_id, type, category, hints, name, label, maker, copyright, unique_id); | |||
| qDebug("CarlaEngine::osc_send_set_plugin_data(%i, %i, %i, %i, \"%s\", \"%s\", \"%s\", \"%s\", %li)", pluginId, type, category, hints, realName, label, maker, copyright, uniqueId); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | |||
| if (oscData->target) | |||
| { | |||
| char target_path[strlen(oscData->path)+17]; | |||
| strcpy(target_path, oscData->path); | |||
| strcat(target_path, "/set_plugin_data"); | |||
| lo_send(oscData->target, target_path, "iiiissssi", plugin_id, type, category, hints, name, label, maker, copyright, unique_id); | |||
| lo_send(oscData->target, target_path, "iiiissssh", pluginId, type, category, hints, realName, label, maker, copyright, uniqueId); | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_set_plugin_ports(int plugin_id, int ains, int aouts, int mins, int mouts, int cins, int couts, int ctotals) | |||
| void CarlaEngine::osc_send_set_plugin_ports(const int32_t pluginId, const int32_t audioIns, const int32_t audioOuts, const int32_t midiIns, const int32_t midiOuts, | |||
| const int32_t cIns, const int32_t cOuts, const int32_t cTotals) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_set_plugin_ports(%i, %i, %i, %i, %i, %i, %i, %i)", plugin_id, ains, aouts, mins, mouts, cins, couts, ctotals); | |||
| qDebug("CarlaEngine::osc_send_set_plugin_ports(%i, %i, %i, %i, %i, %i, %i, %i)", pluginId, audioIns, audioOuts, midiIns, midiOuts, cIns, cOuts, cTotals); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | |||
| if (oscData->target) | |||
| { | |||
| char target_path[strlen(oscData->path)+18]; | |||
| strcpy(target_path, oscData->path); | |||
| strcat(target_path, "/set_plugin_ports"); | |||
| lo_send(oscData->target, target_path, "iiiiiiii", plugin_id, ains, aouts, mins, mouts, cins, couts, ctotals); | |||
| lo_send(oscData->target, target_path, "iiiiiiii", pluginId, audioIns, audioOuts, midiIns, midiOuts, cIns, cOuts, cTotals); | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_set_parameter_value(int plugin_id, int param_id, double value) | |||
| void CarlaEngine::osc_send_set_parameter_data(const int32_t pluginId, const int32_t index, const int32_t type, const int32_t hints, | |||
| const char* const name, const char* const label, const double current) | |||
| { | |||
| #if DEBUG | |||
| if (param_id < 0) | |||
| qDebug("CarlaEngine::osc_send_set_parameter_value(%i, %s, %g)", plugin_id, InternalParametersIndex2str((InternalParametersIndex)param_id), value); | |||
| else | |||
| qDebug("CarlaEngine::osc_send_set_parameter_value(%i, %i, %g)", plugin_id, param_id, value); | |||
| #endif | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| if (oscData->target) | |||
| { | |||
| char target_path[strlen(oscData->path)+21]; | |||
| strcpy(target_path, oscData->path); | |||
| strcat(target_path, "/set_parameter_value"); | |||
| lo_send(oscData->target, target_path, "iif", plugin_id, param_id, value); | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_set_parameter_data(int plugin_id, int param_id, int ptype, int hints, const char* name, const char* label, double current) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_set_parameter_data(%i, %i, %i, %i, %s, %s, %f)", plugin_id, param_id, ptype, hints, name, label, current); | |||
| qDebug("CarlaEngine::osc_send_set_parameter_data(%i, %i, %i, %i, \"%s\", \"%s\", %g)", pluginId, index, type, hints, name, label, current); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | |||
| if (oscData->target) | |||
| { | |||
| char target_path[strlen(oscData->path)+20]; | |||
| strcpy(target_path, oscData->path); | |||
| strcat(target_path, "/set_parameter_data"); | |||
| lo_send(oscData->target, target_path, "iiiissf", plugin_id, param_id, ptype, hints, name, label, current); | |||
| lo_send(oscData->target, target_path, "iiiissd", pluginId, index, type, hints, name, label, current); | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_set_parameter_ranges(int plugin_id, int param_id, double x_min, double x_max, double x_def, double x_step, double x_step_small, double x_step_large) | |||
| void CarlaEngine::osc_send_set_parameter_ranges(const int32_t pluginId, const int32_t index, const double min, const double max, const double def, | |||
| const double step, const double stepSmall, const double stepLarge) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_set_parameter_ranges(%i, %i, %f, %f, %f, %f, %f, %f)", plugin_id, param_id, x_min, x_max, x_def, x_step, x_step_small, x_step_large); | |||
| qDebug("CarlaEngine::osc_send_set_parameter_ranges(%i, %i, %g, %g, %g, %g, %g, %g)", pluginId, index, min, max, def, step, stepSmall, stepLarge); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | |||
| if (oscData->target) | |||
| { | |||
| char target_path[strlen(oscData->path)+22]; | |||
| strcpy(target_path, oscData->path); | |||
| strcat(target_path, "/set_parameter_ranges"); | |||
| lo_send(oscData->target, target_path, "iiffffff", plugin_id, param_id, x_min, x_max, x_def, x_step, x_step_small, x_step_large); | |||
| lo_send(oscData->target, target_path, "iidddddd", pluginId, index, min, max, def, step, stepSmall, stepLarge); | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_set_parameter_midi_channel(int plugin_id, int parameter_id, int midi_channel) | |||
| 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_channel(%i, %i, %i)", plugin_id, parameter_id, midi_channel); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| if (oscData->target) | |||
| { | |||
| char target_path[strlen(oscData->path)+28]; | |||
| strcpy(target_path, oscData->path); | |||
| strcat(target_path, "/set_parameter_midi_channel"); | |||
| lo_send(oscData->target, target_path, "iii", plugin_id, parameter_id, midi_channel); | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_set_parameter_midi_cc(int plugin_id, int parameter_id, int midi_cc) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_set_parameter_midi_cc(%i, %i, %i)", plugin_id, parameter_id, midi_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(pluginId >= 0 && pluginId < MAX_PLUGINS); | |||
| if (oscData->target) | |||
| { | |||
| char target_path[strlen(oscData->path)+23]; | |||
| strcpy(target_path, oscData->path); | |||
| strcat(target_path, "/set_parameter_midi_cc"); | |||
| lo_send(oscData->target, target_path, "iii", plugin_id, parameter_id, midi_cc); | |||
| lo_send(oscData->target, target_path, "iii", pluginId, index, cc); | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_set_default_value(int plugin_id, int param_id, double value) | |||
| void CarlaEngine::osc_send_set_parameter_midi_channel(const int32_t pluginId, const int32_t index, const int32_t channel) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_set_default_value(%i, %i, %f)", plugin_id, param_id, value); | |||
| qDebug("CarlaEngine::osc_send_set_parameter_midi_channel(%i, %i, %i)", pluginId, index, channel); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | |||
| if (oscData->target) | |||
| { | |||
| char target_path[strlen(oscData->path)+19]; | |||
| char target_path[strlen(oscData->path)+28]; | |||
| strcpy(target_path, oscData->path); | |||
| strcat(target_path, "/set_default_value"); | |||
| lo_send(oscData->target, target_path, "iif", plugin_id, param_id, value); | |||
| strcat(target_path, "/set_parameter_midi_channel"); | |||
| lo_send(oscData->target, target_path, "iii", pluginId, index, channel); | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_set_input_peak_value(int plugin_id, int port_id, double value) | |||
| void CarlaEngine::osc_send_set_parameter_value(const int32_t pluginId, const int32_t index, const double value) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_set_input_peak_value(%i, %i, %f)", plugin_id, port_id, value); | |||
| #if DEBUG | |||
| if (index < 0) | |||
| qDebug("CarlaEngine::osc_send_set_parameter_value(%i, %s, %g)", pluginId, InternalParametersIndex2str((InternalParametersIndex)index), value); | |||
| else | |||
| qDebug("CarlaEngine::osc_send_set_parameter_value(%i, %i, %g)", pluginId, index, value); | |||
| #endif | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | |||
| if (oscData->target) | |||
| { | |||
| char target_path[strlen(oscData->path)+22]; | |||
| char target_path[strlen(oscData->path)+21]; | |||
| strcpy(target_path, oscData->path); | |||
| strcat(target_path, "/set_input_peak_value"); | |||
| lo_send(oscData->target, target_path, "iif", plugin_id, port_id, value); | |||
| strcat(target_path, "/set_parameter_value"); | |||
| lo_send(oscData->target, target_path, "iid", pluginId, index, value); | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_set_output_peak_value(int plugin_id, int port_id, double value) | |||
| void CarlaEngine::osc_send_set_default_value(const int32_t pluginId, const int32_t index, const double value) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_set_output_peak_value(%i, %i, %f)", plugin_id, port_id, value); | |||
| qDebug("CarlaEngine::osc_send_set_default_value(%i, %i, %g)", pluginId, index, value); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | |||
| if (oscData->target) | |||
| { | |||
| char target_path[strlen(oscData->path)+23]; | |||
| char target_path[strlen(oscData->path)+19]; | |||
| strcpy(target_path, oscData->path); | |||
| strcat(target_path, "/set_output_peak_value"); | |||
| lo_send(oscData->target, target_path, "iif", plugin_id, port_id, value); | |||
| strcat(target_path, "/set_default_value"); | |||
| lo_send(oscData->target, target_path, "iid", pluginId, index, value); | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_set_program(int plugin_id, int program_id) | |||
| void CarlaEngine::osc_send_set_program(const int32_t pluginId, const int32_t index) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_set_program(%i, %i)", plugin_id, program_id); | |||
| qDebug("CarlaEngine::osc_send_set_program(%i, %i)", pluginId, index); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | |||
| if (oscData->target) | |||
| { | |||
| char target_path[strlen(oscData->path)+13]; | |||
| strcpy(target_path, oscData->path); | |||
| strcat(target_path, "/set_program"); | |||
| lo_send(oscData->target, target_path, "ii", plugin_id, program_id); | |||
| lo_send(oscData->target, target_path, "ii", pluginId, index); | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_set_program_count(int plugin_id, int program_count) | |||
| void CarlaEngine::osc_send_set_program_count(const int32_t pluginId, const int32_t count) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_set_program_count(%i, %i)", plugin_id, program_count); | |||
| qDebug("CarlaEngine::osc_send_set_program_count(%i, %i)", pluginId, count); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | |||
| if (oscData->target) | |||
| { | |||
| char target_path[strlen(oscData->path)+19]; | |||
| strcpy(target_path, oscData->path); | |||
| strcat(target_path, "/set_program_count"); | |||
| lo_send(oscData->target, target_path, "ii", plugin_id, program_count); | |||
| lo_send(oscData->target, target_path, "ii", pluginId, count); | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_set_program_name(int plugin_id, int program_id, const char* program_name) | |||
| void CarlaEngine::osc_send_set_program_name(const int32_t plugin_id, const int32_t program_id, const char* const program_name) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_set_program_name(%i, %i, %s)", plugin_id, program_id, program_name); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | |||
| if (oscData->target) | |||
| { | |||
| @@ -1052,10 +1053,12 @@ void CarlaEngine::osc_send_set_program_name(int plugin_id, int program_id, const | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_set_midi_program(int plugin_id, int midi_program_id) | |||
| void CarlaEngine::osc_send_set_midi_program(const int32_t plugin_id, const int32_t midi_program_id) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_set_midi_program(%i, %i)", plugin_id, midi_program_id); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | |||
| if (oscData->target) | |||
| { | |||
| @@ -1066,10 +1069,12 @@ void CarlaEngine::osc_send_set_midi_program(int plugin_id, int midi_program_id) | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_set_midi_program_count(int plugin_id, int midi_program_count) | |||
| void CarlaEngine::osc_send_set_midi_program_count(const int32_t plugin_id, const int32_t count) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_set_midi_program_count(%i, %i)", plugin_id, midi_program_count); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | |||
| if (oscData->target) | |||
| { | |||
| @@ -1080,10 +1085,12 @@ void CarlaEngine::osc_send_set_midi_program_count(int plugin_id, int midi_progra | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_set_midi_program_data(int plugin_id, int midi_program_id, int bank_id, int program_id, const char* midi_program_name) | |||
| void CarlaEngine::osc_send_set_midi_program_data(const int32_t plugin_id, const int32_t midi_program_id, const int32_t bank_id, const int32_t program_id, const char* const midi_program_name) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_set_midi_program_data(%i, %i, %i, %i, %s)", plugin_id, midi_program_id, bank_id, program_id, midi_program_name); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | |||
| if (oscData->target) | |||
| { | |||
| @@ -1094,10 +1101,44 @@ void CarlaEngine::osc_send_set_midi_program_data(int plugin_id, int midi_program | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_note_on(int plugin_id, int channel, int note, int velo) | |||
| void CarlaEngine::osc_send_set_input_peak_value(const int32_t plugin_id, const int32_t port_id, const double value) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_set_input_peak_value(%i, %i, %f)", plugin_id, port_id, value); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | |||
| if (oscData->target) | |||
| { | |||
| char target_path[strlen(oscData->path)+22]; | |||
| strcpy(target_path, oscData->path); | |||
| strcat(target_path, "/set_input_peak_value"); | |||
| lo_send(oscData->target, target_path, "iid", plugin_id, port_id, value); | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_set_output_peak_value(const int32_t plugin_id, const int32_t port_id, const double value) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_set_output_peak_value(%i, %i, %f)", plugin_id, port_id, value); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | |||
| if (oscData->target) | |||
| { | |||
| char target_path[strlen(oscData->path)+23]; | |||
| strcpy(target_path, oscData->path); | |||
| strcat(target_path, "/set_output_peak_value"); | |||
| lo_send(oscData->target, target_path, "iid", plugin_id, port_id, value); | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_note_on(const int32_t plugin_id, const int32_t channel, const int32_t note, const int32_t velo) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_note_on(%i, %i, %i, %i)", plugin_id, channel, note, velo); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | |||
| if (oscData->target) | |||
| { | |||
| @@ -1108,10 +1149,12 @@ void CarlaEngine::osc_send_note_on(int plugin_id, int channel, int note, int vel | |||
| } | |||
| } | |||
| void CarlaEngine::osc_send_note_off(int plugin_id, int channel, int note) | |||
| void CarlaEngine::osc_send_note_off(const int32_t plugin_id, const int32_t channel, const int32_t note) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_note_off(%i, %i, %i)", plugin_id, channel, note); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < MAX_PLUGINS); | |||
| if (oscData->target) | |||
| { | |||
| @@ -1126,6 +1169,7 @@ void CarlaEngine::osc_send_exit() | |||
| { | |||
| qDebug("CarlaEngine::osc_send_exit()"); | |||
| const CarlaOscData* const oscData = m_osc.getControllerData(); | |||
| Q_ASSERT(oscData); | |||
| if (oscData->target) | |||
| { | |||
| @@ -313,26 +313,30 @@ public: | |||
| return m_osc.getServerPath(); | |||
| } | |||
| void osc_send_add_plugin(int plugin_id, const char* plugin_name); | |||
| void osc_send_remove_plugin(int plugin_id); | |||
| void osc_send_set_plugin_data(int plugin_id, int type, int category, int hints, const char* real_name, const char* label, const char* maker, const char* copyright, long unique_id); | |||
| void osc_send_set_plugin_ports(int plugin_id, int ains, int aouts, int mins, int mouts, int cins, int couts, int ctotals); | |||
| void osc_send_set_parameter_value(int plugin_id, int param_id, double value); | |||
| void osc_send_set_parameter_data(int plugin_id, int param_id, int ptype, int hints, const char* name, const char* label, double current); | |||
| void osc_send_set_parameter_ranges(int plugin_id, int param_id, double x_min, double x_max, double x_def, double x_step, double x_step_small, double x_step_large); | |||
| void osc_send_set_parameter_midi_channel(int plugin_id, int parameter_id, int midi_channel); | |||
| void osc_send_set_parameter_midi_cc(int plugin_id, int parameter_id, int midi_cc); | |||
| void osc_send_set_default_value(int plugin_id, int param_id, double value); | |||
| void osc_send_set_program(int plugin_id, int program_id); | |||
| void osc_send_set_program_count(int plugin_id, int program_count); | |||
| void osc_send_set_program_name(int plugin_id, int program_id, const char* program_name); | |||
| void osc_send_set_midi_program(int plugin_id, int midi_program_id); | |||
| void osc_send_set_midi_program_count(int plugin_id, int midi_program_count); | |||
| void osc_send_set_midi_program_data(int plugin_id, int midi_program_id, int bank_id, int program_id, const char* midi_program_name); | |||
| void osc_send_set_input_peak_value(int plugin_id, int port_id, double value); | |||
| void osc_send_set_output_peak_value(int plugin_id, int port_id, double value); | |||
| void osc_send_note_on(int plugin_id, int channel, int note, int velo); | |||
| void osc_send_note_off(int plugin_id, int channel, int note); | |||
| void osc_send_add_plugin(const int32_t pluginId, const char* const pluginName); | |||
| void osc_send_remove_plugin(const int32_t pluginId); | |||
| void osc_send_set_plugin_data(const int32_t pluginId, const int32_t type, const int32_t category, const int32_t hints, | |||
| const char* const realName, const char* const label, const char* const maker, const char* const copyright, const int64_t uniqueId); | |||
| void osc_send_set_plugin_ports(const int32_t pluginId, const int32_t audioIns, const int32_t audioOuts, const int32_t midiIns, const int32_t midiOuts, | |||
| const int32_t cIns, const int32_t cOuts, const int32_t cTotals); | |||
| void osc_send_set_parameter_data(const int32_t pluginId, const int32_t index, const int32_t type, const int32_t hints, | |||
| const char* const name, const char* const label, const double current); | |||
| void osc_send_set_parameter_ranges(const int32_t pluginId, const int32_t index, const double min, const double max, const double def, | |||
| const double step, const double stepSmall, const double stepLarge); | |||
| void osc_send_set_parameter_midi_cc(const int32_t pluginId, const int32_t index, const int32_t cc); | |||
| void osc_send_set_parameter_midi_channel(const int32_t pluginId, const int32_t index, const int32_t channel); | |||
| void osc_send_set_parameter_value(const int32_t pluginId, const int32_t index, const double value); | |||
| void osc_send_set_default_value(const int32_t pluginId, const int32_t index, const double value); | |||
| void osc_send_set_program(const int32_t pluginId, const int32_t index); | |||
| void osc_send_set_program_count(int32_t pluginId, int program_count); | |||
| void osc_send_set_program_name(int32_t pluginId, int program_id, const char* program_name); | |||
| void osc_send_set_midi_program(int32_t pluginId, int midi_program_id); | |||
| void osc_send_set_midi_program_count(int32_t pluginId, int midi_program_count); | |||
| void osc_send_set_midi_program_data(int32_t pluginId, int midi_program_id, int bank_id, int program_id, const char* midi_program_name); | |||
| void osc_send_set_input_peak_value(int32_t pluginId, int port_id, double value); | |||
| void osc_send_set_output_peak_value(int32_t pluginId, int port_id, double value); | |||
| void osc_send_note_on(int32_t pluginId, int channel, int note, int velo); | |||
| void osc_send_note_off(int32_t pluginId, int channel, int note); | |||
| void osc_send_exit(); | |||
| #ifndef BUILD_BRIDGE | |||
| @@ -20,7 +20,7 @@ | |||
| #include "carla_includes.h" | |||
| #include <cassert> | |||
| #include <cstdint> | |||
| #include <cstring> | |||
| #include <lo/lo.h> | |||
| @@ -33,7 +33,7 @@ struct CarlaOscData { | |||
| static inline | |||
| void osc_clear_data(CarlaOscData* const oscData) | |||
| { | |||
| qDebug("osc_clear_data(%p, path:\"%s\")", oscData, oscData->path); | |||
| qDebug("osc_clear_data(path:\"%s\")", oscData->path); | |||
| if (oscData->path) | |||
| free((void*)oscData->path); | |||
| @@ -44,7 +44,7 @@ void osc_clear_data(CarlaOscData* const oscData) | |||
| if (oscData->target) | |||
| lo_address_free(oscData->target); | |||
| oscData->path = nullptr; | |||
| oscData->path = nullptr; | |||
| oscData->source = nullptr; | |||
| oscData->target = nullptr; | |||
| } | |||
| @@ -53,8 +53,8 @@ static inline | |||
| void osc_send_configure(const CarlaOscData* const oscData, const char* const key, const char* const value) | |||
| { | |||
| qDebug("osc_send_configure(path:\"%s\", \"%s\", \"%s\")", oscData->path, key, value); | |||
| assert(key); | |||
| assert(value); | |||
| Q_ASSERT(key); | |||
| Q_ASSERT(value); | |||
| if (oscData->target) | |||
| { | |||
| @@ -66,7 +66,7 @@ void osc_send_configure(const CarlaOscData* const oscData, const char* const key | |||
| } | |||
| static inline | |||
| void osc_send_control(const CarlaOscData* const oscData, const int index, const float value) | |||
| void osc_send_control(const CarlaOscData* const oscData, const int32_t index, const float value) | |||
| { | |||
| qDebug("osc_send_control(path:\"%s\", %i, %f)", oscData->path, index, value); | |||
| @@ -80,10 +80,10 @@ void osc_send_control(const CarlaOscData* const oscData, const int index, const | |||
| } | |||
| static inline | |||
| void osc_send_program(const CarlaOscData* const oscData, const int index) | |||
| void osc_send_program(const CarlaOscData* const oscData, const int32_t index) | |||
| { | |||
| qDebug("osc_send_program(path:\"%s\", %i)", oscData->path, index); | |||
| assert(index >= 0); | |||
| Q_ASSERT(index >= 0); | |||
| if (oscData->target) | |||
| { | |||
| @@ -95,11 +95,11 @@ void osc_send_program(const CarlaOscData* const oscData, const int index) | |||
| } | |||
| static inline | |||
| void osc_send_program(const CarlaOscData* const oscData, const int bank, const int program) | |||
| void osc_send_program(const CarlaOscData* const oscData, const int32_t bank, const int32_t program) | |||
| { | |||
| qDebug("osc_send_program(path:\"%s\", %i, %i)", oscData->path, bank, program); | |||
| assert(program >= 0); | |||
| assert(bank >= 0); | |||
| Q_ASSERT(program >= 0); | |||
| Q_ASSERT(bank >= 0); | |||
| if (oscData->target) | |||
| { | |||
| @@ -111,10 +111,10 @@ void osc_send_program(const CarlaOscData* const oscData, const int bank, const i | |||
| } | |||
| static inline | |||
| void osc_send_midi_program(const CarlaOscData* const oscData, const int index) | |||
| void osc_send_midi_program(const CarlaOscData* const oscData, const int32_t index) | |||
| { | |||
| qDebug("osc_send_midi_program(path:\"%s\", %i)", oscData->path, index); | |||
| assert(index >= 0); | |||
| Q_ASSERT(index >= 0); | |||
| if (oscData->target) | |||
| { | |||
| @@ -128,9 +128,9 @@ void osc_send_midi_program(const CarlaOscData* const oscData, const int index) | |||
| static inline | |||
| void osc_send_midi(const CarlaOscData* const oscData, const uint8_t buf[4]) | |||
| { | |||
| qDebug("osc_send_midi(path:\"%s\", 0x%X, %03i, %03i)", oscData->path, buf[1], buf[2], buf[3]); | |||
| assert(buf[0] == 0); | |||
| assert(buf[1] != 0); | |||
| qDebug("osc_send_midi(path:\"%s\", 0x%X, %03u, %03u)", oscData->path, buf[1], buf[2], buf[3]); | |||
| Q_ASSERT(buf[0] == 0); | |||
| Q_ASSERT(buf[1] != 0); | |||
| if (oscData->target) | |||
| { | |||
| @@ -145,7 +145,7 @@ void osc_send_midi(const CarlaOscData* const oscData, const uint8_t buf[4]) | |||
| static inline | |||
| void osc_send_update(const CarlaOscData* const oscData, const char* const url) | |||
| { | |||
| qDebug("osc_send_update(path:\"%s\", %s)", oscData->path, url); | |||
| qDebug("osc_send_update(path:\"%s\", \"%s\")", oscData->path, url); | |||
| if (oscData->target) | |||
| { | |||
| @@ -232,9 +232,9 @@ static inline | |||
| void osc_send_lv2_event_transfer(const CarlaOscData* const oscData, const char* const type, const char* const key, const char* const value) | |||
| { | |||
| qDebug("osc_send_lv2_event_transfer(path:\"%s\", \"%s\", \"%s\", \"%s\")", oscData->path, type, key, value); | |||
| assert(type); | |||
| assert(key); | |||
| assert(value); | |||
| Q_ASSERT(type); | |||
| Q_ASSERT(key); | |||
| Q_ASSERT(value); | |||
| if (oscData->target) | |||
| { | |||
| @@ -1,6 +1,6 @@ | |||
| /* | |||
| * Common JACK code | |||
| * Copyright (C) 2011-2012 Filipe Coelho <falktx@gmail.com> | |||
| * Copyright (C) 2012 Filipe Coelho <falktx@gmail.com> | |||
| * | |||
| * This program is free software; you can redistribute it and/or modify | |||
| * it under the terms of the GNU General Public License as published by | |||
| @@ -29,7 +29,7 @@ cadence_jackmeter: $(OBJS) | |||
| $(CXX) $^ $(LINK_FLAGS) -o $@ && strip $@ | |||
| cadence_jackmeter.exe: $(OBJS) | |||
| $(CXX) $^ -static $(LINK_FLAGS) -o $@ && strip $@ | |||
| $(CXX) $^ -static -mwindows $(LINK_FLAGS) -o $@ && strip $@ | |||
| # -------------------------------------------------------------- | |||
| @@ -37,4 +37,4 @@ cadence_jackmeter.exe: $(OBJS) | |||
| $(CXX) -c $< $(BUILD_FLAGS) -o $@ | |||
| clean: | |||
| rm -f $(OBJS) cadence_jackmeter cadence_jackmeter.exe | |||
| rm -f $(OBJS) cadence_jackmeter* | |||
| @@ -137,6 +137,7 @@ public: | |||
| { | |||
| setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint); | |||
| setWindowTitle("M"); | |||
| setChannels(2); | |||
| setOrientation(VERTICAL); | |||
| setSmoothRelease(1); | |||
| @@ -25,6 +25,7 @@ class PixmapDial(QDial): | |||
| HORIZONTAL = 0 | |||
| VERTICAL = 1 | |||
| CUSTOM_PAINT_NULL = 0 | |||
| CUSTOM_PAINT_CARLA_WET = 1 | |||
| CUSTOM_PAINT_CARLA_VOL = 2 | |||
| CUSTOM_PAINT_CARLA_L = 3 | |||
| @@ -38,7 +39,7 @@ class PixmapDial(QDial): | |||
| self.m_pixmap = QPixmap(":/bitmaps/dial_01d.png") | |||
| self.m_pixmap_n_str = "01" | |||
| self.m_custom_paint = 0 | |||
| self.m_custom_paint = CUSTOM_PAINT_NULL | |||
| self.m_hovered = False | |||
| self.m_hover_step = self.HOVER_MIN | |||
| @@ -124,7 +125,7 @@ class PixmapDial(QDial): | |||
| return QSize(self.p_size, self.p_size) | |||
| def updateSizes(self): | |||
| self.p_width = self.m_pixmap.width() | |||
| self.p_width = self.m_pixmap.width() | |||
| self.p_height = self.m_pixmap.height() | |||
| if self.p_width < 1: | |||
| @@ -175,11 +176,9 @@ class PixmapDial(QDial): | |||
| return | |||
| target = QRectF(0.0, 0.0, self.p_size, self.p_size) | |||
| value = (current / divider) | |||
| value = current / divider | |||
| ## Regular knobs | |||
| #else: | |||
| per = int((self.p_count - 1) * (current / divider)) | |||
| per = int((self.p_count - 1) * value) | |||
| if self.m_orientation == self.HORIZONTAL: | |||
| xpos = self.p_size * per | |||
| @@ -132,7 +132,7 @@ class PixmapKeyboard(QWidget): | |||
| elif color == self.COLOR_ORANGE: | |||
| self.m_colorStr = "orange" | |||
| else: | |||
| qCritical("PixmapKeyboard::setMode(%i, %i) - Invalid keyboard color" % (mode, color)) | |||
| qCritical("PixmapKeyboard::setMode(%i, %i) - invalid color" % (mode, color)) | |||
| return self.setMode(mode) | |||
| if mode == self.HORIZONTAL: | |||
| @@ -148,7 +148,7 @@ class PixmapKeyboard(QWidget): | |||
| self.p_width = self.m_pixmap.width() / 2 | |||
| self.p_height = self.m_pixmap.height() | |||
| else: | |||
| qCritical("PixmapKeyboard::setMode(%i, %i) - Invalid keyboard mode" % (mode, color)) | |||
| qCritical("PixmapKeyboard::setMode(%i, %i) - invalid mode" % (mode, color)) | |||
| return self.setMode(self.HORIZONTAL) | |||
| self.setOctaves(self.m_octaves) | |||
| @@ -403,10 +403,11 @@ class PluginParameter(QWidget, ui_carla_parameter.Ui_PluginParameter): | |||
| pType = pInfo['type'] | |||
| pHints = pInfo['hints'] | |||
| self.m_midiCC = -1 | |||
| self.m_midiCC = -1 | |||
| self.m_midiChannel = 1 | |||
| self.m_pluginId = pluginId | |||
| self.m_pluginId = pluginId | |||
| self.m_parameterId = pInfo['index'] | |||
| self.m_tabIndex = tabIndex | |||
| self.add_MIDI_CCs_to_ComboBox() | |||
| @@ -20,7 +20,6 @@ | |||
| from PyQt4.QtCore import pyqtSlot, Qt, QPointF, QRectF, QSettings, QTimer | |||
| from PyQt4.QtGui import QApplication, QColor, QGraphicsItem, QGraphicsScene, QMainWindow, QPainter, QPen | |||
| from queue import Queue, Empty as QuequeEmpty | |||
| #from Queue import Queue, Empty as QuequeEmpty | |||
| # Imports (Custom) | |||
| import ui_xycontroller | |||
| @@ -174,28 +173,30 @@ class XYGraphicsScene(QGraphicsScene): | |||
| self.p_size.setRect(-(size.width() / 2), -(size.height() / 2), size.width(), size.height()) | |||
| def updateSmooth(self): | |||
| if self.m_smooth: | |||
| if self.m_cursor.x() != self.m_smooth_x or self.m_cursor.y() != self.m_smooth_y: | |||
| if abs(self.m_cursor.x() - self.m_smooth_x) <= 0.001: | |||
| self.m_smooth_x = self.m_cursor.x() | |||
| return | |||
| elif abs(self.m_cursor.y() - self.m_smooth_y) <= 0.001: | |||
| self.m_smooth_y = self.m_cursor.y() | |||
| return | |||
| if not self.m_smooth: | |||
| return | |||
| if self.m_cursor.x() != self.m_smooth_x or self.m_cursor.y() != self.m_smooth_y: | |||
| if abs(self.m_cursor.x() - self.m_smooth_x) <= 0.001: | |||
| self.m_smooth_x = self.m_cursor.x() | |||
| return | |||
| elif abs(self.m_cursor.y() - self.m_smooth_y) <= 0.001: | |||
| self.m_smooth_y = self.m_cursor.y() | |||
| return | |||
| new_x = (self.m_smooth_x + self.m_cursor.x() * 3) / 4 | |||
| new_y = (self.m_smooth_y + self.m_cursor.y() * 3) / 4 | |||
| pos = QPointF(new_x, new_y) | |||
| new_x = (self.m_smooth_x + self.m_cursor.x() * 3) / 4 | |||
| new_y = (self.m_smooth_y + self.m_cursor.y() * 3) / 4 | |||
| pos = QPointF(new_x, new_y) | |||
| self.m_cursor.setPos(pos) | |||
| self.m_lineH.setY(pos.y()) | |||
| self.m_lineV.setX(pos.x()) | |||
| self.m_cursor.setPos(pos) | |||
| self.m_lineH.setY(pos.y()) | |||
| self.m_lineV.setX(pos.x()) | |||
| xp = pos.x() / (self.p_size.x() + self.p_size.width()) | |||
| yp = pos.y() / (self.p_size.y() + self.p_size.height()) | |||
| xp = pos.x() / (self.p_size.x() + self.p_size.width()) | |||
| yp = pos.y() / (self.p_size.y() + self.p_size.height()) | |||
| self.sendMIDI(xp, yp) | |||
| self.emit(SIGNAL("cursorMoved(double, double)"), xp, yp) | |||
| self.sendMIDI(xp, yp) | |||
| self.emit(SIGNAL("cursorMoved(double, double)"), xp, yp) | |||
| def keyPressEvent(self, event): | |||
| event.accept() | |||
| @@ -549,16 +550,18 @@ def jack_process_callback(nframes, arg): | |||
| event_count = jacklib.midi_get_event_count(midi_in_buffer) | |||
| for i in range(event_count): | |||
| if jacklib.midi_event_get(jacklib.pointer(static_event), midi_in_buffer, i) == 0: | |||
| if static_event.size == 1: | |||
| jack_midi_in_data.put_nowait((static_event.buffer[0], 0, 0)) | |||
| elif static_event.size == 2: | |||
| jack_midi_in_data.put_nowait((static_event.buffer[0], static_event.buffer[1], 0)) | |||
| elif static_event.size >= 3: | |||
| jack_midi_in_data.put_nowait((static_event.buffer[0], static_event.buffer[1], static_event.buffer[2])) | |||
| if jack_midi_in_data.full(): | |||
| break | |||
| if jacklib.midi_event_get(jacklib.pointer(static_event), midi_in_buffer, i) != 0: | |||
| break | |||
| if static_event.size == 1: | |||
| jack_midi_in_data.put_nowait((static_event.buffer[0], 0, 0)) | |||
| elif static_event.size == 2: | |||
| jack_midi_in_data.put_nowait((static_event.buffer[0], static_event.buffer[1], 0)) | |||
| elif static_event.size >= 3: | |||
| jack_midi_in_data.put_nowait((static_event.buffer[0], static_event.buffer[1], static_event.buffer[2])) | |||
| if jack_midi_in_data.full(): | |||
| break | |||
| # MIDI Out | |||
| midi_out_buffer = jacklib.port_get_buffer(jack_midi_out_port, nframes) | |||
| @@ -602,7 +605,7 @@ if __name__ == '__main__': | |||
| app = QApplication(sys.argv) | |||
| app.setApplicationName("XY-Controller") | |||
| app.setApplicationVersion(VERSION) | |||
| app.setOrganizationName("falkTX") | |||
| app.setOrganizationName("Cadence") | |||
| #app.setWindowIcon(QIcon(":/48x48/xy-controller.png")) | |||
| # Start jack | |||
| @@ -612,11 +615,11 @@ if __name__ == '__main__': | |||
| if not jack_client: | |||
| errorString = get_jack_status_error_string(jack_status) | |||
| QMessageBox.critical(None, app.translate("XYControllerW", "Error"), app.translate("XYControllerW", | |||
| "Could not connect to JACK, possible errors:\n" | |||
| "Could not connect to JACK, possible reasons:\n" | |||
| "%s" % errorString)) | |||
| sys.exit(1) | |||
| jack_midi_in_port = jacklib.port_register(jack_client, "midi_in", jacklib.JACK_DEFAULT_MIDI_TYPE, jacklib.JackPortIsInput, 0) | |||
| jack_midi_in_port = jacklib.port_register(jack_client, "midi_in", jacklib.JACK_DEFAULT_MIDI_TYPE, jacklib.JackPortIsInput, 0) | |||
| jack_midi_out_port = jacklib.port_register(jack_client, "midi_out", jacklib.JACK_DEFAULT_MIDI_TYPE, jacklib.JackPortIsOutput, 0) | |||
| jacklib.set_session_callback(jack_client, jack_session_callback, None) | |||
| jacklib.set_process_callback(jack_client, jack_process_callback, None) | |||