make ardour3 build and link on OS X (tiger, at least)

git-svn-id: svn://localhost/ardour2/branches/3.0@8018 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis
2010-11-13 05:14:48 +00:00
parent 520bc1bed4
commit b85b4d9e54
71 changed files with 1540 additions and 873 deletions

View File

@@ -108,8 +108,8 @@ private:
UInt32 mFrames;
// don't want to copy these.. can if you want, but more code to write!
AUOutputBL (const AUOutputBL &c) {}
AUOutputBL& operator= (const AUOutputBL& c) { return *this; }
AUOutputBL (const AUOutputBL &) {}
AUOutputBL& operator= (const AUOutputBL&) { return *this; }
};
#endif // __AUOutputBL_h__

View File

@@ -102,6 +102,6 @@ private:
// disallow
AUParamInfo () {}
AUParamInfo (const AUParamInfo &c) {}
AUParamInfo& operator= (const AUParamInfo& c) { return *this; }
AUParamInfo (const AUParamInfo &) {}
AUParamInfo& operator= (const AUParamInfo&) { return *this; }
};

View File

@@ -150,8 +150,8 @@ private:
private:
ACLRefCounter () : mLayout(NULL) { }
ACLRefCounter(const ACLRefCounter& c) : mLayout(NULL) { }
ACLRefCounter& operator=(const ACLRefCounter& c) { return *this; }
ACLRefCounter(const ACLRefCounter&) : mLayout(NULL) { }
ACLRefCounter& operator=(const ACLRefCounter&) { return *this; }
};
ACLRefCounter *mLayoutHolder;

View File

@@ -75,8 +75,8 @@ protected:
private:
SInt32 mRefCount;
CAReferenceCounted(const CAReferenceCounted &a) : mRefCount(0) { }
CAReferenceCounted operator=(const CAReferenceCounted &a) { return *this; }
CAReferenceCounted(const CAReferenceCounted &) : mRefCount(0) { }
CAReferenceCounted operator=(const CAReferenceCounted &) { return *this; }
};

View File

@@ -27,14 +27,14 @@ def configure(conf):
autowaf.configure(conf)
def build(bld):
obj = bld.new_task_gen('cxx', 'shlib',
uselib = 'COREAUDIO CORESERVICES COREFOUNDATION AUDIOTOOLBOX AUDIOUNITS OSX GTKOSX')
obj.source = libappleutility_sources
obj = bld.new_task_gen('cxx', 'shlib')
obj.uselib = 'AUDIOUNITS OSX'
obj.source = libappleutility_sources
obj.export_incdirs = ['.']
obj.includes = ['.']
obj.name = 'libappleutility'
obj.target = 'appleutility'
obj.install_path = os.path.join(bld.env['LIBDIR'], 'appleutility')
obj.includes = ['.']
obj.name = 'libappleutility'
obj.target = 'appleutility'
obj.install_path = os.path.join(bld.env['LIBDIR'], 'appleutility')
def shutdown():

