Browse Source

Misc changes

tags/1.9.4
falkTX 13 years ago
parent
commit
645e0f5012
6 changed files with 152 additions and 31 deletions
  1. +1
    -1
      resources/ui/carla_about.ui
  2. +7
    -0
      source/backend/CarlaEngine.hpp
  3. +5
    -0
      source/backend/CarlaStandalone.hpp
  4. +10
    -7
      source/backend/engine/CarlaEngine.cpp
  5. +105
    -23
      source/backend/standalone/CarlaStandalone.cpp
  6. +24
    -0
      source/carla_backend.py

+ 1
- 1
resources/ui/carla_about.ui View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>510</width>
<height>433</height>
<height>576</height>
</rect>
</property>
<property name="windowTitle">


+ 7
- 0
source/backend/CarlaEngine.hpp View File

@@ -743,6 +743,13 @@ public:
// -------------------------------------------------------------------
// Project management

/*!
* Load \a filename of any type.\n
* This will try to load a generic file as a plugin,
* either by direct handling (GIG, SF2 and SFZ) or by using an internal plugin (Audio and MIDI)
*/
bool loadFilename(const char* const filename);

/*!
* Load \a filename session.
* \note Already loaded plugins are not removed; call removeAllPlugins() first if needed.


+ 5
- 0
source/backend/CarlaStandalone.hpp View File

@@ -185,6 +185,7 @@ CARLA_EXPORT const char* carla_get_supported_file_types();

CARLA_EXPORT unsigned int carla_get_engine_driver_count();
CARLA_EXPORT const char* carla_get_engine_driver_name(unsigned int index);
CARLA_EXPORT const void* carla_get_engine_driver_options(unsigned int index); // TODO

CARLA_EXPORT unsigned int carla_get_internal_plugin_count();
CARLA_EXPORT const CarlaNativePluginInfo* carla_get_internal_plugin_info(unsigned int internalPluginId);
@@ -197,6 +198,7 @@ CARLA_EXPORT void carla_set_engine_about_to_close();
CARLA_EXPORT void carla_set_engine_callback(CarlaCallbackFunc func, void* ptr);
CARLA_EXPORT void carla_set_engine_option(CarlaOptionsType option, int value, const char* valueStr);

CARLA_EXPORT bool carla_load_filename(const char* filename);
CARLA_EXPORT bool carla_load_project(const char* filename);
CARLA_EXPORT bool carla_save_project(const char* filename);

@@ -214,6 +216,9 @@ CARLA_EXPORT bool carla_add_plugin(CarlaBinaryType btype, CarlaPluginType ptype,
CARLA_EXPORT bool carla_remove_plugin(unsigned int pluginId);
CARLA_EXPORT void carla_remove_all_plugins();

CARLA_EXPORT bool carla_clone_plugin(unsigned int pluginId);
CARLA_EXPORT bool carla_switch_plugins(unsigned int pluginIdA, unsigned int pluginIdB);

CARLA_EXPORT bool carla_load_plugin_state(unsigned int pluginId, const char* filename);
CARLA_EXPORT bool carla_save_plugin_state(unsigned int pluginId, const char* filename);



+ 10
- 7
source/backend/engine/CarlaEngine.cpp View File

@@ -983,15 +983,18 @@ const char* CarlaEngine::getNewUniquePluginName(const char* const name)
return (const char*)sname;
}

#if 0
void CarlaEngine::__bridgePluginRegister(const unsigned short id, CarlaPlugin* const plugin)
// -----------------------------------------------------------------------
// Project management

bool CarlaEngine::loadFilename(const char* const filename)
{
data->carlaPlugins[id] = plugin;
}
#endif
carla_debug("CarlaEngine::loadFilename(\"%s\")", filename);
CARLA_ASSERT(filename != nullptr);

// -----------------------------------------------------------------------
// Information (base)
// TODO
setLastError("Not implemented yet");
return false;
}

bool CarlaEngine::loadProject(const char* const filename)
{


+ 105
- 23
source/backend/standalone/CarlaStandalone.cpp View File

@@ -106,54 +106,81 @@ const char* carla_get_extended_license_text()

if (retText.isEmpty())
{
retText = "<p>This current Carla build is using the following features and 3rd-party code:</p>";
retText += "<ul>";
CarlaString text1, text2;

text1 += "<p>This current Carla build is using the following features and 3rd-party code:</p>";
text1 += "<ul>";

// Plugin formats
#ifdef WANT_LADSPA
retText += "<li>LADSPA plugin support, http://www.ladspa.org/</li>";
text1 += "<li>LADSPA plugin support, http://www.ladspa.org/</li>";
#endif
#ifdef WANT_DSSI
retText += "<li>DSSI plugin support, http://dssi.sourceforge.net/</li>";
text1 += "<li>DSSI plugin support, http://dssi.sourceforge.net/</li>";
#endif
#ifdef WANT_LV2
retText += "<li>LV2 plugin support, http://lv2plug.in/</li>";
text1 += "<li>LV2 plugin support, http://lv2plug.in/</li>";
#endif
#ifdef WANT_VST
# ifdef VESTIGE_HEADER
retText += "<li>VST plugin support, using VeSTige header by Javier Serrano Polo</li>";
text1 += "<li>VST plugin support, using VeSTige header by Javier Serrano Polo</li>";
# else
retText += "<li>VST plugin support, using official VST SDK 2.4 (trademark of Steinberg Media Technologies GmbH)</li>";
text1 += "<li>VST plugin support, using official VST SDK 2.4 (trademark of Steinberg Media Technologies GmbH)</li>";
# endif
#endif

// Sample kit libraries
#ifdef WANT_FLUIDSYNTH
text1 += "<li>FluidSynth library for SF2 support, http://www.fluidsynth.org/</li>";
#endif
#ifdef WANT_LINUXSAMPLER
text1 += "<li>LinuxSampler library for GIG and SFZ support*, http://www.linuxsampler.org/</li>";
#endif

// Internal plugins
#ifdef WANT_OPENGL
text1 += "<li>DISTRHO Mini-Series plugin code, based on LOSER-dev suite by Michael Gruhn</li>";
#endif
text1 += "<li>NekoFilter plugin code, based on lv2fil by Nedko Arnaudov and Fons Adriaensen</li>";

#ifdef WANT_AUDIOFILE
// TODO
//retText += "<li>ZynAddSubFX plugin code, http://zynaddsubfx.sf.net/</li>";
text1 += "<li>AudioDecoder library for Audio file support, by Robin Gareus</li>";
#endif
#ifdef WANT_MIDIFILE
// TODO
//retText += "<li>ZynAddSubFX plugin code, http://zynaddsubfx.sf.net/</li>";
text1 += "<li>LibSMF library for MIDI file support, http://libsmf.sourceforge.net/</li>";
#endif
#ifdef WANT_ZYNADDSUBFX
retText += "<li>ZynAddSubFX plugin code, http://zynaddsubfx.sf.net/</li>";
#endif
#ifdef WANT_FLUIDSYNTH
retText += "<li>FluidSynth library for SF2 support, http://www.fluidsynth.org/</li>";
#endif
#ifdef WANT_LINUXSAMPLER
retText += "<li>LinuxSampler library for GIG and SFZ support*, http://www.linuxsampler.org/</li>";
text1 += "<li>ZynAddSubFX plugin code, http://zynaddsubfx.sf.net/</li>";
# ifdef WANT_ZYNADDSUBFX_UI
text1 += "<li>ZynAddSubFX UI using NTK, http://non.tuxfamily.org/wiki/NTK</li>";
# endif
#endif
retText += "<li>liblo library for OSC support, http://liblo.sourceforge.net/</li>";

// misc libs
text1 += "<li>liblo library for OSC support, http://liblo.sourceforge.net/</li>";
#ifdef WANT_LV2
retText += "<li>serd, sord, sratom and lilv libraries for LV2 discovery, http://drobilla.net/software/lilv/</li>";
text1 += "<li>serd, sord, sratom and lilv libraries for LV2 discovery, http://drobilla.net/software/lilv/</li>";
#endif
#ifdef WANT_RTAUDIO
retText += "<li>RtAudio and RtMidi libraries for extra Audio and MIDI support, http://www.music.mcgill.ca/~gary/rtaudio/</li>";
text1 += "<li>RtAudio+RtMidi libraries for extra Audio and MIDI support, http://www.music.mcgill.ca/~gary/rtaudio/</li>";
#endif
retText += "</ul>";
text1 += "</ul>";

// code snippets
text2 = "<p>Additionally, Carla uses code snippets from the following projects:</p>";
text2 += "<ul>";
text2 += "<li>Pointer and data leak utils from JUCE, http://www.rawmaterialsoftware.com/juce.php</li>";
text2 += "<li>Shared memory utils from dssi-vst, http://www.breakfastquay.com/dssi-vst/</li>";
text2 += "<li>Real-time memory pool, by Nedko Arnaudov</li>";
text2 += "</ul>";

// LinuxSampler GPL exception
#ifdef WANT_LINUXSAMPLER
retText += "<p>(*) Using LinuxSampler code in commercial hardware or software products is not allowed without prior written authorization by the authors.</p>";
text2 += "<p>(*) Using LinuxSampler code in commercial hardware or software products is not allowed without prior written authorization by the authors.</p>";
#endif

retText += text1;
retText += text2;
}

return retText;
@@ -204,13 +231,24 @@ const char* carla_get_engine_driver_name(unsigned int index)
return CarlaEngine::getDriverName(index);
}

const void* carla_get_engine_driver_options(unsigned int index)
{
carla_debug("carla_get_engine_driver_options(%i)", index);

return nullptr;
}

// -------------------------------------------------------------------------------------------------------------------

unsigned int carla_get_internal_plugin_count()
{
carla_debug("carla_get_internal_plugin_count()");

#ifdef WANT_NATIVE
return static_cast<unsigned int>(CarlaPlugin::getNativePluginCount());
#else
return 0;
#endif
}

const CarlaNativePluginInfo* carla_get_internal_plugin_info(unsigned int internalPluginId)
@@ -219,6 +257,7 @@ const CarlaNativePluginInfo* carla_get_internal_plugin_info(unsigned int interna

static CarlaNativePluginInfo info;

#ifdef WANT_NATIVE
const PluginDescriptor* const nativePlugin = CarlaPlugin::getNativePluginDescriptor(internalPluginId);

// as internal plugin, this must never fail
@@ -250,6 +289,7 @@ const CarlaNativePluginInfo* carla_get_internal_plugin_info(unsigned int interna
info.label = nativePlugin->label;
info.maker = nativePlugin->maker;
info.copyright = nativePlugin->copyright;
#endif

return &info;
}
@@ -517,6 +557,19 @@ void carla_set_engine_option(CarlaBackend::OptionsType option, int value, const

// -------------------------------------------------------------------------------------------------------------------

bool carla_load_filename(const char* filename)
{
carla_debug("carla_load_filename(\"%s\")", filename);
CARLA_ASSERT(standalone.engine != nullptr);
CARLA_ASSERT(filename != nullptr);

if (standalone.engine != nullptr)
return standalone.engine->loadFilename(filename);

standalone.lastError = "Engine is not started";
return false;
}

bool carla_load_project(const char* filename)
{
carla_debug("carla_load_project(\"%s\")", filename);
@@ -690,6 +743,35 @@ void carla_remove_all_plugins()
standalone.engine->removeAllPlugins();
}


// -------------------------------------------------------------------------------------------------------------------

bool carla_clone_plugin(unsigned int pluginId)
{
carla_debug("carla_clone_plugin(%i)", pluginId);
CARLA_ASSERT(standalone.engine != nullptr);

if (standalone.engine == nullptr)
return false;

// TODO
return false;
}

bool carla_switch_plugins(unsigned int pluginIdA, unsigned int pluginIdB)
{
carla_debug("carla_switch_plugins(%i, %i)", pluginIdA, pluginIdB);
CARLA_ASSERT(standalone.engine != nullptr);

if (standalone.engine == nullptr)
return false;

// TODO
return false;
}

// -------------------------------------------------------------------------------------------------------------------

bool carla_load_plugin_state(unsigned int pluginId, const char* filename)
{
carla_debug("carla_load_plugin_state(%i, \"%s\")", pluginId, filename);


+ 24
- 0
source/carla_backend.py View File

@@ -377,6 +377,9 @@ class Host(object):
self.lib.carla_get_engine_driver_name.argtypes = [c_uint]
self.lib.carla_get_engine_driver_name.restype = c_char_p

self.lib.carla_get_engine_driver_options.argtypes = [c_uint]
self.lib.carla_get_engine_driver_options.restype = c_void_p # TODO

self.lib.carla_get_internal_plugin_count.argtypes = None
self.lib.carla_get_internal_plugin_count.restype = c_uint

@@ -404,6 +407,9 @@ class Host(object):
self.lib.carla_set_engine_option.argtypes = [c_enum, c_int, c_char_p]
self.lib.carla_set_engine_option.restype = None

self.lib.carla_load_filename.argtypes = [c_char_p]
self.lib.carla_load_filename.restype = c_bool

self.lib.carla_load_project.argtypes = [c_char_p]
self.lib.carla_load_project.restype = c_bool

@@ -443,6 +449,12 @@ class Host(object):
self.lib.carla_remove_all_plugins.argtypes = None
self.lib.carla_remove_all_plugins.restype = None

self.lib.carla_clone_plugin.argtypes = [c_uint]
self.lib.carla_clone_plugin.restype = c_bool

self.lib.carla_switch_plugins.argtypes = [c_uint, c_uint]
self.lib.carla_switch_plugins.restype = c_bool

self.lib.carla_load_plugin_state.argtypes = [c_uint, c_char_p]
self.lib.carla_load_plugin_state.restype = c_bool

@@ -613,6 +625,9 @@ class Host(object):
def get_engine_driver_name(self, index):
return self.lib.carla_get_engine_driver_name(index)

def get_engine_driver_options(self, index):
return self.lib.carla_get_engine_driver_options(index)

def get_internal_plugin_count(self):
return self.lib.carla_get_internal_plugin_count()

@@ -641,6 +656,9 @@ class Host(object):
def set_engine_option(self, option, value, valueStr):
self.lib.carla_set_engine_option(option, value, valueStr.encode("utf-8"))

def load_filename(self, filename):
return self.lib.carla_load_filename(filename.encode("utf-8"))

def load_project(self, filename):
return self.lib.carla_load_project(filename.encode("utf-8"))

@@ -683,6 +701,12 @@ class Host(object):
def remove_all_plugins(self):
self.lib.carla_remove_all_plugins()

def clone_plugin(self, pluginId):
return self.lib.carla_clone_plugin(pluginId)

def switch_plugins(self, pluginIdA, pluginIdB):
return self.lib.carla_switch_plugins(pluginIdA, pluginIdB)

def load_plugin_state(self, pluginId, filename):
return self.lib.carla_load_plugin_state(pluginId, filename.encode("utf-8"))



Loading…
Cancel
Save