Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Good form for opening/writing/closing



David Sopchak <email@hidden> wrote:

> Hi all,
...
> This is a style question, I guess, but before I go wasting my time on a
> bad approach, I was wondering what you folks thought.
> 
> Thanks,
>       Dave
> 

First I'd throw some thought on if there is some similar interfacing
structure already out in the world. If other people already use this
device for my viewpoint it is desirable to use the same api on the
userland side.

With some more copy paste you'll be able to install Plug/Unplug
Notifications (simply retain the matching dictionary from a previous
finddevice and reuse it for notifications). Then you are able to do the
whole init procedure of a device in its notification.

Either send an apple event from this notification (and init) to your
main app event loop or use some other approach that does not poll from
the main app loop.

btw I did it with some other polling. Though I have to trigger reads on
usb with an runloop timer and if a new device is found it is placed in a
chained list of devices which also is worked down by this kicker timer.
For me it is safe to also modify this chained list from other places.
Don't know if this works for you.


-- 
Hado Hein, Berlin, Fed.Rep. of Germany
     Talk about it ? AIM: chat2hado

http://www.batchmaker.de (software authoring, including stage lighting)
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden

This email sent to email@hidden

References: 
 >Good form for opening/writing/closing (From: David Sopchak <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.