@@ -8,26 +8,34 @@ if [ ! -f Makefile ]; then | |||
cd ../.. | |||
fi | |||
export CC="gcc-mp-4.7" | |||
export CXX="g++-mp-4.7" | |||
export LDFLAGS="-L/usr/local/lib/" | |||
export PYUIC="pyuic4-3.3" | |||
export PYRCC="pyrcc4-3.3 -py3" | |||
if [ -d /dev/shm ]; then | |||
# Linux | |||
export CC="i686-apple-darwin10-gcc" | |||
export CXX="i686-apple-darwin10-g++" | |||
export PATH=/usr/i686-apple-darwin10/bin/:$PATH | |||
else | |||
# MacOS | |||
export CC="gcc-mp-4.7" | |||
export CXX="g++-mp-4.7" | |||
export LDFLAGS="-L/usr/local/lib/" | |||
export PYUIC="pyuic4-3.3" | |||
export PYRCC="pyrcc4-3.3 -py3" | |||
fi | |||
# Clean build | |||
make clean | |||
# Build PyQt4 resources | |||
make $JOBS UI RES WIDGETS | |||
# make $JOBS UI RES WIDGETS | |||
# Build discovery | |||
make $JOBS -C source/discovery MACOS=true | |||
# make $JOBS -C source/discovery MACOS=true | |||
# Build backend | |||
make $JOBS -C source/backend/standalone ../libcarla_standalone.dylib EXTRA_LIBS="-ldl" MACOS=true | |||
# make $JOBS -C source/backend/standalone ../libcarla_standalone.dylib EXTRA_LIBS="-ldl" MACOS=true | |||
# DGL_LIBS="-framework OpenGL -framework Cocoa" HAVE_OPENGL=true | |||
rm -rf ./data/macos/build | |||
# rm -rf ./data/macos/build | |||
# Build Mac App | |||
# cd data/macos | |||
@@ -28,9 +28,14 @@ endif | |||
64BIT_FLAGS = -m64 | |||
BUILD_C_FLAGS = $(BASE_FLAGS) -std=gnu99 $(CFLAGS) | |||
BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=gnu++0x $(CXXFLAGS) | |||
LINK_FLAGS = $(LDFLAGS) | |||
ifeq ($(MACOS),true) | |||
BUILD_CXX_FLAGS = $(BASE_FLAGS) $(CXXFLAGS) | |||
else | |||
BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=gnu++0x $(CXXFLAGS) | |||
endif | |||
# -------------------------------------------------------------- | |||
# Modify to enable/disable specific features | |||
@@ -20,7 +20,11 @@ | |||
#include "CarlaDefines.hpp" | |||
#include <cstdint> | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
# include <cstdint> | |||
#else | |||
# include <stdint.h> | |||
#endif | |||
#define CARLA_BACKEND_START_NAMESPACE namespace CarlaBackend { | |||
#define CARLA_BACKEND_END_NAMESPACE } | |||
@@ -19,15 +19,13 @@ | |||
#define __CARLA_NATIVE_H__ | |||
#ifdef __cplusplus | |||
# include <cstddef> | |||
# include <cstdint> | |||
extern "C" { | |||
#else | |||
# include <stdbool.h> | |||
# include <stddef.h> | |||
# include <stdint.h> | |||
#endif | |||
#include <stdbool.h> | |||
#include <stddef.h> | |||
#include <stdint.h> | |||
/*! | |||
* @defgroup CarlaNativeAPI Carla Native API | |||
* | |||
@@ -250,7 +248,9 @@ void carla_register_native_plugin_midifile(); | |||
// DISTRHO plugins (OpenGL) | |||
void carla_register_native_plugin_3BandEQ(); | |||
void carla_register_native_plugin_3BandSplitter(); | |||
void carla_register_native_plugin_Nekobi(); | |||
void carla_register_native_plugin_PingPongPan(); | |||
void carla_register_native_plugin_StereoEnhancer(); | |||
#endif | |||
// DISTRHO plugins (Qt) | |||
@@ -125,10 +125,19 @@ struct EnginePluginData { | |||
float insPeak[CarlaEngine::MAX_PEAKS]; | |||
float outsPeak[CarlaEngine::MAX_PEAKS]; | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
EnginePluginData() | |||
: plugin(nullptr), | |||
insPeak{0.0f}, | |||
outsPeak{0.0f} {} | |||
#else | |||
EnginePluginData() | |||
: plugin(nullptr) | |||
{ | |||
insPeak[0] = insPeak[1] = nullptr; | |||
outsPeak[0] = outsPeak[1] = nullptr; | |||
} | |||
#endif | |||
}; | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
@@ -204,9 +213,11 @@ struct CarlaEngineProtectedData { | |||
maxPluginNumber(0), | |||
plugins(nullptr) {} | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
CarlaEngineProtectedData() = delete; | |||
CarlaEngineProtectedData(CarlaEngineProtectedData&) = delete; | |||
CarlaEngineProtectedData(const CarlaEngineProtectedData&) = delete; | |||
#endif | |||
#ifndef BUILD_BRIDGE | |||
static void registerEnginePlugin(CarlaEngine* const engine, const unsigned int id, CarlaPlugin* const plugin) | |||
@@ -516,10 +516,10 @@ public: | |||
#ifdef BUILD_BRIDGE | |||
fHasQuit(false) | |||
#else | |||
# ifndef QTCREATOR_TEST | |||
# ifdef CARLA_PROPER_CPP11_SUPPORT | |||
fRackPorts{nullptr}, | |||
fLastGroupId(0), | |||
# endif | |||
fLastGroupId(0), | |||
fLastPortId(0), | |||
fLastConnectionId(0) | |||
#endif | |||
@@ -527,8 +527,13 @@ public: | |||
carla_debug("CarlaEngineJack::CarlaEngineJack()"); | |||
#ifdef BUILD_BRIDGE | |||
fOptions.processMode = PROCESS_MODE_MULTIPLE_CLIENTS; | |||
fOptions.processMode = PROCESS_MODE_MULTIPLE_CLIENTS; | |||
#else | |||
# ifndef CARLA_PROPER_CPP11_SUPPORT | |||
carla_zeroStruct<jack_port_t*>(fRackPorts, rackPortCount); | |||
# endif | |||
#endif | |||
// FIXME: Always enable JACK transport for now | |||
fOptions.transportMode = TRANSPORT_MODE_JACK; | |||
@@ -22,26 +22,6 @@ | |||
#include "CarlaNative.hpp" | |||
#ifdef WANT_LV2 | |||
# include "lv2/lv2.h" | |||
# include "lv2/atom.h" | |||
struct Lv2HostDescriptor { | |||
uint32_t bufferSize; | |||
double sampleRate; | |||
TimeInfo timeInfo; | |||
float* audioPorts[4]; | |||
LV2_Atom_Sequence* atomPort; | |||
Lv2HostDescriptor() | |||
: bufferSize(0), | |||
sampleRate(0.0), | |||
audioPorts{nullptr}, | |||
atomPort(nullptr) {} | |||
}; | |||
#else | |||
struct Lv2HostDescriptor; | |||
#endif | |||
#include <QtCore/QTextStream> | |||
CARLA_BACKEND_START_NAMESPACE | |||
@@ -52,10 +32,9 @@ class CarlaEngineNative : public PluginDescriptorClass, | |||
public CarlaEngine | |||
{ | |||
public: | |||
CarlaEngineNative(const HostDescriptor* const host, Lv2HostDescriptor* const lv2Host = nullptr) | |||
CarlaEngineNative(const HostDescriptor* const host) | |||
: PluginDescriptorClass(host), | |||
CarlaEngine(), | |||
fLv2Host(lv2Host) | |||
CarlaEngine() | |||
{ | |||
carla_debug("CarlaEngineNative::CarlaEngineNative()"); | |||
@@ -75,14 +54,6 @@ public: | |||
setAboutToClose(); | |||
removeAllPlugins(); | |||
close(); | |||
#ifdef WANT_LV2 | |||
if (fLv2Host != nullptr) | |||
{ | |||
delete fLv2Host; | |||
delete hostHandle(); | |||
} | |||
#endif | |||
} | |||
protected: | |||
@@ -594,118 +565,6 @@ protected: | |||
// ------------------------------------------------------------------- | |||
#ifdef WANT_LV2 | |||
Lv2HostDescriptor* const fLv2Host; | |||
// ------------------------------------------------------------------- | |||
public: | |||
#define handlePtr ((Lv2HostDescriptor*)handle) | |||
static uint32_t lv2host_get_buffer_size(HostHandle handle) | |||
{ | |||
return handlePtr->bufferSize; | |||
} | |||
static double lv2host_get_sample_rate(HostHandle handle) | |||
{ | |||
return handlePtr->sampleRate; | |||
} | |||
static const TimeInfo* lv2host_get_time_info(HostHandle handle) | |||
{ | |||
return &handlePtr->timeInfo; | |||
} | |||
static bool lv2host_write_midi_event(HostHandle, const MidiEvent*) | |||
{ | |||
// MIDI Out not supported yet | |||
return false; | |||
} | |||
static void lv2host_ui_parameter_changed(HostHandle, uint32_t, float) {} | |||
static void lv2host_ui_midi_program_changed(HostHandle, uint8_t, uint32_t, uint32_t) {} | |||
static void lv2host_ui_custom_data_changed(HostHandle, const char*, const char*) {} | |||
static void lv2host_ui_closed(HostHandle) {} | |||
static const char* lv2host_ui_open_file(HostHandle, bool, const char*, const char*) { return nullptr; } | |||
static const char* lv2host_ui_save_file(HostHandle, bool, const char*, const char*) { return nullptr; } | |||
static intptr_t lv2host_dispatcher(HostHandle, HostDispatcherOpcode, int32_t, intptr_t, void*) { return 0; } | |||
#undef handlePtr | |||
// ------------------------------------------------------------------- | |||
#define handlePtr ((CarlaEngineNative*)handle) | |||
static LV2_Handle lv2_instantiate(const LV2_Descriptor*, double sampleRate, const char*, const LV2_Feature* const* /*features*/) | |||
{ | |||
Lv2HostDescriptor* const lv2Host(new Lv2HostDescriptor()); | |||
lv2Host->bufferSize = 1024; // TODO | |||
lv2Host->sampleRate = sampleRate; | |||
lv2Host->timeInfo.frame = 0; | |||
lv2Host->timeInfo.usecs = 0; | |||
lv2Host->timeInfo.playing = false; | |||
lv2Host->timeInfo.bbt.valid = false; | |||
HostDescriptor* const host(new HostDescriptor); | |||
host->handle = lv2Host; | |||
host->ui_name = nullptr; | |||
host->get_buffer_size = lv2host_get_buffer_size; | |||
host->get_sample_rate = lv2host_get_sample_rate; | |||
host->get_time_info = lv2host_get_time_info; | |||
host->write_midi_event = lv2host_write_midi_event; | |||
host->ui_parameter_changed = lv2host_ui_parameter_changed; | |||
host->ui_custom_data_changed = lv2host_ui_custom_data_changed; | |||
host->ui_closed = lv2host_ui_closed; | |||
host->ui_open_file = lv2host_ui_open_file; | |||
host->ui_save_file = lv2host_ui_save_file; | |||
host->dispatcher = lv2host_dispatcher; | |||
return new CarlaEngineNative(host, lv2Host); | |||
} | |||
static void lv2_connect_port(LV2_Handle handle, uint32_t port, void* dataLocation) | |||
{ | |||
if (port < 4) | |||
handlePtr->fLv2Host->audioPorts[port] = (float*)dataLocation; | |||
else if (port == 4) | |||
handlePtr->fLv2Host->atomPort = (LV2_Atom_Sequence*)dataLocation; | |||
} | |||
static void lv2_activate(LV2_Handle handle) | |||
{ | |||
handlePtr->activate(); | |||
} | |||
static void lv2_run(LV2_Handle handle, uint32_t sampleCount) | |||
{ | |||
float* inBuffer[2] = { handlePtr->fLv2Host->audioPorts[0], handlePtr->fLv2Host->audioPorts[1] }; | |||
float* outBuffer[2] = { handlePtr->fLv2Host->audioPorts[2], handlePtr->fLv2Host->audioPorts[3] }; | |||
// TODO - get midiEvents and timePos from atomPort | |||
handlePtr->process(inBuffer, outBuffer, sampleCount, 0, nullptr); | |||
} | |||
static void lv2_deactivate(LV2_Handle handle) | |||
{ | |||
handlePtr->deactivate(); | |||
} | |||
static void lv2_cleanup(LV2_Handle handle) | |||
{ | |||
delete handlePtr; | |||
} | |||
static const void* lv2_extension_data(const char* /*uri*/) | |||
{ | |||
return nullptr; | |||
} | |||
#undef handlePtr | |||
#endif | |||
private: | |||
PluginDescriptorClassEND(CarlaEngineNative) | |||
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaEngineNative) | |||
@@ -729,19 +588,6 @@ static const PluginDescriptor carlaDesc = { | |||
PluginDescriptorFILL(CarlaEngineNative) | |||
}; | |||
#ifdef WANT_LV2 | |||
static const LV2_Descriptor carlaLv2Desc = { | |||
/* URI */ "http://kxstudio.sf.net/carla", | |||
/* instantiate */ CarlaEngineNative::lv2_instantiate, | |||
/* connect_port */ CarlaEngineNative::lv2_connect_port, | |||
/* activate */ CarlaEngineNative::lv2_activate, | |||
/* run */ CarlaEngineNative::lv2_run, | |||
/* deactivate */ CarlaEngineNative::lv2_deactivate, | |||
/* cleanup */ CarlaEngineNative::lv2_cleanup, | |||
/* extension_data */ CarlaEngineNative::lv2_extension_data | |||
}; | |||
#endif | |||
void CarlaEngine::registerNativePlugin() | |||
{ | |||
carla_register_native_plugin(&carlaDesc); | |||
@@ -751,15 +597,4 @@ CARLA_BACKEND_END_NAMESPACE | |||
// ----------------------------------------------------------------------- | |||
#ifdef WANT_LV2 | |||
CARLA_EXPORT | |||
const LV2_Descriptor* lv2_descriptor(uint32_t index) | |||
{ | |||
CARLA_BACKEND_USE_NAMESPACE; | |||
return (index == 0) ? &carlaLv2Desc : nullptr; | |||
} | |||
#endif | |||
// ----------------------------------------------------------------------- | |||
#endif // ! BUILD_BRIDGE |
@@ -374,8 +374,8 @@ int CarlaEngineOsc::handleMessage(const bool isTCP, const char* const path, cons | |||
#ifdef WANT_LV2 | |||
if (std::strcmp(method, "lv2_atom_transfer") == 0) | |||
return handleMsgLv2AtomTransfer(plugin, argc, argv, types); | |||
if (std::strcmp(method, "lv2_event_transfer") == 0) | |||
return handleMsgLv2EventTransfer(plugin, argc, argv, types); | |||
if (std::strcmp(method, "lv2_urid_map") == 0) | |||
return handleMsgLv2UridMap(plugin, argc, argv, types); | |||
#endif | |||
carla_stderr("CarlaEngineOsc::handleMessage() - unsupported OSC method '%s'", method); | |||
@@ -90,8 +90,10 @@ public: | |||
fAudio(api), | |||
fAudioBufIn(nullptr), | |||
fAudioBufOut(nullptr), | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
fAudioBufRackIn{nullptr}, | |||
fAudioBufRackOut{nullptr}, | |||
#endif | |||
fAudioCountIn(0), | |||
fAudioCountOut(0), | |||
fAudioIsInterleaved(false), | |||
@@ -102,6 +104,11 @@ public: | |||
{ | |||
carla_debug("CarlaEngineRtAudio::CarlaEngineRtAudio(%i)", api); | |||
#ifndef CARLA_PROPER_CPP11_SUPPORT | |||
fAudioBufRackIn[0] = fAudioBufRackIn[1] = nullptr; | |||
fAudioBufRackOut[0] = fAudioBufRackOut[1] = nullptr; | |||
#endif | |||
// just to make sure | |||
fOptions.forceStereo = true; | |||
fOptions.processMode = PROCESS_MODE_CONTINUOUS_RACK; | |||
@@ -6,19 +6,19 @@ | |||
namespace DistrhoArtwork3BandEQ | |||
{ | |||
extern const char* aboutData; | |||
const unsigned int aboutDataSize = 230280; | |||
const unsigned int aboutDataSize = 172710; | |||
const unsigned int aboutWidth = 303; | |||
const unsigned int aboutHeight = 190; | |||
extern const char* aboutButtonHoverData; | |||
const unsigned int aboutButtonHoverDataSize = 11600; | |||
const unsigned int aboutButtonHoverWidth = 100; | |||
const unsigned int aboutButtonHoverHeight = 29; | |||
const unsigned int aboutButtonHoverDataSize = 7600; | |||
const unsigned int aboutButtonHoverWidth = 95; | |||
const unsigned int aboutButtonHoverHeight = 20; | |||
extern const char* aboutButtonNormalData; | |||
const unsigned int aboutButtonNormalDataSize = 11600; | |||
const unsigned int aboutButtonNormalWidth = 100; | |||
const unsigned int aboutButtonNormalHeight = 29; | |||
const unsigned int aboutButtonNormalDataSize = 7600; | |||
const unsigned int aboutButtonNormalWidth = 95; | |||
const unsigned int aboutButtonNormalHeight = 20; | |||
extern const char* backgroundData; | |||
const unsigned int backgroundDataSize = 437472; | |||
@@ -150,7 +150,7 @@ void DistrhoUI3BandEQ::imageButtonClicked(ImageButton* button, int) | |||
if (button != fButtonAbout) | |||
return; | |||
Image imageAbout(DistrhoArtwork3BandEQ::aboutData, DistrhoArtwork3BandEQ::aboutWidth, DistrhoArtwork3BandEQ::aboutHeight, GL_BGRA); | |||
Image imageAbout(DistrhoArtwork3BandEQ::aboutData, DistrhoArtwork3BandEQ::aboutWidth, DistrhoArtwork3BandEQ::aboutHeight, GL_BGR); | |||
ImageAboutWindow aboutWindow(getApp(), getParent(), imageAbout); | |||
aboutWindow.exec(); | |||
} | |||
@@ -6,19 +6,19 @@ | |||
namespace DistrhoArtwork3BandSplitter | |||
{ | |||
extern const char* aboutData; | |||
const unsigned int aboutDataSize = 230280; | |||
const unsigned int aboutDataSize = 172710; | |||
const unsigned int aboutWidth = 303; | |||
const unsigned int aboutHeight = 190; | |||
extern const char* aboutButtonHoverData; | |||
const unsigned int aboutButtonHoverDataSize = 11600; | |||
const unsigned int aboutButtonHoverWidth = 100; | |||
const unsigned int aboutButtonHoverHeight = 29; | |||
const unsigned int aboutButtonHoverDataSize = 7600; | |||
const unsigned int aboutButtonHoverWidth = 95; | |||
const unsigned int aboutButtonHoverHeight = 20; | |||
extern const char* aboutButtonNormalData; | |||
const unsigned int aboutButtonNormalDataSize = 11600; | |||
const unsigned int aboutButtonNormalWidth = 100; | |||
const unsigned int aboutButtonNormalHeight = 29; | |||
const unsigned int aboutButtonNormalDataSize = 7600; | |||
const unsigned int aboutButtonNormalWidth = 95; | |||
const unsigned int aboutButtonNormalHeight = 20; | |||
extern const char* backgroundData; | |||
const unsigned int backgroundDataSize = 437472; | |||
@@ -150,7 +150,7 @@ void DistrhoUI3BandSplitter::imageButtonClicked(ImageButton* button, int) | |||
if (button != fButtonAbout) | |||
return; | |||
Image imageAbout(DistrhoArtwork3BandSplitter::aboutData, DistrhoArtwork3BandSplitter::aboutWidth, DistrhoArtwork3BandSplitter::aboutHeight, GL_BGRA); | |||
Image imageAbout(DistrhoArtwork3BandSplitter::aboutData, DistrhoArtwork3BandSplitter::aboutWidth, DistrhoArtwork3BandSplitter::aboutHeight, GL_BGR); | |||
ImageAboutWindow aboutWindow(getApp(), getParent(), imageAbout); | |||
aboutWindow.exec(); | |||
} | |||
@@ -79,7 +79,8 @@ ifeq ($(HAVE_OPENGL),true) | |||
OBJS += \ | |||
distrho-3bandeq.cpp.o \ | |||
distrho-3bandsplitter.cpp.o \ | |||
distrho-pingpongpan.cpp.o | |||
distrho-pingpongpan.cpp.o \ | |||
distrho-stereoenhancer.cpp.o | |||
endif | |||
# DISTRHO plugins (Qt) | |||
@@ -173,6 +174,9 @@ distrho-3bandsplitter.cpp.o: distrho-3bandsplitter.cpp 3bandsplitter/*.cpp 3band | |||
distrho-pingpongpan.cpp.o: distrho-pingpongpan.cpp pingpongpan/*.cpp pingpongpan/*.h pingpongpan/*.hpp distrho/DistrhoPluginCarla.cpp $(CXXDEPS) | |||
$(CXX) $< $(GL_CXX_FLAGS) -Ipingpongpan -DDISTRHO_NAMESPACE=DISTRHO_PingPongPan -c -o $@ | |||
distrho-stereoenhancer.cpp.o: distrho-stereoenhancer.cpp stereoenhancer/*.cpp stereoenhancer/*.h stereoenhancer/*.hpp distrho/DistrhoPluginCarla.cpp $(CXXDEPS) | |||
$(CXX) $< $(GL_CXX_FLAGS) -Istereoenhancer -DDISTRHO_NAMESPACE=DISTRHO_StereoEnhancer -c -o $@ | |||
distrho-notes.cpp.o: distrho-notes.cpp notes/moc_DistrhoUINotes.cpp notes/*.cpp notes/*.h notes/*.hpp distrho/DistrhoPluginCarla.cpp $(CXXDEPS) | |||
$(CXX) $< $(BUILD_CXX_FLAGS) -Inotes -DDISTRHO_NAMESPACE=DISTRHO_Notes -c -o $@ | |||
@@ -29,7 +29,7 @@ START_NAMESPACE_DISTRHO | |||
// ----------------------------------------------------------------------- | |||
static PluginDescriptor tBandEqDesc = { | |||
static PluginDescriptor pppDesc = { | |||
/* category */ PLUGIN_CATEGORY_UTILITY, | |||
/* hints */ static_cast<PluginHints>(PLUGIN_IS_RTSAFE|PLUGIN_HAS_GUI), | |||
/* audioIns */ DISTRHO_PLUGIN_NUM_INPUTS, | |||
@@ -52,7 +52,7 @@ END_NAMESPACE_DISTRHO | |||
void carla_register_native_plugin_PingPongPan() | |||
{ | |||
USE_NAMESPACE_DISTRHO | |||
carla_register_native_plugin(&tBandEqDesc); | |||
carla_register_native_plugin(&pppDesc); | |||
} | |||
// ----------------------------------------------------------------------- |
@@ -6,29 +6,29 @@ | |||
namespace DistrhoArtworkPingPongPan | |||
{ | |||
extern const char* aboutData; | |||
const unsigned int aboutDataSize = 230280; | |||
const unsigned int aboutDataSize = 172710; | |||
const unsigned int aboutWidth = 303; | |||
const unsigned int aboutHeight = 190; | |||
extern const char* aboutButtonHoverData; | |||
const unsigned int aboutButtonHoverDataSize = 9600; | |||
const unsigned int aboutButtonHoverWidth = 96; | |||
const unsigned int aboutButtonHoverHeight = 25; | |||
const unsigned int aboutButtonHoverDataSize = 7600; | |||
const unsigned int aboutButtonHoverWidth = 95; | |||
const unsigned int aboutButtonHoverHeight = 20; | |||
extern const char* aboutButtonNormalData; | |||
const unsigned int aboutButtonNormalDataSize = 9600; | |||
const unsigned int aboutButtonNormalWidth = 96; | |||
const unsigned int aboutButtonNormalHeight = 25; | |||
const unsigned int aboutButtonNormalDataSize = 7600; | |||
const unsigned int aboutButtonNormalWidth = 95; | |||
const unsigned int aboutButtonNormalHeight = 20; | |||
extern const char* backgroundData; | |||
const unsigned int backgroundDataSize = 200736; | |||
const unsigned int backgroundDataSize = 150552; | |||
const unsigned int backgroundWidth = 369; | |||
const unsigned int backgroundHeight = 136; | |||
extern const char* knobData; | |||
const unsigned int knobDataSize = 742716; | |||
const unsigned int knobWidth = 69; | |||
const unsigned int knobHeight = 2691; | |||
const unsigned int knobDataSize = 721344; | |||
const unsigned int knobWidth = 68; | |||
const unsigned int knobHeight = 2652; | |||
} | |||
#endif // BINARY_DISTRHOARTWORKPINGPONGPAN_HPP | |||
@@ -28,7 +28,7 @@ DistrhoUIPingPongPan::DistrhoUIPingPongPan() | |||
Window* win = getParent(); | |||
// background | |||
fImgBackground = Image(DistrhoArtworkPingPongPan::backgroundData, DistrhoArtworkPingPongPan::backgroundWidth, DistrhoArtworkPingPongPan::backgroundHeight, GL_BGRA); | |||
fImgBackground = Image(DistrhoArtworkPingPongPan::backgroundData, DistrhoArtworkPingPongPan::backgroundWidth, DistrhoArtworkPingPongPan::backgroundHeight, GL_BGR); | |||
// knobs | |||
Image knobImage(DistrhoArtworkPingPongPan::knobData, DistrhoArtworkPingPongPan::knobWidth, DistrhoArtworkPingPongPan::knobHeight); | |||
@@ -96,7 +96,7 @@ void DistrhoUIPingPongPan::imageButtonClicked(ImageButton* button, int) | |||
if (button != fButtonAbout) | |||
return; | |||
Image imageAbout(DistrhoArtworkPingPongPan::aboutData, DistrhoArtworkPingPongPan::aboutWidth, DistrhoArtworkPingPongPan::aboutHeight, GL_BGRA); | |||
Image imageAbout(DistrhoArtworkPingPongPan::aboutData, DistrhoArtworkPingPongPan::aboutWidth, DistrhoArtworkPingPongPan::aboutHeight, GL_BGR); | |||
ImageAboutWindow aboutWindow(getApp(), getParent(), imageAbout); | |||
aboutWindow.exec(); | |||
} | |||
@@ -717,10 +717,10 @@ static const struct ProgramsDestructor { | |||
// ----------------------------------------------------------------------- | |||
static const PluginDescriptor zynAddSubFxDesc = { | |||
static const PluginDescriptor zynaddsubfxDesc = { | |||
/* category */ PLUGIN_CATEGORY_SYNTH, | |||
#ifdef WANT_ZYNADDSUBFX_UI | |||
/* hints */ static_cast<PluginHints>(PLUGIN_IS_SYNTH|PLUGIN_HAS_GUI/*|PLUGIN_USES_SINGLE_THREAD*/|PLUGIN_USES_STATE), | |||
/* hints */ static_cast<PluginHints>(PLUGIN_IS_SYNTH|PLUGIN_HAS_GUI|PLUGIN_USES_STATE), | |||
#else | |||
/* hints */ static_cast<PluginHints>(PLUGIN_IS_SYNTH|PLUGIN_USES_STATE), | |||
#endif | |||
@@ -741,7 +741,7 @@ static const PluginDescriptor zynAddSubFxDesc = { | |||
void carla_register_native_plugin_zynaddsubfx() | |||
{ | |||
carla_register_native_plugin(&zynAddSubFxDesc); | |||
carla_register_native_plugin(&zynaddsubfxDesc); | |||
} | |||
// ----------------------------------------------------------------------- |
@@ -61,6 +61,7 @@ void carla_register_all_plugins() | |||
carla_register_native_plugin_3BandEQ(); | |||
carla_register_native_plugin_3BandSplitter(); | |||
carla_register_native_plugin_PingPongPan(); | |||
carla_register_native_plugin_StereoEnhancer(); | |||
#endif | |||
// DISTRHO plugins (Qt) | |||
@@ -24,6 +24,10 @@ | |||
CARLA_BRIDGE_START_NAMESPACE | |||
#if 0 | |||
} // Fix editor indentation | |||
#endif | |||
// --------------------------------------------------------------------- | |||
CarlaBridgeClient::CarlaBridgeClient(const char* const uiTitle) | |||
@@ -16,13 +16,16 @@ | |||
*/ | |||
#include "CarlaBridgeOsc.hpp" | |||
#include "CarlaBridgeClient.hpp" | |||
#include "CarlaMIDI.h" | |||
#include "CarlaUtils.hpp" | |||
CARLA_BRIDGE_START_NAMESPACE | |||
#if 0 | |||
} // Fix editor indentation | |||
#endif | |||
// ----------------------------------------------------------------------- | |||
CarlaBridgeOsc::CarlaBridgeOsc(CarlaBridgeClient* const client) | |||
@@ -138,7 +141,7 @@ int CarlaBridgeOsc::handleMessage(const char* const path, const int argc, const | |||
return 1; | |||
} | |||
const size_t nameSize = fName.length(); | |||
const size_t nameSize(fName.length()); | |||
// Check if message is for this client | |||
if (std::strlen(path) <= nameSize || std::strncmp(path+1, (const char*)fName, nameSize) != 0) | |||
@@ -191,17 +194,15 @@ int CarlaBridgeOsc::handleMessage(const char* const path, const int argc, const | |||
// Plugin methods | |||
if (std::strcmp(method, "plugin_save_now") == 0) | |||
return handleMsgPluginSaveNow(); | |||
// TODO: | |||
//if (std::strcmp(method, "plugin_set_parameter_midi_channel") == 0) | |||
// return handleMsgPluginSetParameterMidiChannel(argv); | |||
//if (std::strcmp(method, "plugin_set_parameter_midi_cc") == 0) | |||
// return handleMsgPluginSetParameterMidiCC(argv); | |||
if (std::strcmp(method, "plugin_set_chunk") == 0) | |||
return handleMsgPluginSetChunk(argc, argv, types); | |||
if (std::strcmp(method, "plugin_set_custom_data") == 0) | |||
return handleMsgPluginSetCustomData(argc, argv, types); | |||
#if 0 | |||
// TODO | |||
if (std::strcmp(method, "set_parameter_midi_channel") == 0) | |||
return osc_set_parameter_midi_channel_handler(argv); | |||
if (std::strcmp(method, "set_parameter_midi_cc") == 0) | |||
return osc_set_parameter_midi_channel_handler(argv); | |||
#endif | |||
#endif | |||
carla_stderr("CarlaBridgeOsc::handleMessage(\"%s\", ...) - received unsupported OSC method '%s'", path, method); | |||
@@ -75,8 +75,7 @@ class CarlaBridgeToolkitQt: public CarlaBridgeToolkit, | |||
public: | |||
CarlaBridgeToolkitQt(CarlaBridgeClient* const client, const char* const uiTitle) | |||
: CarlaBridgeToolkit(client, uiTitle), | |||
QObject(nullptr), | |||
settings("falkTX", appName) | |||
QObject(nullptr) | |||
{ | |||
carla_debug("CarlaBridgeToolkitQt::CarlaBridgeToolkitQt(%p, \"%s\")", client, uiTitle); | |||
@@ -96,18 +95,18 @@ public: | |||
~CarlaBridgeToolkitQt() override | |||
{ | |||
carla_debug("CarlaBridgeToolkitQt::~CarlaBridgeToolkitQt()"); | |||
CARLA_ASSERT(! app); | |||
CARLA_ASSERT(! window); | |||
CARLA_ASSERT(! msgTimer); | |||
carla_debug("CarlaBridgeToolkitQt::~CarlaBridgeToolkitQt()"); | |||
} | |||
void init() override | |||
{ | |||
carla_debug("CarlaBridgeToolkitQt::init()"); | |||
CARLA_ASSERT(! app); | |||
CARLA_ASSERT(! window); | |||
CARLA_ASSERT(! msgTimer); | |||
carla_debug("CarlaBridgeToolkitQt::init()"); | |||
app = new QApplication(qargc, qargv); | |||
@@ -136,10 +135,10 @@ public: | |||
void exec(const bool showGui) override | |||
{ | |||
carla_debug("CarlaBridgeToolkitQt::exec(%s)", bool2str(showGui)); | |||
CARLA_ASSERT(app); | |||
CARLA_ASSERT(window); | |||
CARLA_ASSERT(kClient); | |||
carla_debug("CarlaBridgeToolkitQt::exec(%s)", bool2str(showGui)); | |||
#if defined(BRIDGE_QT4) || defined(BRIDGE_QT5) | |||
QWidget* const widget = (QWidget*)kClient->getWidget(); | |||
@@ -161,23 +160,27 @@ public: | |||
window->setWindowTitle(kUiTitle); | |||
if (settings.contains(QString("%1/pos_x").arg(kUiTitle))) | |||
{ | |||
bool hasX, hasY; | |||
int posX = settings.value(QString("%1/pos_x").arg(kUiTitle), window->x()).toInt(&hasX); | |||
int posY = settings.value(QString("%1/pos_y").arg(kUiTitle), window->y()).toInt(&hasY); | |||
if (hasX && hasY) | |||
window->move(posX, posY); | |||
QSettings settings("falkTX", appName); | |||
if (kClient->isResizable()) | |||
if (settings.contains(QString("%1/pos_x").arg(kUiTitle))) | |||
{ | |||
bool hasWidth, hasHeight; | |||
int width = settings.value(QString("%1/width").arg(kUiTitle), window->width()).toInt(&hasWidth); | |||
int height = settings.value(QString("%1/height").arg(kUiTitle), window->height()).toInt(&hasHeight); | |||
if (hasWidth && hasHeight) | |||
window->resize(width, height); | |||
bool hasX, hasY; | |||
int posX = settings.value(QString("%1/pos_x").arg(kUiTitle), window->x()).toInt(&hasX); | |||
int posY = settings.value(QString("%1/pos_y").arg(kUiTitle), window->y()).toInt(&hasY); | |||
if (hasX && hasY) | |||
window->move(posX, posY); | |||
if (kClient->isResizable()) | |||
{ | |||
bool hasWidth, hasHeight; | |||
int width = settings.value(QString("%1/width").arg(kUiTitle), window->width()).toInt(&hasWidth); | |||
int height = settings.value(QString("%1/height").arg(kUiTitle), window->height()).toInt(&hasHeight); | |||
if (hasWidth && hasHeight) | |||
window->resize(width, height); | |||
} | |||
} | |||
} | |||
@@ -198,8 +201,8 @@ public: | |||
void quit() override | |||
{ | |||
carla_debug("CarlaBridgeToolkitQt::quit()"); | |||
CARLA_ASSERT(app); | |||
carla_debug("CarlaBridgeToolkitQt::quit()"); | |||
if (msgTimer != 0) | |||
{ | |||
@@ -209,6 +212,7 @@ public: | |||
if (window != nullptr) | |||
{ | |||
QSettings settings("falkTX", appName); | |||
settings.setValue(QString("%1/pos_x").arg(kUiTitle), window->x()); | |||
settings.setValue(QString("%1/pos_y").arg(kUiTitle), window->y()); | |||
settings.setValue(QString("%1/width").arg(kUiTitle), window->width()); | |||
@@ -246,8 +250,8 @@ public: | |||
void show() override | |||
{ | |||
carla_debug("CarlaBridgeToolkitQt::show()"); | |||
CARLA_ASSERT(window); | |||
carla_debug("CarlaBridgeToolkitQt::show()"); | |||
if (window) | |||
window->show(); | |||
@@ -255,8 +259,8 @@ public: | |||
void hide() override | |||
{ | |||
carla_debug("CarlaBridgeToolkitQt::hide()"); | |||
CARLA_ASSERT(window); | |||
carla_debug("CarlaBridgeToolkitQt::hide()"); | |||
if (window) | |||
window->hide(); | |||
@@ -264,8 +268,8 @@ public: | |||
void resize(const int width, const int height) override | |||
{ | |||
carla_debug("CarlaBridgeToolkitQt::resize(%i, %i)", width, height); | |||
CARLA_ASSERT(window); | |||
carla_debug("CarlaBridgeToolkitQt::resize(%i, %i)", width, height); | |||
if (app->thread() != QThread::currentThread()) | |||
{ | |||
@@ -287,8 +291,8 @@ public: | |||
#ifdef BRIDGE_CONTAINER | |||
void* getContainerId() | |||
{ | |||
carla_debug("CarlaBridgeToolkitQt::getContainerId()"); | |||
CARLA_ASSERT(window != nullptr); | |||
carla_debug("CarlaBridgeToolkitQt::getContainerId()"); | |||
if (embedContainer == nullptr) | |||
{ | |||
@@ -308,7 +312,6 @@ public: | |||
protected: | |||
QApplication* app; | |||
QMainWindow* window; | |||
QSettings settings; | |||
int msgTimer; | |||
bool needsResize; | |||
@@ -434,7 +434,7 @@ public: | |||
// initialize UI | |||
#ifdef BRIDGE_LV2_X11 | |||
features[lv2_feature_id_ui_parent]->data = getContainerId(); | |||
//features[lv2_feature_id_ui_parent]->data = getContainerId(); | |||
#endif | |||
handle = descriptor->instantiate(descriptor, pluginURI, rdf_ui_descriptor->Bundle, carla_lv2_ui_write_function, this, &widget, features); | |||
@@ -19,6 +19,8 @@ QT_UI_FLAGS = $(shell pkg-config --cflags QtGui) | |||
QT_UI_LIBS = $(shell pkg-config --libs QtGui) | |||
endif | |||
QT_UI_FLAGS += -I../theme | |||
# -------------------------------------------------------------- | |||
BUILD_CXX_FLAGS += -DBUILD_BRIDGE | |||
@@ -133,10 +135,10 @@ LINK_UI_LV2_GTK2_FLAGS = $(LINK_UI_FLAGS) $(shell pkg-config --libs gtk+-2.0) | |||
BUILD_UI_LV2_GTK3_FLAGS = $(BUILD_UI_LV2_FLAGS) -DBRIDGE_GTK3 -DBRIDGE_LV2_GTK3 $(shell pkg-config --cflags gtk+-3.0) | |||
LINK_UI_LV2_GTK3_FLAGS = $(LINK_UI_FLAGS) $(shell pkg-config --libs gtk+-3.0) | |||
BUILD_UI_LV2_QT4_FLAGS = $(BUILD_UI_LV2_FLAGS) -DBRIDGE_QT4 -DBRIDGE_LV2_QT4 $(shell pkg-config --cflags QtGui) | |||
BUILD_UI_LV2_QT4_FLAGS = $(BUILD_UI_LV2_FLAGS) -DBRIDGE_QT4 -DBRIDGE_LV2_QT4 $(shell pkg-config --cflags QtGui) -I../theme | |||
LINK_UI_LV2_QT4_FLAGS = $(LINK_UI_FLAGS) $(shell pkg-config --libs QtGui) | |||
BUILD_UI_LV2_QT5_FLAGS = $(BUILD_UI_LV2_FLAGS) -DBRIDGE_QT5 -DBRIDGE_LV2_QT5 $(shell pkg-config --cflags Qt5Gui Qt5Widgets) | |||
BUILD_UI_LV2_QT5_FLAGS = $(BUILD_UI_LV2_FLAGS) -DBRIDGE_QT5 -DBRIDGE_LV2_QT5 $(shell pkg-config --cflags Qt5Gui Qt5Widgets) -I../theme | |||
LINK_UI_LV2_QT5_FLAGS = $(LINK_UI_FLAGS) $(shell pkg-config --libs Qt5Gui Qt5Widgets) | |||
BUILD_UI_LV2_COCOA_FLAGS = $(BUILD_UI_VST_FLAGS) -DBRIDGE_COCOA -DBRIDGE_LV2_COCOA $(QT_UI_FLAGS) | |||
@@ -273,7 +275,7 @@ OBJS_UI_LV2_X11 = CarlaBridgeUI-LV2__lv2-x11.o \ | |||
CarlaBridgeClient__lv2.o CarlaBridgeOsc__lv2.o \ | |||
CarlaBridgeToolkit__lv2.o CarlaBridgeToolkitQt__lv2-x11.o | |||
carla-bridge-lv2-x11: $(OBJS_UI_LV2_X11) $(OBJS_UI_LV2_LIBS) | |||
carla-bridge-lv2-x11: $(OBJS_UI_LV2_X11) $(OBJS_UI_LV2_LIBS) ../libs/theme.a | |||
$(CXX) $^ $(LINK_UI_LV2_X11_FLAGS) -o $@ && $(STRIP) $@ | |||
%__lv2-x11.o: %.cpp | |||
@@ -286,7 +288,7 @@ OBJS_UI_VST_HWND = CarlaBridgeUI-VST__vst-hwnd.o \ | |||
CarlaBridgeClient__vst.o CarlaBridgeOsc__vst.o \ | |||
CarlaBridgeToolkit__vst.o CarlaBridgeToolkitQt__vst-hwnd.o | |||
carla-bridge-vst-hwnd.exe: $(OBJS_UI_VST_HWND) | |||
carla-bridge-vst-hwnd.exe: $(OBJS_UI_VST_HWND) ../libs/theme.a | |||
$(CXX) $^ $(LINK_UI_VST_HWND_FLAGS) -o $@ && $(STRIP) $@ | |||
%__vst-hwnd.o: %.cpp | |||
@@ -299,7 +301,7 @@ OBJS_UI_VST_X11 = CarlaBridgeUI-VST__vst-x11.o \ | |||
CarlaBridgeClient__vst.o CarlaBridgeOsc__vst.o \ | |||
CarlaBridgeToolkit__vst.o CarlaBridgeToolkitQt__vst-x11.o | |||
carla-bridge-vst-x11: $(OBJS_UI_VST_X11) | |||
carla-bridge-vst-x11: $(OBJS_UI_VST_X11) ../libs/theme.a | |||
$(CXX) $^ $(LINK_UI_VST_X11_FLAGS) -o $@ && $(STRIP) $@ | |||
%__vst-x11.o: %.cpp | |||
@@ -1212,8 +1212,15 @@ void do_vst_check(void* const libHandle, const bool init) | |||
VstEventsFixed() | |||
: numEvents(0), | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
reserved(0), | |||
data{0} {} | |||
#else | |||
reserved(0) | |||
{ | |||
data[0] = data[1] = nullptr; | |||
} | |||
#endif | |||
} events; | |||
VstMidiEvent midiEvents[2]; | |||
@@ -130,8 +130,10 @@ struct LADSPA_RDF_ScalePoint { | |||
delete[] Label; | |||
} | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
LADSPA_RDF_ScalePoint(LADSPA_RDF_ScalePoint&) = delete; | |||
LADSPA_RDF_ScalePoint(const LADSPA_RDF_ScalePoint&) = delete; | |||
#endif | |||
}; | |||
// Port | |||
@@ -162,8 +164,10 @@ struct LADSPA_RDF_Port { | |||
delete[] ScalePoints; | |||
} | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
LADSPA_RDF_Port(LADSPA_RDF_Port&) = delete; | |||
LADSPA_RDF_Port(const LADSPA_RDF_Port&) = delete; | |||
#endif | |||
}; | |||
// Plugin | |||
@@ -194,8 +198,10 @@ struct LADSPA_RDF_Descriptor { | |||
delete[] Ports; | |||
} | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
LADSPA_RDF_Descriptor(LADSPA_RDF_Descriptor&) = delete; | |||
LADSPA_RDF_Descriptor(const LADSPA_RDF_Descriptor&) = delete; | |||
#endif | |||
}; | |||
#endif // LADSPA_RDF_INCLUDED |
@@ -18,7 +18,11 @@ | |||
#ifndef LV2_RDF_INCLUDED | |||
#define LV2_RDF_INCLUDED | |||
#include <cstdint> | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
# include <cstdint> | |||
#else | |||
# include <stdint.h> | |||
#endif | |||
// Base Types | |||
typedef const char* LV2_URI; | |||
@@ -295,8 +299,10 @@ struct LV2_RDF_PortMidiMap { | |||
: Type(0), | |||
Number(0) {} | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
LV2_RDF_PortMidiMap(LV2_RDF_PortMidiMap&) = delete; | |||
LV2_RDF_PortMidiMap(const LV2_RDF_PortMidiMap&) = delete; | |||
#endif | |||
}; | |||
// Port Points | |||
@@ -312,8 +318,10 @@ struct LV2_RDF_PortPoints { | |||
Minimum(0.0f), | |||
Maximum(1.0f) {} | |||
//LV2_RDF_PortPoints(LV2_RDF_PortPoints&) = delete; | |||
//LV2_RDF_PortPoints(const LV2_RDF_PortPoints&) = delete; | |||
#if 0 // def CARLA_PROPER_CPP11_SUPPORT FIXME! | |||
LV2_RDF_PortPoints(LV2_RDF_PortPoints&) = delete; | |||
LV2_RDF_PortPoints(const LV2_RDF_PortPoints&) = delete; | |||
#endif | |||
}; | |||
// Port Unit | |||
@@ -341,8 +349,10 @@ struct LV2_RDF_PortUnit { | |||
delete[] Symbol; | |||
} | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
LV2_RDF_PortUnit(LV2_RDF_PortUnit&) = delete; | |||
LV2_RDF_PortUnit(const LV2_RDF_PortUnit&) = delete; | |||
#endif | |||
}; | |||
// Port Scale Point | |||
@@ -360,8 +370,10 @@ struct LV2_RDF_PortScalePoint { | |||
delete[] Label; | |||
} | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
LV2_RDF_PortScalePoint(LV2_RDF_PortScalePoint&) = delete; | |||
LV2_RDF_PortScalePoint(const LV2_RDF_PortScalePoint&) = delete; | |||
#endif | |||
}; | |||
// Port | |||
@@ -398,8 +410,10 @@ struct LV2_RDF_Port { | |||
delete[] ScalePoints; | |||
} | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
LV2_RDF_Port(LV2_RDF_Port&) = delete; | |||
LV2_RDF_Port(const LV2_RDF_Port&) = delete; | |||
#endif | |||
}; | |||
// Preset | |||
@@ -419,8 +433,10 @@ struct LV2_RDF_Preset { | |||
delete[] Label; | |||
} | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
LV2_RDF_Preset(LV2_RDF_Preset&) = delete; | |||
LV2_RDF_Preset(const LV2_RDF_Preset&) = delete; | |||
#endif | |||
}; | |||
// Feature | |||
@@ -438,8 +454,10 @@ struct LV2_RDF_Feature { | |||
delete[] URI; | |||
} | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
LV2_RDF_Feature(LV2_RDF_Feature&) = delete; | |||
LV2_RDF_Feature(const LV2_RDF_Feature&) = delete; | |||
#endif | |||
}; | |||
// UI | |||
@@ -479,8 +497,10 @@ struct LV2_RDF_UI { | |||
delete[] Extensions; | |||
} | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
LV2_RDF_UI(LV2_RDF_UI&) = delete; | |||
LV2_RDF_UI(const LV2_RDF_UI&) = delete; | |||
#endif | |||
}; | |||
// Plugin | |||
@@ -510,8 +530,12 @@ struct LV2_RDF_Descriptor { | |||
LV2_RDF_UI* UIs; | |||
LV2_RDF_Descriptor() | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
: Type{0x0}, | |||
URI(nullptr), | |||
#else | |||
: URI(nullptr), | |||
#endif | |||
Name(nullptr), | |||
Author(nullptr), | |||
License(nullptr), | |||
@@ -527,7 +551,12 @@ struct LV2_RDF_Descriptor { | |||
ExtensionCount(0), | |||
Extensions(nullptr), | |||
UICount(0), | |||
UIs(nullptr) {} | |||
UIs(nullptr) | |||
{ | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
Type[0] = Type[1] = 0x0; | |||
#endif | |||
} | |||
~LV2_RDF_Descriptor() | |||
{ | |||
@@ -555,8 +584,10 @@ struct LV2_RDF_Descriptor { | |||
delete[] UIs; | |||
} | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
LV2_RDF_Descriptor(LV2_RDF_Descriptor&) = delete; | |||
LV2_RDF_Descriptor(const LV2_RDF_Descriptor&) = delete; | |||
#endif | |||
}; | |||
#endif // LV2_RDF_INCLUDED |
@@ -19,8 +19,6 @@ | |||
#include "DistrhoUtils.hpp" | |||
#include <cstdint> | |||
START_NAMESPACE_DISTRHO | |||
// ------------------------------------------------- | |||
@@ -19,8 +19,6 @@ | |||
#include "DistrhoUtils.hpp" | |||
#include <cstdint> | |||
START_NAMESPACE_DISTRHO | |||
// ------------------------------------------------- | |||
@@ -31,6 +31,12 @@ | |||
# include <unistd.h> | |||
#endif | |||
#ifdef PROPER_CPP11_SUPPORT | |||
# include <cstdint> | |||
#else | |||
# include <stdint.h> | |||
#endif | |||
START_NAMESPACE_DISTRHO | |||
// ------------------------------------------------- | |||
@@ -27,6 +27,23 @@ | |||
# define DGL_OS_LINUX 1 | |||
#endif | |||
#if defined(HAVE_CPP11_SUPPORT) | |||
# define PROPER_CPP11_SUPPORT | |||
#elif defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__) | |||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 | |||
# define PROPER_CPP11_SUPPORT | |||
# if (__GNUC__ * 100 + __GNUC_MINOR__) < 407 | |||
# define override // gcc4.7+ only | |||
# endif | |||
# endif | |||
#endif | |||
#ifndef PROPER_CPP11_SUPPORT | |||
# define override | |||
# define noexcept | |||
# define nullptr (0) | |||
#endif | |||
#define DGL_NAMESPACE DGL | |||
#define START_NAMESPACE_DGL namespace DGL_NAMESPACE { | |||
@@ -21,7 +21,11 @@ | |||
#include "Widget.hpp" | |||
#include "Window.hpp" | |||
#include <cstdint> | |||
#ifdef PROPER_CPP11_SUPPORT | |||
# include <cstdint> | |||
#else | |||
# include <stdint.h> | |||
#endif | |||
START_NAMESPACE_DGL | |||
@@ -19,7 +19,11 @@ | |||
#include "Geometry.hpp" | |||
#include <cstdint> | |||
#ifdef PROPER_CPP11_SUPPORT | |||
# include <cstdint> | |||
#else | |||
# include <stdint.h> | |||
#endif | |||
START_NAMESPACE_DGL | |||
@@ -105,6 +105,8 @@ void Image::draw(int x, int y) | |||
if (! isValid()) | |||
return; | |||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1); | |||
glPixelStorei(GL_PACK_ALIGNMENT, 1); | |||
glRasterPos2i(x, fSize.getHeight()+y); | |||
glDrawPixels(fSize.getWidth(), fSize.getHeight(), fFormat, fType, fRawData); | |||
} | |||
@@ -25,13 +25,7 @@ ImageAboutWindow::ImageAboutWindow(App* app, Window* parent, const Image& image) | |||
Widget(this), | |||
fImgBackground(image) | |||
{ | |||
#if DGL_OS_WINDOWS | |||
// FIXME | |||
Window::setSize(image.getWidth(), image.getHeight()+1); | |||
#else | |||
Window::setSize(image.getWidth(), image.getHeight()); | |||
#endif | |||
Window::setWindowTitle("About"); | |||
} | |||
@@ -120,6 +120,8 @@ void ImageKnob::onDisplay() | |||
int imageDataSize = layerDataSize * fImgLayerCount; | |||
int imageDataOffset = imageDataSize - layerDataSize - (layerDataSize * int(normValue * float(fImgLayerCount-1))); | |||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1); | |||
glPixelStorei(GL_PACK_ALIGNMENT, 1); | |||
glRasterPos2i(getX(), getY()+getHeight()); | |||
glDrawPixels(fImgLayerSize, fImgLayerSize, fImage.getFormat(), fImage.getType(), fImage.getRawData() + imageDataOffset); | |||
} | |||
@@ -55,10 +55,14 @@ public: | |||
: kApp(app), | |||
kAppPriv(appPriv), | |||
kSelf(self), | |||
kView(puglCreate(parentId, "Window", 600, 500, (parentId != 0), (parentId != 0))), | |||
kView(puglCreate(parentId, "Window", 600, 500, false, (parentId != 0))), | |||
fParent(parent), | |||
fChildFocus(nullptr), | |||
#if DGL_OS_MAC | |||
fVisible(true), | |||
#else | |||
fVisible((parentId != 0)), | |||
#endif | |||
fClosed(false), | |||
fResizable(false), | |||
#if DGL_OS_WINDOWS | |||
@@ -107,6 +111,11 @@ public: | |||
#endif | |||
kAppPriv->addWindow(kSelf); | |||
#if DGL_OS_MAC | |||
// TODO | |||
kAppPriv->oneShown(); | |||
#endif | |||
} | |||
~Private() | |||
@@ -162,9 +171,7 @@ public: | |||
fClosed = true; | |||
if (fParent != nullptr) | |||
{ | |||
fParent->fChildFocus = nullptr; | |||
} | |||
} | |||
void focus() | |||
@@ -222,6 +229,14 @@ public: | |||
void setVisible(bool yesNo, bool closed = false) | |||
{ | |||
#if DGL_OS_MAC | |||
// TODO | |||
if (closed && ! yesNo) | |||
kAppPriv->oneHidden(); | |||
return; | |||
#endif | |||
if (fVisible == yesNo) | |||
return; | |||
@@ -300,7 +300,7 @@ getModifiers(PuglView* view, NSEvent* ev) | |||
- (void) flagsChanged:(NSEvent*)event | |||
{ | |||
if (puglview->specialFunc) { | |||
const unsigned mods = getModifiers(puglview, [event modifierFlags]); | |||
const unsigned mods = getModifiers(puglview, event); | |||
if ((mods & PUGL_MOD_SHIFT) != (puglview->mods & PUGL_MOD_SHIFT)) { | |||
puglview->specialFunc(puglview, mods & PUGL_MOD_SHIFT, PUGL_KEY_SHIFT); | |||
} else if ((mods & PUGL_MOD_CTRL) != (puglview->mods & PUGL_MOD_CTRL)) { | |||
@@ -57,12 +57,6 @@ | |||
# endif | |||
#endif | |||
#if defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__) | |||
# if (__GNUC__ * 100 + __GNUC_MINOR__) < 407 | |||
# define override // gcc4.7+ only | |||
# endif | |||
#endif | |||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) | |||
# define DISTRHO_PLUGIN_EXPORT extern "C" __declspec (dllexport) | |||
# define DISTRHO_OS_WINDOWS 1 | |||
@@ -85,6 +79,23 @@ | |||
# define DISTRHO_DLL_EXTENSION "so" | |||
#endif | |||
#if defined(HAVE_CPP11_SUPPORT) | |||
# define PROPER_CPP11_SUPPORT | |||
#elif defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__) | |||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 | |||
# define PROPER_CPP11_SUPPORT | |||
# if (__GNUC__ * 100 + __GNUC_MINOR__) < 407 | |||
# define override // gcc4.7+ only | |||
# endif | |||
# endif | |||
#endif | |||
#ifndef PROPER_CPP11_SUPPORT | |||
# define override | |||
# define noexcept | |||
# define nullptr (0) | |||
#endif | |||
#ifndef DISTRHO_NO_NAMESPACE | |||
# ifndef DISTRHO_NAMESPACE | |||
# define DISTRHO_NAMESPACE DISTRHO | |||
@@ -20,7 +20,11 @@ | |||
# error DSSI always uses external UI, no wrapper neeed! | |||
#endif | |||
#define TEST_ONLY | |||
#ifndef TEST_ONLY | |||
#include <lo/lo.h> | |||
#endif | |||
#ifdef DISTRHO_UI_QT | |||
# include <QtGui/QApplication> | |||
@@ -34,6 +38,9 @@ START_NAMESPACE_DISTRHO | |||
// ------------------------------------------------- | |||
#ifdef TEST_ONLY | |||
struct OscData {}; | |||
#else | |||
struct OscData { | |||
lo_address addr; | |||
const char* path; | |||
@@ -79,6 +86,7 @@ void osc_send_exiting(const OscData* oscData) | |||
strcat(targetPath, "/exiting"); | |||
lo_send(oscData->addr, targetPath, ""); | |||
} | |||
#endif | |||
// ------------------------------------------------- | |||
@@ -137,8 +145,10 @@ public: | |||
qtTimer = 0; | |||
} | |||
#endif | |||
#ifndef TEST_ONLY | |||
if (kOscData->server && ! fHostClosed) | |||
osc_send_exiting(kOscData); | |||
#endif | |||
} | |||
#ifndef DISTRHO_UI_QT | |||
@@ -146,10 +156,12 @@ public: | |||
{ | |||
while (! glApp.isQuiting()) | |||
{ | |||
#ifndef TEST_ONLY | |||
if (kOscData->server != nullptr) | |||
{ | |||
while (lo_server_recv_noblock(kOscData->server, 0) != 0) {} | |||
} | |||
#endif | |||
glApp.idle(); | |||
@@ -242,6 +254,7 @@ public: | |||
// --------------------------------------------- | |||
protected: | |||
#ifndef TEST_ONLY | |||
void setParameterValue(uint32_t rindex, float value) | |||
{ | |||
if (kOscData->server == nullptr) | |||
@@ -270,6 +283,7 @@ protected: | |||
osc_send_midi(kOscData, mdata); | |||
} | |||
#endif | |||
void uiResize(unsigned int width, unsigned int height) | |||
{ | |||
@@ -317,17 +331,23 @@ private: | |||
static void setParameterCallback(void* ptr, uint32_t rindex, float value) | |||
{ | |||
#ifndef TEST_ONLY | |||
uiPtr->setParameterValue(rindex, value); | |||
#endif | |||
} | |||
static void setStateCallback(void* ptr, const char* key, const char* value) | |||
{ | |||
#ifndef TEST_ONLY | |||
uiPtr->setState(key, value); | |||
#endif | |||
} | |||
static void uiSendNoteCallback(void* ptr, bool onOff, uint8_t channel, uint8_t note, uint8_t velocity) | |||
{ | |||
#ifndef TEST_ONLY | |||
uiPtr->uiSendNote(onOff, channel, note, velocity); | |||
#endif | |||
} | |||
static void uiResizeCallback(void* ptr, unsigned int width, unsigned int height) | |||
@@ -341,7 +361,11 @@ private: | |||
// ------------------------------------------------- | |||
static UIDssi* globalUI = nullptr; | |||
#ifdef TEST_ONLY | |||
static OscData gOscData; | |||
#else | |||
static OscData gOscData = { nullptr, nullptr, nullptr }; | |||
#endif | |||
static const char* gUiTitle = nullptr; | |||
static void initUiIfNeeded() | |||
@@ -357,6 +381,7 @@ static void initUiIfNeeded() | |||
// ------------------------------------------------- | |||
#ifndef TEST_ONLY | |||
int osc_debug_handler(const char* path, const char*, lo_arg**, int, lo_message, void*) | |||
{ | |||
d_debug("osc_debug_handler(\"%s\")", path); | |||
@@ -478,6 +503,7 @@ int osc_quit_handler(const char*, const char*, lo_arg**, int, lo_message, void*) | |||
return 0; | |||
} | |||
#endif | |||
END_NAMESPACE_DISTRHO | |||
@@ -485,8 +511,10 @@ int main(int argc, char* argv[]) | |||
{ | |||
USE_NAMESPACE_DISTRHO | |||
#ifndef TEST_ONLY | |||
// dummy test mode | |||
if (argc == 1) | |||
#endif | |||
{ | |||
#ifdef DISTRHO_UI_QT | |||
QApplication app(argc, argv, true); | |||
@@ -508,6 +536,7 @@ int main(int argc, char* argv[]) | |||
return 0; | |||
} | |||
#ifndef TEST_ONLY | |||
if (argc != 5) | |||
{ | |||
fprintf(stderr, "Usage: %s <osc-url> <plugin-dll> <plugin-label> <instance-name>\n", argv[0]); | |||
@@ -645,4 +674,5 @@ int main(int argc, char* argv[]) | |||
lo_server_free(oscServer); | |||
return ret; | |||
#endif | |||
} |
@@ -37,7 +37,12 @@ | |||
#define JACK_DEFAULT_MIDI_TYPE "8 bit raw midi" | |||
#include <cstddef> | |||
#include <cstdint> | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
# include <cstdint> | |||
#else | |||
# include <stdint.h> | |||
#endif | |||
enum JackOptions { | |||
JackNullOption = 0x00, | |||
@@ -11,7 +11,7 @@ include ../Makefile.mk | |||
BUILD_CXX_FLAGS += -I../backend -I../includes -I../libs -I../theme -I../utils -Wall -Wextra | |||
# BUILD_CXX_FLAGS += -isystem ../libs/juce | |||
# BUILD_CXX_FLAGS += -DWANT_JACK -DWANT_LADSPA -DWANT_DSSI | |||
BUILD_CXX_FLAGS += -isystem /usr/include/qt4 | |||
# BUILD_CXX_FLAGS += -isystem /usr/include/qt4 | |||
# BUILD_CXX_FLAGS += -isystem ../backend/engine/rtaudio-4.0.11 | |||
# BUILD_CXX_FLAGS += -I/opt/mingw32/include | |||
@@ -20,7 +20,17 @@ ANSI_CXX_FLAGS += -Wcast-qual -Wconversion -Wsign-conversion -Wlogical-op -Wagg | |||
ANSI_CXX_FLAGS += -std=c++11 -Wzero-as-null-pointer-constant | |||
ANSI_CXX_FLAGS += -DBUILD_ANSI_TEST -DVESTIGE_HEADER -fPIC | |||
TARGETS = ANSI CarlaString DGL RtList Print Utils | |||
ifeq ($(MACOS),true) | |||
DGL_LIBS = -framework OpenGL -framework Cocoa | |||
else | |||
DGL_LIBS = -lGL -lX11 | |||
endif | |||
ifeq ($(MACOS),true) | |||
TARGETS = CarlaString DGL Print | |||
else | |||
TARGETS = ANSI CarlaString DGL Print RtList Utils | |||
endif | |||
all: $(TARGETS) RUN | |||
@@ -33,7 +43,10 @@ CarlaString: CarlaString.cpp | |||
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ | |||
DGL: DGL.cpp DGL_Artwork.cpp ../libs/dgl.a | |||
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -lGL -lX11 -o $@ | |||
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) -o $@ | |||
MacTest: MacTest.cpp | |||
$(CXX) MacTest.cpp -o $@ | |||
RtList: RtList.cpp ../utils/RtList.hpp ../libs/rtmempool.a | |||
$(CXX) RtList.cpp ../libs/rtmempool.a $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -pthread -lpthread -o $@ | |||
@@ -44,9 +57,6 @@ Print: Print.cpp | |||
Utils: Utils.cpp | |||
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ | |||
Rewire.exe: Rewire.cpp | |||
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -lversion -o $@ | |||
RUN: $(TARGETS) | |||
# valgrind ./Base64 | |||
# ./ANSI | |||
@@ -34,8 +34,10 @@ struct MyData { | |||
: str(id), | |||
idStr(id) {} | |||
#ifdef PROPER_CPP11_SUPPORT | |||
MyData(MyData&) = delete; | |||
MyData(const MyData&) = delete; | |||
#endif | |||
}; | |||
struct PostRtEvents { | |||
@@ -150,7 +152,7 @@ int main() | |||
for (auto it = postRtEvents.data.begin(); it.valid(); it.next()) | |||
{ | |||
MyData& my = *it; | |||
MyData& my(*it); | |||
printf("FOR DATA!!!: %i %s\n", my.idStr, (const char*)my.str); | |||
@@ -59,6 +59,11 @@ private: \ | |||
#define CARLA_JOIN_MACRO_HELPER(a, b) a ## b | |||
#define CARLA_JOIN_MACRO(item1, item2) CARLA_JOIN_MACRO_HELPER (item1, item2) | |||
/** Remove unsupported macros */ | |||
#ifndef CARLA_PROPER_CPP11_SUPPORT | |||
# undef CARLA_DECLARE_NON_COPY_STRUCT | |||
# define CARLA_DECLARE_NON_COPY_STRUCT(...) | |||
#endif | |||
//============================================================================== | |||
/** | |||
@@ -20,7 +20,6 @@ | |||
#include "CarlaJuceUtils.hpp" | |||
#include <cstdint> | |||
#include <lo/lo.h> | |||
// ------------------------------------------------- | |||
@@ -82,6 +82,9 @@ struct StateCustomData { | |||
typedef NonRtList<StateParameter*> StateParameterList; | |||
typedef NonRtList<StateCustomData*> StateCustomDataList; | |||
typedef NonRtList<StateParameter*>::Itenerator StateParameterItenerator; | |||
typedef NonRtList<StateCustomData*>::Itenerator StateCustomDataItenerator; | |||
struct SaveState { | |||
const char* type; | |||
const char* name; | |||
@@ -180,13 +183,13 @@ struct SaveState { | |||
currentMidiBank = -1; | |||
currentMidiProgram = -1; | |||
for (auto it = parameters.begin(); it.valid(); it.next()) | |||
for (StateParameterItenerator it = parameters.begin(); it.valid(); it.next()) | |||
{ | |||
StateParameter* const stateParameter(*it); | |||
delete stateParameter; | |||
} | |||
for (auto it = customData.begin(); it.valid(); it.next()) | |||
for (StateCustomDataItenerator it = customData.begin(); it.valid(); it.next()) | |||
{ | |||
StateCustomData* const stateCustomData(*it); | |||
delete stateCustomData; | |||
@@ -534,7 +537,7 @@ const QString& getXMLFromSaveState(const SaveState& saveState) | |||
content += data; | |||
} | |||
for (auto it = saveState.parameters.begin(); it.valid(); it.next()) | |||
for (StateParameterItenerator it = saveState.parameters.begin(); it.valid(); it.next()) | |||
{ | |||
StateParameter* const stateParameter(*it); | |||
@@ -585,7 +588,7 @@ const QString& getXMLFromSaveState(const SaveState& saveState) | |||
content += midiProgram; | |||
} | |||
for (auto it = saveState.customData.begin(); it.valid(); it.next()) | |||
for (StateCustomDataItenerator it = saveState.customData.begin(); it.valid(); it.next()) | |||
{ | |||
StateCustomData* const stateCustomData(*it); | |||
@@ -26,6 +26,12 @@ | |||
#include <cstdlib> | |||
#include <cstring> | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
# include <cstdint> | |||
#else | |||
# include <stdint.h> | |||
#endif | |||
#if defined(CARLA_OS_HAIKU) | |||
# include <kernel/OS.h> | |||
#elif defined(CARLA_OS_LINUX) | |||
@@ -375,15 +381,18 @@ void carla_zeroFloat(float* const data, const size_t size) | |||
#ifdef CARLA_OS_MAC | |||
namespace std { | |||
inline float | |||
fmin(float __x, float __y) | |||
{ return __builtin_fminf(__x, __y); } | |||
inline float | |||
fmax(float __x, float __y) | |||
{ return __builtin_fmaxf(__x, __y); } | |||
inline float | |||
rint(float __x) | |||
{ return __builtin_rintf(__x); } | |||
// inline float | |||
// fabs(float __x) | |||
// { return __builtin_fabsf(__x); } | |||
// inline float | |||
// fmin(float __x, float __y) | |||
// { return __builtin_fminf(__x, __y); } | |||
// inline float | |||
// fmax(float __x, float __y) | |||
// { return __builtin_fmaxf(__x, __y); } | |||
// inline float | |||
// rint(float __x) | |||
// { return __builtin_rintf(__x); } | |||
} | |||
#endif | |||
@@ -20,7 +20,6 @@ | |||
#include "CarlaUtils.hpp" | |||
#include <cstdint> | |||
#include <cstring> | |||
// ------------------------------------------------- | |||
@@ -47,6 +47,19 @@ protected: | |||
k_list_head siblings; | |||
}; | |||
List() | |||
: kDataSize(sizeof(Data)), | |||
fCount(0) | |||
{ | |||
_init(); | |||
} | |||
virtual ~List() | |||
{ | |||
CARLA_ASSERT(fCount == 0); | |||
} | |||
public: | |||
class Itenerator { | |||
public: | |||
Itenerator(const k_list_head* queue) | |||
@@ -87,19 +100,6 @@ protected: | |||
friend class List; | |||
}; | |||
List() | |||
: kDataSize(sizeof(Data)), | |||
fCount(0) | |||
{ | |||
_init(); | |||
} | |||
public: | |||
virtual ~List() | |||
{ | |||
CARLA_ASSERT(fCount == 0); | |||
} | |||
Itenerator begin() const | |||
{ | |||
return Itenerator(&fQueue); | |||