From 576f73e03249dc56ce662e2beb8f7dd03f1c0166 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 2 Aug 2012 00:02:32 +0000 Subject: [PATCH] build system and minor code changes to work with new mixercoresg framework git-svn-id: svn://localhost/ardour2/branches/3.0-SG@13104 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/soundgrid.h | 6 +++--- libs/ardour/soundgrid.mm | 26 ++++++++++++++++++++++---- libs/ardour/wscript | 2 +- libs/soundgrid/driver.cc | 7 ++----- libs/soundgrid/wscript | 4 +++- wscript | 19 +++++++++++++------ 6 files changed, 44 insertions(+), 20 deletions(-) diff --git a/libs/ardour/ardour/soundgrid.h b/libs/ardour/ardour/soundgrid.h index ca0216900a..2a2a9d1d85 100644 --- a/libs/ardour/ardour/soundgrid.h +++ b/libs/ardour/ardour/soundgrid.h @@ -29,7 +29,7 @@ #include #include -#include +#include #include "pbd/signals.h" @@ -104,8 +104,8 @@ class SoundGrid : public boost::noncopyable void _finalize (void* ecc, int state); void event_completed (int); - static WTErr _sg_callback (const WSControlID* pControlID); - static WTErr sg_callback (const WSControlID* pControlID); + static WTErr _sg_callback (void*, const WSControlID* pControlID); + WTErr sg_callback (const WSControlID* pControlID); WTErr get (WSControlID*, WSControlInfo*); WTErr set (WSEvent*, const std::string&); diff --git a/libs/ardour/soundgrid.mm b/libs/ardour/soundgrid.mm index fc61bb219f..b01c8f6f6d 100644 --- a/libs/ardour/soundgrid.mm +++ b/libs/ardour/soundgrid.mm @@ -22,7 +22,7 @@ #include #include -#include +#include #include "pbd/compose.h" #include "pbd/stacktrace.h" @@ -59,6 +59,9 @@ SoundGrid::SoundGrid () , _host_handle (0) , _pool (0) { +#if 0 + /* we link against the framework now */ + const char *s; string path; @@ -83,6 +86,8 @@ SoundGrid::SoundGrid () DEBUG_TRACE (DEBUG::SoundGrid, "\tfailed\n"); return; } +#endif + } SoundGrid::~SoundGrid() @@ -116,7 +121,20 @@ SoundGrid::initialize (void* window_handle) if (!_sg) { WTErr ret; DEBUG_TRACE (DEBUG::SoundGrid, "Initializing SG core...\n"); - if ((ret = InitializeMixerCoreDLL (window_handle, sg_callback, &_sg)) != eNoErr) { + + WSMixerConfig mixer_limits; + Init_WSMixerConfig (&mixer_limits); + //the following two are for physical input and output representations + mixer_limits.m_clusterConfigs[eClusterType_Inputs].m_uiIndexNum = 1; + mixer_limits.m_clusterConfigs[eClusterType_Outputs].m_uiIndexNum = 1; + + //the following is for the tracks that this app will create. + //This will probably be changed to eClusterType_Group in future. + mixer_limits.m_clusterConfigs[eClusterType_Input].m_uiIndexNum = 64; + + string driver_path = "build/libs/soundgrid/SurfaceDriverApp.bundle"; + + if ((ret = InitializeMixerCoreDLL (&mixer_limits, driver_path.c_str(), window_handle, _sg_callback, this, &_sg)) != eNoErr) { DEBUG_TRACE (DEBUG::SoundGrid, string_compose ("Initialized SG core, ret = %1 core handle %2\n", ret, _sg)); return -1; } @@ -367,9 +385,9 @@ SoundGrid::current_network_buffer_size () /* callback */ WTErr -SoundGrid::_sg_callback (const WSControlID* cid) +SoundGrid::_sg_callback (void* arg, const WSControlID* cid) { - return SoundGrid::instance().sg_callback (cid); + return ((SoundGrid*) arg)->sg_callback (cid); } WTErr diff --git a/libs/ardour/wscript b/libs/ardour/wscript index f2be76019d..867a841d80 100644 --- a/libs/ardour/wscript +++ b/libs/ardour/wscript @@ -367,7 +367,7 @@ def build(bld): 'libvampplugin','libtaglib','librubberband', 'libaudiographer'] if bld.is_defined ('HAVE_SOUNDGRID'): - obj.uselib += [ 'SOUNDGRID' ] + obj.uselib += [ 'SOUNDGRID' ] obj.vnum = LIBARDOUR_LIB_VERSION obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3') obj.defines = [ diff --git a/libs/soundgrid/driver.cc b/libs/soundgrid/driver.cc index 65a54f1889..7004707926 100644 --- a/libs/soundgrid/driver.cc +++ b/libs/soundgrid/driver.cc @@ -1,6 +1,6 @@ #include -#include +#include #include #include @@ -22,7 +22,7 @@ struct WSCoreCallbackTable /* This API is really a C API, but we want to be able to use C++ objects within it, so ... */ extern "C" { -static const char* surface_type = "ArdourSurface"; +static const char* surface_type = PROGRAM_NAME; uint32_t WMSD_QueryInterfaceVersion() @@ -118,9 +118,6 @@ WMSD_SurfaceDisplayUpdate (const WSDSurfaceHandle /*surfaceHandle*/, case eClusterType_Global_RequestTimeout: DEBUG_TRACE (DEBUG::SGSurface, "RequestTimeout\n"); break; - case eClusterType_Global_NetworkLatency: - DEBUG_TRACE (DEBUG::SGSurface, "NetworkLatency\n"); - break; case eClusterType_Global_SurfacesSetup: DEBUG_TRACE (DEBUG::SGSurface, "SurfacesSetup\n"); break; diff --git a/libs/soundgrid/wscript b/libs/soundgrid/wscript index bbaff8b109..98a512cd20 100644 --- a/libs/soundgrid/wscript +++ b/libs/soundgrid/wscript @@ -35,7 +35,9 @@ def build(bld): linkflags = '-bundle', use = [ 'libardour' ], install_path = os.path.join(bld.env['LIBDIR'], 'ardour3'), - defines = ['PACKAGE="' + I18N_PACKAGE + '"'] + defines = ['PACKAGE="' + I18N_PACKAGE + '"', + 'PROGRAM_NAME="' + bld.env['PROGRAM_NAME'] + '"' + ] ) bld (rule='mkdir -p ${TGT}', target=bld.path.get_bld().make_node ('SurfaceDriver_App.bundle/Contents/MacOS')) diff --git a/wscript b/wscript index 4a5ba3936f..abfa45a9e5 100644 --- a/wscript +++ b/wscript @@ -227,7 +227,7 @@ def set_compiler_flags (conf,opt): if sys.platform == 'darwin': optimization_flags.append ("-DBUILD_VECLIB_OPTIMIZATIONS"); debug_flags.append ("-DBUILD_VECLIB_OPTIMIZATIONS"); - conf.env.append_value('LINKFLAGS', "-framework Accelerate") + conf.env.append_value('LINKFLAGS', [ '-framework', 'Accelerate' ]) elif conf.env['build_target'] == 'i686' or conf.env['build_target'] == 'x86_64': optimization_flags.append ("-DBUILD_SSE_OPTIMIZATIONS") debug_flags.append ("-DBUILD_SSE_OPTIMIZATIONS") @@ -544,18 +544,25 @@ def configure(conf): conf.env.append_value ('CXXFLAGS_SOUNDGRID', [ '-D__MACOS__', '-DUSE_SOUNDGRID', - '-I/Volumes/Work/paul/ardour/3.0-SG/soundgrid', - '-I/Volumes/Work/paul/ardour/3.0-SG/soundgrid/WavesPublicAPI/WavesMixerAPI/1.0', + '-I/Volumes/Work/paul/ardour/3.0-SG/soundgrid', + '-I/Volumes/Work/paul/ardour/3.0-SG/soundgrid/WavesMixerAPI/1.0', '-I/Volumes/Work/paul/ardour/3.0-SG/soundgrid/WavesPublicAPI/1.0', + '-I/Volumes/Work/paul/ardour/3.0-SG/soundgrid/WavesPublicAPIs/', ]) conf.env.append_value ('CFLAGS_SOUNDGRID', [ '-D__MACOS__', '-DUSE_SOUNDGRID', - '-I/Volumes/Work/paul/ardour/3.0-SG/soundgrid', - '-I/Volumes/Work/paul/ardour/3.0-SG/soundgrid/WavesPublicAPI/WavesMixerAPI/1.0', + '-I/Volumes/Work/paul/ardour/3.0-SG/soundgrid', + '-I/Volumes/Work/paul/ardour/3.0-SG/soundgrid/WavesMixerAPI/1.0', '-I/Volumes/Work/paul/ardour/3.0-SG/soundgrid/WavesPublicAPI/1.0', + '-I/Volumes/Work/paul/ardour/3.0-SG/soundgrid/WavesPublicAPIs/', ]) - conf.check_cxx (header_name='WavesPublicAPI/WavesMixerAPI/1.0/WavesMixerAPI.h', + conf.env.append_value ('LINKFLAGS_SOUNDGRID', + [ '-Xlinker', '-rpath', '-Xlinker', '/Volumes/Work/paul/ardour/3.0-SG/soundgrid/WavesMixerCore', + '-F/Volumes/Work/paul/ardour/3.0-SG/soundgrid/WavesMixerCore', + '-framework', 'MixerCoreSG' + ]) + conf.check_cxx (header_name='WavesMixerAPI/1.0/WavesMixerAPI.h', mandatory=True, use='SOUNDGRID') conf.define('HAVE_SOUNDGRID', 1)