• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
error in AUPublic/AUCarbonViewBase/CarbonEventHandler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

error in AUPublic/AUCarbonViewBase/CarbonEventHandler


  • Subject: error in AUPublic/AUCarbonViewBase/CarbonEventHandler
  • From: Brandon Ware <email@hidden>
  • Date: Wed, 2 Oct 2002 06:25:08 -0400

In CarbonEventHandler.h/cc, if you call WantEventTypes for two or more different targets, only the latest registered handler and target will be called. CarbonEventHandler checks to see if a handler has been registered, and if so, just adds the event type to the handler, even if it has a different target. The fix is to keep track of the handler-target combination:

-- CarbonEventHandler.h --

#include <map>
...
protected:
/*! @var mHandler */
typedef std::map<EventTargetRef, EventHandlerRef> Handlers;
Handlers mHandlers;
};

-- CarbonEventHandler.cpp --

...
CarbonEventHandler::~CarbonEventHandler()
{
for( Handlers::iterator i = mHandlers.begin();
i != mHandlers.end();
++i )
{
if( i->second )
RemoveEventHandler(i->second);
}
}

void CarbonEventHandler::WantEventTypes(EventTargetRef target, UInt32 inNumTypes, const EventTypeSpec *inList)
{
Handlers::iterator iHandler = mHandlers.find(target);
if(iHandler == mHandlers.end())
{
EventHandlerRef handler = 0;
verify_noerr(InstallEventHandler(target, TheEventHandler, inNumTypes, inList, this, &handler));
mHandlers[target] = handler;
}
else
{
verify_noerr(AddEventTypesToHandler(iHandler->second, inNumTypes, inList));
}
}
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
  • Prev by Date: Re: AU interface consistency
  • Next by Date: Re: AU HostCallback - musical location
  • Previous by thread: Re: (HAL) clock sources
  • Next by thread: DLS Synth Problems
  • Index(es):
    • Date
    • Thread