Browse Source

Initial stub implementation of jack application plugin

tags/1.9.7b
falkTX 8 years ago
parent
commit
11e7814b3b
9 changed files with 76 additions and 5 deletions
  1. +7
    -2
      source/backend/CarlaBackend.h
  2. +2
    -0
      source/backend/CarlaPlugin.hpp
  3. +6
    -0
      source/backend/engine/CarlaEngine.cpp
  4. +1
    -1
      source/backend/engine/CarlaEngineBridge.cpp
  5. +45
    -0
      source/backend/plugin/CarlaPluginJack.cpp
  6. +2
    -1
      source/backend/plugin/Makefile
  7. +4
    -1
      source/carla_backend.py
  8. +6
    -0
      source/utils/CarlaBackendUtils.hpp
  9. +3
    -0
      source/utils/CarlaStateUtils.cpp

+ 7
- 2
source/backend/CarlaBackend.h View File

@@ -1,6 +1,6 @@
/* /*
* Carla Plugin Host * Carla Plugin Host
* Copyright (C) 2011-2014 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2011-2017 Filipe Coelho <falktx@falktx.com>
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
@@ -501,7 +501,12 @@ typedef enum {
/*! /*!
* SFZ file. * SFZ file.
*/ */
PLUGIN_SFZ = 10
PLUGIN_SFZ = 10,

/*!
* JACK application.
*/
PLUGIN_JACK = 11


} PluginType; } PluginType;




+ 2
- 0
source/backend/CarlaPlugin.hpp View File

@@ -903,6 +903,8 @@ public:
static CarlaPlugin* newFileGIG(const Initializer& init, const bool use16Outs); static CarlaPlugin* newFileGIG(const Initializer& init, const bool use16Outs);
static CarlaPlugin* newFileSF2(const Initializer& init, const bool use16Outs); static CarlaPlugin* newFileSF2(const Initializer& init, const bool use16Outs);
static CarlaPlugin* newFileSFZ(const Initializer& init); static CarlaPlugin* newFileSFZ(const Initializer& init);

static CarlaPlugin* newJackApp(const Initializer& init);
#endif #endif


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


+ 6
- 0
source/backend/engine/CarlaEngine.cpp View File

@@ -638,6 +638,12 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype,
case PLUGIN_SFZ: case PLUGIN_SFZ:
plugin = CarlaPlugin::newFileSFZ(initializer); plugin = CarlaPlugin::newFileSFZ(initializer);
break; break;

case PLUGIN_JACK:
#ifndef BUILD_BRIDGE
plugin = CarlaPlugin::newJackApp(initializer);
#endif
break;
} }
} }




+ 1
- 1
source/backend/engine/CarlaEngineBridge.cpp View File

@@ -587,7 +587,7 @@ public:


const bool wasFirstIdle(fFirstIdle); const bool wasFirstIdle(fFirstIdle);


