MetadataHandlerWMA.cpp File Reference
#include "MetadataHandlerWMA.h"
#include "sbStandardProperties.h"
#include "sbIPropertyArray.h"
#include "sbPropertiesCID.h"
#include "sbMemoryUtils.h"
#include <sbProxiedComponentManager.h>
#include <sbStringUtils.h>
#include <sbFileUtils.h>
#include <sbAutoCOMInitializer.h>
#include <nsIChannel.h>
#include <nsIContentSniffer.h>
#include <nsIFileStreams.h>
#include <nsIFileURL.h>
#include <nsIIOService.h>
#include <nsIURI.h>
#include <nsNetUtil.h>
#include <nsUnicharUtils.h>
#include <prlog.h>
#include <prprf.h>
#include <atlbase.h>
#include <wmsdk.h>
#include <wmp.h>
#include <wininet.h>
Include dependency graph for MetadataHandlerWMA.cpp:

Go to the source code of this file.

Classes

struct  metadataKeyMapEntry_t
 

Macros

#define LOG(args)   /* nothing */
 
#define TRACE(args)   /* nothing */
 
#define COM_ENSURE_SUCCESS(_val)
 
#define countof(_array)   sizeof(_array) / sizeof(_array[0])
 
#define SB_ARTIST   SB_PROPERTY_ARTISTNAME
 
#define SB_TITLE   SB_PROPERTY_TRACKNAME
 
#define SB_ALBUM   SB_PROPERTY_ALBUMNAME
 
#define SB_GENRE   SB_PROPERTY_GENRE
 
#define SB_TRACKNO   SB_PROPERTY_TRACKNUMBER
 
#define SB_VENDOR   SB_PROPERTY_SOFTWAREVENDOR
 
#define SB_COPYRIGHT   SB_PROPERTY_COPYRIGHT
 
#define SB_COMPOSER   SB_PROPERTY_COMPOSERNAME
 
#define SB_CONDUCTOR   SB_PROPERTY_CONDUCTORNAME
 
#define SB_DIRECTOR   "director"
 
#define SB_BPM   SB_PROPERTY_BPM
 
#define SB_LYRICS   SB_PROPERTY_LYRICS
 
#define SB_YEAR   SB_PROPERTY_YEAR
 
#define SB_BITRATE   SB_PROPERTY_BITRATE
 
#define SB_RATING   SB_PROPERTY_RATING
 
#define SB_COMMENT   SB_PROPERTY_COMMENT
 
#define SB_LENGTH   SB_PROPERTY_DURATION
 
#define SB_ALBUMARTIST   SB_PROPERTY_ALBUMARTISTNAME
 
#define SB_PROTECTED   SB_PROPERTY_ISDRMPROTECTED
 
#define WMP_ARTIST   "Author"
 
#define WMP_TITLE   "Title"
 
#define WMP_ALBUM   "WM/AlbumTitle"
 
#define WMP_GENRE   "WM/Genre"
 
#define WMP_TRACKNO   "WM/TrackNumber"
 
#define WMP_VENDOR   "WM/ToolName"
 
#define WMP_COPYRIGHT   "Copyright"
 
#define WMP_COMPOSER   "WM/Composer"
 
#define WMP_CONDUCTOR   "WM/Conductor"
 
#define WMP_DIRECTOR   "WM/Director"
 
#define WMP_BPM   "WM/BeatsPerMinute"
 
#define WMP_LYRICS   "WM/Lyrics"
 
#define WMP_YEAR   "WM/Year"
 
#define WMP_BITRATE   "Bitrate"
 
#define WMP_RATING   "Rating"
 
#define WMP_COMMENT   "Description"
 
#define WMP_LENGTH   "Duration"
 
#define WMP_ALBUMARTIST   "WM/AlbumArtist"
 
#define WMP_PROTECTED   "Is_Protected"
 
