Re: Carbon View Events
Re: Carbon View Events
- Subject: Re: Carbon View Events
- From: Marek Bereza <email@hidden>
- Date: Thu, 23 Jun 2005 20:11:19 +0100
Hi List,
I've got exactly the same problem described below. I've written a
plugin (a sampler) which all works fine. The problem is, the controls
don't seem to respond to mouse events. Looking at other people's
source code seems to indicate that when you tie a control to an AU
parameter, it seems to take care of it.
The problem I have is that I need controls that aren't tied to
controls - like a DataBrowser for listing samples.
I would be extremely grateful for any help with this. If this seems
too trivial, could anyone possibly forward me to the appropriate
documentation?
Regards,
Marek Bereza
On 2 Jun 2005, at 21:29, Jeremy Jurksztowicz wrote:
Hello,
I am writing an audiounit with both a carbon and a cocoa view.The
cocoa view has the real user interface. In the event that only the
carbon view can be hosted (unfortunately common) I would like to
present a button which allows the user to load a preset created in
the cocoa view. The preset is not standard AU preset that the host
handles, so I would like to intercept the button push and open a
standard open dialog box in response. I see that the carbon view
base, handles mapping parameters to controls, but I don't
understand how to actually intercept the gui events properly.
Please excuse my ignorance if this is really simple, I am good with
cocoa, but usless with carbon. Here is my code so far:
OSStatus MYAUView::CreateUI(Float32 xoffset, Float32 yoffset)
{
ControlRef button;
Rect buttonBounds = {0, 0, 100, 50};
OSStatus res = CreatePushButtonControl (
this->GetCarbonWindow(),
&buttonBounds,
CFSTR("Load Preset"),
&button);
if(res == noErr) {
_loadButton = button;
this->EmbedControl(button);
}
SizeControl(mCarbonPane, 100, 50);
return noErr;
}
bool MYAUView::HandleEvent(EventRef event)
{
UInt32 eclass = GetEventClass(event);
UInt32 ekind = GetEventKind(event);
if(eclass == kEventClassControl)
{
if(ekind == kEventControlClick)
{
ControlRef control;
GetEventParameter(event,
kEventParamDirectObject,
typeControlRef, NULL, sizeof(ControlRef), NULL,
&control);
if(control == _loadButton)
{
// DO CUSTOM WORK
return true;
}
}
}
return AUCarbonViewBase::HandleEvent(event);
}
This compiles all right, but the button does not give any visual
feedback of being pressed, and the custom code is not called, so...
beats me!?
Thank you,
Jeremy Jurksztowicz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40blueyonder.co.uk
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden