13
0

use DEBUG_TRACE for some AudioUnit GUI debugging

git-svn-id: svn://localhost/ardour2/branches/3.0@10523 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2011-11-10 01:32:34 +00:00
parent 7366afdf2b
commit 4f7b88f40f

View File

@ -5,7 +5,9 @@
#include "pbd/convert.h" #include "pbd/convert.h"
#include "pbd/error.h" #include "pbd/error.h"
#include "ardour/audio_unit.h" #include "ardour/audio_unit.h"
#include "ardour/debug.h"
#include "ardour/plugin_insert.h" #include "ardour/plugin_insert.h"
#undef check // stupid gtk, stupid apple #undef check // stupid gtk, stupid apple
@ -290,6 +292,10 @@ AUPluginUI::create_cocoa_view ()
// Does view have custom Cocoa UI? // Does view have custom Cocoa UI?
if ((result == noErr) && (numberOfClasses > 0) ) { 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); cocoaViewInfo = (AudioUnitCocoaViewInfo *)malloc(dataSize);
if(AudioUnitGetProperty(*au->get_au(), if(AudioUnitGetProperty(*au->get_au(),
kAudioUnitProperty_CocoaUI, kAudioUnitProperty_CocoaUI,
@ -303,8 +309,13 @@ AUPluginUI::create_cocoa_view ()
// we only take the first view in this example. // we only take the first view in this example.
factoryClassName = (NSString *)cocoaViewInfo->mCocoaAUViewClass[0]; factoryClassName = (NSString *)cocoaViewInfo->mCocoaAUViewClass[0];
DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("the factory name is %1 bundle is %2\n",
factoryClassName, CocoaViewBundlePath));
} else { } else {
DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("No cocoaUI property cocoaViewInfo = %1\n", cocoaViewInfo));
if (cocoaViewInfo != NULL) { if (cocoaViewInfo != NULL) {
free (cocoaViewInfo); free (cocoaViewInfo);
cocoaViewInfo = NULL; cocoaViewInfo = NULL;
@ -318,11 +329,15 @@ AUPluginUI::create_cocoa_view ()
if (CocoaViewBundlePath && factoryClassName) { if (CocoaViewBundlePath && factoryClassName) {
NSBundle *viewBundle = [NSBundle bundleWithPath:[CocoaViewBundlePath path]]; NSBundle *viewBundle = [NSBundle bundleWithPath:[CocoaViewBundlePath path]];
DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("tried to create bundle, result = %1\n", viewBundle));
if (viewBundle == nil) { if (viewBundle == nil) {
error << _("AUPluginUI: error loading AU view's bundle") << endmsg; error << _("AUPluginUI: error loading AU view's bundle") << endmsg;
return -1; return -1;
} else { } else {
Class factoryClass = [viewBundle classNamed:factoryClassName]; Class factoryClass = [viewBundle classNamed:factoryClassName];
DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("tried to create factory class, result = %1\n", factoryClass));
if (!factoryClass) { if (!factoryClass) {
error << _("AUPluginUI: error getting AU view's factory class from bundle") << endmsg; error << _("AUPluginUI: error getting AU view's factory class from bundle") << endmsg;
return -1; return -1;
@ -340,9 +355,13 @@ AUPluginUI::create_cocoa_view ()
return -1; return -1;
} }
DEBUG_TRACE (DEBUG::AudioUnits, "got a factory instance\n");
// make a view // make a view
au_view = [factoryInstance uiViewForAudioUnit:*au->get_au() withSize:crect.size]; au_view = [factoryInstance uiViewForAudioUnit:*au->get_au() withSize:crect.size];
DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("view created @ %1\n", au_view));
// cleanup // cleanup
[CocoaViewBundlePath release]; [CocoaViewBundlePath release];
if (cocoaViewInfo) { if (cocoaViewInfo) {
@ -358,7 +377,10 @@ AUPluginUI::create_cocoa_view ()
if (!wasAbleToLoadCustomView) { if (!wasAbleToLoadCustomView) {
// load generic Cocoa view // 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()]; 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]; [(AUGenericView *)au_view setShowsExpertParameters:YES];
} }