Browse Source

Misc

tags/1.9.4
falkTX 11 years ago
parent
commit
6e2fe81ead
7 changed files with 72 additions and 65 deletions
  1. +1
    -1
      source/Makefile.mk
  2. +7
    -7
      source/backend/native/Makefile
  3. +58
    -43
      source/backend/native/zynaddsubfx.cpp
  4. +0
    -2
      source/backend/plugin/NativePlugin.cpp
  5. +5
    -2
      source/backend/standalone/Makefile
  6. +0
    -9
      source/bridges/CarlaBridgePlugin.cpp
  7. +1
    -1
      source/bridges/Makefile

+ 1
- 1
source/Makefile.mk View File

@@ -55,7 +55,7 @@ BUILD_CXX_FLAGS += -DVESTIGE_HEADER
HAVE_JACK = $(shell pkg-config --exists jack && echo true) HAVE_JACK = $(shell pkg-config --exists jack && echo true)


HAVE_AF_DEPS = $(shell pkg-config --exists libavcodec libavformat sndfile && echo true) HAVE_AF_DEPS = $(shell pkg-config --exists libavcodec libavformat sndfile && echo true)
HAVE_ZYN_DEPS = $(shell pkg-config --exists fftw3 mxml && echo true)
HAVE_ZYN_DEPS = $(shell pkg-config --exists fftw3 mxml zlib && echo true)


ifeq ($(HAVE_JACK),true) ifeq ($(HAVE_JACK),true)
HAVE_JACK_LATENCY = $(shell pkg-config --atleast-version=0.121.0 jack && echo true) HAVE_JACK_LATENCY = $(shell pkg-config --atleast-version=0.121.0 jack && echo true)


+ 7
- 7
source/backend/native/Makefile View File

@@ -19,8 +19,8 @@ endif


ifeq ($(HAVE_ZYN_DEPS),true) ifeq ($(HAVE_ZYN_DEPS),true)
ZYN_CXX_FLAGS = $(BUILD_CXX_FLAGS) ZYN_CXX_FLAGS = $(BUILD_CXX_FLAGS)
ZYN_CXX_FLAGS += $(shell pkg-config --cflags fftw3 mxml)
LINK_FLAGS += $(shell pkg-config --libs fftw3 mxml)
ZYN_CXX_FLAGS += $(shell pkg-config --cflags fftw3 mxml zlib)
LINK_FLAGS += $(shell pkg-config --libs fftw3 mxml zlib)
endif endif


# -------------------------------------------------------------- # --------------------------------------------------------------
@@ -35,11 +35,11 @@ OBJS = \
nekofilter.c.o nekofilter.c.o


# DISTRHO plugins # DISTRHO plugins
# OBJS += \
# distrho-3bandeq.cpp.o \
# distrho-3bandsplitter.cpp.o \
# distrho-pingpongpan.cpp.o \
# distrho-notes.cpp.o
OBJS += \
distrho-3bandeq.cpp.o \
distrho-3bandsplitter.cpp.o \
distrho-pingpongpan.cpp.o \
distrho-notes.cpp.o


# AudioFile # AudioFile
ifeq ($(HAVE_AF_DEPS),true) ifeq ($(HAVE_AF_DEPS),true)


+ 58
- 43
source/backend/native/zynaddsubfx.cpp View File

@@ -22,12 +22,15 @@
#include "CarlaNative.hpp" #include "CarlaNative.hpp"
#include "CarlaMIDI.h" #include "CarlaMIDI.h"
#include "CarlaString.hpp" #include "CarlaString.hpp"
#include "RtList.hpp"


#include "zynaddsubfx/Misc/Master.h" #include "zynaddsubfx/Misc/Master.h"
#include "zynaddsubfx/Misc/Util.h" #include "zynaddsubfx/Misc/Util.h"


#include <ctime> #include <ctime>


// TODO - free sPrograms

// Dummy variables and functions for linking purposes // Dummy variables and functions for linking purposes
class WavFile; class WavFile;
namespace Nio { namespace Nio {
@@ -53,29 +56,7 @@ public:
kMaster(new Master()), kMaster(new Master()),
kSampleRate(getSampleRate()) kSampleRate(getSampleRate())
{ {
#if 0
// refresh banks
kMaster->bank.rescanforbanks();

for (uint32_t i=0, size = kMaster->bank.banks.size(); i < size; i++)
{
if (kMaster->bank.banks[i].dir.empty())
continue;

kMaster->bank.loadbank(kMaster->bank.banks[i].dir);

for (unsigned int instrument = 0; instrument < BANK_SIZE; instrument++)
{
const std::string insName(kMaster->bank.getname(instrument));

if (insName.empty() || insName[0] == '\0' || insName[0] == ' ')
continue;

ProgramInfo pInfo(i, instrument, insName.c_str());
fPrograms.push_back(pInfo);
}
}
#endif
_maybeInitPrograms(kMaster);
} }


~ZynAddSubFxPlugin() ~ZynAddSubFxPlugin()
@@ -84,8 +65,6 @@ public:
pthread_mutex_lock(&kMaster->mutex); pthread_mutex_lock(&kMaster->mutex);
pthread_mutex_unlock(&kMaster->mutex); pthread_mutex_unlock(&kMaster->mutex);


fPrograms.clear();

delete kMaster; delete kMaster;
} }