#define SB_GN_EXTENDEDDATA   "http://gracenote.com/pos/1.0#extendedData"
 
#define SB_GN_TAGID   "http://gracenote.com/pos/1.0#tagId"
 
#define WMP_GN_EXTENDEDDATA   "GN/ExtData"
 
#define WMP_GN_TAGID   "GN/UniqueFileIdentifier"
 
#define KEY_MAP_ENTRY(_entry, _type)
 

Functions

 NS_IMPL_THREADSAFE_ISUPPORTS2 (sbMetadataHandlerWMA, sbIMetadataHandler, sbIMetadataHandlerWMA) sbMetadataHandlerWMA
 

Variables

static const metadataKeyMapEntry_t kMetadataKeys []
 

Macro Definition Documentation

#define COM_ENSURE_SUCCESS (   _val)
Value:
PR_BEGIN_MACRO \
nsresult __rv = _val; \
if (FAILED(__rv)) { \
NS_ENSURE_SUCCESS_BODY(_val, _val); \
return NS_ERROR_FAILURE; \
} \
PR_END_MACRO
return
Definition: FeedWriter.js:850
if(DEBUG_DATAREMOTES)

Definition at line 80 of file MetadataHandlerWMA.cpp.

#define countof (   _array)    sizeof(_array) / sizeof(_array[0])

Definition at line 89 of file MetadataHandlerWMA.cpp.

