MetadataHandlerTaglib.cpp File Reference

Songbird MetadataHandlerTaglib implementation. More...

#include "MetadataHandlerTaglib.h"
#include "tagunion.h"
#include "TaglibChannelFileIO.h"
#include "sbStringUtils.h"
#include "sbMemoryUtils.h"
#include <sbILibraryUtils.h>
#include <sbProxiedComponentManager.h>
#include "sbStandardProperties.h"
#include "sbIPropertyArray.h"
#include "sbPropertiesCID.h"
#include <nsIURI.h>
#include <nsComponentManagerUtils.h>
#include <nsIFile.h>
#include <nsIMIMEService.h>
#include <nsIBinaryInputStream.h>
#include <nsIIOService.h>
#include <nsIProtocolHandler.h>
#include <nsIStandardURL.h>
#include <nsICharsetDetector.h>
#include <nsICharsetConverterManager.h>
#include <nsIUnicodeDecoder.h>
#include <nsIContentSniffer.h>
#include <nsNetUtil.h>
#include <nsServiceManagerUtils.h>
#include <nsStringGlue.h>
#include <prlog.h>
#include <prprf.h>
#include <nsUnicharUtils.h>
#include <nsMemory.h>
#include <flacfile.h>
#include <oggflacfile.h>
#include <mpcfile.h>
#include <mpegfile.h>
#include <urllinkframe.h>
#include <mp4file.h>
#include <asffile.h>
#include <vorbisfile.h>
#include <uniquefileidentifierframe.h>
#include <textidentificationframe.h>
#include <tpropertymap.h>
#include <sstream>
Include dependency graph for MetadataHandlerTaglib.cpp:

Go to the source code of this file.

Macros

#define WRITE_PROPERTY(tmp_result, SB_PROPERTY, taglibName)
 
#define GET_PROPERTY(taglibid)   properties[TagLib::String(taglibid)].toString(", ")
 
#define TAGLIB1_PROPERTIES_WORKAROUND(pTag)
 
#define SB_GN_PROP_EXTENDEDDATA   "http://gracenote.com/pos/1.0#extendedData"
 
#define SB_GN_PROP_TAGID   "http://gracenote.com/pos/1.0#tagId"
 
#define MAX_MPEG_IMAGE_SIZE   16777216
 
#define LOG(args)   /* nothing */
 
#define GUESS_CHARSET_MIN_CHAR_COUNT   256
 

Functions

 NS_IMPL_THREADSAFE_ISUPPORTS3 (sbMetadataHandlerTaglib, sbIMetadataHandler, sbISeekableChannelListener, nsICharsetDetectionObserver) NS_IMETHODIMP sbMetadataHandlerTaglib
 
void toMozString (TagLib::String aString, nsAString &aResult)
 

Variables

static const char * ID3v2Map [][2]
 
static const char * APEMap [][2]
 
static const std::string base64_chars
 
static const unsigned char base64lookup [256]
 

Detailed Description

Songbird MetadataHandlerTaglib implementation.

Definition in file MetadataHandlerTaglib.cpp.

Macro Definition Documentation

#define GET_PROPERTY (   taglibid)    properties[TagLib::String(taglibid)].toString(", ")

Definition at line 123 of file MetadataHandlerTaglib.cpp.

#define GUESS_CHARSET_MIN_CHAR_COUNT   256

Definition at line 183 of file MetadataHandlerTaglib.cpp.

#define LOG (   args)    /* nothing */

Definition at line 178 of file MetadataHandlerTaglib.cpp.

#define MAX_MPEG_IMAGE_SIZE   16777216

Definition at line 161 of file MetadataHandlerTaglib.cpp.

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

Definition at line 157 of file MetadataHandlerTaglib.cpp.

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

Definition at line 158 of file MetadataHandlerTaglib.cpp.

#define TAGLIB1_PROPERTIES_WORKAROUND (   pTag)
Value:
if (dynamic_cast<TagLib::APE::Tag*>(pTag)){ \
properties.merge(dynamic_cast<TagLib::APE::Tag*>(pTag) \
->properties()); \
} \
if (dynamic_cast<TagLib::ASF::Tag*>(pTag)){ \
properties.merge(dynamic_cast<TagLib::ASF::Tag*>(pTag) \
->properties()); \
} \
if (dynamic_cast<TagLib::ID3v1::Tag*>(pTag)){ \
properties.merge(dynamic_cast<TagLib::ID3v1::Tag*>(pTag)\
->properties()); \
} \
if (dynamic_cast<TagLib::ID3v2::Tag*>(pTag)){ \
properties.merge(dynamic_cast<TagLib::ID3v2::Tag*>(pTag)\
->properties()); \
} \
if (dynamic_cast<TagLib::MP4::Tag*>(pTag)){ \
properties.merge(dynamic_cast<TagLib::MP4::Tag*>(pTag) \
->properties()); \
} \
if (dynamic_cast<TagLib::Ogg::XiphComment*>(pTag)){ \
properties.merge( \
dynamic_cast<TagLib::Ogg::XiphComment*>(pTag) \
->properties()); \
} \
PR_END_MACRO
if(DEBUG_DATAREMOTES)

Definition at line 125 of file MetadataHandlerTaglib.cpp.

#define WRITE_PROPERTY (   tmp_result,
  SB_PROPERTY,
  taglibName 
)
Value:
PR_BEGIN_MACRO \
tmp_result = mpMetadataPropertyArray->GetPropertyValue( \
NS_LITERAL_STRING(SB_PROPERTY), propertyValue); \
if (NS_SUCCEEDED(tmp_result)) { \
TagLib::String::UTF8); \
NS_ConvertUTF16toUTF8(propertyValue).BeginReading(), \
TagLib::String::UTF8); \
properties->erase(key); \
if (!value.isEmpty()) { \
TagLib::StringList valueList = \
TagLib::StringList(value); \
properties->insert(key, valueList); \
} \
} \
PR_END_MACRO
countRef value
Definition: FeedWriter.js:1423
if(DEBUG_DATAREMOTES)

Definition at line 105 of file MetadataHandlerTaglib.cpp.

Function Documentation

NS_IMPL_THREADSAFE_ISUPPORTS3 ( sbMetadataHandlerTaglib  ,
sbIMetadataHandler  ,
sbISeekableChannelListener  ,
nsICharsetDetectionObserver   
)

Definition at line 193 of file MetadataHandlerTaglib.cpp.

void toMozString ( TagLib::String  aString,
nsAString &  aResult 
)
inline

Definition at line 2591 of file MetadataHandlerTaglib.cpp.

Variable Documentation

const char* APEMap[][2]
static
Initial value:
=
{
{ "Subtitle", SB_PROPERTY_SUBTITLE },
}
#define SB_PROPERTY_SUBTITLE

Definition at line 2154 of file MetadataHandlerTaglib.cpp.

const std::string base64_chars
static
Initial value:
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/"

Definition at line 3654 of file MetadataHandlerTaglib.cpp.

const unsigned char base64lookup[256]
static

Definition at line 3703 of file MetadataHandlerTaglib.cpp.

const char* ID3v2Map[][2]
static
Initial value:
=
{
{ "TIT3", SB_PROPERTY_SUBTITLE },
{ "XXXX", "junq" }
}
#define SB_PROPERTY_METADATAUUID
#define SB_PROPERTY_SOFTWAREVENDOR
#define SB_PROPERTY_SUBTITLE

Definition at line 2037 of file MetadataHandlerTaglib.cpp.