#include "sbiTunesImporter.h"
#include <algorithm>
#include <nsAppDirectoryServiceDefs.h>
#include <nsArrayUtils.h>
#include <nsAutoPtr.h>
#include <nsCOMArray.h>
#include <nsComponentManagerUtils.h>
#include <nsDirectoryServiceUtils.h>
#include <nsXPCOMCIDInternal.h>
#include <nsIArray.h>
#include <nsIBufferedStreams.h>
#include <nsIFile.h>
#include <nsIFileURL.h>
#include <nsIInputStream.h>
#include <nsIIOService.h>
#include <nsILineInputStream.h>
#include <nsILocalFile.h>
#include <nsIProperties.h>
#include <nsISimpleEnumerator.h>
#include <nsIURI.h>
#include <nsIXULRuntime.h>
#include <nsMemory.h>
#include <nsNetUtil.h>
#include <nsThreadUtils.h>
#include <prtime.h>
#include <sbIAlbumArtFetcherSet.h>
#include <sbIAlbumArtListener.h>
#include <sbFileUtils.h>
#include <sbILibrary.h>
#include <sbILocalDatabaseLibrary.h>
#include <sbIMediaList.h>
#include <sbIPropertyArray.h>
#include <sbLibraryUtils.h>
#include <sbIMediacoreTypeSniffer.h>
#include <sbPrefBranch.h>
#include <sbPropertiesCID.h>
#include <sbStringUtils.h>
#include <sbStandardProperties.h>
#include "sbiTunesImporterAlbumArtListener.h"
#include "sbiTunesImporterJob.h"
#include "sbiTunesImporterStatus.h"
Go to the source code of this file.
|
nsString | ConvertRating (nsAString const &aRating) |
|
nsString | ConvertDuration (nsAString const &aDuration) |
|
nsString | ConvertDateTime (nsAString const &aDateTime) |
|
| NS_IMPL_ISUPPORTS2 (sbiTunesImporter, sbILibraryImporter, sbIiTunesXMLParserListener) sbiTunesImporter |
|
static PRBool | IsSongbirdFolder (sbIStringMap *aProperties) |
|
static nsresult | FindPlaylistByName (sbILibrary *aLibrary, nsAString const &aPlaylistName, sbIMediaList **aMediaList) |
|
static nsresult | ComputePlaylistSignature (sbiTunesSignature &aSignature, sbIMediaList *aMediaList) |
|
static nsresult | IsPlaylistDirty (sbIMediaList *aMediaList, PRBool &aIsDirty) |
|
static nsresult | AddItemsToPlaylist (sbIMediaList *aMediaList, nsIMutableArray *aItems) |
|
static nsresult | StorePlaylistSignature (sbIMediaList *aMediaList) |
|
static PLDHashOperator | EnumReadFunc (nsAString const &aKey, nsString aValue, void *aUserArg) |
|
static PLDHashOperator | ConvertToPropertyArray (nsAString const &aKey, nsString aValue, void *aUserArg) |
|
#define LOG |
( |
|
args | ) |
/* nothing */ |
#define TRACE |
( |
|
args | ) |
/* nothing */ |
typedef nsString(* ValueConversion)(nsAString const &aValue) |
typedef for conversion functions used to convert values from iTunes to Songbird
Definition at line 109 of file sbiTunesImporter.cpp.
static nsresult AddItemsToPlaylist |
( |
sbIMediaList * |
aMediaList, |
|
|
nsIMutableArray * |
aItems |
|
) |
| |
|
static |
nsString ConvertDateTime |
( |
nsAString const & |
aDateTime | ) |
|
Convert the iTunes date/time value specified by aITunesMetaValue to a Songbird date/time property value and return the result.
- Parameters
-
aDateTime | iTunes date/time value. |
- Returns
- Songbird property value.
Definition at line 165 of file sbiTunesImporter.cpp.
nsString ConvertDuration |
( |
nsAString const & |
aDuration | ) |
|
Convert the iTunes duration value specified by aITunesMetaValue to a Songbird duration property value and return the result.
- Parameters
-
aDuration | iTunes duration in seconds. |
- Returns
- Songbird property value.
Definition at line 143 of file sbiTunesImporter.cpp.
nsString ConvertRating |
( |
nsAString const & |
aRating | ) |
|
Convert the iTunes rating value specified by aITunesMetaValue to a Songbird rating property value and return the result. 1 star is the same as 20 in iTunes
- Parameters
-
- Returns
- Songbird property value.
Definition at line 121 of file sbiTunesImporter.cpp.
static PLDHashOperator ConvertToPropertyArray |
( |
nsAString const & |
aKey, |
|
|
nsString |
aValue, |
|
|
void * |
aUserArg |
|
) |
| |
|
static |
static PLDHashOperator EnumReadFunc |
( |
nsAString const & |
aKey, |
|
|
nsString |
aValue, |
|
|
void * |
aUserArg |
|
) |
| |
|
static |
static nsresult FindPlaylistByName |
( |
sbILibrary * |
aLibrary, |
|
|
nsAString const & |
aPlaylistName, |
|
|
sbIMediaList ** |
aMediaList |
|
) |
| |
|
static |
static nsresult IsPlaylistDirty |
( |
sbIMediaList * |
aMediaList, |
|
|
PRBool & |
aIsDirty |
|
) |
| |
|
static |
static PRBool IsSongbirdFolder |
( |
sbIStringMap * |
aProperties | ) |
|
|
static |
Determines if this is the special Songbird folder for playlists
Definition at line 841 of file sbiTunesImporter.cpp.
static nsresult StorePlaylistSignature |
( |
sbIMediaList * |
aMediaList | ) |
|
|
static |
Initial value:= {
}
#define SB_PROPERTY_TOTALDISCS
nsString ConvertDuration(nsAString const &aDuration)
#define SB_PROPERTY_PLAYCOUNT
#define SB_PROPERTY_SAMPLERATE
#define SB_PROPERTY_ALBUMARTISTNAME
#define SB_PROPERTY_RATING
#define SB_PROPERTY_LASTPLAYTIME
#define SB_PROPERTY_TOTALTRACKS
#define SB_PROPERTY_BITRATE
#define SB_PROPERTY_GENRE
#define SB_PROPERTY_DURATION
#define SB_PROPERTY_DISCNUMBER
nsString ConvertRating(nsAString const &aRating)
#define SB_PROPERTY_ARTISTNAME
nsString ConvertDateTime(nsAString const &aDateTime)
#define SB_PROPERTY_ALBUMNAME
#define SB_PROPERTY_COMPOSERNAME
#define SB_PROPERTY_LASTSKIPTIME
#define SB_PROPERTY_TRACKNAME
#define SB_PROPERTY_COMMENT
#define SB_PROPERTY_ITUNES_GUID
#define SB_PROPERTY_SKIPCOUNT
#define SB_PROPERTY_TRACKNUMBER
Mapping between Songbird properties and iTunes
Definition at line 230 of file sbiTunesImporter.cpp.
char const SB_ITUNES_LIBRARY_IMPORT_PREF_PREFIX[] = "library_import.itunes" |
char const SB_ITUNES_LIBRARY_IMPORTER_PREF_PREFIX[] = "songbird.library_importer." |