#define KEY_MAP_ENTRY (   _entry,
  _type 
)
Value:
{ NS_L(SB_##_entry), \
NS_L(WMP_##_entry), \
_type }

Definition at line 150 of file MetadataHandlerWMA.cpp.

#define LOG (   args)    /* nothing */

Definition at line 74 of file MetadataHandlerWMA.cpp.

#define SB_ALBUM   SB_PROPERTY_ALBUMNAME

Definition at line 94 of file MetadataHandlerWMA.cpp.

#define SB_ALBUMARTIST   SB_PROPERTY_ALBUMARTISTNAME

Definition at line 109 of file MetadataHandlerWMA.cpp.

#define SB_ARTIST   SB_PROPERTY_ARTISTNAME

Definition at line 92 of file MetadataHandlerWMA.cpp.

#define SB_BITRATE   SB_PROPERTY_BITRATE

Definition at line 105 of file MetadataHandlerWMA.cpp.

#define SB_BPM   SB_PROPERTY_BPM

Definition at line 102 of file MetadataHandlerWMA.cpp.

#define SB_COMMENT   SB_PROPERTY_COMMENT

Definition at line 107 of file MetadataHandlerWMA.cpp.

#define SB_COMPOSER   SB_PROPERTY_COMPOSERNAME

Definition at line 99 of file MetadataHandlerWMA.cpp.

#define SB_CONDUCTOR   SB_PROPERTY_CONDUCTORNAME

Definition at line 100 of file MetadataHandlerWMA.cpp.

#define SB_COPYRIGHT   SB_PROPERTY_COPYRIGHT

Definition at line 98 of file MetadataHandlerWMA.cpp.

#define SB_DIRECTOR   "director"

Definition at line 101 of file MetadataHandlerWMA.cpp.

#define SB_GENRE   SB_PROPERTY_GENRE

Definition at line 95 of file MetadataHandlerWMA.cpp.

#define SB_GN_EXTENDEDDATA   "http://gracenote.com/pos/1.0#extendedData"

Definition at line 135 of file MetadataHandlerWMA.cpp.

#define SB_GN_TAGID   "http://gracenote.com/pos/1.0#tagId"

Definition at line 136 of file MetadataHandlerWMA.cpp.

#define SB_LENGTH   SB_PROPERTY_DURATION

Definition at line 108 of file MetadataHandlerWMA.cpp.

#define SB_LYRICS   SB_PROPERTY_LYRICS

Definition at line 103 of file MetadataHandlerWMA.cpp.

#define SB_PROTECTED   SB_PROPERTY_ISDRMPROTECTED

Definition at line 110 of file MetadataHandlerWMA.cpp.

#define SB_RATING   SB_PROPERTY_RATING

Definition at line 106 of file MetadataHandlerWMA.cpp.

#define SB_TITLE   SB_PROPERTY_TRACKNAME

Definition at line 93 of file MetadataHandlerWMA.cpp.

#define SB_TRACKNO   SB_PROPERTY_TRACKNUMBER

Definition at line 96 of file MetadataHandlerWMA.cpp.

#define SB_VENDOR   SB_PROPERTY_SOFTWAREVENDOR

Definition at line 97 of file MetadataHandlerWMA.cpp.

#define SB_YEAR   SB_PROPERTY_YEAR

Definition at line 104 of file MetadataHandlerWMA.cpp.

#define TRACE (   args)    /* nothing */

Definition at line 75 of file MetadataHandlerWMA.cpp.

#define WMP_ALBUM   "WM/AlbumTitle"

Definition at line 114 of file MetadataHandlerWMA.cpp.

#define WMP_ALBUMARTIST   "WM/AlbumArtist"

Definition at line 129 of file MetadataHandlerWMA.cpp.

#define WMP_ARTIST   "Author"

Definition at line 112 of file MetadataHandlerWMA.cpp.

#define WMP_BITRATE   "Bitrate"

Definition at line 125 of file MetadataHandlerWMA.cpp.

#define WMP_BPM   "WM/BeatsPerMinute"

Definition at line 122 of file MetadataHandlerWMA.cpp.

#define WMP_COMMENT   "Description"

Definition at line 127 of file MetadataHandlerWMA.cpp.

#define WMP_COMPOSER   "WM/Composer"

Definition at line 119 of file MetadataHandlerWMA.cpp.

#define WMP_CONDUCTOR   "WM/Conductor"

Definition at line 120 of file MetadataHandlerWMA.cpp.

#define WMP_COPYRIGHT   "Copyright"

Definition at line 118 of file MetadataHandlerWMA.cpp.

#define WMP_DIRECTOR   "WM/Director"

Definition at line 121 of file MetadataHandlerWMA.cpp.

#define WMP_GENRE   "WM/Genre"

Definition at line 115 of file MetadataHandlerWMA.cpp.

#define WMP_GN_EXTENDEDDATA   "GN/ExtData"

Definition at line 137 of file MetadataHandlerWMA.cpp.

#define WMP_GN_TAGID   "GN/UniqueFileIdentifier"

Definition at line 138 of file MetadataHandlerWMA.cpp.

#define WMP_LENGTH   "Duration"

Definition at line 128 of file MetadataHandlerWMA.cpp.

#define WMP_LYRICS   "WM/Lyrics"

Definition at line 123 of file MetadataHandlerWMA.cpp.

#define WMP_PROTECTED   "Is_Protected"

Definition at line 130 of file MetadataHandlerWMA.cpp.

#define WMP_RATING   "Rating"

Definition at line 126 of file MetadataHandlerWMA.cpp.

#define WMP_TITLE   "Title"

Definition at line 113 of file MetadataHandlerWMA.cpp.

#define WMP_TRACKNO   "WM/TrackNumber"

Definition at line 116 of file MetadataHandlerWMA.cpp.

#define WMP_VENDOR   "WM/ToolName"

Definition at line 117 of file MetadataHandlerWMA.cpp.

#define WMP_YEAR   "WM/Year"

Definition at line 124 of file MetadataHandlerWMA.cpp.

Function Documentation

NS_IMPL_THREADSAFE_ISUPPORTS2 ( sbMetadataHandlerWMA  ,
sbIMetadataHandler  ,
sbIMetadataHandlerWMA   
)

Definition at line 182 of file MetadataHandlerWMA.cpp.

Variable Documentation

const metadataKeyMapEntry_t kMetadataKeys[]
static
Initial value:
= {
{ NS_L( SB_PROPERTY_ARTISTNAME ), NS_L( "Author" ), WMT_TYPE_STRING },
{ NS_L( SB_PROPERTY_TRACKNAME ), NS_L( "Title" ), WMT_TYPE_STRING },
{ NS_L( SB_PROPERTY_ALBUMNAME ), NS_L( "WM/AlbumTitle" ), WMT_TYPE_STRING },
{ NS_L( SB_PROPERTY_GENRE ), NS_L( "WM/Genre" ), WMT_TYPE_STRING },
{ NS_L( SB_PROPERTY_TRACKNUMBER ), NS_L( "WM/TrackNumber" ), WMT_TYPE_STRING },
{ NS_L( SB_PROPERTY_SOFTWAREVENDOR ), NS_L( "WM/ToolName" ), WMT_TYPE_STRING },
{ NS_L( SB_PROPERTY_COPYRIGHT ), NS_L( "Copyright" ), WMT_TYPE_STRING },
{ NS_L( SB_PROPERTY_COMPOSERNAME ), NS_L( "WM/Composer" ), WMT_TYPE_STRING },
{ NS_L( SB_PROPERTY_CONDUCTORNAME ), NS_L( "WM/Conductor" ), WMT_TYPE_STRING },
{ NS_L( SB_PROPERTY_COMMENT ), NS_L( "Description" ), WMT_TYPE_STRING },
{ NS_L( SB_PROPERTY_BPM ), NS_L( "WM/BeatsPerMinute" ), WMT_TYPE_STRING },
{ NS_L( SB_PROPERTY_LYRICS ), NS_L( "WM/Lyrics" ), WMT_TYPE_STRING },
{ NS_L( SB_PROPERTY_YEAR ), NS_L( "WM/Year" ), WMT_TYPE_STRING },
{ NS_L( SB_PROPERTY_BITRATE ), NS_L( "Bitrate" ), WMT_TYPE_DWORD },
{ NS_L( SB_PROPERTY_RATING ), NS_L( "Rating" ), WMT_TYPE_STRING },
{ NS_L( SB_PROPERTY_DURATION ), NS_L( "Duration" ), WMT_TYPE_QWORD },
{ NS_L( SB_PROPERTY_ALBUMARTISTNAME ), NS_L( "WM/AlbumArtist" ), WMT_TYPE_STRING },
{ NS_L( SB_PROPERTY_ISDRMPROTECTED ), NS_L( "Is_Protected" ), WMT_TYPE_BOOL },
{ NS_L( "http://gracenote.com/pos/1.0#extendedData" ), NS_L( "GN/ExtData" ), WMT_TYPE_BINARY },
{ NS_L( "http://gracenote.com/pos/1.0#tagId" ), NS_L( "GN/UniqueFileIdentifier" ), WMT_TYPE_BINARY },
}
#define SB_PROPERTY_LYRICS
#define SB_PROPERTY_ALBUMARTISTNAME
#define SB_PROPERTY_RATING
#define SB_PROPERTY_ISDRMPROTECTED
#define SB_PROPERTY_CONDUCTORNAME
#define SB_PROPERTY_BITRATE
#define SB_PROPERTY_GENRE
#define SB_PROPERTY_SOFTWAREVENDOR
#define SB_PROPERTY_DURATION
#define SB_PROPERTY_COPYRIGHT
#define SB_PROPERTY_ARTISTNAME
#define SB_PROPERTY_BPM
#define SB_PROPERTY_ALBUMNAME
#define SB_PROPERTY_COMPOSERNAME
#define SB_PROPERTY_YEAR
#define SB_PROPERTY_TRACKNAME
#define SB_PROPERTY_COMMENT
#define SB_PROPERTY_TRACKNUMBER

Definition at line 154 of file MetadataHandlerWMA.cpp.