build SG surface driver as an OS X bundle, and do a better job with the implementation itself (probably not finished yet)

git-svn-id: svn://localhost/ardour2/branches/3.0-SG@12603 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2012-06-08 12:53:22 +00:00
parent 75a91de35e
commit b4a3b29b97
3 changed files with 100 additions and 59 deletions

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>SurfaceDriver_App</string>
<key>CFBundleIdentifier</key>
<string>com.linuxaudiosystems.SurfaceDriver-App</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View file

@ -3,6 +3,14 @@
#include <WavesPublicAPI/WavesMixerAPI/1.0/WavesMixerAPI.h>
#include <WavesPublicAPI/WTErr.h>
#include <pbd/compose.h>
#include "ardour/soundgrid.h"
#include "ardour/debug.h"
using ARDOUR::SoundGrid;
using namespace PBD;
/*
struct WSCoreCallbackTable
{
@ -11,79 +19,100 @@ 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";
uint32_t
WMSD_QueryInterfaceVersion()
{
return 0;
DEBUG_TRACE (DEBUG::SoundGrid, string_compose ("SurfaceDriver:%1\n", __FUNCTION__));
return WMSD_INTERFACE_VERSION;
}
WSDSurfaceHandle
WMSD_CreateSurfaceFromPreset(const WSDCoreHandle hostHandle,
const WSCoreCallbackTable* pCallbackTable, const WSMixerConfig* pMixerConfig,
const void* pPresetChunk, WSDSize presetSize)
WMSD_CreateSurfaceFromPreset (const WSDCoreHandle hostHandle,
const WSCoreCallbackTable* pCallbackTable, const WSMixerConfig* pMixerConfig,
const void*, WSDSize)
{
return eNoErr;
DEBUG_TRACE (DEBUG::SoundGrid, string_compose ("SurfaceDriver:%1\n", __FUNCTION__));
SoundGrid::driver_register (hostHandle, pCallbackTable, pMixerConfig);
return (WSDSurfaceHandle) &SoundGrid::instance();
}
WMSDErr
WMSD_GetAvailableSurfaceInfo(struct WMSD_SURFACEINFO *p)
WMSD_GetAvailableSurfaceInfo (struct WMSD_SURFACEINFO *p)
{
snprintf (p->surfaceDriverName, sizeof (p->surfaceDriverName), "Ardour");
snprintf (p->surfaceDriverCategory, sizeof (p->surfaceDriverCategory), "Ardour");
snprintf (p->surfaceType, sizeof (p->surfaceType), "Ardour");
DEBUG_TRACE (DEBUG::SoundGrid, string_compose ("SurfaceDriver:%1\n", __FUNCTION__));
strncpy (p->surfaceDriverName, "ArdourSurfaceDriver", WMSD_MAX_SURFACEDRIVERNAME_LENGTH);
strncpy (p->surfaceDriverCategory, "Ardour", WMSD_MAX_SURFACEDRIVERCATEGORY_LENGTH);
strncpy (p->surfaceType, surface_type, WMSD_MAX_SURFACETYPE_LENGTH);
return eNoErr;
}
WSDSurfaceHandle
WMSD_CreateSurfaceForType(const char* pSurfaceType,
const WSDCoreHandle hostHandle, const WSCoreCallbackTable* pCallbackTable,
const WSMixerConfig* pMixerConfig)
WMSD_CreateSurfaceForType (const char* /* pSurfaceType */,
const WSDCoreHandle hostHandle, const WSCoreCallbackTable* pCallbackTable,
const WSMixerConfig* pMixerConfig)
{
DEBUG_TRACE (DEBUG::SoundGrid, string_compose ("SurfaceDriver:%1\n", __FUNCTION__));
SoundGrid::driver_register (hostHandle, pCallbackTable, pMixerConfig);
return (WSDSurfaceHandle) &SoundGrid::instance();
}
WMSDErr
WMSD_ShowConfigWindow (const WSDSurfaceHandle /* surfaceHandle */)
{
DEBUG_TRACE (DEBUG::SoundGrid, string_compose ("SurfaceDriver:%1\n", __FUNCTION__));
return eNoErr;
}
WMSDErr
WMSD_ShowConfigWindow(const WSDSurfaceHandle surfaceHandle)
WMSD_IdentifySurface (const WSDSurfaceHandle /*surfaceHandle*/, const bool /*turnOnLed*/)
{
DEBUG_TRACE (DEBUG::SoundGrid, string_compose ("SurfaceDriver:%1\n", __FUNCTION__));
return eNoErr;
}
WMSDErr
WMSD_IdentifySurface(const WSDSurfaceHandle surfaceHandle, const bool turnOnLed)
WMSD_GetPreset (const WSDSurfaceHandle /*surfaceHandle*/, void* /*pPresetChunk*/, WSDSize *pPresetSize)
{
DEBUG_TRACE (DEBUG::SoundGrid, string_compose ("SurfaceDriver:%1\n", __FUNCTION__));
*pPresetSize = 0;
return eNoErr;
}
WMSDErr
WMSD_GetPreset(const WSDSurfaceHandle surfaceHandle, void *pPresetChunk,
WSDSize *pPresetSize)
WMSD_SetPreset (const WSDSurfaceHandle /*surfaceHandle*/, void* /*pPresetChunk*/, WSDSize /*presetSize*/)
{
DEBUG_TRACE (DEBUG::SoundGrid, string_compose ("SurfaceDriver:%1\n", __FUNCTION__));
return eNoErr;
}
WMSDErr
WMSD_SetPreset(const WSDSurfaceHandle surfaceHandle, void *pPresetChunk,
WSDSize presetSize)
WMSD_SurfaceDisplayUpdate (const WSDSurfaceHandle /*surfaceHandle*/,
const struct WSControlID* /*pControlID*/)
{
DEBUG_TRACE (DEBUG::SoundGrid, string_compose ("SurfaceDriver:%1\n", __FUNCTION__));
return eNoErr;
}
WMSDErr
WMSD_SurfaceDisplayUpdate(const WSDSurfaceHandle surfaceHandle,
const struct WSControlID *pControlID)
WMSD_DestroySurface (const WSDSurfaceHandle /*surfaceHandle*/)
{
DEBUG_TRACE (DEBUG::SoundGrid, string_compose ("SurfaceDriver:%1\n", __FUNCTION__));
SoundGrid::driver_register (0, 0, 0);
return eNoErr;
}
WMSDErr
WMSD_DestroySurface(const WSDSurfaceHandle surfaceHandle)
WMSD_GetTypeForSurface (const WSDSurfaceHandle /*surfaceHandle*/, char *out_surfaceType)
{
DEBUG_TRACE (DEBUG::SoundGrid, string_compose ("SurfaceDriver:%1\n", __FUNCTION__));
strncpy (out_surfaceType, surface_type, WMSD_MAX_SURFACETYPE_LENGTH);
return eNoErr;
}
WMSDErr
WMSD_GetTypeForSurface(const WSDSurfaceHandle surfaceHandle, char *out_surfaceType)
{
return eNoErr;
}
} /* extern "C" */