@@ -150,22 +129,22 @@ protected:


uint32_t getMidiProgramCount() uint32_t getMidiProgramCount()
{ {
return fPrograms.size();
return sPrograms.count();
} }


const MidiProgram* getMidiProgramInfo(const uint32_t index) const MidiProgram* getMidiProgramInfo(const uint32_t index)
{ {
CARLA_ASSERT(index < getMidiProgramCount()); CARLA_ASSERT(index < getMidiProgramCount());


if (index >= fPrograms.size())
if (index >= sPrograms.count())
return nullptr; return nullptr;


const ProgramInfo& pInfo(fPrograms[index]);
const ProgramInfo* const pInfo(sPrograms.getAt(index));


static MidiProgram midiProgram; static MidiProgram midiProgram;
midiProgram.bank = pInfo.bank;
midiProgram.program = pInfo.prog;
midiProgram.name = pInfo.name;
midiProgram.bank = pInfo->bank;
midiProgram.program = pInfo->prog;
midiProgram.name = pInfo->name;


return &midiProgram; return &midiProgram;
} }
@@ -224,13 +203,6 @@ protected:
return; return;
} }


if (frames != 1024)
carla_stdout("ZYN process(%p, %i, %i, %p)", outBuffer, frames, midiEventCount, midiEvents);

#if 0
carla_zeroFloat(outBuffer[0], frames);
carla_zeroFloat(outBuffer[1], frames);
#else
for (uint32_t i=0; i < midiEventCount; i++) for (uint32_t i=0; i < midiEventCount; i++)
{ {
const MidiEvent* const midiEvent = &midiEvents[i]; const MidiEvent* const midiEvent = &midiEvents[i];
@@ -261,7 +233,6 @@ protected:
} }


kMaster->GetAudioOutSamples(frames, kSampleRate, outBuffer[0], outBuffer[1]); kMaster->GetAudioOutSamples(frames, kSampleRate, outBuffer[0], outBuffer[1]);
#endif


pthread_mutex_unlock(&kMaster->mutex); pthread_mutex_unlock(&kMaster->mutex);
} }
@@ -272,23 +243,33 @@ private:
struct ProgramInfo { struct ProgramInfo {
uint32_t bank; uint32_t bank;
uint32_t prog; uint32_t prog;
CarlaString name;
const char* name;


ProgramInfo(uint32_t bank_, uint32_t prog_, const char* name_) ProgramInfo(uint32_t bank_, uint32_t prog_, const char* name_)
: bank(bank_), : bank(bank_),
prog(prog_), prog(prog_),
name(name_) {}
name(carla_strdup(name_)) {}

~ProgramInfo()
{
if (name != nullptr)
{
delete[] name;
name = nullptr;
}
}


ProgramInfo() = delete; ProgramInfo() = delete;
ProgramInfo(ProgramInfo&) = delete;
ProgramInfo(const ProgramInfo&) = delete;
}; };


std::vector<ProgramInfo> fPrograms;

Master* const kMaster; Master* const kMaster;
const unsigned kSampleRate; const unsigned kSampleRate;


public: public:
static int sInstanceCount; static int sInstanceCount;
static NonRtList<ProgramInfo*> sPrograms;


static PluginHandle _instantiate(const PluginDescriptor*, HostDescriptor* host) static PluginHandle _instantiate(const PluginDescriptor*, HostDescriptor* host)
{ {
@@ -327,10 +308,44 @@ public:
} }
} }


static void _maybeInitPrograms(Master* const master)
{
static bool doSearch = true;

if (! doSearch)
return;

doSearch = false;

#if 0
// refresh banks
master->bank.rescanforbanks();

for (uint32_t i=0, size = master->bank.banks.size(); i < size; i++)
{
if (master->bank.banks[i].dir.empty())
continue;

master->bank.loadbank(master->bank.banks[i].dir);

for (unsigned int instrument = 0; instrument < BANK_SIZE; instrument++)
{
const std::string insName(master->bank.getname(instrument));

if (insName.empty() || insName[0] == '\0' || insName[0] == ' ')
continue;

sPrograms.append(new ProgramInfo(i, instrument, insName.c_str()));
}
}
#endif
}

CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ZynAddSubFxPlugin) CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ZynAddSubFxPlugin)
}; };


int ZynAddSubFxPlugin::sInstanceCount = 0; int ZynAddSubFxPlugin::sInstanceCount = 0;
NonRtList<ZynAddSubFxPlugin::ProgramInfo*> ZynAddSubFxPlugin::sPrograms;


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




+ 0
- 2
source/backend/plugin/NativePlugin.cpp View File

@@ -33,13 +33,11 @@ void carla_register_all_plugins()
carla_register_native_plugin_midiTranspose(); carla_register_native_plugin_midiTranspose();
carla_register_native_plugin_nekofilter(); carla_register_native_plugin_nekofilter();


#ifndef BUILD_BRIDGE
// DISTRHO plugins // DISTRHO plugins
carla_register_native_plugin_3BandEQ(); carla_register_native_plugin_3BandEQ();
carla_register_native_plugin_3BandSplitter(); carla_register_native_plugin_3BandSplitter();
carla_register_native_plugin_PingPongPan(); carla_register_native_plugin_PingPongPan();
carla_register_native_plugin_Notes(); carla_register_native_plugin_Notes();
#endif


#ifdef WANT_AUDIOFILE #ifdef WANT_AUDIOFILE
// AudioFile // AudioFile


+ 5
- 2
source/backend/standalone/Makefile View File

@@ -9,7 +9,8 @@ include ../Makefile.mk
# -------------------------------------------------------------- # --------------------------------------------------------------
# Common # Common


LINK_FLAGS += $(shell pkg-config --libs gl liblo QtCore QtGui QtXml)
LINK_FLAGS += $(shell pkg-config --libs gl liblo QtCore QtXml)
LINK_FLAGS += -X11


# -------------------------------------------------------------- # --------------------------------------------------------------
# Engine # Engine
@@ -37,11 +38,13 @@ endif
# -------------------------------------------------------------- # --------------------------------------------------------------
# Native # Native


LINK_FLAGS += $(shell pkg-config --libs QtGui)

ifeq ($(HAVE_AF_DEPS),true) ifeq ($(HAVE_AF_DEPS),true)
LINK_FLAGS += $(shell pkg-config --libs libavcodec libavformat sndfile) LINK_FLAGS += $(shell pkg-config --libs libavcodec libavformat sndfile)
endif endif
ifeq ($(HAVE_ZYN_DEPS),true) ifeq ($(HAVE_ZYN_DEPS),true)
LINK_FLAGS += $(shell pkg-config --libs fftw3 mxml)
LINK_FLAGS += $(shell pkg-config --libs fftw3 mxml zlib)
endif endif


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


+ 0
- 9
source/bridges/CarlaBridgePlugin.cpp View File

@@ -436,7 +436,6 @@ int main(int argc, char* argv[])
{ {
CARLA_BRIDGE_USE_NAMESPACE CARLA_BRIDGE_USE_NAMESPACE


#if 0
if (argc != 6) if (argc != 6)
{ {
carla_stdout("usage: %s <osc-url|\"null\"> <type> <filename> <name|\"(none)\"> <label>", argv[0]); carla_stdout("usage: %s <osc-url|\"null\"> <type> <filename> <name|\"(none)\"> <label>", argv[0]);
@@ -471,14 +470,6 @@ int main(int argc, char* argv[])
carla_stderr("Invalid plugin type '%s'", stype); carla_stderr("Invalid plugin type '%s'", stype);
return 1; return 1;
} }
#else
const char* const oscUrl = "null";
const char* const filename = "zynaddsubfx";
const char* const name = nullptr;
const char* const label = "zynaddsubfx";
const bool useOsc = false;
CarlaBackend::PluginType itype = CarlaBackend::PLUGIN_INTERNAL;
#endif


// Init Plugin client // Init Plugin client
CarlaPluginClient client(name ? name : label); CarlaPluginClient client(name ? name : label);


+ 1
- 1
source/bridges/Makefile View File

@@ -51,7 +51,7 @@ endif


ifeq ($(HAVE_ZYN_DEPS),true) ifeq ($(HAVE_ZYN_DEPS),true)
NATIVE_BUILD_FLAGS += -DWANT_ZYNADDSUBFX NATIVE_BUILD_FLAGS += -DWANT_ZYNADDSUBFX
NATIVE_LINK_FLAGS += $(shell pkg-config --libs fftw3 mxml)
NATIVE_LINK_FLAGS += $(shell pkg-config --libs fftw3 mxml zlib)
endif endif


POSIX_BUILD_FLAGS = $(BUILD_PLUGIN_FLAGS) POSIX_BUILD_FLAGS = $(BUILD_PLUGIN_FLAGS)


Loading…
Cancel
Save