27 #ifndef __SB_IPD_MARSHALL_H__
28 #define __SB_IPD_MARSHALL_H__
54 #include <sbIDeviceManager.h>
55 #include <sbIDeviceRegistrar.h>
58 #include <nsAutoLock.h>
59 #include <nsAutoPtr.h>
60 #include <nsIClassInfo.h>
61 #include <nsInterfaceHashtable.h>
64 #include <Carbon/Carbon.h>
77 #define SB_IPDMARSHALL_CONTRACTID "@songbirdnest.com/Songbird/IPDMarshall;1"
78 #define SB_IPDMARSHALL_CLASSNAME "iPod Device Marshall"
79 #define SB_IPDMARSHALL_DESCRIPTION "iPod Device Marshall"
80 #define SB_IPDMARSHALL_CID \
85 { 0xae, 0x2b, 0x0f, 0xed, 0xb9, 0x47, 0xdf, 0x37 } \
100 template<
class RefType>
110 if (mRef && mRef != ref)
115 operator RefType() {
return mRef; }
116 operator int() {
return (mRef != NULL); }
125 class sbAutoFinalizeVolumeMonitor;
152 NS_DECL_SBIDEVICEMARSHALL
186 nsCOMPtr<sbIDeviceRegistrar> mDeviceRegistrar;
187 nsInterfaceHashtable<nsUint32HashKey, nsISupports>
189 EventHandlerProcPtr mVolumeEventHandler;
190 EventHandlerRef mVolumeEventHandlerRef;
197 nsresult InitializeVolumeMonitor();
199 void FinalizeVolumeMonitor();
201 static pascal OSStatus VolumeEventHandler(EventHandlerCallRef aNextHandler,
205 void VolumeEventHandler(EventHandlerCallRef aNextHandler,
208 void HandleAddedEvent(FSVolumeRefNum aVolumeRefNum);
210 void HandleRemovedEvent(FSVolumeRefNum aVolumeRefNum);
217 nsresult ScanForConnectedDevices();
219 PRBool IsIPod(FSVolumeRefNum aVolumeRefNum);
221 nsresult GetVolumePath(FSVolumeRefNum aVolumeRefNum,
222 nsAString& aVolumePath);
224 nsresult GetFirewireGUID(FSVolumeRefNum aVolumeRefNum,
225 nsAString& aFirewireGUID);
237 mValue->FinalizeVolumeMonitor(),
Songbird iPod Device Utility Definitions.
RefType operator=(RefType ref)
NS_DECL_ISUPPORTS NS_DECL_SBIDEVICEMARSHALL NS_DECL_NSICLASSINFO sbIPDMarshall()
friend class sbAutoFinalizeVolumeMonitor
gWaitForCompletion mDeviceManager
SB_AUTO_CLASS(sbAutoFinalizeVolumeMonitor, sbIPDMarshall *, mValue, mValue->FinalizeVolumeMonitor(), mValue=nsnull)