25 #ifndef __SB_PLAYQUEUESERVICE_H__
26 #define __SB_PLAYQUEUESERVICE_H__
33 #include <nsAutoPtr.h>
36 #include <nsIObserver.h>
37 #include <nsIGenericFactory.h>
38 #include <nsIWeakReference.h>
39 #include <nsTHashtable.h>
40 #include <nsHashKeys.h>
42 #include <sbILibrary.h>
43 #include <sbILocalDatabaseLibraryCopyListener.h>
44 #include <sbIMediacoreEvent.h>
45 #include <sbIMediacoreEventListener.h>
46 #include <sbIMediacoreManager.h>
47 #include <sbIMediaListListener.h>
48 #include <sbIPlayQueueService.h>
54 class nsIStringBundle;
70 NS_DECL_SBIPLAYQUEUESERVICE
71 NS_DECL_SBIMEDIALISTLISTENER
72 NS_DECL_SBIMEDIACOREEVENTLISTENER
73 NS_DECL_SBILOCALDATABASELIBRARYCOPYLISTENER
79 static NS_METHOD
RegisterSelf(nsIComponentManager* aCompMgr,
81 const char* aLoaderStr,
83 const nsModuleComponentInfo* aInfo);
88 mIgnoreListListener = aIgnore;
98 nsCOMPtr<sbIMediaList> mMediaList;
103 nsCOMPtr<sbILibrary> mLibrary;
121 PRBool mExplicitStop;
127 PRUint32 mBatchRemovalIndex;
133 PRBool mBatchBeginAllHistory;
138 PRBool mIgnoreListListener;
144 PRBool mSequencerOnQueue;
149 PRBool mSequencerPlayingOrPaused;
153 PRBool mOperationInProgress;
164 nsTArray<nsString> mRemovedItemGUIDs;
169 nsRefPtr<sbPlayQueueLibraryListener> mLibraryListener;
174 nsCOMPtr<nsIWeakReference> mWeakMediacoreManager;
180 PRUint32 aInsertBeforeIndex);
187 PRUint32 aInsertBeforeIndex);
199 nsresult RefreshIndexFromView();
207 nsresult CreateMediaList();
212 nsresult InitLibrary();
217 nsresult InitMediaList();
223 nsresult SetIndexToPlayingTrack();
246 nsTHashtable<nsISupportsHashKey> mListeners;
251 nsresult NotifyQueueOperationStarted();
256 nsresult NotifyQueueOperationCompleted();
262 static PLDHashOperator PR_CALLBACK
263 OnIndexUpdatedCallback(nsISupportsHashKey* aKey,
269 static PLDHashOperator PR_CALLBACK
270 OnQueueStartedCallback(nsISupportsHashKey* aKey,
276 static PLDHashOperator PR_CALLBACK
277 OnQueueCompletedCallback(nsISupportsHashKey* aKey,
283 nsRefPtr<sbPlayQueueExternalLibraryListener> mExternalListener;
289 nsRefPtr<sbPlayQueueAsyncListener> mAsyncListener;
297 NS_DECL_SBIADDMEDIAITEMSLISTENER
315 nsCOMPtr<nsIStringBundle> mBundle;
320 nsCOMPtr<sbIDataRemote> mDataRemote;
328 #define SB_PLAYQUEUESERVICE_CONTRACTID \
329 "@songbirdnest.com/Songbird/playqueue/service;1"
330 #define SB_PLAYQUEUESERVICE_CLASSNAME \
331 "Songbird Play Queue Service"
332 #define SB_PLAYQUEUESERVICE_CID \
333 { 0xe6407d63, 0x33d2, 0x402e, \
334 { 0xa1, 0x66, 0x3d, 0x6b, 0xc7, 0x85, 0xa4, 0x8e } }
static NS_METHOD RegisterSelf(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *aLoaderStr, const char *aType, const nsModuleComponentInfo *aInfo)
void SetIgnoreListListener(PRBool aIgnore)
Interface used to listen for items being copied from a library.
An interface for accessing, and binding to, stored data.
Helper class to listen to external libraries and sync properties.
NS_DECL_ISUPPORTS NS_DECL_SBIPLAYQUEUESERVICE NS_DECL_SBIMEDIALISTLISTENER NS_DECL_SBIMEDIACOREEVENTLISTENER NS_DECL_SBILOCALDATABASELIBRARYCOPYLISTENER NS_DECL_NSIOBSERVER sbPlayQueueService()
virtual ~sbPlayQueueService()
Service for interacting with the Play Queue.
NS_DECL_ISUPPORTS NS_DECL_SBIADDMEDIAITEMSLISTENER sbPlayQueueAsyncListener(sbPlayQueueService *aService)
virtual ~sbPlayQueueAsyncListener()
Helper class to listen to play queue library notifications.