summaryrefslogtreecommitdiff
path: root/gtk2_ardour/au_pluginui.mm
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-11-10 01:32:34 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-11-10 01:32:34 +0000
commit4f7b88f40f2a01535060b9c00c740d8ddd29155f (patch)
treee250a1918de9e63db17220f0baa62d8dbf511bd3 /gtk2_ardour/au_pluginui.mm
parent7366afdf2b6a8b42c0ea66298e119f2ea257605f (diff)
use DEBUG_TRACE for some AudioUnit GUI debugging
git-svn-id: svn://localhost/ardour2/branches/3.0@10523 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/au_pluginui.mm')
-rw-r--r--gtk2_ardour/au_pluginui.mm26
1 files changed, 24 insertions, 2 deletions
diff --git a/gtk2_ardour/au_pluginui.mm b/gtk2_ardour/au_pluginui.mm
index 2b3053d20f..c90f4c1f3e 100644
--- a/gtk2_ardour/au_pluginui.mm
+++ b/gtk2_ardour/au_pluginui.mm
@@ -5,7 +5,9 @@
#include "pbd/convert.h"
#include "pbd/error.h"
+
#include "ardour/audio_unit.h"
+#include "ardour/debug.h"
#include "ardour/plugin_insert.h"
#undef check // stupid gtk, stupid apple
@@ -286,10 +288,14 @@ AUPluginUI::create_cocoa_view ()
&isWritable );
numberOfClasses = (dataSize - sizeof(CFURLRef)) / sizeof(CFStringRef);
-
+
// Does view have custom Cocoa UI?
if ((result == noErr) && (numberOfClasses > 0) ) {
+
+ DEBUG_TRACE(DEBUG::AudioUnits,
+ string_compose ( "based on %1, there are %2 cocoa UI classes\n", dataSize, numberOfClasses));
+
cocoaViewInfo = (AudioUnitCocoaViewInfo *)malloc(dataSize);
if(AudioUnitGetProperty(*au->get_au(),
kAudioUnitProperty_CocoaUI,
@@ -299,12 +305,17 @@ AUPluginUI::create_cocoa_view ()
&dataSize) == noErr) {
CocoaViewBundlePath = (NSURL *)cocoaViewInfo->mCocoaAUViewBundleLocation;
-
+
// we only take the first view in this example.
factoryClassName = (NSString *)cocoaViewInfo->mCocoaAUViewClass[0];
+
+ DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("the factory name is %1 bundle is %2\n",
+ factoryClassName, CocoaViewBundlePath));
} else {
+ DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("No cocoaUI property cocoaViewInfo = %1\n", cocoaViewInfo));
+
if (cocoaViewInfo != NULL) {
free (cocoaViewInfo);
cocoaViewInfo = NULL;
@@ -318,11 +329,15 @@ AUPluginUI::create_cocoa_view ()
if (CocoaViewBundlePath && factoryClassName) {
NSBundle *viewBundle = [NSBundle bundleWithPath:[CocoaViewBundlePath path]];
+
+ DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("tried to create bundle, result = %1\n", viewBundle));
+
if (viewBundle == nil) {
error << _("AUPluginUI: error loading AU view's bundle") << endmsg;
return -1;
} else {
Class factoryClass = [viewBundle classNamed:factoryClassName];
+ DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("tried to create factory class, result = %1\n", factoryClass));
if (!factoryClass) {
error << _("AUPluginUI: error getting AU view's factory class from bundle") << endmsg;
return -1;
@@ -340,8 +355,12 @@ AUPluginUI::create_cocoa_view ()
return -1;
}
+ DEBUG_TRACE (DEBUG::AudioUnits, "got a factory instance\n");
+
// make a view
au_view = [factoryInstance uiViewForAudioUnit:*au->get_au() withSize:crect.size];
+
+ DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("view created @ %1\n", au_view));
// cleanup
[CocoaViewBundlePath release];
@@ -358,7 +377,10 @@ AUPluginUI::create_cocoa_view ()
if (!wasAbleToLoadCustomView) {
// load generic Cocoa view
+ DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("Loading generic view using %1 -> %2\n", au,
+ au->get_au()));
au_view = [[AUGenericView alloc] initWithAudioUnit:*au->get_au()];
+ DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("view created @ %1\n", au_view));
[(AUGenericView *)au_view setShowsExpertParameters:YES];
}