/* * JACK Backend code for Carla * Copyright (C) 2011-2012 Filipe Coelho * * 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 * the Free Software Foundation; either version 2 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * For a full copy of the GNU General Public License see the COPYING file */ #include "carla_shared.h" #include #include // Global variables (shared) const char* unique_names[MAX_PLUGINS] = { nullptr }; CarlaPlugin* CarlaPlugins[MAX_PLUGINS] = { nullptr }; volatile double ains_peak[MAX_PLUGINS*2] = { 0.0 }; volatile double aouts_peak[MAX_PLUGINS*2] = { 0.0 }; // Global options carla_options_t carla_options = { /* initiated */ false, #ifdef BUILD_BRIDGE /* global_jack_client */ false, /* use_dssi_chunks */ false, /* prefer_ui_bridges */ false, #else /* global_jack_client */ true, /* use_dssi_chunks */ false, /* prefer_ui_bridges */ true, #endif /* bridge_unix32 */ nullptr, /* bridge_unix64 */ nullptr, /* bridge_win32 */ nullptr, /* bridge_win64 */ nullptr }; CallbackFunc Callback = nullptr; const char* last_error = nullptr; QMutex carla_proc_lock_var; QMutex carla_midi_lock_var; const unsigned short max_client_name_size = 32 - 5; // 32 = jack1 max name; 5 = strlen(" (10)") // ------------------------------------------------------------------------------------------------------------------- // Exported symbols (API) void set_callback_function(CallbackFunc func) { qDebug("set_callback_function(%p)", func); Callback = func; } const char* get_last_error() { qDebug("get_last_error()"); return last_error; } // End of exported symbols (API) // ------------------------------------------------------------------------------------------------------------------- const char* bool2str(bool yesno) { if (yesno) return "true"; else return "false"; } const char* binarytype2str(BinaryType type) { switch (type) { case BINARY_UNIX32: return carla_options.bridge_unix32; case BINARY_UNIX64: return carla_options.bridge_unix64; case BINARY_WIN32: return carla_options.bridge_win32; case BINARY_WIN64: return carla_options.bridge_win64; default: return nullptr; } } const char* plugintype2str(PluginType type) { switch (type) { case PLUGIN_LADSPA: return "LADSPA"; case PLUGIN_DSSI: return "DSSI"; case PLUGIN_LV2: return "LV2"; case PLUGIN_VST: return "VST"; case PLUGIN_SF2: return "SF2"; default: return "Unknown"; } } // ------------------------------------------------------------------------------------------------------------------- short get_new_plugin_id() { for (unsigned short i=0; i