1
/***************************************************************************
2
copyright : (C) 2006 by Lukáš Lalinský
3
email : lalinsky@gmail.com
5
copyright : (C) 2002 by Scott Wheeler
6
email : wheeler@kde.org
7
(original Vorbis implementation)
8
***************************************************************************/
10
/***************************************************************************
11
* This library is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU Lesser General Public License version *
13
* 2.1 as published by the Free Software Foundation. *
15
* This library is distributed in the hope that it will be useful, but *
16
* WITHOUT ANY WARRANTY; without even the implied warranty of *
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
18
* Lesser General Public License for more details. *
20
* You should have received a copy of the GNU Lesser General Public *
21
* License along with this library; if not, write to the Free Software *
22
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, *
24
***************************************************************************/
33
#include "speexfile.h"
35
using namespace TagLib;
37
class Speex::File::FilePrivate
50
Ogg::XiphComment *comment;
51
Properties *properties;
54
////////////////////////////////////////////////////////////////////////////////
56
////////////////////////////////////////////////////////////////////////////////
58
Speex::File::File(const char *file, bool readProperties,
59
Properties::ReadStyle propertiesStyle) : Ogg::File(file)
62
read(readProperties, propertiesStyle);
70
Ogg::XiphComment *Speex::File::tag() const
75
Speex::Properties *Speex::File::audioProperties() const
80
bool Speex::File::save()
83
d->comment = new Ogg::XiphComment;
85
setPacket(1, d->comment->render());
87
return Ogg::File::save();
90
////////////////////////////////////////////////////////////////////////////////
92
////////////////////////////////////////////////////////////////////////////////
94
void Speex::File::read(bool readProperties, Properties::ReadStyle propertiesStyle)
96
ByteVector speexHeaderData = packet(0);
98
if(!speexHeaderData.startsWith("Speex ")) {
100
debug("Speex::File::read() -- invalid Speex identification header");
105
ByteVector commentHeaderData = packet(1);
107
d->comment = new Ogg::XiphComment(commentHeaderData);
110
d->properties = new Properties(this, propertiesStyle);