47 #include <sbIDynamicPlaylistService.h>
48 #include <sbIMediaListFactory.h>
52 #include <nsAutoPtr.h>
53 #include <nsIClassInfoImpl.h>
54 #include <nsIProgrammingLanguage.h>
56 #include <nsServiceManagerUtils.h>
71 static PRLogModuleInfo* gLocalDatabaseDynamicMediaListLog = nsnull;
72 #define TRACE(args) PR_LOG(gLocalDatabaseDynamicMediaListLog, \
75 #define LOG(args) PR_LOG(gLocalDatabaseDynamicMediaListLog, PR_LOG_WARN, args)
120 sbLocalDatabaseDynamicMediaList::Update()
123 TRACE((
"sbLocalDatabaseDynamicMediaList[0x%p] - Update()",
this));
129 nsCOMPtr<sbIDynamicPlaylistService> dynamicPlaylistService =
130 do_GetService(
"@songbirdnest.com/Songbird/Library/DynamicPlaylistService;1",
132 NS_ENSURE_SUCCESS(rv, rv);
133 rv = dynamicPlaylistService->UpdateNow(
this);
134 NS_ENSURE_SUCCESS(rv, rv);
153 aType.Assign(NS_LITERAL_STRING(
"dynamic"));
177 NS_ENSURE_ARG_POINTER(aInner);
178 NS_ENSURE_ARG_POINTER(aMediaList);
184 nsRefPtr<sbLocalDatabaseDynamicMediaList>
186 NS_ENSURE_TRUE(dynamicMediaList, NS_ERROR_OUT_OF_MEMORY);
187 rv = dynamicMediaList->Initialize(aInner);
188 NS_ENSURE_SUCCESS(rv, rv);
191 rv = CallQueryInterface(dynamicMediaList.get(), aMediaList);
192 NS_ENSURE_SUCCESS(rv, rv);
221 if (!gLocalDatabaseDynamicMediaListLog) {
222 gLocalDatabaseDynamicMediaListLog =
223 PR_NewLogModule(
"sbLocalDatabaseDynamicMediaList");
240 TRACE((
"sbLocalDatabaseDynamicMediaList[0x%p] - Initialize(0x%p)",
245 NS_ENSURE_ARG_POINTER(aInner);
251 nsCOMPtr<sbIMediaListFactory> simpleMediaListFactory =
254 NS_ENSURE_SUCCESS(rv, rv);
255 rv = simpleMediaListFactory->CreateMediaList(aInner,
257 NS_ENSURE_SUCCESS(rv, rv);
259 NS_ENSURE_SUCCESS(rv, rv);
262 nsAutoString customType;
265 if (customType.IsEmpty()) {
267 NS_LITERAL_STRING(
"dynamic"));
268 NS_ENSURE_SUCCESS(rv, rv);
272 NS_LITERAL_STRING(
"1"));
273 NS_ENSURE_SUCCESS(rv, rv);
#define SB_PROPERTY_ISSUBSCRIPTION
NS_INTERFACE_MAP_END NS_IMPL_CI_INTERFACE_GETTER6(sbDeviceLibrary, nsIClassInfo, sbIDeviceLibrary, sbILibrary, sbIMediaList, sbIMediaItem, sbILibraryResource) sbDeviceLibrary
General interface to data resources.
#define SB_LOCALDATABASE_SIMPLEMEDIALISTFACTORY_CONTRACTID
#define SB_PROPERTY_CUSTOMTYPE