Browse Source

Send extra initial server info to carla-plugin; Fix about size

tags/1.9.5
falkTX 10 years ago
parent
commit
cf77580cad
6 changed files with 285 additions and 218 deletions
  1. +168
    -0
      source/backend/CarlaHostCommon.cpp
  2. +1
    -145
      source/backend/CarlaStandalone.cpp
  3. +19
    -0
      source/backend/engine/CarlaEngineNative.cpp
  4. +12
    -7
      source/carla_backend.py
  5. +73
    -66
      source/carla_widgets.py
  6. +12
    -0
      source/modules/native-plugins/resources/carla-plugin

+ 168
- 0
source/backend/CarlaHostCommon.cpp View File

@@ -0,0 +1,168 @@
/*
* Carla Plugin Host
* Copyright (C) 2011-2014 Filipe Coelho <falktx@falktx.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 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 doc/GPL.txt file.
*/

#include "CarlaHost.h"
#include "CarlaString.hpp"

#include "juce_audio_formats.h"

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

const char* carla_get_complete_license_text()
{
carla_debug("carla_get_complete_license_text()");

static CarlaString retText;

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

// Plugin formats
"<li>LADSPA plugin support</li>"
"<li>DSSI plugin support</li>"
"<li>LV2 plugin support</li>"
#ifdef VESTIGE_HEADER
"<li>VST plugin support using VeSTige header by Javier Serrano Polo</li>"
#else
"<li>VST plugin support using official VST SDK 2.4 [1]</li>"
#endif
#if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)
"<li>VST3 plugin support using official VST SDK 3.6 [1]</li>"
#endif
#ifdef CARLA_OS_MAC
"<li>AU plugin support</li>"
#endif

// Sample kit libraries
#ifdef HAVE_FLUIDSYNTH
"<li>FluidSynth library for SF2 support</li>"
#endif
#ifdef HAVE_LINUXSAMPLER
"<li>LinuxSampler library for GIG and SFZ support [2]</li>"
#endif

// Internal plugins
"<li>NekoFilter plugin code based on lv2fil by Nedko Arnaudov and Fons Adriaensen</li>"
#ifdef WANT_ZYNADDSUBFX
"<li>ZynAddSubFX plugin code</li>"
#endif

// misc libs
"<li>base64 utilities based on code by Ren\u00E9 Nyffenegger</li>"
#ifdef CARLA_OS_MAC
"<li>sem_timedwait for Mac OS by Keith Shortridge</li>"
#endif
"<li>liblo library for OSC support</li>"
"<li>rtmempool library by Nedko Arnaudov"
"<li>serd, sord, sratom and lilv libraries for LV2 discovery</li>"
#if ! (defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN))
"<li>RtAudio and RtMidi libraries for extra Audio and MIDI support</li>"
#endif

// end
"</ul>"

"<p>"
#if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN) || ! defined(VESTIGE_HEADER)
// Required by VST SDK
"&nbsp;[1] Trademark of Steinberg Media Technologies GmbH.<br/>"
#endif
#ifdef HAVE_LINUXSAMPLER
// LinuxSampler GPL exception
"&nbsp;[2] Using LinuxSampler code in commercial hardware or software products is not allowed without prior written authorization by the authors."
#endif
"</p>"
;
}

return retText;
}

const char* carla_get_juce_version()
{
carla_debug("carla_get_juce_version()");

static CarlaString retVersion;

if (retVersion.isEmpty())
{
if (const char* const version = juce::SystemStats::getJUCEVersion().toRawUTF8())
retVersion = version+6;
else
retVersion = "3.0";
}

return retVersion;
}

