From 95e74413c12366048ab6f42516715bc2b77aa072 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 16 Apr 2013 03:23:43 +0100 Subject: [PATCH] Cleanup --- source/backend/native/sunvox-file.cpp | 20 ++++++-------------- source/backend/plugin/NativePlugin.cpp | 4 ++-- source/includes/sunvox/sunvox.h | 2 +- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/source/backend/native/sunvox-file.cpp b/source/backend/native/sunvox-file.cpp index cd774ba94..7f1209ca0 100644 --- a/source/backend/native/sunvox-file.cpp +++ b/source/backend/native/sunvox-file.cpp @@ -33,12 +33,6 @@ public: { sv_open_slot(fSlot); sv_set_autostop(fSlot, 0); - - // TESTING - carla_stdout("sv_load"); - sv_load(fSlot, "/home/falktx/bin/sunvox/examples/8bit_tales.sunvox"); - carla_stdout("sv_load - FINISHED"); - sv_play_from_beginning(fSlot); } ~SunVoxFilePlugin() override @@ -58,13 +52,14 @@ protected: if (std::strcmp(key, "file") != 0) return; - //sv_load(fSlot, value); + sv_load(fSlot, value); + sv_play_from_beginning(fSlot); } // ------------------------------------------------------------------- // Plugin process calls - void process(float** inBuf, float** outBuf, const uint32_t frames, const uint32_t, const MidiEvent* const) override + void process(float**, float** outBuf, const uint32_t frames, const uint32_t, const MidiEvent* const) override { const TimeInfo* const timePos = getTimeInfo(); @@ -78,13 +73,10 @@ protected: svBuffer[j++] = outBuf[1][i]; } - //double tickFrame = double(timePos->frame)*sTicksPerFrame; - //int outTime = (timePos->usecs - ) & 0xFFFFFFFF; - unsigned int tick = 0; sv_get_ticks()& 0xFFFFFFFF; - - sv_audio_callback(svBuffer, frames, 0, tick); + unsigned int ticks = sv_get_ticks(); + ticks += timePos->frame * sTicksPerFrame; - printf("Line counter: %d, ticks: %u\n", sv_get_current_line(fSlot), tick); + sv_audio_callback(svBuffer, frames, 0, ticks+10000); } else { diff --git a/source/backend/plugin/NativePlugin.cpp b/source/backend/plugin/NativePlugin.cpp index 27e9ab97a..68f298a5c 100644 --- a/source/backend/plugin/NativePlugin.cpp +++ b/source/backend/plugin/NativePlugin.cpp @@ -41,7 +41,7 @@ void carla_register_all_plugins() #ifndef CARLA_OS_WIN carla_register_native_plugin_nekofilter(); #endif - //carla_register_native_plugin_sunvoxfile(); // unfinished + carla_register_native_plugin_sunvoxfile(); // unfinished // Carla //carla_register_native_plugin_carla(); // unfinished @@ -510,7 +510,7 @@ public: CARLA_ASSERT(type != nullptr); CARLA_ASSERT(key != nullptr); CARLA_ASSERT(value != nullptr); - carla_debug("DssiPlugin::setCustomData(%s, %s, %s, %s)", type, key, value, bool2str(sendGui)); + carla_debug("NativePlugin::setCustomData(%s, %s, %s, %s)", type, key, value, bool2str(sendGui)); if (type == nullptr) return carla_stderr2("NativePlugin::setCustomData(\"%s\", \"%s\", \"%s\", %s) - type is null", type, key, value, bool2str(sendGui)); diff --git a/source/includes/sunvox/sunvox.h b/source/includes/sunvox/sunvox.h index 70098b1e9..46c4d4fa8 100644 --- a/source/includes/sunvox/sunvox.h +++ b/source/includes/sunvox/sunvox.h @@ -54,7 +54,7 @@ typedef struct #endif #if defined(__linux__) || defined(linux) #define LINUX - #define LIBNAME "./sunvox.so" + #define LIBNAME "sunvox.so" #endif #if defined(OSX) || defined(LINUX) #define UNIX