if (fFirstIdle)
if (wasFirstIdle)
{ {
fFirstIdle = false; fFirstIdle = false;
fLastPingTime = Time::currentTimeMillis(); fLastPingTime = Time::currentTimeMillis();


+ 45
- 0
source/backend/plugin/CarlaPluginJack.cpp View File

@@ -0,0 +1,45 @@
/*
* Carla JACK Plugin
* Copyright (C) 2017 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 "CarlaPlugin.hpp"
#include "CarlaEngine.hpp"
#include "CarlaUtils.hpp"

#ifdef BUILD_BRIDGE
# error This file should not be used under bridge mode
#endif

CARLA_BACKEND_START_NAMESPACE

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

CarlaPlugin* CarlaPlugin::newJackApp(const Initializer& init)
{
carla_debug("CarlaPlugin::newVST3({%p, \"%s\", \"%s\", " P_INT64 "})", init.engine, init.filename, init.name, init.uniqueId);

#ifdef CARLA_OS_LINUX
init.engine->setLastError("JACK application support not implemented yet");
return nullptr;
#else
init.engine->setLastError("JACK application support not available");
return nullptr;
#endif
}

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

CARLA_BACKEND_END_NAMESPACE

+ 2
- 1
source/backend/plugin/Makefile View File

@@ -22,7 +22,8 @@ OBJS = \
$(OBJDIR)/CarlaPluginAU.cpp.o \ $(OBJDIR)/CarlaPluginAU.cpp.o \
$(OBJDIR)/CarlaPluginJuce.cpp.o \ $(OBJDIR)/CarlaPluginJuce.cpp.o \
$(OBJDIR)/CarlaPluginFluidSynth.cpp.o \ $(OBJDIR)/CarlaPluginFluidSynth.cpp.o \
$(OBJDIR)/CarlaPluginLinuxSampler.cpp.o
$(OBJDIR)/CarlaPluginLinuxSampler.cpp.o \
$(OBJDIR)/CarlaPluginJack.cpp.o


TARGETS = \ TARGETS = \
$(MODULEDIR)/carla_plugin.a $(MODULEDIR)/carla_plugin.a


+ 4
- 1
source/carla_backend.py View File

@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-


# Carla Backend code # Carla Backend code
# Copyright (C) 2011-2014 Filipe Coelho <falktx@falktx.com>
# Copyright (C) 2011-2017 Filipe Coelho <falktx@falktx.com>
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as # modify it under the terms of the GNU General Public License as
@@ -400,6 +400,9 @@ PLUGIN_SF2 = 9
# SFZ file. # SFZ file.
PLUGIN_SFZ = 10 PLUGIN_SFZ = 10


# JACK application.
PLUGIN_JACK = 11

# ------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------
# Plugin Category # Plugin Category
# Plugin category, which describes the functionality of a plugin. # Plugin category, which describes the functionality of a plugin.


+ 6
- 0
source/utils/CarlaBackendUtils.hpp View File

@@ -106,6 +106,8 @@ const char* PluginType2Str(const PluginType type) noexcept
return "PLUGIN_SF2"; return "PLUGIN_SF2";
case PLUGIN_SFZ: case PLUGIN_SFZ:
return "PLUGIN_SFZ"; return "PLUGIN_SFZ";
case PLUGIN_JACK:
return "PLUGIN_JACK";
} }


carla_stderr("CarlaBackend::PluginType2Str(%i) - invalid type", type); carla_stderr("CarlaBackend::PluginType2Str(%i) - invalid type", type);
@@ -478,6 +480,8 @@ const char* getPluginTypeAsString(const PluginType type) noexcept
return "SF2"; return "SF2";
case PLUGIN_SFZ: case PLUGIN_SFZ:
return "SFZ"; return "SFZ";
case PLUGIN_JACK:
return "JACK";
} }


carla_stderr("CarlaBackend::getPluginTypeAsString(%i) - invalid type", type); carla_stderr("CarlaBackend::getPluginTypeAsString(%i) - invalid type", type);
@@ -519,6 +523,8 @@ PluginType getPluginTypeFromString(const char* const ctype) noexcept
return PLUGIN_SF2; return PLUGIN_SF2;
if (stype == "sfz") if (stype == "sfz")
return PLUGIN_SFZ; return PLUGIN_SFZ;
if (stype == "jack")
return PLUGIN_JACK;


carla_stderr("CarlaBackend::getPluginTypeFromString(\"%s\") - invalid string type", ctype); carla_stderr("CarlaBackend::getPluginTypeFromString(\"%s\") - invalid string type", ctype);
return PLUGIN_NONE; return PLUGIN_NONE;


+ 3
- 0
source/utils/CarlaStateUtils.cpp View File

@@ -537,6 +537,9 @@ void CarlaStateSave::dumpToMemoryStream(MemoryOutputStream& content) const
case PLUGIN_SFZ: case PLUGIN_SFZ:
infoXml << " <Filename>" << xmlSafeString(binary, true) << "</Filename>\n"; infoXml << " <Filename>" << xmlSafeString(binary, true) << "</Filename>\n";
break; break;
case PLUGIN_JACK:
infoXml << " <Filename>" << xmlSafeString(binary, true) << "</Filename>\n";
break;
} }


infoXml << " </Info>\n\n"; infoXml << " </Info>\n\n";


Loading…
Cancel
Save