const char* carla_get_supported_file_extensions()
{
carla_debug("carla_get_supported_file_extensions()");

static CarlaString retText;

if (retText.isEmpty())
{
retText =
// Base types
"*.carxp;*.carxs"
// MIDI files
";*.mid;*.midi"
#ifdef HAVE_FLUIDSYNTH
// fluidsynth (sf2)
";*.sf2"
#endif
#ifdef HAVE_LINUXSAMPLER
// linuxsampler (gig and sfz)
";*.gig;*.sfz"
#endif
#ifdef WANT_ZYNADDSUBFX
// zynaddsubfx presets
";*.xmz;*.xiz"
#endif
;

#ifndef BUILD_BRIDGE
// Audio files
{
using namespace juce;

AudioFormatManager afm;
afm.registerBasicFormats();

String juceFormats;

for (AudioFormat **it=afm.begin(), **end=afm.end(); it != end; ++it)
{
const StringArray& exts((*it)->getFileExtensions());

for (String *eit=exts.begin(), *eend=exts.end(); eit != eend; ++eit)
juceFormats += String(";*" + (*eit)).toRawUTF8();
}

retText += juceFormats.toRawUTF8();
}
#endif
}

return retText;
}

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

+ 1
- 145
source/backend/CarlaStandalone.cpp View File

@@ -445,151 +445,6 @@ _CarlaTransportInfo::_CarlaTransportInfo() noexcept
// ------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------
// API // API


const char* carla_get_complete_license_text()
{
carla_debug("carla_get_complete_license_text()");

static CarlaString retText;

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

// Plugin formats
"<li>LADSPA plugin support</li>"
"<li>DSSI plugin support</li>"
"<li>LV2 plugin support</li>"
#ifdef VESTIGE_HEADER
"<li>VST plugin support using VeSTige header by Javier Serrano Polo</li>"
#else
"<li>VST plugin support using official VST SDK 2.4 [1]</li>"
#endif
#if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)
"<li>VST3 plugin support using official VST SDK 3.6 [1]</li>"
#endif
#ifdef CARLA_OS_MAC
"<li>AU plugin support</li>"
#endif

// Sample kit libraries
#ifdef HAVE_FLUIDSYNTH
"<li>FluidSynth library for SF2 support</li>"
#endif
#ifdef HAVE_LINUXSAMPLER
"<li>LinuxSampler library for GIG and SFZ support [2]</li>"
#endif

// Internal plugins
"<li>NekoFilter plugin code based on lv2fil by Nedko Arnaudov and Fons Adriaensen</li>"
#ifdef WANT_ZYNADDSUBFX
"<li>ZynAddSubFX plugin code</li>"
#endif

// misc libs
"<li>base64 utilities based on code by Ren\u00E9 Nyffenegger</li>"
#ifdef CARLA_OS_MAC
"<li>sem_timedwait for Mac OS by Keith Shortridge</li>"
#endif
"<li>liblo library for OSC support</li>"
"<li>rtmempool library by Nedko Arnaudov"
"<li>serd, sord, sratom and lilv libraries for LV2 discovery</li>"
#if ! (defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN))
"<li>RtAudio and RtMidi libraries for extra Audio and MIDI support</li>"
#endif

// end
"</ul>"

"<p>"
#if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN) || ! defined(VESTIGE_HEADER)
// Required by VST SDK
"&nbsp;[1] Trademark of Steinberg Media Technologies GmbH.<br/>"
#endif
#ifdef HAVE_LINUXSAMPLER
// LinuxSampler GPL exception
"&nbsp;[2] Using LinuxSampler code in commercial hardware or software products is not allowed without prior written authorization by the authors."
#endif
"</p>"
;
}

return retText;
}

const char* carla_get_juce_version()
{
carla_debug("carla_get_juce_version()");

static CarlaString retVersion;

if (retVersion.isEmpty())
{
if (const char* const version = juce::SystemStats::getJUCEVersion().toRawUTF8())
retVersion = version+6;
else
retVersion = "3.0";
}

return retVersion;
}

