mirror of
https://github.com/taglib/taglib.git
synced 2025-06-04 01:28:21 -04:00
Move Speex into the Ogg namespace
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@773920 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
parent
a78afdc660
commit
83d3b1b9cc
@ -67,7 +67,7 @@ TagLib_File *taglib_file_new_type(const char *filename, TagLib_File_Type type)
|
||||
case TagLib_File_MPEG:
|
||||
return reinterpret_cast<TagLib_File *>(new MPEG::File(filename));
|
||||
case TagLib_File_OggVorbis:
|
||||
return reinterpret_cast<TagLib_File *>(new Vorbis::File(filename));
|
||||
return reinterpret_cast<TagLib_File *>(new Ogg::Vorbis::File(filename));
|
||||
case TagLib_File_FLAC:
|
||||
return reinterpret_cast<TagLib_File *>(new FLAC::File(filename));
|
||||
case TagLib_File_MPC:
|
||||
@ -77,7 +77,7 @@ TagLib_File *taglib_file_new_type(const char *filename, TagLib_File_Type type)
|
||||
case TagLib_File_WavPack:
|
||||
return reinterpret_cast<TagLib_File *>(new WavPack::File(filename));
|
||||
case TagLib_File_Speex:
|
||||
return reinterpret_cast<TagLib_File *>(new Speex::File(filename));
|
||||
return reinterpret_cast<TagLib_File *>(new Ogg::Speex::File(filename));
|
||||
case TagLib_File_TrueAudio:
|
||||
return reinterpret_cast<TagLib_File *>(new TrueAudio::File(filename));
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ File *FileRef::create(FileName fileName, bool readAudioProperties,
|
||||
|
||||
if(s.size() > 4) {
|
||||
if(s.substr(s.size() - 4, 4).upper() == ".OGG")
|
||||
return new Vorbis::File(fileName, readAudioProperties, audioPropertiesStyle);
|
||||
return new Ogg::Vorbis::File(fileName, readAudioProperties, audioPropertiesStyle);
|
||||
if(s.substr(s.size() - 4, 4).upper() == ".MP3")
|
||||
return new MPEG::File(fileName, readAudioProperties, audioPropertiesStyle);
|
||||
if(s.substr(s.size() - 4, 4).upper() == ".OGA")
|
||||
@ -196,7 +196,7 @@ File *FileRef::create(FileName fileName, bool readAudioProperties,
|
||||
if(s.substr(s.size() - 3, 3).upper() == ".WV")
|
||||
return new WavPack::File(fileName, readAudioProperties, audioPropertiesStyle);
|
||||
if(s.substr(s.size() - 4, 4).upper() == ".SPX")
|
||||
return new Speex::File(fileName, readAudioProperties, audioPropertiesStyle);
|
||||
return new Ogg::Speex::File(fileName, readAudioProperties, audioPropertiesStyle);
|
||||
if(s.substr(s.size() - 4, 4).upper() == ".TTA")
|
||||
return new TrueAudio::File(fileName, readAudioProperties, audioPropertiesStyle);
|
||||
}
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "speexfile.h"
|
||||
|
||||
using namespace TagLib;
|
||||
using namespace TagLib::Ogg;
|
||||
|
||||
class Speex::File::FilePrivate
|
||||
{
|
||||
|
@ -5,7 +5,7 @@
|
||||
copyright : (C) 2002 - 2008 by Scott Wheeler
|
||||
email : wheeler@kde.org
|
||||
(original Vorbis implementation)
|
||||
***************************************************************************/
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* This library is free software; you can redistribute it and/or modify *
|
||||
@ -37,61 +37,63 @@
|
||||
|
||||
namespace TagLib {
|
||||
|
||||
//! A namespace containing classes for Speex metadata
|
||||
namespace Ogg {
|
||||
|
||||
namespace Speex {
|
||||
//! A namespace containing classes for Speex metadata
|
||||
|
||||
//! An implementation of Ogg::File with Speex specific methods
|
||||
namespace Speex {
|
||||
|
||||
/*!
|
||||
* This is the central class in the Ogg Speex metadata processing collection
|
||||
* of classes. It's built upon Ogg::File which handles processing of the Ogg
|
||||
* logical bitstream and breaking it down into pages which are handled by
|
||||
* the codec implementations, in this case Speex specifically.
|
||||
*/
|
||||
|
||||
class TAGLIB_EXPORT File : public Ogg::File
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
* Contructs a Speex file from \a file. If \a readProperties is true the
|
||||
* file's audio properties will also be read using \a propertiesStyle. If
|
||||
* false, \a propertiesStyle is ignored.
|
||||
*/
|
||||
File(FileName file, bool readProperties = true,
|
||||
Properties::ReadStyle propertiesStyle = Properties::Average);
|
||||
//! An implementation of Ogg::File with Speex specific methods
|
||||
|
||||
/*!
|
||||
* Destroys this instance of the File.
|
||||
* This is the central class in the Ogg Speex metadata processing collection
|
||||
* of classes. It's built upon Ogg::File which handles processing of the Ogg
|
||||
* logical bitstream and breaking it down into pages which are handled by
|
||||
* the codec implementations, in this case Speex specifically.
|
||||
*/
|
||||
virtual ~File();
|
||||
|
||||
/*!
|
||||
* Returns the XiphComment for this file. XiphComment implements the tag
|
||||
* interface, so this serves as the reimplementation of
|
||||
* TagLib::File::tag().
|
||||
*/
|
||||
virtual Ogg::XiphComment *tag() const;
|
||||
class TAGLIB_EXPORT File : public Ogg::File
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
* Contructs a Speex file from \a file. If \a readProperties is true the
|
||||
* file's audio properties will also be read using \a propertiesStyle. If
|
||||
* false, \a propertiesStyle is ignored.
|
||||
*/
|
||||
File(FileName file, bool readProperties = true,
|
||||
Properties::ReadStyle propertiesStyle = Properties::Average);
|
||||
|
||||
/*!
|
||||
* Returns the Speex::Properties for this file. If no audio properties
|
||||
* were read then this will return a null pointer.
|
||||
*/
|
||||
virtual Properties *audioProperties() const;
|
||||
/*!
|
||||
* Destroys this instance of the File.
|
||||
*/
|
||||
virtual ~File();
|
||||
|
||||
virtual bool save();
|
||||
/*!
|
||||
* Returns the XiphComment for this file. XiphComment implements the tag
|
||||
* interface, so this serves as the reimplementation of
|
||||
* TagLib::File::tag().
|
||||
*/
|
||||
virtual Ogg::XiphComment *tag() const;
|
||||
|
||||
private:
|
||||
File(const File &);
|
||||
File &operator=(const File &);
|
||||
/*!
|
||||
* Returns the Speex::Properties for this file. If no audio properties
|
||||
* were read then this will return a null pointer.
|
||||
*/
|
||||
virtual Properties *audioProperties() const;
|
||||
|
||||
void read(bool readProperties, Properties::ReadStyle propertiesStyle);
|
||||
virtual bool save();
|
||||
|
||||
class FilePrivate;
|
||||
FilePrivate *d;
|
||||
};
|
||||
private:
|
||||
File(const File &);
|
||||
File &operator=(const File &);
|
||||
|
||||
void read(bool readProperties, Properties::ReadStyle propertiesStyle);
|
||||
|
||||
class FilePrivate;
|
||||
FilePrivate *d;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "speexfile.h"
|
||||
|
||||
using namespace TagLib;
|
||||
using namespace TagLib::Ogg;
|
||||
|
||||
class Speex::Properties::PropertiesPrivate
|
||||
{
|
||||
|
@ -5,7 +5,7 @@
|
||||
copyright : (C) 2002 - 2008 by Scott Wheeler
|
||||
email : wheeler@kde.org
|
||||
(original Vorbis implementation)
|
||||
***************************************************************************/
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* This library is free software; you can redistribute it and/or modify *
|
||||
@ -34,54 +34,56 @@
|
||||
|
||||
namespace TagLib {
|
||||
|
||||
namespace Speex {
|
||||
namespace Ogg {
|
||||
|
||||
class File;
|
||||
namespace Speex {
|
||||
|
||||
//! An implementation of audio property reading for Ogg Speex
|
||||
class File;
|
||||
|
||||
/*!
|
||||
* This reads the data from an Ogg Speex stream found in the AudioProperties
|
||||
* API.
|
||||
*/
|
||||
|
||||
class TAGLIB_EXPORT Properties : public AudioProperties
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
* Create an instance of Speex::Properties with the data read from the
|
||||
* Speex::File \a file.
|
||||
*/
|
||||
Properties(File *file, ReadStyle style = Average);
|
||||
//! An implementation of audio property reading for Ogg Speex
|
||||
|
||||
/*!
|
||||
* Destroys this Speex::Properties instance.
|
||||
* This reads the data from an Ogg Speex stream found in the AudioProperties
|
||||
* API.
|
||||
*/
|
||||
virtual ~Properties();
|
||||
|
||||
// Reimplementations.
|
||||
class TAGLIB_EXPORT Properties : public AudioProperties
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
* Create an instance of Speex::Properties with the data read from the
|
||||
* Speex::File \a file.
|
||||
*/
|
||||
Properties(File *file, ReadStyle style = Average);
|
||||
|
||||
virtual int length() const;
|
||||
virtual int bitrate() const;
|
||||
virtual int sampleRate() const;
|
||||
virtual int channels() const;
|
||||
/*!
|
||||
* Destroys this Speex::Properties instance.
|
||||
*/
|
||||
virtual ~Properties();
|
||||
|
||||
/*!
|
||||
* Returns the Speex version, currently "0" (as specified by the spec).
|
||||
*/
|
||||
int speexVersion() const;
|
||||
// Reimplementations.
|
||||
|
||||
private:
|
||||
Properties(const Properties &);
|
||||
Properties &operator=(const Properties &);
|
||||
virtual int length() const;
|
||||
virtual int bitrate() const;
|
||||
virtual int sampleRate() const;
|
||||
virtual int channels() const;
|
||||
|
||||
void read();
|
||||
/*!
|
||||
* Returns the Speex version, currently "0" (as specified by the spec).
|
||||
*/
|
||||
int speexVersion() const;
|
||||
|
||||
class PropertiesPrivate;
|
||||
PropertiesPrivate *d;
|
||||
};
|
||||
private:
|
||||
Properties(const Properties &);
|
||||
Properties &operator=(const Properties &);
|
||||
|
||||
void read();
|
||||
|
||||
class PropertiesPrivate;
|
||||
PropertiesPrivate *d;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -161,6 +161,8 @@ namespace TagLib {
|
||||
*
|
||||
* \endcode
|
||||
*
|
||||
* More examples can be found in the \e examples directory of the source distribution.
|
||||
*
|
||||
* \section Contact
|
||||
*
|
||||
* Questions about TagLib should be directed to the TagLib mailing list, not directly to the author.
|
||||
|
Loading…
x
Reference in New Issue
Block a user