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

@ -17,7 +17,10 @@
*/
#define __STDC_FORMAT_MACROS 1
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#endif
#include <stdint.h>
#include <algorithm>

View File

@ -17,6 +17,10 @@
*/
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#endif
#include <fcntl.h>
#include <signal.h>
#include <unistd.h>

View File

@ -17,6 +17,10 @@
*/
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#endif
/* this file exists solely to break compilation dependencies that
would connect changes to the mixer or editor objects.
*/

View File

@ -17,6 +17,10 @@
*/
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#endif
/* This file contains any ARDOUR_UI methods that require knowledge of
the editor, and exists so that no compilation dependency exists
between the main ARDOUR_UI modules and the PublicEditor class. This

View File

@ -28,6 +28,16 @@ namespace ARDOUR {
class IOProcessor;
}
class AUPluginUI;
@interface NotificationObject : NSObject {
@private
AUPluginUI* plugin_ui;
NSWindow* cocoa_parent;
NSWindow* top_level_parent;
}
@end
class AUPluginUI : public PlugUIBase, public Gtk::VBox
{
public:
@ -42,13 +52,20 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox
void activate ();
void deactivate ();
bool non_gtk_gui() const { return true; }
void lower_box_realized ();
void cocoa_view_resized ();
void on_realize ();
void on_show ();
void on_hide ();
bool on_map_event (GdkEventAny*);
bool on_focus_in_event (GdkEventFocus*);
bool on_focus_out_event (GdkEventFocus*);
void forward_key_event (GdkEventKey*);
bool on_window_show (const std::string& /*title*/);
void on_window_hide ();
OSStatus carbon_event (EventHandlerCallRef nextHandlerRef, EventRef event);
@ -80,7 +97,7 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox
WindowRef carbon_window;
EventHandlerRef carbon_event_handler;
bool _activating_from_app;
NSView* packView;
NotificationObject* _notify;
bool test_cocoa_view_support ();
bool test_carbon_view_support ();

View File