const char* carla_get_supported_file_extensions()
{
carla_debug("carla_get_supported_file_extensions()");

static CarlaString retText;

if (retText.isEmpty())
{
retText =
// Base types
"*.carxp;*.carxs"
// MIDI files
";*.mid;*.midi"
#ifdef HAVE_FLUIDSYNTH
// fluidsynth (sf2)
";*.sf2"
#endif
#ifdef HAVE_LINUXSAMPLER
// linuxsampler (gig and sfz)
";*.gig;*.sfz"
#endif
#ifdef WANT_ZYNADDSUBFX
// zynaddsubfx presets
";*.xmz;*.xiz"
#endif
;

#ifndef BUILD_BRIDGE
// Audio files
{
using namespace juce;

AudioFormatManager afm;
afm.registerBasicFormats();

String juceFormats;

for (AudioFormat **it=afm.begin(), **end=afm.end(); it != end; ++it)
{
const StringArray& exts((*it)->getFileExtensions());

for (String *eit=exts.begin(), *eend=exts.end(); eit != eend; ++eit)
juceFormats += String(";*" + (*eit)).toRawUTF8();
}

retText += juceFormats.toRawUTF8();
}
#endif
}

return retText;
}

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

uint carla_get_engine_driver_count() uint carla_get_engine_driver_count()
{ {
carla_debug("carla_get_engine_driver_count()"); carla_debug("carla_get_engine_driver_count()");
@@ -2478,6 +2333,7 @@ const char* carla_get_library_folder()


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


#include "CarlaHostCommon.cpp"
#include "CarlaPluginUI.cpp" #include "CarlaPluginUI.cpp"
#include "CarlaDssiUtils.cpp" #include "CarlaDssiUtils.cpp"
#include "CarlaStateUtils.cpp" #include "CarlaStateUtils.cpp"


+ 19
- 0
source/backend/engine/CarlaEngineNative.cpp View File

@@ -946,6 +946,23 @@ protected:
fUiServer.writeAndFixMsg(valueStr); fUiServer.writeAndFixMsg(valueStr);
} }


void uiServerInfo()
{
CARLA_SAFE_ASSERT_RETURN(fIsRunning,);
CARLA_SAFE_ASSERT_RETURN(fUiServer.isOk(),);

const CarlaMutexLocker cml(fUiServer.getWriteLock());

fUiServer.writeAndFixMsg("carla-complete-license");
fUiServer.writeAndFixMsg(carla_get_complete_license_text());

fUiServer.writeAndFixMsg("carla-juce-version");
fUiServer.writeAndFixMsg(carla_get_juce_version());

fUiServer.writeAndFixMsg("carla-file-exts");
fUiServer.writeAndFixMsg(carla_get_supported_file_extensions());
}