View file

@ -4,57 +4,47 @@ from waflib import TaskGen
import os
import sys
# Version of this package (even if built as a child)
MAJOR = '1'
MINOR = '0'
MICRO = '0'
LIBSGARDOUR_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
# Library version (UNIX style major, minor, micro)
# major increment <=> incompatible changes
# minor increment <=> compatible changes (additions)
# micro increment <=> no interface changes
LIBSGARDOUR_LIB_VERSION = '1.0.0'
# Variables for 'waf dist'
APPNAME = 'libsgardour'
VERSION = LIBSGARDOUR_VERSION
VERSION = '1.0.0'
I18N_PACKAGE = 'libsgardour'
# Mandatory variables
top = '.'
out = 'build'
path_prefix = 'libs/sgardour/'
def options(opt):
autowaf.set_options(opt)
def configure(conf):
conf.load('compiler_cxx')
autowaf.configure(conf)
autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
conf.write_config_header('libsgardour-config.h', remove=False)
# Boost headers
autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
def bundlify(bld):
# ensure the bundle directory folder is in place
p = bld.path.find_dir ('.')
# copy the object into it
# copy the Info.plist file
def build(bld):
# Library
if bld.is_defined ('HAVE_SOUNDGRID'):
driver = bld(features = 'cxx cxxshlib')
driver.source = [ 'driver.cc' ]
driver.export_includes = ['.']
driver.includes = ['.']
driver.name = 'libsgardour'
driver.target = 'sgardour'
driver.uselib = [ 'SOUNDGRID', 'GLIBMM', 'SIGCPP', 'XML', 'UUID', 'SNDFILE', 'GIOMM' ]
driver.use = [ 'libardour' ]
driver.vnum = LIBSGARDOUR_LIB_VERSION
driver.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
driver.defines = ['PACKAGE="' + I18N_PACKAGE + '"']
object = bld.program (
source = [ 'driver.cc' ],
target = 'SurfaceDriver_App',
includes = ['.'],
linkflags = '-bundle',
use = [ 'libardour' ],
install_path = os.path.join(bld.env['LIBDIR'], 'ardour3'),
defines = ['PACKAGE="' + I18N_PACKAGE + '"']
)
bld (rule='mkdir -p ${TGT}',
target=bld.path.get_bld().make_node ('SurfaceDriver_App.bundle/Contents/MacOS'))
bld (rule='cp ${SRC} ${TGT}',
target=bld.path.get_bld().make_node ('SurfaceDriver_App.bundle/Contents/Info.plist'),
source=bld.path.make_node ('Info.plist.in'))
bld (rule='cp ${SRC} ${TGT}',
target=bld.path.get_bld().make_node('SurfaceDriver_App.bundle/Contents/MacOS/SurfaceDriver_App'),
source=bld.path.get_bld().make_node ('SurfaceDriver_App'))
def shutdown():
autowaf.shutdown()