@ -1,9 +1,12 @@
#include <gtkmm/stock.h>
#undef Marker
#define Marker FuckYouAppleAndYourLackOfNameSpaces
#include "pbd/convert.h"
#include "pbd/error.h"
#include "ardour/audio_unit.h"
#include "ardour/insert.h"
#include "ardour/plugin_insert.h"
#undef check // stupid gtk, stupid apple
@ -15,8 +18,8 @@
#include "au_pluginui.h"
#include "gui_thread.h"
#include <appleutility/CAAudioUnit.h>
#include <appleutility/CAComponent.h>
#include "appleutility/CAAudioUnit.h"
#include "appleutility/CAComponent.h"
#import <AudioUnit/AUCocoaUIView.h>
#import <CoreAudioKit/AUGenericView.h>
@ -45,6 +48,65 @@ static const gchar* _automation_mode_strings[] = {
0
};
@implementation NotificationObject
- (NotificationObject*) initWithPluginUI: (AUPluginUI*) apluginui andCocoaParent: (NSWindow*) cp andTopLevelParent: (NSWindow*) tlp
{
self = [ super init ];
if (self) {
plugin_ui = apluginui;
cocoa_parent = cp;
top_level_parent = tlp;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(cocoaParentActivationHandler:)
name:NSWindowDidBecomeMainNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(cocoaParentBecameKeyHandler:)
name:NSWindowDidBecomeKeyNotification
object:nil];
}
return self;
}
- (void)cocoaParentActivationHandler:(NSNotification *)notification
{
NSWindow* notification_window = (NSWindow *)[notification object];
if (top_level_parent == notification_window || cocoa_parent == notification_window) {
if ([notification_window isMainWindow]) {
plugin_ui->activate();
} else {
plugin_ui->deactivate();
}
}
}
- (void)cocoaParentBecameKeyHandler:(NSNotification *)notification
{
NSWindow* notification_window = (NSWindow *)[notification object];
if (top_level_parent == notification_window || cocoa_parent == notification_window) {
if ([notification_window isKeyWindow]) {
plugin_ui->activate();
} else {
plugin_ui->deactivate();
}
}
}
- (void)auViewResized:(NSNotification *)notification;
{
(void) notification;
plugin_ui->cocoa_view_resized();
}
@end
AUPluginUI::AUPluginUI (boost::shared_ptr<PluginInsert> insert)
: PlugUIBase (insert)
, automation_mode_label (_("Automation"))
@ -67,11 +129,15 @@ AUPluginUI::AUPluginUI (boost::shared_ptr<PluginInsert> insert)
HBox* smaller_hbox = manage (new HBox);
smaller_hbox->pack_start (preset_label, false, false, 10);
smaller_hbox->set_spacing (6);
smaller_hbox->pack_start (preset_label, false, false, 4);
smaller_hbox->pack_start (preset_combo, false, false);
smaller_hbox->pack_start (save_button, false, false);
#if 0
/* one day these might be useful with an AU plugin, but not yet */
smaller_hbox->pack_start (automation_mode_label, false, false);
smaller_hbox->pack_start (automation_mode_selector, false, false);
#endif
smaller_hbox->pack_start (bypass_button, false, true);
VBox* v1_box = manage (new VBox);
@ -101,9 +167,10 @@ AUPluginUI::AUPluginUI (boost::shared_ptr<PluginInsert> insert)
_activating_from_app = false;
cocoa_parent = 0;
_notify = 0;
cocoa_window = 0;
au_view = 0;
packView = 0;
editView = 0;
/* prefer cocoa, fall back to cocoa, but use carbon if its there */
@ -122,19 +189,26 @@ AUPluginUI::~AUPluginUI ()
{
if (cocoa_parent) {
NSWindow* win = get_nswindow();
RemoveEventHandler(carbon_event_handler);
[[NSNotificationCenter defaultCenter] removeObserver:_notify];
[win removeChildWindow:cocoa_parent];
} else if (carbon_window) {
/* never parented */
}
if (carbon_window) {
/* not parented, just overlaid on top of our window */
DisposeWindow (carbon_window);
}
if (packView) {
if (editView) {
CloseComponent (editView);
}
if (au_view) {
/* remove whatever we packed into low_box so that GTK doesn't
mess with it.
*/
[packView removeFromSuperview];
[au_view removeFromSuperview];
}
}
@ -288,17 +362,29 @@ AUPluginUI::create_cocoa_view ()
[(AUGenericView *)au_view setShowsExpertParameters:YES];
}
packView = au_view;
// watch for size changes of the view
[[NSNotificationCenter defaultCenter] addObserver:_notify
selector:@selector(auViewResized:) name:NSWindowDidResizeNotification
object:au_view];
// Get the size of the new AU View's frame
NSRect packFrame;
packFrame = [au_view frame];
prefwidth = packFrame.size.width;
prefheight = packFrame.size.height;
low_box.set_size_request (prefwidth, prefheight);
return 0;
}
void
AUPluginUI::cocoa_view_resized ()
{
NSRect packFrame = [au_view frame];
}
int
AUPluginUI::create_carbon_view ()
{
@ -321,11 +407,14 @@ AUPluginUI::create_carbon_view ()
if ((err = CreateNewWindow(kDocumentWindowClass, attr, &r, &carbon_window)) != noErr) {
error << string_compose (_("AUPluginUI: cannot create carbon window (err: %1)"), err) << endmsg;
CloseComponent (editView);
return -1;
}
if ((err = GetRootControl(carbon_window, &root_control)) != noErr) {
error << string_compose (_("AUPlugin: cannot get root control of carbon window (err: %1)"), err) << endmsg;
DisposeWindow (carbon_window);
CloseComponent (editView);
return -1;
}
@ -335,6 +424,8 @@ AUPluginUI::create_carbon_view ()
if ((err = AudioUnitCarbonViewCreate (editView, *au->get_au(), carbon_window, root_control, &location, &size, &viewPane)) != noErr) {
error << string_compose (_("AUPluginUI: cannot create carbon plugin view (err: %1)"), err) << endmsg;
DisposeWindow (carbon_window);
CloseComponent (editView);
return -1;
}
@ -377,70 +468,14 @@ AUPluginUI::get_nswindow ()
void
AUPluginUI::activate ()
{
if (carbon_window && cocoa_parent) {
cerr << "APP activated, activate carbon window " << insert->name() << endl;
_activating_from_app = true;
ActivateWindow (carbon_window, TRUE);
_activating_from_app = false;
[cocoa_parent makeKeyAndOrderFront:nil];
}
ActivateWindow (carbon_window, TRUE);
// [cocoa_parent makeKeyAndOrderFront:nil];
}
void
AUPluginUI::deactivate ()
{
return;
cerr << "APP DEactivated, for " << insert->name() << endl;
_activating_from_app = true;
ActivateWindow (carbon_window, FALSE);
_activating_from_app = false;
}
OSStatus
_carbon_event (EventHandlerCallRef nextHandlerRef, EventRef event, void *userData)
{
return ((AUPluginUI*)userData)->carbon_event (nextHandlerRef, event);
}
OSStatus
AUPluginUI::carbon_event (EventHandlerCallRef nextHandlerRef, EventRef event)
{
cerr << "CARBON EVENT\n";
UInt32 eventKind = GetEventKind(event);
ClickActivationResult howToHandleClick;
NSWindow* win = get_nswindow ();
cerr << "window " << win << " carbon event type " << eventKind << endl;
switch (eventKind) {
case kEventWindowHandleActivate:
cerr << "carbon window for " << insert->name() << " activated\n";
if (_activating_from_app) {
cerr << "app activation, ignore window activation\n";
return noErr;
}
[win makeMainWindow];
return eventNotHandledErr;
break;
case kEventWindowHandleDeactivate:
cerr << "carbon window for " << insert->name() << " would have been deactivated\n";
// never deactivate the carbon window
return noErr;
break;
case kEventWindowGetClickActivation:
cerr << "carbon window CLICK activated\n";
[win makeKeyAndOrderFront:nil];
howToHandleClick = kActivateAndHandleClick;
SetEventParameter(event, kEventParamClickActivation, typeClickActivationResult,
sizeof(ClickActivationResult), &howToHandleClick);
break;
}
return noErr;
}
int
@ -479,18 +514,9 @@ AUPluginUI::parent_carbon_window ()
// create the cocoa window for the carbon one and make it visible
cocoa_parent = [[NSWindow alloc] initWithWindowRef: carbon_window];
EventTypeSpec windowEventTypes[] = {
{kEventClassWindow, kEventWindowGetClickActivation },
{kEventClassWindow, kEventWindowHandleDeactivate }
};
EventHandlerUPP ehUPP = NewEventHandlerUPP(_carbon_event);
OSStatus result = InstallWindowEventHandler (carbon_window, ehUPP,
sizeof(windowEventTypes) / sizeof(EventTypeSpec),
windowEventTypes, this, &carbon_event_handler);
if (result != noErr) {
return -1;
}
SetWindowActivationScope (carbon_window, kWindowActivationScopeNone);
_notify = [ [NotificationObject alloc] initWithPluginUI:this andCocoaParent:cocoa_parent andTopLevelParent:win ];
[win addChildWindow:cocoa_parent ordered:NSWindowAbove];
@ -501,7 +527,6 @@ int
AUPluginUI::parent_cocoa_window ()
{
NSWindow* win = get_nswindow ();
NSRect packFrame;
if (!win) {
return -1;
@ -515,21 +540,59 @@ AUPluginUI::parent_cocoa_window ()
error << _("AUPluginUI: no top level window!") << endmsg;
return -1;
}
// Get the size of the new AU View's frame
packFrame = [au_view frame];
NSView* view = gdk_quartz_window_get_nsview (low_box.get_window()->gobj());
NSView* view = gdk_quartz_window_get_nsview (get_toplevel()->get_window()->gobj());
GtkRequisition a = top_box.size_request ();
[view setFrame:packFrame];
[view addSubview:packView];
/* move the au_view down so that it doesn't overlap the top_box contents */
low_box.set_size_request (packFrame.size.width, packFrame.size.height);
NSPoint origin = { 0, a.height };
[au_view setFrameOrigin:origin];
[view addSubview:au_view];
return 0;
}
static void
dump_view_tree (NSView* view, int depth)
{
NSArray* subviews = [view subviews];
unsigned long cnt = [subviews count];
for (int d = 0; d < depth; d++) {
cerr << '\t';
}
cerr << " view @ " << view << endl;
for (unsigned long i = 0; i < cnt; ++i) {
NSView* subview = [subviews objectAtIndex:i];
dump_view_tree (subview, depth+1);
}
}
void
AUPluginUI::forward_key_event (GdkEventKey* ev)
{
NSEvent* nsevent = gdk_quartz_event_get_nsevent ((GdkEvent*)ev);
if (au_view && nsevent) {
/* filter on nsevent type here because GDK massages FlagsChanged
messages into GDK_KEY_{PRESS,RELEASE} but Cocoa won't
handle a FlagsChanged message as a keyDown or keyUp
*/
if ([nsevent type] == NSKeyDown) {
[[[au_view window] firstResponder] keyDown:nsevent];
} else if ([nsevent type] == NSKeyUp) {
[[[au_view window] firstResponder] keyUp:nsevent];
} else if ([nsevent type] == NSFlagsChanged) {
[[[au_view window] firstResponder] flagsChanged:nsevent];
}
}
}
void
AUPluginUI::on_realize ()
{
@ -553,44 +616,48 @@ AUPluginUI::lower_box_realized ()
}
}
void
AUPluginUI::on_hide ()
{
// VBox::on_hide ();
cerr << "AU plugin window hidden\n";
}
bool
AUPluginUI::on_map_event (GdkEventAny* ev)
AUPluginUI::on_map_event (GdkEventAny*)
{
return false;
}
void
AUPluginUI::on_show ()
AUPluginUI::on_window_hide ()
{
cerr << "AU plugin window shown\n";
if (carbon_window) {
HideWindow (carbon_window);
ActivateWindow (carbon_window, FALSE);
}
VBox::on_show ();
hide_all ();
}
bool
AUPluginUI::on_window_show (const string& /*title*/)
{
/* this is idempotent so just call it every time we show the window */
gtk_widget_realize (GTK_WIDGET(low_box.gobj()));
if (au_view) {
show_all ();
} else if (carbon_window) {
[cocoa_parent setIsVisible:YES];
show_all ();
if (carbon_window) {
ShowWindow (carbon_window);
ActivateWindow (carbon_window, TRUE);
}
return true;
}
bool
AUPluginUI::start_updating (GdkEventAny* any)
AUPluginUI::start_updating (GdkEventAny*)
{
return false;
}
bool
AUPluginUI::stop_updating (GdkEventAny* any)
AUPluginUI::stop_updating (GdkEventAny*)
{
return false;
}
@ -604,7 +671,7 @@ create_au_gui (boost::shared_ptr<PluginInsert> plugin_insert, VBox** box)
}
bool
AUPluginUI::on_focus_in_event (GdkEventFocus* ev)
AUPluginUI::on_focus_in_event (GdkEventFocus*)
{
//cerr << "au plugin focus in\n";
//Keyboard::magic_widget_grab_focus ();
@ -612,7 +679,7 @@ AUPluginUI::on_focus_in_event (GdkEventFocus* ev)
}
bool
AUPluginUI::on_focus_out_event (GdkEventFocus* ev)
AUPluginUI::on_focus_out_event (GdkEventFocus*)
{
//cerr << "au plugin focus out\n";
//Keyboard::magic_widget_drop_focus ();

View File

@ -23,6 +23,7 @@
#include "pbd/convert.h"
#include "pbd/enumwriter.h"
#include <gtkmm/style.h>
#include <gtkmm2ext/utils.h>
#include "ardour/ardour.h"
@ -2084,7 +2085,7 @@ AudioClock::set_bbt_reference (framepos_t pos)
}
void
AudioClock::on_style_changed (const Glib::RefPtr<Style>& old_style)
AudioClock::on_style_changed (const Glib::RefPtr<Gtk::Style>& old_style)
{
HBox::on_style_changed (old_style);

View File

@ -973,7 +973,8 @@ AutomationTimeAxisView::set_state (const XMLNode& node, int version)
}
int
AutomationTimeAxisView::set_state_2X (const XMLNode& node, int version)
AutomationTimeAxisView::set_state_2X (const XMLNode& node, int /*version*/)
{
if (node.name() == X_("gain") && _control->parameter() == Evoral::Parameter (GainAutomation)) {
XMLProperty const * shown = node.property (X_("shown"));

View File

@ -16,153 +16,33 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <Carbon/Carbon.h>
#undef check // stupid, stupid carbon
#undef YES // stupid, stupid gtkmm and/or NSObjC
#undef NO // ditto
#ifdef GTKOSX
#include <objc/objc.h>
#ifdef nil
/*Stupid OS X defining nil*/
#undef nil
#endif
#endif
#include <string>
#include <ctype.h>
#include <stdlib.h>
#include <pbd/error.h>
#include <gtkmm2ext/gtkapplication.h>
#include <gdk/gdkquartz.h>
#undef check
#undef YES
#undef NO
#include "ardour_ui.h"
#include "actions.h"
#include "opts.h"
#include <gtkmm2ext/sync-menu.h>
#include <Appkit/Appkit.h>
#include <gdk/gdkquartz.h>
#include <CoreFoundation/CFLocale.h>
#import <CoreFoundation/CFString.h>
#import <Foundation/NSString.h>
#import <Foundation/NSAutoreleasePool.h>
sigc::signal<void,bool> ApplicationActivationChanged;
static EventHandlerRef application_event_handler_ref;
/* Called for clicks on the dock icon. Can be used to unminimize or
* create a new window for example.
*/
static OSErr
handle_reopen_application (const AppleEvent *inAppleEvent,
AppleEvent *outAppleEvent,
long inHandlerRefcon)
{
return noErr;
}
static OSErr
handle_print_documents (const AppleEvent *inAppleEvent,
AppleEvent *outAppleEvent,
long inHandlerRefcon)
{
return noErr;
}
static OSErr
handle_open_documents (const AppleEvent *inAppleEvent,
AppleEvent *outAppleEvent,
long inHandlerRefcon)
{
AEDescList docs;
if (AEGetParamDesc(inAppleEvent, keyDirectObject, typeAEList, &docs) == noErr) {
long n = 0;
AECountItems(&docs, &n);
UInt8 strBuffer[PATH_MAX+1];
/* ardour only opens 1 session at a time */
FSRef ref;
if (AEGetNthPtr(&docs, 1, typeFSRef, 0, 0, &ref, sizeof(ref), 0) == noErr) {
if (FSRefMakePath(&ref, strBuffer, sizeof(strBuffer)) == noErr) {
Glib::ustring utf8_path ((const char*) strBuffer);
ARDOUR_UI::instance()->idle_load (utf8_path);
}
}
}
return noErr;
}
static OSErr
handle_open_application (const AppleEvent *inAppleEvent,
AppleEvent *outAppleEvent,
long inHandlerRefcon)
{
return noErr;
}
static OSStatus
application_event_handler (EventHandlerCallRef nextHandlerRef, EventRef event, void *userData)
{
UInt32 eventKind = GetEventKind (event);
switch (eventKind) {
case kEventAppActivated:
ApplicationActivationChanged (true); // EMIT SIGNAL
return eventNotHandledErr;
case kEventAppDeactivated:
ApplicationActivationChanged (false); // EMIT SIGNAL
return eventNotHandledErr;
default:
// pass-thru all kEventClassApplication events we're not interested in.
break;
}
return eventNotHandledErr;
}
using namespace std;
using namespace PBD;
void
ARDOUR_UI::platform_specific ()
{
Gtk::Widget* widget = ActionManager::get_widget ("/ui/Main/Session/Quit");
if (widget) {
ige_mac_menu_set_quit_menu_item ((GtkMenuItem*) widget->gobj());
}
gtk_application_ready ();
IgeMacMenuGroup* group = ige_mac_menu_add_app_menu_group ();
widget = ActionManager::get_widget ("/ui/Main/Session/About");
if (widget) {
ige_mac_menu_add_app_menu_item (group, (GtkMenuItem*) widget->gobj(), 0);
}
widget = ActionManager::get_widget ("/ui/Main/Session/ToggleOptionsEditor");
if (widget) {
ige_mac_menu_add_app_menu_item (group, (GtkMenuItem*) widget->gobj(), 0);
}
}
void
ARDOUR_UI::platform_setup ()
{
AEInstallEventHandler (kCoreEventClass, kAEOpenDocuments,
handle_open_documents, 0, true);
AEInstallEventHandler (kCoreEventClass, kAEOpenApplication,
handle_open_application, 0, true);
AEInstallEventHandler (kCoreEventClass, kAEReopenApplication,
handle_reopen_application, 0, true);
AEInstallEventHandler (kCoreEventClass, kAEPrintDocuments,
handle_print_documents, 0, true);
EventTypeSpec applicationEventTypes[] = {
{kEventClassApplication, kEventAppActivated },
{kEventClassApplication, kEventAppDeactivated }
};
EventHandlerUPP ehUPP = NewEventHandlerUPP (application_event_handler);
InstallApplicationEventHandler (ehUPP, sizeof(applicationEventTypes) / sizeof(EventTypeSpec),
applicationEventTypes, 0, &application_event_handler_ref);
if (!ARDOUR_COMMAND_LINE::finder_invoked_ardour) {
/* if invoked from the command line, make sure we're visible */
@ -171,6 +51,11 @@ ARDOUR_UI::platform_setup ()
}
}
void
ARDOUR_UI::platform_setup ()
{
}
bool
cocoa_open_url (const char* uri)
{
@ -184,3 +69,63 @@ cocoa_open_url (const char* uri)
return ret;
}
void
set_language_preference ()
{
gtk_disable_setlocale ();
if (g_getenv ("LANGUAGE") || g_getenv ("LC_ALL") || g_getenv ("LANG")) {
return;
}
if (g_getenv ("ARDOUR_EN")) {
return;
}
/* the gettext manual is potentially misleading about the utility of
LANGUAGE. It notes that if LANGUAGE is set to include a dialect/region-free
language code, like "it", it will assume that you mean the main
dialect (e.g. "it_IT"). But in reality, it doesn't bother looking for
locale dirs with the full name, only the short code (it doesn't
know any better).
Since Apple's preferred language list only consists of short language codes,
if we set LANGUAGE then gettext will not look for the relevant long-form
variants.
*/
/* how to get language preferences with CoreFoundation
*/
NSArray* languages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"];
/* push into LANGUAGE */
if (languages && [languages count] > 0) {
int i, count = [languages count];
for (i = 0; i < count; ++i) {
if ([[languages objectAtIndex:i]
isEqualToString:@"en"]) {
count = i+1;
break;
}
}
NSRange r = { 0, count };
setenv ("LANGUAGE", [[[languages subarrayWithRange:r] componentsJoinedByString:@":"] UTF8String], 0);
cout << "LANGUAGE set to " << getenv ("LANGUAGE") << endl;
}
/* now get AppleLocale value and use that for LANG */
CFLocaleRef cflocale = CFLocaleCopyCurrent();
NSString* nslocale = (NSString*) CFLocaleGetValue (cflocale, kCFLocaleIdentifier);
/* the full POSIX locale specification allows for lots of things. that could be an issue. Silly Apple.
*/
cout << "LANG set to " << [nslocale UTF8String] << endl;
setenv ("LANG", [nslocale UTF8String], 0);
CFRelease (cflocale);
}

View File

@ -19,7 +19,6 @@
/* Note: public Editor methods are documented in public_editor.h */
#define __STDC_LIMIT_MACROS 1
#include <stdint.h>
#include <unistd.h>
#include <cstdlib>

View File

@ -17,6 +17,10 @@
*/
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#endif
#include <libgnomecanvasmm/init.h>
#include <libgnomecanvasmm/pixbuf.h>
#include <jack/types.h>

View File

@ -17,6 +17,10 @@
*/
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#endif
#include <stdint.h>
#include "pbd/memento_command.h"
@ -795,11 +799,7 @@ RegionMoveDrag::finished (GdkEvent *, bool movement_occurred)
}
void
RegionMoveDrag::finished_copy (
bool const changed_position,
bool const changed_tracks,
framecnt_t const drag_delta
)
RegionMoveDrag::finished_copy (bool const changed_position, bool const /*changed_tracks*/, framecnt_t const drag_delta)
{
RegionSelection new_views;
PlaylistSet modified_playlists;
@ -1362,7 +1362,7 @@ RegionCreateDrag::motion (GdkEvent* event, bool first_move)
}
void
RegionCreateDrag::finished (GdkEvent* event, bool movement_occurred)
RegionCreateDrag::finished (GdkEvent*, bool movement_occurred)
{
if (!movement_occurred) {
add_region ();
@ -1514,7 +1514,7 @@ TrimDrag::TrimDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list<Region
}
void
TrimDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
TrimDrag::start_grab (GdkEvent* event, Gdk::Cursor*)
{
double speed = 1.0;
TimeAxisView* tvp = &_primary->get_time_axis_view ();
@ -2863,7 +2863,7 @@ FeatureLineDrag::start_grab (GdkEvent* event, Gdk::Cursor* /*cursor*/)
}
void
FeatureLineDrag::motion (GdkEvent* event, bool)
FeatureLineDrag::motion (GdkEvent*, bool)
{
double dx = _drags->current_pointer_x() - last_pointer_x();
@ -2887,7 +2887,7 @@ FeatureLineDrag::motion (GdkEvent* event, bool)
}
void
FeatureLineDrag::finished (GdkEvent* event, bool)
FeatureLineDrag::finished (GdkEvent*, bool)
{
_arv = reinterpret_cast<AudioRegionView*> (_item->get_data ("regionview"));
_arv->update_transient(_before, _line->property_x1());
@ -3978,7 +3978,7 @@ AutomationRangeDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
}
void
AutomationRangeDrag::motion (GdkEvent* event, bool first_move)
AutomationRangeDrag::motion (GdkEvent*, bool /*first_move*/)
{
if (_nothing_to_drag) {
return;

View File

@ -19,7 +19,6 @@
/* Note: public Editor methods are documented in public_editor.h */
#define __STDC_FORMAT_MACROS 1
#include <inttypes.h>
#include <unistd.h>
#include <climits>

View File

@ -17,6 +17,10 @@
*/
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#endif
#include <glibmm/miscutils.h>
#include <gtkmm2ext/utils.h>
#include <gtkmm2ext/window_title.h>

View File

@ -17,6 +17,10 @@
*/
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#endif
#include <cstdlib>
#include <cmath>

View File

@ -249,7 +249,7 @@ EditorRoutes::focus_out (GdkEventFocus*)
}
bool
EditorRoutes::enter_notify (GdkEventCrossing* ev)
EditorRoutes::enter_notify (GdkEventCrossing*)
{
/* arm counter so that ::selection_filter() will deny selecting anything for the
next two attempts to change selection status.
@ -261,7 +261,7 @@ EditorRoutes::enter_notify (GdkEventCrossing* ev)
}
bool
EditorRoutes::leave_notify (GdkEventCrossing* ev)
EditorRoutes::leave_notify (GdkEventCrossing*)
{
selection_countdown = 0;
@ -1018,7 +1018,7 @@ EditorRoutes::button_press (GdkEventButton* ev)
}
bool
EditorRoutes::selection_filter (Glib::RefPtr<TreeModel> const &, TreeModel::Path const &path , bool selected)
EditorRoutes::selection_filter (Glib::RefPtr<TreeModel> const &, TreeModel::Path const&, bool /*selected*/)
{
if (selection_countdown) {
if (--selection_countdown == 0) {

View File

@ -17,7 +17,10 @@
*/
#define __STDC_FORMAT_MACROS 1
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#endif
#include <cstdio> // for sprintf, grrr
#include <cmath>
#include <inttypes.h>

View File

@ -17,6 +17,10 @@
*/
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#endif
#include <cstdio> // for sprintf, grrr
#include <cstdlib>
#include <cmath>

View File

@ -1,5 +1,5 @@
/*-
* Copyright (c) 2007, 2008 Edward Tomasz Napierała <trasz@FreeBSD.org>
* Copyright (c) 2007, 2008 Edward Tomasz Napiera<EFBFBD>Åa <trasz@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -254,7 +254,7 @@ IOSelectorWindow::on_show ()
}
void
IOSelectorWindow::io_name_changed (void* src)
IOSelectorWindow::io_name_changed (void*)
{
ENSURE_GUI_THREAD (*this, &IOSelectorWindow::io_name_changed, src)

View File

@ -1,3 +1,26 @@
/*
Copyright (C) 2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#endif
#include <map>
#include "ardour/profile.h"

View File

@ -1,4 +1,3 @@
#define __STDC_FORMAT_MACROS 1
#include <inttypes.h>
#include <iomanip>

View File

@ -557,10 +557,8 @@ LocationEditRow::end_changed (ARDOUR::Location *loc)
}
void
LocationEditRow::start_changed (ARDOUR::Location *loc)
LocationEditRow::start_changed (ARDOUR::Location*)
{
ENSURE_GUI_THREAD (*this, &LocationEditRow::start_changed, loc)
if (!location) return;
// update end and length
@ -578,10 +576,8 @@ LocationEditRow::start_changed (ARDOUR::Location *loc)
}
void
LocationEditRow::name_changed (ARDOUR::Location *loc)
LocationEditRow::name_changed (ARDOUR::Location *)
{
ENSURE_GUI_THREAD (*this, &LocationEditRow::name_changed, loc)
if (!location) return;
// update end and length
@ -595,9 +591,8 @@ LocationEditRow::name_changed (ARDOUR::Location *loc)
}
void
LocationEditRow::location_changed (ARDOUR::Location *loc)
LocationEditRow::location_changed (ARDOUR::Location*)
{
ENSURE_GUI_THREAD (*this, &LocationEditRow::location_changed, loc)
if (!location) return;
@ -614,7 +609,7 @@ LocationEditRow::location_changed (ARDOUR::Location *loc)
}
void
LocationEditRow::flags_changed (ARDOUR::Location *loc, void *src)
LocationEditRow::flags_changed (ARDOUR::Location*, void *)
{
if (!location) {
return;
@ -630,7 +625,7 @@ LocationEditRow::flags_changed (ARDOUR::Location *loc, void *src)
}
void
LocationEditRow::lock_changed (ARDOUR::Location *loc)
LocationEditRow::lock_changed (ARDOUR::Location*)
{
if (!location) {
return;
@ -646,7 +641,7 @@ LocationEditRow::lock_changed (ARDOUR::Location *loc)
}
void
LocationEditRow::position_lock_style_changed (ARDOUR::Location* loc)
LocationEditRow::position_lock_style_changed (ARDOUR::Location*)
{
if (!location) {
return;
@ -826,8 +821,6 @@ struct LocationSortByStart {
void
LocationUI::location_added (Location* location)
{
ENSURE_GUI_THREAD (*this, &LocationUI::location_added, location)
if (location->is_auto_punch()) {
punch_edit_row.set_location(location);
} else if (location->is_auto_loop()) {

View File

@ -488,7 +488,7 @@ session at this time, because we would lose your connection information.\n"), PR
}
static void
sigpipe_handler (int sig)
sigpipe_handler (int /*signal*/)
{
/* XXX fix this so that we do this again after a reconnect to JACK
*/

View File

@ -317,7 +317,7 @@ MidiRegionView::enter_notify (GdkEventCrossing* ev)
}
bool
MidiRegionView::leave_notify (GdkEventCrossing* ev)
MidiRegionView::leave_notify (GdkEventCrossing*)
{
trackview.editor().hide_verbose_canvas_cursor ();
delete _ghost_note;
@ -2677,7 +2677,7 @@ MidiRegionView::note_entered(ArdourCanvas::CanvasNoteEvent* ev)
}
void
MidiRegionView::note_left (ArdourCanvas::CanvasNoteEvent* note)
MidiRegionView::note_left (ArdourCanvas::CanvasNoteEvent*)
{
Editor* editor = dynamic_cast<Editor*>(&trackview.editor());
@ -2694,7 +2694,7 @@ MidiRegionView::note_left (ArdourCanvas::CanvasNoteEvent* note)
}
void
MidiRegionView::note_mouse_position (float x_fraction, float y_fraction, bool can_set_cursor)
MidiRegionView::note_mouse_position (float x_fraction, float /*y_fraction*/, bool can_set_cursor)
{
Editor* editor = dynamic_cast<Editor*>(&trackview.editor());
@ -3027,7 +3027,7 @@ MidiRegionView::drop_down_keys ()
}
void
MidiRegionView::maybe_select_by_position (GdkEventButton* ev, double x, double y)
MidiRegionView::maybe_select_by_position (GdkEventButton* ev, double /*x*/, double y)
{
double note = midi_stream_view()->y_to_note(y);
Events e;

View File

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

View File

@ -1386,7 +1386,7 @@ MixerStrip::route_group_changed ()
void
MixerStrip::route_gui_changed (string what_changed, void* ignored)
MixerStrip::route_gui_changed (string what_changed, void*)
{
ENSURE_GUI_THREAD (*this, &MixerStrip::route_gui_changed, what_changed, ignored)

View File

@ -17,6 +17,10 @@
*/
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#endif
#include <algorithm>
#include <map>
#include <sigc++/bind.h>

View File

@ -954,7 +954,7 @@ MonitorSection::solo_blink (bool onoff)
}
bool
MonitorSection::cancel_solo (GdkEventButton* ev)
MonitorSection::cancel_solo (GdkEventButton*)
{
if (_session) {
if (_session->soloing()) {
@ -968,7 +968,7 @@ MonitorSection::cancel_solo (GdkEventButton* ev)
}
bool
MonitorSection::cancel_isolate (GdkEventButton* ev)
MonitorSection::cancel_isolate (GdkEventButton*)
{
if (_session) {
boost::shared_ptr<RouteList> rl (_session->get_routes ());
@ -979,7 +979,7 @@ MonitorSection::cancel_isolate (GdkEventButton* ev)
}
bool
MonitorSection::cancel_audition (GdkEventButton* ev)
MonitorSection::cancel_audition (GdkEventButton*)
{
if (_session) {
_session->cancel_audition();

View File

@ -277,13 +277,13 @@ PluginUIWindow::create_vst_editor(boost::shared_ptr<PluginInsert>)
}
bool
#if defined (HAVE_AUDIOUNITS) && defined (GTKOSX)
#ifdef GTKOSX
PluginUIWindow::create_audiounit_editor (boost::shared_ptr<PluginInsert> insert)
#else
PluginUIWindow::create_audiounit_editor (boost::shared_ptr<PluginInsert>)
#endif
{
#if !defined(HAVE_AUDIOUNITS) || !defined(GTKOSX)
#ifndef GTKOSX
return false;
#else
VBox* box;
@ -299,13 +299,13 @@ PluginUIWindow::create_audiounit_editor (boost::shared_ptr<PluginInsert>)
}
void
#if defined (HAVE_AUDIOUNITS) && defined(GTKOSX)
#ifdef GTKOSX
PluginUIWindow::app_activated (bool yn)
#else
PluginUIWindow::app_activated (bool)
#endif
{
#if defined (HAVE_AUDIOUNITS) && defined(GTKOSX)
#ifdef GTKOSX
cerr << "APP activated ? " << yn << endl;
if (_pluginui) {
if (yn) {

View File

@ -325,7 +325,7 @@ class VSTPluginUI : public PlugUIBase, public Gtk::VBox
};
#endif // VST_SUPPORT
#ifdef HAVE_AUDIOUNITS
#ifdef AUDIOUNITS
/* this function has to be in a .mm file */
extern PlugUIBase* create_au_gui (boost::shared_ptr<ARDOUR::PluginInsert>, Gtk::VBox**);
#endif

View File

@ -20,6 +20,10 @@
#ifndef __gtk_ardour_public_editor_h__
#define __gtk_ardour_public_editor_h__
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#endif
#include <map>
#include <string>

View File

@ -1,3 +1,7 @@
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#endif
#include <gtkmm/liststore.h>
#include <gtkmm/stock.h>
#include <gtkmm/scale.h>
@ -715,7 +719,7 @@ RCOptionEditor::RCOptionEditor ()
if (hwcpus > 1) {
add_option (_("Misc"), new OptionEditorHeading (_("DSP CPU Utilization")));
ComboOption<uint32_t>* procs = new ComboOption<uint32_t> (
ComboOption<int32_t>* procs = new ComboOption<int32_t> (
"processor-usage",
_("Signal processing uses"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_processor_usage),

View File

@ -17,6 +17,10 @@
*/
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#endif
#include <map>
#include <cerrno>
#include <sstream>

View File

@ -17,6 +17,10 @@
*/
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#endif
#include <fstream>
#include <algorithm>
@ -674,7 +678,7 @@ ArdourStartup::setup_new_session_page ()
new_folder_chooser.set_title (_("Select folder for session"));
#ifdef GTKOSX
new_folder_chooser->add_shortcut_folder ("/Volumes");
new_folder_chooser.add_shortcut_folder ("/Volumes");
#endif
vbox1->pack_start (*hbox2, false, false);
@ -928,7 +932,7 @@ ArdourStartup::setup_existing_session_page ()
existing_session_chooser.signal_file_set().connect (sigc::mem_fun (*this, &ArdourStartup::existing_session_selected));
#ifdef GTKOSX
existing_session_chooser->add_shortcut_folder ("/Volumes");
existing_session_chooser.add_shortcut_folder ("/Volumes");
#endif
HBox* hbox = manage (new HBox);

View File

@ -186,13 +186,13 @@ StepEditor::check_step_edit ()
}
int
StepEditor::step_add_bank_change (uint8_t channel, uint8_t bank)
StepEditor::step_add_bank_change (uint8_t /*channel*/, uint8_t /*bank*/)
{
return 0;
}
int
StepEditor::step_add_program_change (uint8_t channel, uint8_t program)
StepEditor::step_add_program_change (uint8_t /*channel*/, uint8_t /*program*/)
{
return 0;
}

View File

@ -17,6 +17,10 @@
*/
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#endif
#include <pango/pangoft2.h> // for fontmap resolution control for GnomeCanvas
#include <pango/pangocairo.h> // for fontmap resolution control for GnomeCanvas

View File

@ -277,9 +277,10 @@ def build(bld):
obj.target = 'ardour-3.0'
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
obj.uselib = 'UUID FLAC GLIBMM GTHREAD GTK GNOMECANVAS OGG ALSA CURL DL'
obj.uselib += ' GTKMM GNOMECANVASMM OSX GTKOSX COREAUDIO'
obj.uselib += ' GTKMM GNOMECANVASMM '
obj.uselib += ' AUDIOUNITS OSX GTKOSX '
obj.uselib_local = '''libpbd libmidipp libtaglib libardour libardour_cp
libgtkmm2ext libtaglib'''
libgtkmm2ext libappleutility libtaglib'''
obj.cflags = ['-DPACKAGE="gtk2_ardour"']
obj.cxxflags = ['-DPACKAGE="gtk2_ardour"']
obj.cxxflags += ['-DVERSIONSTRING="' + bld.env['VERSION'] + '"']
@ -289,6 +290,7 @@ def build(bld):
obj.cxxflags += ['-DLOCALEDIR="' + os.path.join(
os.path.normpath(bld.env['DATADIR']), 'locale') + '"']
obj.cxxflags += ['-DPROGRAM_NAME="' + bld.env['PROGRAM_NAME'] + '"']
obj.cxxflags += ['-I../libs']
if bld.env['HAVE_SLV2']:
obj.source += [ 'lv2_plugin_ui.cc' ]
@ -304,14 +306,10 @@ def build(bld):
if bld.env['PHONE_HOME']:
obj.cxxflags += [ '-DPHONE_HOME' ]
if bld.env['GTKOSX']:
if bld.env['COREAUDIO']:
TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
obj.source += [ 'cocoacarbon.mm' ]
if bld.env['AUDIOUNITS']:
obj.source += [ 'au_pluginui.mm' ]
obj.uselib_local += ' libappleutility '
obj.source += [ 'cocoacarbon.mm', 'au_pluginui.mm' ]
obj.uselib_local += ' libappleutility '
else:
obj.source += [ 'x11.cc' ]
@ -346,13 +344,13 @@ def build(bld):
obj = bld.new_task_gen('subst')
obj.source = 'ardev_common.sh.in'
obj.target = 'ardev_common_waf.sh'
obj.chmod = 0o755
obj.chmod = 0755
obj.dict = wrapper_subst_dict
obj = bld.new_task_gen('subst')
obj.source = 'ardour.sh.in'
obj.target = 'ardour3'
obj.chmod = 0o755
obj.chmod = 0755
obj.dict = wrapper_subst_dict
obj.install_path = bld.env['BINDIR']

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>

74
wscript
View File

@ -397,25 +397,27 @@ def configure(conf):
if sys.platform == 'darwin':
conf.define ('AUDIOUNITS', 1)
conf.define ('AUSTATE', 1)
conf.define ('AU_STATE_SUPPORT', 1)
conf.define ('COREAUDIO', 1)
conf.define ('GTKOSX', 1)
conf.define ('TOP_MENUBAR',1)
conf.define ('GTKOSX',1)
conf.env.append_value('CXXFLAGS_APPLEUTILITY', '-I../libs')
#
# Define OSX as a uselib to use when compiling
# on Darwin to add all applicable flags at once
#
conf.env.append_value('CXXFLAGS_OSX', '-DMAC_OS_X_VERSION_MIN_REQUIRED=1040')
conf.env.append_value('CCFLAGS_OSX', '-DMAC_OS_X_VERSION_MIN_REQUIRED=1040')
#conf.env.append_value('CXXFLAGS_OSX', "-mmacosx-version-min=10.4")
#conf.env.append_value('CXXFLAGS_OSX', "-mmacosx-version-min=10.4")
conf.env.append_value('CXXFLAGS_OSX', '-mmacosx-version-min=10.4')
conf.env.append_value('CCFLAGS_OSX', '-mmacosx-version-min=10.4')
#conf.env.append_value('CXXFLAGS_OSX', "-isysroot /Developer/SDKs/MacOSX10.4u.sdk")
#conf.env.append_value('CCFLAGS_OSX', "-isysroot /Developer/SDKs/MacOSX10.4u.sdk")
#conf.env.append_value('LINKFLAGS_OSX', "-mmacosx-version-min=10.4")
#conf.env.append_value('LINKFLAGS_OSX', "-isysroot /Developer/SDKs/MacOSX10.4u.sdk")
#conf.env.append_value('LINKFLAGS_OSX', "-sysroot /Developer/SDKs/MacOSX10.4u.sdk")
#conf.env.append_value('LINKFLAGS_OSX', "-F/System/Library/Frameworks")
conf.env.append_value('CXXFLAGS_OSX', "-msse")
conf.env.append_value('CCFLAGS_OSX', "-msse")
@ -426,60 +428,23 @@ def configure(conf):
# off processor type. Need to add in a check
# for that.
#
conf.env.append_value('CXXFLAGS_OSX', '-F/System/LibraryFrameworks')
conf.env.append_value('CXXFLAGS_OSX', '-F/Library/Frameworks')
#conf.env.append_value('CPPPATH_OSX', "/System/Library/Frameworks/")
#conf.env.append_value('CPPPATH_OSX', "/usr/include/")
#conf.env.append_value('CPPPATH_OSX', "/usr/include/c++/4.0.0")
#conf.env.append_value('CPPPATH_OSX', "/usr/include/c++/4.0.0/i686-apple-darwin8/")
#
# TODO: Fix the above include path, it needs to be
# defined based off what is read in the configuration
# stage about the machine(PPC, X86, X86_64, etc.)
#
conf.env.append_value('CPPPATH_OSX', "/usr/lib/gcc/i686-apple-darwin9/4.0.1/include/")
#
# TODO: Likewise this needs to be defined not only
# based off the machine characteristics, but also
# based off the version of GCC being used.
#
conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'AppKit'])
conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'CoreAudio'])
conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'CoreFoundation'])
conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'CoreServices'])
conf.env.append_value('FRAMEWORK_OSX', ['CoreFoundation'])
conf.env.append_value('LINKFLAGS_OSX', ['-undefined', 'suppress' ])
conf.env.append_value('LINKFLAGS_OSX', '-flat_namespace')
#conf.env.append_value('LINKFLAGS_OSX', ['-undefined', 'suppress'])
#conf.env.append_value('LINKFLAGS_OSX', "-flat_namespace")
#
# The previous 2 flags avoid circular dependencies
# between libardour and libardour_cp on OS X.
# ld reported -undefined suppress as an unknown option
# in one of the tests ran, removing it for the moment
#
conf.env.append_value('CXXFLAGS_OSX', "-F/System/Library/Frameworks")
conf.env.append_value('CCFLAGS_OSX', "-F/System/Library/Frameworks")
#
# Define Include Paths for GTKOSX
#
conf.env.append_value('CXXFLAGS_GTKOSX', '-DTOP_MENUBAR')
conf.env.append_value('CXXFLAGS_GTKOSX', '-DGTKOSX')
conf.env.append_value('LINKFLAGS_GTKOSX', "-framework AppKit")
conf.env.append_value('LINKFLAGS_GTKOSX', "-Xlinker -headerpad")
conf.env.append_value('LINKFLAGS_GTKOSX', "-Xlinker 2048")
conf.env.append_value('LINKFLAGS_GTKOSX', [ '-Xlinker', '-headerpad'])
conf.env.append_value('LINKFLAGS_GTKOSX', ['-Xlinker', '2048'])
conf.env.append_value('CPPPATH_GTKOSX', "/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/")
conf.check_cc (header_name = '/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h',
define_name = 'HAVE_COREAUDIO', linkflags = ['-framework CoreAudio'],
uselib_store="COREAUDIO")
conf.check_cxx (header_name = '/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h',
linkflags = [ '-framework AudioToolbox' ], uselib_store="COREAUDIO")
conf.check_cc (header_name = '/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h',
linkflags = ['-framework CoreServices'], uselib_store="COREAUDIO")
conf.env.append_value('CXXFLAGS_AUDIOUNIT', "-DHAVE_AUDIOUNITS")
conf.env.append_value('FRAMEWORK_AUDIOUNIT', ['AudioToolbox'])
conf.env.append_value('FRAMEWORK_AUDIOUNIT', ['CoreServices'])
conf.check_cc (header_name = '/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h',
define_name = 'HAVE_AUDIOUNITS', linkflags = [ '-framework AudioUnit' ],
uselib_store="AUDIOUNIT")
conf.env.append_value('CXXFLAGS_AUDIOUNITS', "-DHAVE_AUDIOUNITS")
conf.env.append_value('LINKFLAGS_AUDIOUNITS', ['-framework', 'Audiotoolbox', '-framework', 'AudioUnit'])
if Options.options.boost_include != '':
conf.env.append_value('CPPPATH', Options.options.boost_include)
@ -502,6 +467,7 @@ def configure(conf):
autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2')
autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.2')
autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0')
autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18')
if sys.platform == 'darwin':
sub_config_and_use(conf, 'libs/appleutility')