void uiServerOptions() void uiServerOptions()
{ {
CARLA_SAFE_ASSERT_RETURN(fIsRunning,); CARLA_SAFE_ASSERT_RETURN(fIsRunning,);
@@ -1366,6 +1383,7 @@ protected:
fUiServer.setData(path, pData->sampleRate, pHost->uiName); fUiServer.setData(path, pData->sampleRate, pHost->uiName);
fUiServer.start(false); fUiServer.start(false);


uiServerInfo();
uiServerOptions(); uiServerOptions();


fUiServer.show(); fUiServer.show();
@@ -1760,6 +1778,7 @@ const EngineDriverDeviceInfo* CarlaEngine::getRtAudioDeviceInfo(const uint, cons


CARLA_BACKEND_END_NAMESPACE CARLA_BACKEND_END_NAMESPACE


#include "CarlaHostCommon.cpp"
#include "CarlaPluginUI.cpp" #include "CarlaPluginUI.cpp"
#include "CarlaDssiUtils.cpp" #include "CarlaDssiUtils.cpp"
#include "CarlaStateUtils.cpp" #include "CarlaStateUtils.cpp"


+ 12
- 7
source/carla_backend.py View File

@@ -2891,12 +2891,12 @@ class CarlaHostPlugin(CarlaHostMeta):
self.processModeForced = True self.processModeForced = True


# text data to return when requested # text data to return when requested
self.fCompleteLicentText = ""
self.fJuceVersion = ""
self.fSupportedFileExts = ""
self.fLastError = ""
self.fOscUrlTCP = ""
self.fOscUrlUDP = ""
self.fCompleteLicenseText = ""
self.fJuceVersion = ""
self.fSupportedFileExts = ""
self.fLastError = ""
self.fOscUrlTCP = ""
self.fOscUrlUDP = ""


# plugin info # plugin info
self.fPluginsInfo = [] self.fPluginsInfo = []
@@ -2934,7 +2934,7 @@ class CarlaHostPlugin(CarlaHostMeta):
# -------------------------------------------------------------------------------------------------------- # --------------------------------------------------------------------------------------------------------


def get_complete_license_text(self): def get_complete_license_text(self):
return self.fCompleteLicentText
return self.fCompleteLicenseText


def get_juce_version(self): def get_juce_version(self):
return self.fJuceVersion return self.fJuceVersion
@@ -3200,6 +3200,11 @@ class CarlaHostPlugin(CarlaHostMeta):


# -------------------------------------------------------------------------------------------------------- # --------------------------------------------------------------------------------------------------------


def _set_info(self, license, juceversion, fileexts):
self.fCompleteLicenseText = license;
self.fJuceVersion = juceversion
self.fSupportedFileExts = fileexts

def _add(self, pluginId): def _add(self, pluginId):
if len(self.fPluginsInfo) != pluginId: if len(self.fPluginsInfo) != pluginId:
return return


+ 73
- 66
source/carla_widgets.py View File

@@ -79,79 +79,86 @@ class CarlaAboutW(QDialog):
"<br>Copyright (C) 2011-2014 falkTX<br>" "<br>Copyright (C) 2011-2014 falkTX<br>"
"" % (VERSION, extraInfo))) "" % (VERSION, extraInfo)))


if host.isControl or host.isPlugin:
if host.isControl:
self.ui.l_extended.hide() self.ui.l_extended.hide()
self.ui.tabWidget.removeTab(2) self.ui.tabWidget.removeTab(2)
self.ui.tabWidget.removeTab(1) self.ui.tabWidget.removeTab(1)


else:
self.ui.l_extended.setText(host.get_complete_license_text())
elif host.isPlugin:
self.ui.tabWidget.removeTab(2)


if host.is_engine_running():
self.ui.le_osc_url_tcp.setText(host.get_host_osc_url_tcp())
self.ui.le_osc_url_udp.setText(host.get_host_osc_url_udp())
else:
self.ui.le_osc_url_tcp.setText(self.tr("(Engine not running)"))
self.ui.le_osc_url_udp.setText(self.tr("(Engine not running)"))

self.ui.l_osc_cmds.setText(""
" /set_active <i-value>\n"
" /set_drywet <f-value>\n"
" /set_volume <f-value>\n"
" /set_balance_left <f-value>\n"
" /set_balance_right <f-value>\n"
" /set_panning <f-value>\n"
" /set_parameter_value <i-index> <f-value>\n"
" /set_parameter_midi_cc <i-index> <i-cc>\n"
" /set_parameter_midi_channel <i-index> <i-channel>\n"
" /set_program <i-index>\n"
" /set_midi_program <i-index>\n"
" /note_on <i-note> <i-velo>\n"
" /note_off <i-note>\n"
)

self.ui.l_example.setText("/Carla/2/set_parameter_value 5 1.0")
self.ui.l_example_help.setText("<i>(as in this example, \"2\" is the plugin number and \"5\" the parameter)</i>")