View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2006 Paul Davis
Copyright (C) 2006 Paul Davis
Written by Taybin Rutkin
This program is free software; you can redistribute it and/or modify
@@ -30,14 +30,14 @@
#include <vector>
#include <map>
#include "ardour/plugin.h"
#include <AudioUnit/AudioUnit.h>
#include <appleutility/AUParamInfo.h>
#include <AudioUnit/AudioUnitProperties.h>
#include "appleutility/AUParamInfo.h"
#include <boost/shared_ptr.hpp>
#include "ardour/plugin.h"
#include "ardour/chan_mapping.h"
class CAComponent;
class CAAudioUnit;
class CAComponentDescription;
@@ -64,102 +64,144 @@ class AUPlugin : public ARDOUR::Plugin
AUPlugin (AudioEngine& engine, Session& session, boost::shared_ptr<CAComponent> comp);
AUPlugin (const AUPlugin& other);
virtual ~AUPlugin ();
std::string unique_id () const;
std::string unique_id () const;
const char * label () const;
const char * name () const { return _info->name.c_str(); }
const char * maker () const { return _info->creator.c_str(); }
uint32_t parameter_count () const;
float default_value (uint32_t port);
nframes_t latency () const;
nframes_t signal_latency() const;
void set_parameter (uint32_t which, float val);
float get_parameter (uint32_t which) const;
int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const;
uint32_t nth_parameter (uint32_t which, bool& ok) const;
void activate ();
void deactivate ();
void set_block_size (nframes_t nframes);
int connect_and_run (std::vector<Sample*>& bufs, uint32_t maxbuf, int32_t& in, int32_t& out, nframes_t nframes, nframes_t offset);
std::set<uint32_t> automatable() const;
std::string describe_parameter (uint32_t);
void flush ();
int set_block_size (nframes_t nframes);
int connect_and_run (BufferSet& bufs,
ChanMapping in, ChanMapping out,
nframes_t nframes, nframes_t offset);
std::set<Evoral::Parameter> automatable() const;
std::string describe_parameter (Evoral::Parameter);
std::string state_node_name () const { return "audiounit"; }
void print_parameter (uint32_t, char*, uint32_t len) const;
bool parameter_is_audio (uint32_t) const;
bool parameter_is_control (uint32_t) const;
bool parameter_is_input (uint32_t) const;
bool parameter_is_output (uint32_t) const;
XMLNode& get_state();
int set_state(const XMLNode& node);
int set_state(const XMLNode& node, int);
bool save_preset (std::string name);
bool load_preset (const std::string& preset_label);
std::vector<std::string> get_presets ();
std::vector<PresetRecord> get_presets ();
std::string current_preset() const;
bool has_editor () const;
bool reconfigurable_io() const { return true; }
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
bool configure_io (ChanCount in, ChanCount out);
bool requires_fixed_size_buffers() const;
int32_t can_do (int32_t in, int32_t& out);
ChanCount output_streams() const;
ChanCount input_streams() const;
int32_t configure_io (int32_t in, int32_t out);
void set_fixed_size_buffers (bool yn) {
_requires_fixed_size_buffers = yn;
}
boost::shared_ptr<CAAudioUnit> get_au () { return unit; }
boost::shared_ptr<CAComponent> get_comp () const { return comp; }
OSStatus render_callback(AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
UInt32 inBusNumber,
UInt32 inNumberFrames,
AudioBufferList* ioData);
/* "host" callbacks */
OSStatus get_beat_and_tempo_callback (Float64* outCurrentBeat,
Float64* outCurrentTempo);
OSStatus get_musical_time_location_callback (UInt32* outDeltaSampleOffsetToNextBeat,
Float32* outTimeSig_Numerator,
UInt32* outTimeSig_Denominator,
Float64* outCurrentMeasureDownBeat);
OSStatus get_transport_state_callback (Boolean* outIsPlaying,
Boolean* outTransportStateChanged,
Float64* outCurrentSampleInTimeLine,
Boolean* outIsCycling,
Float64* outCycleStartBeat,
Float64* outCycleEndBeat);
static std::string maybe_fix_broken_au_id (const std::string&);
OSStatus render_callback(AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
UInt32 inBusNumber,
UInt32 inNumberFrames,
AudioBufferList* ioData);
private:
boost::shared_ptr<CAComponent> comp;
boost::shared_ptr<CAAudioUnit> unit;
bool initialized;
ChanCount input_channels;
ChanCount output_channels;
boost::shared_ptr<CAComponent> comp;
boost::shared_ptr<CAAudioUnit> unit;
bool initialized;
int32_t input_channels;
int32_t output_channels;
std::vector<std::pair<int,int> > io_configs;
nframes_t _current_block_size;
nframes_t _last_nframes;
bool _requires_fixed_size_buffers;
AudioBufferList* buffers;
/* XXX this should really be shared across all AUPlugin instances */
/* despite all the cool work that apple did on their AU preset
system, they left factory presets and user presets as two
entirely different kinds of things, handled by two entirely
different parts of the API. Resolve this.
*/
typedef std::map<std::string,std::string> PresetMap;
PresetMap preset_map;
/* XXX these two maps should really be shared across all instances of this AUPlugin */
typedef std::map<std::string,std::string> UserPresetMap;
UserPresetMap user_preset_map;
typedef std::map<std::string,int> FactoryPresetMap;
FactoryPresetMap factory_preset_map;
UInt32 global_elements;
UInt32 output_elements;
UInt32 input_elements;
int set_output_format (AudioStreamBasicDescription&);
int set_input_format (AudioStreamBasicDescription&);
int set_stream_format (int scope, uint32_t cnt, AudioStreamBasicDescription&);
int _set_block_size (nframes_t nframes);
void discover_parameters ();
std::vector<std::pair<uint32_t, uint32_t> > parameter_map;
uint32_t current_maxbuf;
nframes_t current_offset;
nframes_t cb_offset;
std::vector<Sample*>* current_buffers;
nframes_t frames_processed;
nframes_t current_offset;
nframes_t cb_offset;
BufferSet* current_buffers;
nframes_t frames_processed;
std::vector<AUParameterDescriptor> descriptors;
void init ();
};
void discover_factory_presets ();
bool last_transport_rolling;
float last_transport_speed;
};
typedef boost::shared_ptr<AUPlugin> AUPluginPtr;
struct AUPluginCachedInfo {
struct AUPluginCachedInfo {
std::vector<std::pair<int,int> > io_configs;
};
class AUPluginInfo : public PluginInfo {
public:
AUPluginInfo (boost::shared_ptr<CAComponentDescription>);
public:
AUPluginInfo (boost::shared_ptr<CAComponentDescription>);
~AUPluginInfo ();
PluginPtr load (Session& session);
@@ -175,19 +217,19 @@ class AUPluginInfo : public PluginInfo {
private:
boost::shared_ptr<CAComponentDescription> descriptor;
UInt32 version;
static void discover_music (PluginInfoList&);
static void discover_fx (PluginInfoList&);
static void discover_generators (PluginInfoList&);
static void discover_by_description (PluginInfoList&, CAComponentDescription&);
static std::string au_cache_path ();
static Glib::ustring au_cache_path ();
typedef std::map<std::string,AUPluginCachedInfo> CachedInfoMap;
static CachedInfoMap cached_info;
static bool cached_io_configuration (const std::string&, UInt32, CAComponent&, AUPluginCachedInfo&, const std::string& name);
static void add_cached_info (const std::string&, AUPluginCachedInfo&);
static void save_cached_info ();
static void save_cached_info ();
};
typedef boost::shared_ptr<AUPluginInfo> AUPluginInfoPtr;

View File

@@ -35,10 +35,11 @@ class CAImportableSource : public ImportableSource {
nframes_t read (Sample* buffer, nframes_t nframes);
uint32_t channels() const;
nframes_t length() const;
framecnt_t length() const;
nframes_t samplerate() const;
void seek (nframes_t pos);
framepos_t natural_position() const { return 0; }
bool clamped_at_unity () const { return false; }
protected:
mutable CAAudioFile af;

View File

@@ -41,19 +41,20 @@ class CoreAudioSource : public AudioFileSource {
int flush_header () {return 0;};
void set_header_timeline_position () {};
bool clamped_at_unity () const { return false; }
static int get_soundfile_info (string path, SoundFileInfo& _info, string& error_msg);
protected:
nframes_t read_unlocked (Sample *dst, framepos_t start, nframes_t cnt) const;
nframes_t write_unlocked (Sample *dst, nframes_t cnt) { return 0; }
framecnt_t read_unlocked (Sample *dst, framepos_t start, framecnt_t cnt) const;
framecnt_t write_unlocked (Sample *, framecnt_t) { return 0; }
private:
mutable CAAudioFile af;
uint16_t n_channels;
void init_cafile ();
int safe_read (Sample*, nframes_t start, nframes_t cnt, AudioBufferList&) const;
int safe_read (Sample*, nframes_t start, framecnt_t cnt, AudioBufferList&) const;
};
}; /* namespace ARDOUR */

View File

@@ -140,6 +140,8 @@ class Plugin : public PBD::StatefulDestructible, public Latent
virtual std::vector<PresetRecord> get_presets();
virtual std::string current_preset() const { return std::string(); }
static PBD::Signal0<bool> PresetFileExists;
const PresetRecord* preset_by_label(const std::string& label);
const PresetRecord* preset_by_uri(const std::string& uri);
@@ -169,7 +171,7 @@ class Plugin : public PBD::StatefulDestructible, public Latent
virtual ChanCount output_streams() const;
virtual ChanCount input_streams() const;
PluginInfoPtr get_info() { return _info; }
PluginInfoPtr get_info() const { return _info; }
void set_info (const PluginInfoPtr inf) { _info = inf; }
ARDOUR::AudioEngine& engine() const { return _engine; }

View File

@@ -28,9 +28,9 @@
#include <string>
#include <cmath>
#if defined(HAVE_COREAUDIO) || defined(HAVE_AUDIOUNITS)
#if __APPLE__
#include <CoreFoundation/CoreFoundation.h>
#endif
#endif /* __APPLE__ */
bool string_is_affirmative (const std::string&);
@@ -107,9 +107,9 @@ float meter_falloff_to_db_per_sec (float);
const char* native_header_format_extension (ARDOUR::HeaderFormat, const ARDOUR::DataType& type);
bool matching_unsuffixed_filename_exists_in (const std::string& dir, const std::string& name);
#if defined(HAVE_COREAUDIO) || defined(HAVE_AUDIOUNITS)
#if __APPLE__
std::string CFStringRefToStdString(CFStringRef stringRef);
#endif // HAVE_COREAUDIO
#endif // __APPLE__
#endif /* __ardour_utils_h__ */

File diff suppressed because it is too large Load Diff

View File

@@ -85,7 +85,7 @@ CAImportableSource::channels () const
return af.GetFileDataFormat().NumberChannels();
}
nframes_t
framecnt_t
CAImportableSource::length () const
{
return af.GetNumberFrames();

View File

@@ -19,7 +19,6 @@
*/
#include <algorithm>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include "pbd/error.h"
@@ -93,16 +92,16 @@ CoreAudioSource::~CoreAudioSource ()
}
int
CoreAudioSource::safe_read (Sample* dst, nframes_t start, nframes_t cnt, AudioBufferList& abl) const
CoreAudioSource::safe_read (Sample* dst, nframes_t start, framecnt_t cnt, AudioBufferList& abl) const
{
nframes_t nread = 0;
framecnt_t nread = 0;
while (nread < cnt) {
try {
af.Seek (start+nread);
} catch (CAXException& cax) {
error << string_compose("CoreAudioSource: %1 to %2 (%3)", cax.mOperation, start+nread, _name.substr (1)) << endmsg;
error << string_compose("CoreAudioSource: %1 to %2 (%3)", cax.mOperation, start+nread, _name.val().substr (1)) << endmsg;
return -1;
}
@@ -138,10 +137,10 @@ CoreAudioSource::safe_read (Sample* dst, nframes_t start, nframes_t cnt, AudioBu
}
nframes_t
CoreAudioSource::read_unlocked (Sample *dst, framepos_t start, nframes_t cnt) const
framecnt_t
CoreAudioSource::read_unlocked (Sample *dst, framepos_t start, framecnt_t cnt) const
{
nframes_t file_cnt;
framecnt_t file_cnt;
AudioBufferList abl;
abl.mNumberBuffers = 1;
@@ -167,7 +166,7 @@ CoreAudioSource::read_unlocked (Sample *dst, framepos_t start, nframes_t cnt) co
}
if (file_cnt != cnt) {
nframes_t delta = cnt - file_cnt;
frameoffset_t delta = cnt - file_cnt;
memset (dst+file_cnt, 0, sizeof (Sample) * delta);
}
@@ -194,7 +193,7 @@ CoreAudioSource::read_unlocked (Sample *dst, framepos_t start, nframes_t cnt) co
/* stride through the interleaved data */
for (uint32_t n = 0; n < file_cnt; ++n) {
for (framecnt_t n = 0; n < file_cnt; ++n) {
dst[n] = *ptr;
ptr += n_channels;
}
@@ -218,13 +217,13 @@ CoreAudioSource::sample_rate() const
}
int
CoreAudioSource::update_header (framepos_t when, struct tm&, time_t)
CoreAudioSource::update_header (framepos_t, struct tm&, time_t)
{
return 0;
}
int
CoreAudioSource::get_soundfile_info (string path, SoundFileInfo& _info, string& error_msg)
CoreAudioSource::get_soundfile_info (string path, SoundFileInfo& _info, string&)
{
FSRef ref;
ExtAudioFileRef af = 0;

View File

@@ -16,7 +16,6 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifdef WAF_BUILD
#include "libardour-config.h"
#endif

View File

@@ -17,7 +17,6 @@
675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define __STDC_LIMIT_MACROS 1
#include <stdint.h>
#include <iostream>
#include "lv2ext/lv2_event.h"

View File

@@ -17,7 +17,6 @@
*/
#define __STDC_FORMAT_MACROS 1
#include <inttypes.h>
#include <cmath>

View File

@@ -62,6 +62,8 @@ using namespace std;
using namespace ARDOUR;
using namespace PBD;
PBD::Signal0<bool> Plugin::PresetFileExists;
Plugin::Plugin (AudioEngine& e, Session& s)
: _engine (e)
, _session (s)

View File

@@ -21,7 +21,6 @@
#include "libardour-config.h"
#endif
#define __STDC_FORMAT_MACROS 1
#include <stdint.h>
#include <sys/types.h>

View File

@@ -60,7 +60,7 @@ RBEffect::~RBEffect ()
}
int
RBEffect::run (boost::shared_ptr<Region> r, Progress* progress)
RBEffect::run (boost::shared_ptr<Region> r, Progress*)
{
boost::shared_ptr<AudioRegion> region = boost::dynamic_pointer_cast<AudioRegion> (r);

View File

@@ -42,7 +42,7 @@ Reverse::~Reverse ()
}
int
Reverse::run (boost::shared_ptr<Region> r, Progress* progress)
Reverse::run (boost::shared_ptr<Region> r, Progress*)
{
SourceList nsrcs;
SourceList::iterator si;

View File

@@ -167,7 +167,7 @@ Send::set_state (const XMLNode& node, int version)
}
int
Send::set_state_2X (const XMLNode& node, int version)
Send::set_state_2X (const XMLNode& node, int /* version */)
{
/* use the IO's name for the name of the send */
XMLNodeList const & children = node.children ();

View File

@@ -22,7 +22,6 @@
#include "libardour-config.h"
#endif
#define __STDC_FORMAT_MACROS 1
#include <stdint.h>
#include <algorithm>

View File

@@ -15,7 +15,6 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define __STDC_LIMIT_MACROS 1
#include <cassert>
#include <iostream>
#include <stdint.h>

View File

@@ -21,7 +21,6 @@
#include "libardour-config.h"
#endif
#define __STDC_FORMAT_MACROS 1
#include <stdint.h>
#include <cstdio> /* for sprintf */
@@ -322,7 +321,7 @@ path_expand (string path)
#endif
}
#if defined(HAVE_COREAUDIO) || defined(HAVE_AUDIOUNITS)
#if __APPLE__
string
CFStringRefToStdString(CFStringRef stringRef)
{
@@ -339,7 +338,7 @@ CFStringRefToStdString(CFStringRef stringRef)
delete [] buf;
return result;
}
#endif // HAVE_COREAUDIO
#endif // __APPLE__
void
compute_equal_power_fades (nframes_t nframes, float* in, float* out)

View File

@@ -233,7 +233,6 @@ def configure(conf):
autowaf.check_pkg(conf, 'samplerate', uselib_store='SAMPLERATE', atleast_version='0.1.0')
autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
autowaf.check_pkg(conf, 'slv2', uselib_store='SLV2', atleast_version='0.6.4', mandatory=False)
autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18')
autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH', mandatory=False)
autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=False)
autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
@@ -281,7 +280,7 @@ def build(bld):
obj.includes = ['.', '../surfaces/control_protocol', '..']
obj.name = 'libardour'
obj.target = 'ardour'
obj.uselib = 'GLIBMM GTHREAD AUBIO SIGCPP XML UUID JACK SNDFILE SAMPLERATE LRDF OSX COREAUDIO CURL DL'
obj.uselib = 'GLIBMM GTHREAD AUBIO SIGCPP XML UUID JACK SNDFILE SAMPLERATE LRDF AUDIOUNIT OSX BOOST CURL DL'
obj.uselib_local = 'libpbd libmidipp libevoral libvamphost libvampplugin libtaglib librubberband libaudiographer'
obj.vnum = LIBARDOUR_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
@@ -314,13 +313,9 @@ def build(bld):
obj.includes += [ '../fst' ]
obj.cxxflags += [ '-DVST_SUPPORT' ]
if bld.env['HAVE_COREAUDIO'] and bld.env['COREAUDIO']:
if bld.env['COREAUDIO']:
obj.source += [ 'coreaudiosource.cc', 'caimportable.cc' ]
if bld.env['HAVE_AUDIOUNITS'] or bld.env['HAVE_COREAUDIO']:
obj.uselib_local += ' libappleutility'
if bld.env['HAVE_AUDIOUNITS'] and bld.env['AUDIOUNITS']:
obj.source += [ 'audio_unit.cc' ]
if bld.env['FPU_OPTIMIZATION']:

View File

@@ -17,7 +17,6 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define __STDC_LIMIT_MACROS 1
#include <cassert>
#include <cmath>
#include <iostream>

View File

@@ -16,7 +16,6 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define __STDC_LIMIT_MACROS 1
#include <algorithm>
#include <cmath>
#include <iostream>

View File

@@ -38,6 +38,8 @@
#include <gtkmm2ext/gtkapplication.h>
#include <gtkmm2ext/gtkapplication-private.h>
#define UNUSED_PARAMETER(a) (void) (a)
// #define DEBUG(format, ...) g_printerr ("%s: " format, G_STRFUNC, ## __VA_ARGS__)
#define DEBUG(format, ...)
@@ -567,6 +569,7 @@ idle_call_activate (gpointer data)
}
- (void) activate:(id) sender
{
UNUSED_PARAMETER(sender);
g_idle_add (idle_call_activate, gtk_menu_item);
}
@end
@@ -625,7 +628,7 @@ get_menu_label_text (GtkWidget *menu_item,
}
static gboolean
accel_find_func (GtkAccelKey *key,
accel_find_func (GtkAccelKey * /*key*/,
GClosure *closure,
gpointer data)
{
@@ -802,8 +805,6 @@ cocoa_menu_item_update_accelerator (NSMenuItem *cocoa_item,
appear.
*/
const gchar* ltxt = get_menu_label_text (widget, &label);
if (GTK_IS_ACCEL_LABEL (label) &&
GTK_ACCEL_LABEL (label)->accel_closure)
{
@@ -887,9 +888,9 @@ cocoa_menu_item_update_accelerator (NSMenuItem *cocoa_item,
}
static void
cocoa_menu_item_accel_changed (GtkAccelGroup *accel_group,
guint keyval,
GdkModifierType modifier,
cocoa_menu_item_accel_changed (GtkAccelGroup* /*accel_group*/,
guint /*keyval*/,
GdkModifierType /*modifier*/,
GClosure *accel_closure,
GtkWidget *widget)
{
@@ -948,8 +949,8 @@ cocoa_menu_item_update_accel_closure (GNSMenuItem *cocoa_item,
static void
cocoa_menu_item_notify_label (GObject *object,
GParamSpec *pspec,
gpointer data)
GParamSpec *pspec,
gpointer)
{
GNSMenuItem *cocoa_item;
@@ -1089,8 +1090,8 @@ add_menu_item (NSMenu* cocoa_menu, GtkWidget* menu_item, int index)
static void
push_menu_shell_to_nsmenu (GtkMenuShell *menu_shell,
NSMenu* cocoa_menu,
gboolean toplevel,
gboolean debug)
gboolean /*toplevel*/,
gboolean /*debug*/)
{
GList *children;
GList *l;
@@ -1117,9 +1118,9 @@ push_menu_shell_to_nsmenu (GtkMenuShell *menu_shell,
static gulong emission_hook_id = 0;
static gboolean
parent_set_emission_hook (GSignalInvocationHint *ihint,
guint n_param_values,
const GValue *param_values,
parent_set_emission_hook (GSignalInvocationHint* /*ihint*/,
guint /*n_param_values*/,
const GValue* param_values,
gpointer data)
{
GtkWidget *instance = (GtkWidget*) g_value_get_object (param_values);
@@ -1156,12 +1157,10 @@ parent_set_emission_hook (GSignalInvocationHint *ihint,
}
static void
parent_set_emission_hook_remove (GtkWidget *widget,
gpointer data)
parent_set_emission_hook_remove (GtkWidget*, gpointer)
{
g_signal_remove_emission_hook (g_signal_lookup ("parent-set",
GTK_TYPE_WIDGET),
emission_hook_id);
g_signal_remove_emission_hook (g_signal_lookup ("parent-set", GTK_TYPE_WIDGET),
emission_hook_id);
}
/* Building "standard" Cocoa/OS X menus */
@@ -1186,6 +1185,7 @@ add_to_menubar (NSMenu *menu)
return 0;
}
#if 0
static int
add_to_app_menu (NSMenu *menu)
{
@@ -1196,17 +1196,7 @@ add_to_app_menu (NSMenu *menu)
[dummyItem release];
return 0;
}
static int
add_to_window_menu (NSMenu *menu)
{
NSMenuItem *dummyItem = [[NSMenuItem alloc] initWithTitle:@""
action:nil keyEquivalent:@""];
[dummyItem setSubmenu:menu];
[_window_menu addItem:dummyItem];
[dummyItem release];
return 0;
}
#endif
static int
create_apple_menu ()
@@ -1253,6 +1243,18 @@ create_apple_menu ()
return 0;
}
#if 0
static int
add_to_window_menu (NSMenu *menu)
{
NSMenuItem *dummyItem = [[NSMenuItem alloc] initWithTitle:@""
action:nil keyEquivalent:@""];
[dummyItem setSubmenu:menu];
[_window_menu addItem:dummyItem];
[dummyItem release];
return 0;
}
static int
create_window_menu ()
{
@@ -1269,6 +1271,7 @@ create_window_menu ()
return 0;
}
#endif
/*
* public functions
@@ -1402,13 +1405,15 @@ namespace Gtk {
return self;
}
- (void)appDidBecomeActive:(NSNotification *)notification
- (void)appDidBecomeActive:(NSNotification *) notification
{
UNUSED_PARAMETER(notification);
Gtkmm2ext::Application::instance()->ActivationChanged (true);
}
- (void)appDidBecomeInactive:(NSNotification *)notification
- (void)appDidBecomeInactive:(NSNotification *) notification
{
UNUSED_PARAMETER(notification);
Gtkmm2ext::Application::instance()->ActivationChanged (false);
}
@@ -1418,14 +1423,16 @@ namespace Gtk {
@end
@implementation GtkApplicationDelegate
-(BOOL) application:(NSApplication*) theApplication openFile:(NSString*) file
-(BOOL) application:(NSApplication*) app :(NSString*) file
{
UNUSED_PARAMETER(app);
Glib::ustring utf8_path ([file UTF8String]);
Gtkmm2ext::Application::instance()->ShouldLoad (utf8_path);
return 1;
}
- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *)sender
- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *) app
{
UNUSED_PARAMETER(app);
Gtkmm2ext::Application::instance()->ShouldQuit ();
return NSTerminateCancel;
}

View File

@@ -0,0 +1,19 @@
#include <CoreFoundation/CFLocale.h>
#import <CoreFoundation/CFString.h>
#import <Foundation/NSString.h>
#import <Foundation/NSAutoreleasePool.h>
#import <AppKit/NSWorkspace.h>
bool
cocoa_open_url (const char* uri)
{
NSString* struri = [[NSString alloc] initWithUTF8String:uri];
NSURL* nsurl = [[NSURL alloc] initWithString:struri];
bool ret = [[NSWorkspace sharedWorkspace] openURL:nsurl];
[struri release];
[nsurl release];
return ret;
}

View File

@@ -26,3 +26,4 @@ PBD::open_uri (const char* uri)
#endif
#endif
}

View File

@@ -2,6 +2,7 @@
import autowaf
import os
import sys
import TaskGen
# Version of this package (even if built as a child)
MAJOR = '4'
@@ -106,7 +107,11 @@ def build(bld):
obj.includes = ['.']
obj.name = 'libpbd'
obj.target = 'pbd'
obj.uselib = 'GLIBMM SIGCPP XML UUID'
obj.uselib = 'GLIBMM SIGCPP XML UUID SNDFILE'
if sys.platform == 'darwin':
TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
obj.source += 'cocoa_open_uri.mm'
obj.uselib += ' OSX'
obj.vnum = LIBPBD_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
obj.cxxflags = ['-DPACKAGE="libpbd"']
@@ -127,6 +132,7 @@ def build(bld):
testobj.uselib = 'CPPUNIT XML SNDFILE'
testobj.uselib_local = 'libpbd'
def shutdown():
autowaf.shutdown()

View File

@@ -17,7 +17,6 @@
*/
#define __STDC_FORMAT_MACROS 1
#include <stdint.h>
#include <sstream>