self.ui.l_ladspa.setText(self.tr("Everything! (Including LRDF)"))
self.ui.l_dssi.setText(self.tr("Everything! (Including CustomData/Chunks)"))
self.ui.l_lv2.setText(self.tr("About 95&#37; complete (using custom extensions)<br/>"
"Implemented Feature/Extensions:"
"<ul>"
"<li>http://lv2plug.in/ns/ext/atom</li>"
"<li>http://lv2plug.in/ns/ext/buf-size</li>"
"<li>http://lv2plug.in/ns/ext/data-access</li>"
#"<li>http://lv2plug.in/ns/ext/dynmanifest</li>"
"<li>http://lv2plug.in/ns/ext/event</li>"
"<li>http://lv2plug.in/ns/ext/instance-access</li>"
"<li>http://lv2plug.in/ns/ext/log</li>"
"<li>http://lv2plug.in/ns/ext/midi</li>"
#"<li>http://lv2plug.in/ns/ext/morph</li>"
"<li>http://lv2plug.in/ns/ext/options</li>"
"<li>http://lv2plug.in/ns/ext/parameters</li>"
#"<li>http://lv2plug.in/ns/ext/patch</li>"
#"<li>http://lv2plug.in/ns/ext/port-groups</li>"
"<li>http://lv2plug.in/ns/ext/port-props</li>"
"<li>http://lv2plug.in/ns/ext/presets</li>"
"<li>http://lv2plug.in/ns/ext/resize-port</li>"
"<li>http://lv2plug.in/ns/ext/state</li>"
"<li>http://lv2plug.in/ns/ext/time</li>"
"<li>http://lv2plug.in/ns/ext/uri-map</li>"
"<li>http://lv2plug.in/ns/ext/urid</li>"
"<li>http://lv2plug.in/ns/ext/worker</li>"
"<li>http://lv2plug.in/ns/extensions/ui</li>"
"<li>http://lv2plug.in/ns/extensions/units</li>"
"<li>http://home.gna.org/lv2dynparam/rtmempool/v1</li>"
"<li>http://kxstudio.sf.net/ns/lv2ext/external-ui</li>"
"<li>http://kxstudio.sf.net/ns/lv2ext/programs</li>"
"<li>http://kxstudio.sf.net/ns/lv2ext/props</li>"
"<li>http://kxstudio.sf.net/ns/lv2ext/rtmempool</li>"
"<li>http://ll-plugins.nongnu.org/lv2/ext/midimap</li>"
"<li>http://ll-plugins.nongnu.org/lv2/ext/miditype</li>"
"</ul>"))
self.ui.l_vst.setText(self.tr("<p>About 85&#37; complete (missing vst bank/presets and some minor stuff)</p>"))
self.ui.l_extended.setText(host.get_complete_license_text())


if host.is_engine_running() and not (host.isControl or host.isPlugin):
self.ui.le_osc_url_tcp.setText(host.get_host_osc_url_tcp())
self.ui.le_osc_url_udp.setText(host.get_host_osc_url_udp())
else:
self.ui.le_osc_url_tcp.setText(self.tr("(Engine not running)"))
self.ui.le_osc_url_udp.setText(self.tr("(Engine not running)"))

self.ui.l_osc_cmds.setText(""
" /set_active <i-value>\n"
" /set_drywet <f-value>\n"
" /set_volume <f-value>\n"
" /set_balance_left <f-value>\n"
" /set_balance_right <f-value>\n"
" /set_panning <f-value>\n"
" /set_parameter_value <i-index> <f-value>\n"
" /set_parameter_midi_cc <i-index> <i-cc>\n"
" /set_parameter_midi_channel <i-index> <i-channel>\n"
" /set_program <i-index>\n"
" /set_midi_program <i-index>\n"
" /note_on <i-note> <i-velo>\n"
" /note_off <i-note>\n"
)

self.ui.l_example.setText("/Carla/2/set_parameter_value 5 1.0")
self.ui.l_example_help.setText("<i>(as in this example, \"2\" is the plugin number and \"5\" the parameter)</i>")

self.ui.l_ladspa.setText(self.tr("Everything! (Including LRDF)"))
self.ui.l_dssi.setText(self.tr("Everything! (Including CustomData/Chunks)"))
self.ui.l_lv2.setText(self.tr("About 95&#37; complete (using custom extensions)<br/>"
"Implemented Feature/Extensions:"
"<ul>"
"<li>http://lv2plug.in/ns/ext/atom</li>"
"<li>http://lv2plug.in/ns/ext/buf-size</li>"
"<li>http://lv2plug.in/ns/ext/data-access</li>"
#"<li>http://lv2plug.in/ns/ext/dynmanifest</li>"
"<li>http://lv2plug.in/ns/ext/event</li>"
"<li>http://lv2plug.in/ns/ext/instance-access</li>"
"<li>http://lv2plug.in/ns/ext/log</li>"
"<li>http://lv2plug.in/ns/ext/midi</li>"
#"<li>http://lv2plug.in/ns/ext/morph</li>"
"<li>http://lv2plug.in/ns/ext/options</li>"
"<li>http://lv2plug.in/ns/ext/parameters</li>"
#"<li>http://lv2plug.in/ns/ext/patch</li>"
#"<li>http://lv2plug.in/ns/ext/port-groups</li>"
"<li>http://lv2plug.in/ns/ext/port-props</li>"
"<li>http://lv2plug.in/ns/ext/presets</li>"
"<li>http://lv2plug.in/ns/ext/resize-port</li>"
"<li>http://lv2plug.in/ns/ext/state</li>"
"<li>http://lv2plug.in/ns/ext/time</li>"
"<li>http://lv2plug.in/ns/ext/uri-map</li>"
"<li>http://lv2plug.in/ns/ext/urid</li>"
"<li>http://lv2plug.in/ns/ext/worker</li>"
"<li>http://lv2plug.in/ns/extensions/ui</li>"
"<li>http://lv2plug.in/ns/extensions/units</li>"
"<li>http://home.gna.org/lv2dynparam/rtmempool/v1</li>"
"<li>http://kxstudio.sf.net/ns/lv2ext/external-ui</li>"
"<li>http://kxstudio.sf.net/ns/lv2ext/programs</li>"
"<li>http://kxstudio.sf.net/ns/lv2ext/props</li>"
"<li>http://kxstudio.sf.net/ns/lv2ext/rtmempool</li>"
"<li>http://ll-plugins.nongnu.org/lv2/ext/midimap</li>"
"<li>http://ll-plugins.nongnu.org/lv2/ext/miditype</li>"
"</ul>"))
self.ui.l_vst.setText(self.tr("<p>About 85&#37; complete (missing vst bank/presets and some minor stuff)</p>"))

# 2nd tab is usually longer than the 1st
# adjust appropriately
self.ui.tabWidget.setCurrentIndex(1)
self.adjustSize() self.adjustSize()

self.ui.tabWidget.setCurrentIndex(0)
self.setFixedSize(self.size()) self.setFixedSize(self.size())


if WINDOWS: if WINDOWS:


+ 12
- 0
source/modules/native-plugins/resources/carla-plugin View File

@@ -308,6 +308,18 @@ class CarlaMiniW(ExternalUI, HostWindow):
name = self.readlineblock().replace("\r", "\n") name = self.readlineblock().replace("\r", "\n")
self.host._set_midiProgramData(pluginId, midiProgId, {'bank': bank, 'program': program, 'name': name}) self.host._set_midiProgramData(pluginId, midiProgId, {'bank': bank, 'program': program, 'name': name})


elif msg == "carla-complete-license":
license = self.readlineblock().replace("\r", "\n")
self.host.fCompleteLicenseText = license

elif msg == "carla-juce-version":
version = self.readlineblock().replace("\r", "\n")
self.host.fJuceVersion = version

elif msg == "carla-file-exts":
exts = self.readlineblock().replace("\r", "\n")
self.host.fSupportedFileExts = exts

elif msg == "error": elif msg == "error":
error = self.readlineblock().replace("\r", "\n") error = self.readlineblock().replace("\r", "\n")
engineCallback(self.host, ENGINE_CALLBACK_ERROR, 0, 0, 0, 0.0, error) engineCallback(self.host, ENGINE_CALLBACK_ERROR, 0, 0, 0, 0.0, error)


Loading…
Cancel
Save