Add support for taglib 2

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/61/head
Michele Calgaro 7 months ago
parent 9b95475830
commit 7fdc344c40
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -33,8 +33,6 @@
#include "threadmanager.h"
#include "qstringx.h"
#include <taglib/tfile.h> //TagLib::File::isWritable
#include <unistd.h> //CollectionView ctor
#include <tqapplication.h>
@ -3347,7 +3345,7 @@ CollectionView::setCompilation( const KURL::List &urls, bool compilation )
CollectionDB::instance()->setCompilation( urls, compilation, false );
foreachType( KURL::List, urls ) {
if ( !TagLib::File::isWritable( TQFile::encodeName( ( *it ).path() ) ) )
if (access((*it).path().local8Bit().data(), R_OK|W_OK))
continue;
MetaBundle mb( *it );

@ -99,8 +99,8 @@ DeviceConfigureDialog::DeviceConfigureDialog( const Medium &medium )
m_transcodeRemove->setChecked( device->m_transcodeRemove );
const ScriptManager *sm = ScriptManager::instance();
m_transcodeCheck->setEnabled( sm->transcodeScriptRunning() != TQString::null );
transcodeGroup->setEnabled( sm->transcodeScriptRunning() != TQString::null && device->m_transcode );
m_transcodeCheck->setEnabled( !sm->transcodeScriptRunning().isEmpty() );
transcodeGroup->setEnabled( !sm->transcodeScriptRunning().isEmpty() && device->m_transcode );
if( sm->transcodeScriptRunning().isNull() )
{
TQToolTip::add( m_transcodeCheck, i18n( "For this feature, a script of type \"Transcode\" has to be running" ) );

@ -380,7 +380,7 @@ NjbMediaDevice::downloadToCollection()
TQPtrList<MediaItem> items;
m_view->getSelectedLeaves( 0, &items );
KTempDir tempdir( TQString::null ); // Default prefix is fine with us
KTempDir tempdir; // Default prefix is fine with us
tempdir.setAutoDelete( true ); // We don't need it once the work is done.
TQString path = tempdir.name(), filepath;
KURL::List urls;

@ -420,7 +420,7 @@ MetaBundle::init( TagLib::AudioProperties *ap )
if ( ap )
{
m_bitrate = ap->bitrate();
m_length = ap->length();
m_length = ap->lengthInSeconds();
m_sampleRate = ap->sampleRate();
}
else
@ -1338,7 +1338,7 @@ MetaBundle::setExtendedTag( TagLib::File *file, int tag, const TQString value )
if ( oggFile && oggFile->tag() )
{
value.isEmpty() ?
oggFile->tag()->removeField( id ):
oggFile->tag()->removeFields( id ):
oggFile->tag()->addField( id, QStringToTString( value ), true );
}
}
@ -1356,7 +1356,7 @@ MetaBundle::setExtendedTag( TagLib::File *file, int tag, const TQString value )
if ( flacFile && flacFile->xiphComment() )
{
value.isEmpty() ?
flacFile->xiphComment()->removeField( id ):
flacFile->xiphComment()->removeFields( id ):
flacFile->xiphComment()->addField( id, QStringToTString( value ), true );
}
}

@ -23,9 +23,11 @@
#include "asfattribute.h"
#include "asffile.h"
#include "tqshared.h"
using namespace TagLib;
class ASF::Attribute::AttributePrivate : public RefCounter
class ASF::Attribute::AttributePrivate : public TQShared
{
public:
AttributePrivate()

@ -252,7 +252,7 @@ ASF::File::ExtendedContentDescriptionObject::render(ASF::File *file)
{
data.clear();
data.append(ByteVector::fromShort(attributeData.size(), false));
data.append(attributeData.toByteVector(ByteVector::null));
data.append(attributeData.toByteVector(ByteVector()));
return BaseObject::render(file);
}
@ -279,7 +279,7 @@ ASF::File::MetadataObject::render(ASF::File *file)
{
data.clear();
data.append(ByteVector::fromShort(attributeData.size(), false));
data.append(attributeData.toByteVector(ByteVector::null));
data.append(attributeData.toByteVector(ByteVector()));
return BaseObject::render(file);
}
@ -306,7 +306,7 @@ ASF::File::MetadataLibraryObject::render(ASF::File *file)
{
data.clear();
data.append(ByteVector::fromShort(attributeData.size(), false));
data.append(attributeData.toByteVector(ByteVector::null));
data.append(attributeData.toByteVector(ByteVector()));
return BaseObject::render(file);
}

@ -63,7 +63,7 @@ ASF::Tag::album() const
{
if(d->attributeListMap.contains("WM/AlbumTitle"))
return d->attributeListMap["WM/AlbumTitle"][0].toString();
return String::null;
return String();
}
String
@ -107,7 +107,7 @@ ASF::Tag::genre() const
{
if(d->attributeListMap.contains("WM/Genre"))
return d->attributeListMap["WM/Genre"][0].toString();
return String::null;
return String();
}
void

@ -56,7 +56,7 @@ namespace TagLib {
/*!
* Returns the album name; if no album name is present in the tag
* String::null will be returned.
* a null String will be returned.
*/
virtual String album() const;
@ -66,7 +66,7 @@ namespace TagLib {
virtual String comment() const;
/*!
* Returns the genre name; if no genre is present in the tag String::null
* Returns the genre name; if no genre is present in the tag a null String
* will be returned.
*/
virtual String genre() const;
@ -77,7 +77,7 @@ namespace TagLib {
virtual String rating() const;
/*!
* Returns the genre name; if no genre is present in the tag String::null
* Returns the genre name; if no genre is present in the tag a null String
* will be returned.
*/
virtual String copyright() const;
@ -104,7 +104,7 @@ namespace TagLib {
virtual void setArtist(const String &s);
/*!
* Sets the album to \a s. If \a s is String::null then this value will be
* Sets the album to \a s. If \a s is a null String then this value will be
* cleared.
*/
virtual void setAlbum(const String &s);

@ -35,11 +35,11 @@
using namespace TagLib;
Audible::Tag::Tag() : TagLib::Tag::Tag() {
m_title = String::null;
m_artist = String::null;
m_album = String::null;
m_comment = String::null;
m_genre = String::null;
m_title = String();
m_artist = String();
m_album = String();
m_comment = String();
m_genre = String();
m_year = 0;
m_track = 0;
m_userID = 0;
@ -50,11 +50,11 @@ Audible::Tag::~Tag() {
}
bool Audible::Tag::isEmpty() const {
return m_title == String::null &&
m_artist == String::null &&
m_album == String::null &&
m_comment == String::null &&
m_genre == String::null &&
return m_title.isEmpty() &&
m_artist.isEmpty() &&
m_album.isEmpty() &&
m_comment.isEmpty() &&
m_genre.isEmpty() &&
m_year == 0 &&
m_track == 0 &&
m_userID == 0;
@ -105,7 +105,7 @@ void Audible::Tag::readTags( FILE *fp )
}
else if(!strcmp(name, "description"))
{
if( m_comment.isNull() )
if( m_comment.isEmpty() )
m_comment = String(value, String::Latin1);
}
else if(!strcmp(name, "pubdate"))

@ -54,30 +54,30 @@ namespace TagLib {
/*!
* Returns the track name; if no track name is present in the tag
* String::null will be returned.
* a null String will be returned.
*/
virtual String title() const { return m_title; }
/*!
* Returns the artist name; if no artist name is present in the tag
* String::null will be returned.
* a null String will be returned.
*/
virtual String artist() const { return m_artist; }
/*!
* Returns the album name; if no album name is present in the tag
* String::null will be returned.
* a null String will be returned.
*/
virtual String album() const { return m_album; }
/*!
* Returns the track comment; if no comment is present in the tag
* String::null will be returned.
* a null String will be returned.
*/
virtual String comment() const { return m_comment; }
/*!
* Returns the genre name; if no genre is present in the tag String::null
* Returns the genre name; if no genre is present in the tag a null String
* will be returned.
*/
virtual String genre() const { return m_genre; }
@ -99,31 +99,31 @@ namespace TagLib {
virtual uint userID() const { return m_userID; }
/*!
* Sets the title to \a s. If \a s is String::null then this value will be
* Sets the title to \a s. If \a s is a null String then this value will be
* cleared.
*/
virtual void setTitle(const String &s) { m_title = s; }
/*!
* Sets the artist to \a s. If \a s is String::null then this value will be
* Sets the artist to \a s. If \a s is a null String then this value will be
* cleared.
*/
virtual void setArtist(const String &s) { m_artist = s; }
/*!
* Sets the album to \a s. If \a s is String::null then this value will be
* Sets the album to \a s. If \a s is a null String then this value will be
* cleared.
*/
virtual void setAlbum(const String &s) { m_album = s; }
/*!
* Sets the album to \a s. If \a s is String::null then this value will be
* Sets the album to \a s. If \a s is a null String then this value will be
* cleared.
*/
virtual void setComment(const String &s) { m_comment = s; }
/*!
* Sets the genre to \a s. If \a s is String::null then this value will be
* Sets the genre to \a s. If \a s is a null String then this value will be
* cleared. For tag formats that use a fixed set of genres, the appropriate
* value will be selected based on a string comparison. A list of available
* genres for those formats should be available in that type's

@ -55,7 +55,7 @@ void MP4::ITunesAlbBox::parse()
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
// parse data box
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
if(mp4file->readSizeAndType( size, fourcc ) == true)

@ -55,7 +55,7 @@ void MP4::ITunesArtBox::parse()
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
// parse data box
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
if(mp4file->readSizeAndType( size, fourcc ) == true)

@ -55,7 +55,7 @@ void MP4::ITunesCmtBox::parse()
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
// parse data box
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
if(mp4file->readSizeAndType( size, fourcc ) == true)

@ -55,7 +55,7 @@ void MP4::ITunesCvrBox::parse()
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
// parse data box
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
if(mp4file->readSizeAndType( size, fourcc ) == true)

@ -55,7 +55,7 @@ void MP4::ITunesDayBox::parse()
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
// parse data box
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
if(mp4file->readSizeAndType( size, fourcc ) == true)

@ -55,7 +55,7 @@ void MP4::ITunesDiskBox::parse()
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
// parse data box
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
if(mp4file->readSizeAndType( size, fourcc ) == true)

@ -55,7 +55,7 @@ void MP4::ITunesGenBox::parse()
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
// parse data box
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
if(mp4file->readSizeAndType( size, fourcc ) == true)

@ -55,7 +55,7 @@ void MP4::ITunesGrpBox::parse()
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
// parse data box
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
if(mp4file->readSizeAndType( size, fourcc ) == true)

@ -55,7 +55,7 @@ void MP4::ITunesNamBox::parse()
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
// parse data box
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
if(mp4file->readSizeAndType( size, fourcc ) == true)

@ -55,7 +55,7 @@ void MP4::ITunesTmpoBox::parse()
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
// parse data box
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
if(mp4file->readSizeAndType( size, fourcc ) == true)

@ -55,7 +55,7 @@ void MP4::ITunesTrknBox::parse()
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
// parse data box
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
if(mp4file->readSizeAndType( size, fourcc ) == true)

@ -55,7 +55,7 @@ void MP4::ITunesWrtBox::parse()
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
// parse data box
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
if(mp4file->readSizeAndType( size, fourcc ) == true)

@ -30,9 +30,9 @@ using namespace TagLib;
class MP4::Mp4AudioSampleEntry::Mp4AudioSampleEntryPrivate
{
public:
TagLib::uint channelcount;
TagLib::uint samplerate;
TagLib::uint bitrate;
uint channelcount;
uint samplerate;
uint bitrate;
};
MP4::Mp4AudioSampleEntry::Mp4AudioSampleEntry( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset )
@ -46,17 +46,17 @@ MP4::Mp4AudioSampleEntry::~Mp4AudioSampleEntry()
delete d;
}
TagLib::uint MP4::Mp4AudioSampleEntry::channels() const
uint MP4::Mp4AudioSampleEntry::channels() const
{
return d->channelcount;
}
TagLib::uint MP4::Mp4AudioSampleEntry::samplerate() const
uint MP4::Mp4AudioSampleEntry::samplerate() const
{
return d->samplerate;
}
TagLib::uint MP4::Mp4AudioSampleEntry::bitrate() const
uint MP4::Mp4AudioSampleEntry::bitrate() const
{
return d->bitrate;
}
@ -88,7 +88,7 @@ void MP4::Mp4AudioSampleEntry::parseEntry()
(fourcc() == MP4::Fourcc("drms")) )
{
TagLib::MP4::Fourcc fourcc;
TagLib::uint esds_size;
uint esds_size;
if (!mp4file->readSizeAndType( esds_size, fourcc ))
return;
@ -104,8 +104,8 @@ void MP4::Mp4AudioSampleEntry::parseEntry()
// upcoming byte must be ESDescrTag (0x03)
if( EsDescrTag[0] == 0x03 )
{
TagLib::uint descr_len = mp4file->readSystemsLen();
TagLib::uint EsId;
uint descr_len = mp4file->readSystemsLen();
uint EsId;
if( !mp4file->readShort( EsId ) )
return;
ByteVector priority = mp4file->readBlock(1);
@ -114,7 +114,7 @@ void MP4::Mp4AudioSampleEntry::parseEntry()
}
else
{
TagLib::uint EsId;
uint EsId;
if( !mp4file->readShort( EsId ) )
return;
}
@ -123,7 +123,7 @@ void MP4::Mp4AudioSampleEntry::parseEntry()
if( DecCfgTag[0] != 0x04 )
return;
// read decoder configuration length
// TagLib::uint deccfg_len = mp4file->readSystemsLen();
// uint deccfg_len = mp4file->readSystemsLen();
// read object type Id
ByteVector objId = mp4file->readBlock(1);
// read stream type id
@ -131,7 +131,7 @@ void MP4::Mp4AudioSampleEntry::parseEntry()
// read buffer Size DB
ByteVector bufferSizeDB = mp4file->readBlock(3);
// read max bitrate
TagLib::uint max_bitrate;
uint max_bitrate;
if( !mp4file->readInt( max_bitrate ) )
return;
// read average bitrate

@ -36,11 +36,11 @@ namespace TagLib
~Mp4AudioSampleEntry();
//! function to get the number of channels
TagLib::uint channels() const;
uint channels() const;
//! function to get the sample rate
TagLib::uint samplerate() const;
uint samplerate() const;
//! function to get the average bitrate of the audio stream
TagLib::uint bitrate() const;
uint bitrate() const;
private:
//! parse the content of the box

@ -63,7 +63,7 @@ MP4::File::File(const char *file, bool , AudioProperties::ReadStyle )
d->isValid = false;
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
while( readSizeAndType( size, fourcc ) == true )
@ -126,10 +126,10 @@ void MP4::File::remove()
{
}
TagLib::uint MP4::File::readSystemsLen()
uint MP4::File::readSystemsLen()
{
TagLib::uint length = 0;
TagLib::uint nbytes = 0;
uint length = 0;
uint nbytes = 0;
ByteVector input;
TagLib::uchar tmp_input;
@ -144,7 +144,7 @@ TagLib::uint MP4::File::readSystemsLen()
return length;
}
bool MP4::File::readSizeAndType( TagLib::uint& size, MP4::Fourcc& fourcc )
bool MP4::File::readSizeAndType( uint& size, MP4::Fourcc& fourcc )
{
// read the two blocks from file
ByteVector readsize = readBlock(4);
@ -169,7 +169,7 @@ bool MP4::File::readSizeAndType( TagLib::uint& size, MP4::Fourcc& fourcc )
return true;
}
bool MP4::File::readInt( TagLib::uint& toRead )
bool MP4::File::readInt( uint& toRead )
{
ByteVector readbuffer = readBlock(4);
if( readbuffer.size() != 4 )
@ -182,7 +182,7 @@ bool MP4::File::readInt( TagLib::uint& toRead )
return true;
}
bool MP4::File::readShort( TagLib::uint& toRead )
bool MP4::File::readShort( uint& toRead )
{
ByteVector readbuffer = readBlock(2);
if( readbuffer.size() != 2 )
@ -295,7 +295,7 @@ void fillTagFromProxy( MP4::Mp4TagsProxy& proxy, MP4::Tag& mp4tag )
TagLib::ByteVector datavec = databox->data();
if( datavec.size() >= 4 )
{
TagLib::uint trackno = static_cast<TagLib::uint>( static_cast<unsigned char>(datavec[0]) << 24 |
uint trackno = static_cast<uint>( static_cast<unsigned char>(datavec[0]) << 24 |
static_cast<unsigned char>(datavec[1]) << 16 |
static_cast<unsigned char>(datavec[2]) << 8 |
static_cast<unsigned char>(datavec[3]) );
@ -342,7 +342,7 @@ void fillTagFromProxy( MP4::Mp4TagsProxy& proxy, MP4::Tag& mp4tag )
TagLib::ByteVector datavec = databox->data();
if( datavec.size() >= 4 )
{
TagLib::uint discno = static_cast<TagLib::uint>( static_cast<unsigned char>(datavec[0]) << 24 |
uint discno = static_cast<uint>( static_cast<unsigned char>(datavec[0]) << 24 |
static_cast<unsigned char>(datavec[1]) << 16 |
static_cast<unsigned char>(datavec[2]) << 8 |
static_cast<unsigned char>(datavec[3]) );
@ -360,7 +360,7 @@ void fillTagFromProxy( MP4::Mp4TagsProxy& proxy, MP4::Tag& mp4tag )
if( datavec.size() >= 2 )
{
TagLib::uint bpm = static_cast<TagLib::uint>( static_cast<unsigned char>(datavec[0]) << 8 |
uint bpm = static_cast<uint>( static_cast<unsigned char>(datavec[0]) << 8 |
static_cast<unsigned char>(datavec[1]) );
mp4tag.setBpm( bpm );
}

@ -114,22 +114,22 @@ namespace TagLib {
* Helper function for parsing the MP4 file - reads the size and type of the next box.
* Returns true if read succeeded - not at EOF
*/
bool readSizeAndType( TagLib::uint& size, MP4::Fourcc& fourcc );
bool readSizeAndType( uint& size, MP4::Fourcc& fourcc );
/*!
* Helper function to read the length of an descriptor in systems manner
*/
TagLib::uint readSystemsLen();
uint readSystemsLen();
/*!
* Helper function for reading an unsigned int out of the file (big endian method)
*/
bool readInt( TagLib::uint& toRead );
bool readInt( uint& toRead );
/*!
* Helper function for reading an unsigned short out of the file (big endian method)
*/
bool readShort( TagLib::uint& toRead );
bool readShort( uint& toRead );
/*!
* Helper function for reading an unsigned long long (64bit) out of the file (big endian method)

@ -30,12 +30,12 @@ using namespace TagLib;
class MP4::Mp4HdlrBox::Mp4HdlrBoxPrivate
{
public:
TagLib::uint pre_defined;
uint pre_defined;
MP4::Fourcc handler_type;
TagLib::String hdlr_string;
}; // class Mp4HdlrBoxPrivate
MP4::Mp4HdlrBox::Mp4HdlrBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset )
MP4::Mp4HdlrBox::Mp4HdlrBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset )
: Mp4IsoFullBox( file, fourcc, size, offset )
{
d = new MP4::Mp4HdlrBox::Mp4HdlrBoxPrivate();
@ -58,7 +58,7 @@ TagLib::String MP4::Mp4HdlrBox::hdlr_string() const
void MP4::Mp4HdlrBox::parse()
{
TagLib::uint totalread = 12+20;
uint totalread = 12+20;
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
if( mp4file->readInt( d->pre_defined ) == false )

@ -32,7 +32,7 @@ namespace TagLib
class Mp4HdlrBox: public Mp4IsoFullBox
{
public:
Mp4HdlrBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset );
Mp4HdlrBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset );
~Mp4HdlrBox();
//! parse hdlr contents

@ -36,7 +36,7 @@ public:
MP4::BoxFactory boxfactory;
}; // class Mp4IlstBoxPrivate
MP4::Mp4IlstBox::Mp4IlstBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset )
MP4::Mp4IlstBox::Mp4IlstBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset )
: Mp4IsoBox( file, fourcc, size, offset )
{
d = new MP4::Mp4IlstBox::Mp4IlstBoxPrivate();
@ -62,9 +62,9 @@ void MP4::Mp4IlstBox::parse()
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
TagLib::uint totalsize = 8;
uint totalsize = 8;
// parse all contained boxes
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
#if 0

@ -32,7 +32,7 @@ namespace TagLib
class Mp4IlstBox: public Mp4IsoBox
{
public:
Mp4IlstBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset );
Mp4IlstBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset );
~Mp4IlstBox();
//! parse ilst contents

@ -28,12 +28,12 @@ class MP4::Mp4IsoBox::Mp4IsoBoxPrivate
{
public:
MP4::Fourcc fourcc;
TagLib::uint size;
uint size;
long offset;
TagLib::File* file;
};
MP4::Mp4IsoBox::Mp4IsoBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset )
MP4::Mp4IsoBox::Mp4IsoBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset )
{
d = new MP4::Mp4IsoBox::Mp4IsoBoxPrivate();
d->file = file;
@ -60,7 +60,7 @@ MP4::Fourcc MP4::Mp4IsoBox::fourcc() const
return d->fourcc;
}
TagLib::uint MP4::Mp4IsoBox::size() const
uint MP4::Mp4IsoBox::size() const
{
return d->size;
}

@ -60,7 +60,7 @@ TagLib::uchar MP4::Mp4IsoFullBox::version()
return d->version;
}
TagLib::uint MP4::Mp4IsoFullBox::flags()
uint MP4::Mp4IsoFullBox::flags()
{
return d->flags;
}

@ -31,13 +31,13 @@ public:
TagLib::String artist;
TagLib::String album;
TagLib::String genre;
TagLib::uint year;
TagLib::uint track;
uint year;
uint track;
TagLib::String comment;
TagLib::String grouping;
TagLib::String composer;
TagLib::uint disk;
TagLib::uint bpm;
uint disk;
uint bpm;
bool isEmpty;
TagLib::ByteVector cover;
};
@ -83,12 +83,12 @@ String MP4::Tag::genre() const
return d->genre;
}
TagLib::uint MP4::Tag::year() const
uint MP4::Tag::year() const
{
return d->year;
}
TagLib::uint MP4::Tag::track() const
uint MP4::Tag::track() const
{
return d->track;
}
@ -103,12 +103,12 @@ String MP4::Tag::composer() const
return d->composer;
}
TagLib::uint MP4::Tag::disk() const
uint MP4::Tag::disk() const
{
return d->disk;
}
TagLib::uint MP4::Tag::bpm() const
uint MP4::Tag::bpm() const
{
return d->bpm;
}
@ -148,13 +148,13 @@ void MP4::Tag::setGenre(const String &s)
d->isEmpty = false;
}
void MP4::Tag::setYear(const TagLib::uint i)
void MP4::Tag::setYear(const uint i)
{
d->year = i;
d->isEmpty = false;
}
void MP4::Tag::setTrack(const TagLib::uint i)
void MP4::Tag::setTrack(const uint i)
{
d->track = i;
d->isEmpty = false;
@ -172,13 +172,13 @@ void MP4::Tag::setComposer(const String &s)
d->isEmpty = false;
}
void MP4::Tag::setDisk(const TagLib::uint i)
void MP4::Tag::setDisk(const uint i)
{
d->disk = i;
d->isEmpty = false;
}
void MP4::Tag::setBpm(const TagLib::uint i)
void MP4::Tag::setBpm(const uint i)
{
d->bpm = i;
d->isEmpty = false;

@ -38,7 +38,7 @@ public:
MP4::BoxFactory boxfactory;
}; // class Mp4MdiaBoxPrivate
MP4::Mp4MdiaBox::Mp4MdiaBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset )
MP4::Mp4MdiaBox::Mp4MdiaBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset )
: Mp4IsoBox( file, fourcc, size, offset )
{
d = new MP4::Mp4MdiaBox::Mp4MdiaBoxPrivate();
@ -60,9 +60,9 @@ void MP4::Mp4MdiaBox::parse()
{
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
TagLib::uint totalsize = 8;
uint totalsize = 8;
// parse all contained boxes
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
// stores the current handler type
@ -81,7 +81,7 @@ void MP4::Mp4MdiaBox::parse()
// create the appropriate subclass and parse it
MP4::Mp4IsoBox* curbox = d->boxfactory.createInstance( mp4file, fourcc, size, mp4file->tell() );
if( static_cast<TagLib::uint>( fourcc ) == 0x6d696e66 /*"minf"*/ )
if( static_cast<uint>( fourcc ) == 0x6d696e66 /*"minf"*/ )
{
// cast to minf
Mp4MinfBox* minfbox = dynamic_cast<Mp4MinfBox*>( curbox );
@ -94,7 +94,7 @@ void MP4::Mp4MdiaBox::parse()
curbox->parsebox();
d->mdiaBoxes.append( curbox );
if(static_cast<TagLib::uint>( fourcc ) == 0x68646c72 /*"hdlr"*/ )
if(static_cast<uint>( fourcc ) == 0x68646c72 /*"hdlr"*/ )
{
// cast to hdlr box
Mp4HdlrBox* hdlrbox = dynamic_cast<Mp4HdlrBox*>( curbox );

@ -32,7 +32,7 @@ namespace TagLib
class Mp4MdiaBox: public Mp4IsoBox
{
public:
Mp4MdiaBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset );
Mp4MdiaBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset );
~Mp4MdiaBox();
//! parse mdia contents

@ -36,7 +36,7 @@ public:
MP4::BoxFactory boxfactory;
}; // class Mp4MetaBoxPrivate
MP4::Mp4MetaBox::Mp4MetaBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset )
MP4::Mp4MetaBox::Mp4MetaBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset )
: Mp4IsoFullBox( file, fourcc, size, offset )
{
d = new MP4::Mp4MetaBox::Mp4MetaBoxPrivate();
@ -58,9 +58,9 @@ void MP4::Mp4MetaBox::parse()
{
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
TagLib::uint totalsize = 12; // initial size of box
uint totalsize = 12; // initial size of box
// parse all contained boxes
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
while( (mp4file->readSizeAndType( size, fourcc ) == true) )

@ -32,7 +32,7 @@ namespace TagLib
class Mp4MetaBox: public Mp4IsoFullBox
{
public:
Mp4MetaBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset );
Mp4MetaBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset );
~Mp4MetaBox();
//! parse meta contents

@ -39,7 +39,7 @@ public:
MP4::Fourcc handler_type;
}; // class Mp4MinfBoxPrivate
MP4::Mp4MinfBox::Mp4MinfBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset )
MP4::Mp4MinfBox::Mp4MinfBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset )
: Mp4IsoBox( file, fourcc, size, offset )
{
d = new MP4::Mp4MinfBox::Mp4MinfBoxPrivate();
@ -66,9 +66,9 @@ void MP4::Mp4MinfBox::parse()
{
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
TagLib::uint totalsize = 8;
uint totalsize = 8;
// parse all contained boxes
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
while( (mp4file->readSizeAndType( size, fourcc ) == true) )
@ -84,7 +84,7 @@ void MP4::Mp4MinfBox::parse()
// create the appropriate subclass and parse it
MP4::Mp4IsoBox* curbox = d->boxfactory.createInstance( mp4file, fourcc, size, mp4file->tell() );
if(static_cast<TagLib::uint>( fourcc ) == 0x7374626c /*stbl*/ )
if(static_cast<uint>( fourcc ) == 0x7374626c /*stbl*/ )
{
// cast to hdlr box
Mp4StblBox* stblbox = dynamic_cast<Mp4StblBox*>( curbox );

@ -32,7 +32,7 @@ namespace TagLib
class Mp4MinfBox: public Mp4IsoBox
{
public:
Mp4MinfBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset );
Mp4MinfBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset );
~Mp4MinfBox();
//! parse minf contents

@ -36,7 +36,7 @@ public:
MP4::BoxFactory boxfactory;
}; // class Mp4MoovBoxPrivate
MP4::Mp4MoovBox::Mp4MoovBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset )
MP4::Mp4MoovBox::Mp4MoovBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset )
: Mp4IsoBox( file, fourcc, size, offset )
{
d = new MP4::Mp4MoovBox::Mp4MoovBoxPrivate();
@ -58,9 +58,9 @@ void MP4::Mp4MoovBox::parse()
{
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
TagLib::uint totalsize = 8;
uint totalsize = 8;
// parse all contained boxes
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
while( (mp4file->readSizeAndType( size, fourcc ) == true) )

@ -32,7 +32,7 @@ namespace TagLib
class Mp4MoovBox: public Mp4IsoBox
{
public:
Mp4MoovBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset );
Mp4MoovBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset );
~Mp4MoovBox();
//! parse moov contents

@ -36,18 +36,18 @@ public:
//! modification time of the file - since midnight, Jan. 1, 1904, UTC-time
TagLib::ulonglong modificationTime;
//! timescale for the file - referred by all time specifications in this box
TagLib::uint timescale;
uint timescale;
//! duration of presentation
TagLib::ulonglong duration;
//! playout speed
TagLib::uint rate;
uint rate;
//! volume for entire presentation
TagLib::uint volume;
uint volume;
//! track ID for an additional track (next new track)
TagLib::uint nextTrackID;
uint nextTrackID;
}; // class Mp4MvhdBoxPrivate
MP4::Mp4MvhdBox::Mp4MvhdBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset )
MP4::Mp4MvhdBox::Mp4MvhdBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset )
: Mp4IsoFullBox( file, fourcc, size, offset )
{
d = new MP4::Mp4MvhdBox::Mp4MvhdBoxPrivate();
@ -68,7 +68,7 @@ TagLib::ulonglong MP4::Mp4MvhdBox::modificationTime() const
return d->modificationTime;
}
TagLib::uint MP4::Mp4MvhdBox::timescale() const
uint MP4::Mp4MvhdBox::timescale() const
{
return d->timescale;
}
@ -78,17 +78,17 @@ TagLib::ulonglong MP4::Mp4MvhdBox::duration() const
return d->duration;
}
TagLib::uint MP4::Mp4MvhdBox::rate() const
uint MP4::Mp4MvhdBox::rate() const
{
return d->rate;
}
TagLib::uint MP4::Mp4MvhdBox::volume() const
uint MP4::Mp4MvhdBox::volume() const
{
return d->volume;
}
TagLib::uint MP4::Mp4MvhdBox::nextTrackID() const
uint MP4::Mp4MvhdBox::nextTrackID() const
{
return d->nextTrackID;
}
@ -111,7 +111,7 @@ void MP4::Mp4MvhdBox::parse()
}
else
{
TagLib::uint creationTime_tmp, modificationTime_tmp, duration_tmp;
uint creationTime_tmp, modificationTime_tmp, duration_tmp;
if( !mp4file->readInt( creationTime_tmp ) )
return;

@ -33,7 +33,7 @@ namespace TagLib
class Mp4MvhdBox: public Mp4IsoFullBox
{
public:
Mp4MvhdBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset );
Mp4MvhdBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset );
~Mp4MvhdBox();
//! function to get the creation time of the mp4 file

@ -45,15 +45,15 @@ MP4::Mp4PropsProxy::~Mp4PropsProxy()
delete d;
}
TagLib::uint MP4::Mp4PropsProxy::seconds() const
uint MP4::Mp4PropsProxy::seconds() const
{
if( d->mvhdbox )
return static_cast<TagLib::uint>( d->mvhdbox->duration() / d->mvhdbox->timescale() );
return static_cast<uint>( d->mvhdbox->duration() / d->mvhdbox->timescale() );
else
return 0;
}
TagLib::uint MP4::Mp4PropsProxy::channels() const
uint MP4::Mp4PropsProxy::channels() const
{
if( d->audiosampleentry )
return d->audiosampleentry->channels();
@ -61,7 +61,7 @@ TagLib::uint MP4::Mp4PropsProxy::channels() const
return 0;
}
TagLib::uint MP4::Mp4PropsProxy::sampleRate() const
uint MP4::Mp4PropsProxy::sampleRate() const
{
if( d->audiosampleentry )
return (d->audiosampleentry->samplerate()>>16);
@ -69,7 +69,7 @@ TagLib::uint MP4::Mp4PropsProxy::sampleRate() const
return 0;
}
TagLib::uint MP4::Mp4PropsProxy::bitRate() const
uint MP4::Mp4PropsProxy::bitRate() const
{
if( d->audiosampleentry )
return (d->audiosampleentry->bitrate());

@ -41,13 +41,13 @@ namespace TagLib
~Mp4PropsProxy();
//! function to get length of media in seconds
TagLib::uint seconds() const;
uint seconds() const;
//! function to get the nunmber of channels
TagLib::uint channels() const;
uint channels() const;
//! function to get the sample rate
TagLib::uint sampleRate() const;
uint sampleRate() const;
//! function to get the bitrate rate
TagLib::uint bitRate() const;
uint bitRate() const;
//! function to register the movie header box - mvhd
void registerMvhd( MP4::Mp4MvhdBox* mvhdbox );

@ -28,7 +28,7 @@ using namespace TagLib;
class MP4::Mp4SampleEntry::Mp4SampleEntryPrivate
{
public:
TagLib::uint data_reference_index;
uint data_reference_index;
};
MP4::Mp4SampleEntry::Mp4SampleEntry( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset )

@ -39,7 +39,7 @@ public:
MP4::Fourcc handler_type;
}; // class Mp4StblBoxPrivate
MP4::Mp4StblBox::Mp4StblBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset )
MP4::Mp4StblBox::Mp4StblBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset )
: Mp4IsoBox( file, fourcc, size, offset )
{
d = new MP4::Mp4StblBox::Mp4StblBoxPrivate();
@ -66,9 +66,9 @@ void MP4::Mp4StblBox::parse()
{
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
TagLib::uint totalsize = 8;
uint totalsize = 8;
// parse all contained boxes
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
while( (mp4file->readSizeAndType( size, fourcc ) == true) )
@ -86,7 +86,7 @@ void MP4::Mp4StblBox::parse()
MP4::Mp4IsoBox* curbox = d->boxfactory.createInstance( mp4file, fourcc, size, mp4file->tell() );
// check for stsd
if( static_cast<TagLib::uint>(fourcc) == 0x73747364 /*'stsd'*/ )
if( static_cast<uint>(fourcc) == 0x73747364 /*'stsd'*/ )
{
// cast to stsd box
MP4::Mp4StsdBox* stsdbox = dynamic_cast<MP4::Mp4StsdBox*>(curbox);

@ -32,7 +32,7 @@ namespace TagLib
class Mp4StblBox: public Mp4IsoBox
{
public:
Mp4StblBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset );
Mp4StblBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset );
~Mp4StblBox();
//! parse stbl contents

@ -36,7 +36,7 @@ public:
MP4::Mp4AudioSampleEntry* audioSampleEntry;
}; // class Mp4StsdBoxPrivate
MP4::Mp4StsdBox::Mp4StsdBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset )
MP4::Mp4StsdBox::Mp4StsdBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset )
: Mp4IsoFullBox( file, fourcc, size, offset )
{
d = new MP4::Mp4StsdBox::Mp4StsdBoxPrivate();
@ -58,19 +58,19 @@ void MP4::Mp4StsdBox::parse()
if(!mp4file)
return;
TagLib::uint totalsize = 12; // initial size of box
uint totalsize = 12; // initial size of box
// check for handler type - only parse if 'soun':
if( static_cast<TagLib::uint>(d->handler_type) == 0x736f756e )
if( static_cast<uint>(d->handler_type) == 0x736f756e )
{
// read entry count
TagLib::uint entry_count;
uint entry_count;
if(!mp4file->readInt( entry_count ))
return;
// simply read first entry and skip all following
// read size and type
TagLib::uint cursize;
uint cursize;
MP4::Fourcc fourcc;
if( !mp4file->readSizeAndType( cursize, fourcc ))
return;

@ -32,7 +32,7 @@ namespace TagLib
class Mp4StsdBox: public Mp4IsoFullBox
{
public:
Mp4StsdBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset );
Mp4StsdBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset );
~Mp4StsdBox();
//! parse stsd contents

@ -36,7 +36,7 @@ public:
MP4::BoxFactory boxfactory;
}; // class Mp4TrakBoxPrivate
MP4::Mp4TrakBox::Mp4TrakBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset )
MP4::Mp4TrakBox::Mp4TrakBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset )
: Mp4IsoBox( file, fourcc, size, offset )
{
d = new MP4::Mp4TrakBox::Mp4TrakBoxPrivate();
@ -58,9 +58,9 @@ void MP4::Mp4TrakBox::parse()
{
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
TagLib::uint totalsize = 8;
uint totalsize = 8;
// parse all contained boxes
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
while( (mp4file->readSizeAndType( size, fourcc ) == true) )

@ -32,7 +32,7 @@ namespace TagLib
class Mp4TrakBox: public Mp4IsoBox
{
public:
Mp4TrakBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset );
Mp4TrakBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset );
~Mp4TrakBox();
//! parse trak contents

@ -36,7 +36,7 @@ public:
MP4::BoxFactory boxfactory;
}; // class Mp4UdtaBoxPrivate
MP4::Mp4UdtaBox::Mp4UdtaBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset )
MP4::Mp4UdtaBox::Mp4UdtaBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset )
: Mp4IsoBox( file, fourcc, size, offset )
{
d = new MP4::Mp4UdtaBox::Mp4UdtaBoxPrivate();
@ -61,9 +61,9 @@ void MP4::Mp4UdtaBox::parse()
#endif
TagLib::MP4::File* mp4file = static_cast<MP4::File*>( file() );
TagLib::uint totalsize = 8;
uint totalsize = 8;
// parse all contained boxes
TagLib::uint size;
uint size;
MP4::Fourcc fourcc;
#if 0

@ -32,7 +32,7 @@ namespace TagLib
class Mp4UdtaBox: public Mp4IsoBox
{
public:
Mp4UdtaBox( TagLib::File* file, MP4::Fourcc fourcc, TagLib::uint size, long offset );
Mp4UdtaBox( TagLib::File* file, MP4::Fourcc fourcc, uint size, long offset );
~Mp4UdtaBox();
//! parse moov contents

@ -129,15 +129,15 @@ bool MP4::File::save()
#ifdef USE_ITMF_TAGS
MP4TagsSetName(filetags, mp4tag->title().isNull() ? "" : mp4tag->title().toCString(true));
MP4TagsSetArtist(filetags, mp4tag->artist().isNull() ? "" : mp4tag->artist().toCString(true));
MP4TagsSetAlbum(filetags, mp4tag->album().isNull() ? "" : mp4tag->album().toCString(true));
MP4TagsSetComments(filetags, mp4tag->comment().isNull() ? "" : mp4tag->comment().toCString(true));
MP4TagsSetGenre(filetags, mp4tag->genre().isNull() ? "" : mp4tag->genre().toCString(true));
MP4TagsSetComposer(filetags, mp4tag->composer().isNull() ? "" : mp4tag->composer().toCString(true));
MP4TagsSetName(filetags, mp4tag->title().isEmpty() ? "" : mp4tag->title().toCString(true));
MP4TagsSetArtist(filetags, mp4tag->artist().isEmpty() ? "" : mp4tag->artist().toCString(true));
MP4TagsSetAlbum(filetags, mp4tag->album().isEmpty() ? "" : mp4tag->album().toCString(true));
MP4TagsSetComments(filetags, mp4tag->comment().isEmpty() ? "" : mp4tag->comment().toCString(true));
MP4TagsSetGenre(filetags, mp4tag->genre().isEmpty() ? "" : mp4tag->genre().toCString(true));
MP4TagsSetComposer(filetags, mp4tag->composer().isEmpty() ? "" : mp4tag->composer().toCString(true));
#else
#define setmeta(val, tag) \
if(mp4tag->val().isNull()) { \
if(mp4tag->val().isEmpty()) { \
/*MP4DeleteMetadata##tag(handle);*/ \
MP4SetMetadata##tag(handle, ""); \
} else { \

@ -38,12 +38,12 @@ email : andrew.leadbetter@gmail.com
using namespace TagLib;
MP4::Tag::Tag() : TagLib::Tag::Tag() {
m_title = String::null;
m_artist = String::null;
m_album = String::null;
m_comment = String::null;
m_genre = String::null;
m_composer = String::null;
m_title = String();
m_artist = String();
m_album = String();
m_comment = String();
m_genre = String();
m_composer = String();
m_year = 0;
m_track = 0;
m_disk = 0;
@ -55,12 +55,12 @@ MP4::Tag::~Tag() {
}
bool MP4::Tag::isEmpty() const {
return m_title == String::null &&
m_artist == String::null &&
m_album == String::null &&
m_comment == String::null &&
m_genre == String::null &&
m_composer == String::null &&
return m_title.isEmpty() &&
m_artist.isEmpty() &&
m_album.isEmpty() &&
m_comment.isEmpty() &&
m_genre.isEmpty() &&
m_composer.isEmpty() &&
m_year == 0 &&
m_track == 0 &&
m_disk == 0 &&

@ -57,36 +57,36 @@ namespace TagLib {
/*!
* Returns the track name; if no track name is present in the tag
* String::null will be returned.
* a null String will be returned.
*/
virtual String title() const { return m_title; }
/*!
* Returns the artist name; if no artist name is present in the tag
* String::null will be returned.
* a null String will be returned.
*/
virtual String artist() const { return m_artist; }
/*!
* Returns the album name; if no album name is present in the tag
* String::null will be returned.
* a null String will be returned.
*/
virtual String album() const { return m_album; }
/*!
* Returns the track comment; if no comment is present in the tag
* String::null will be returned.
* a null String will be returned.
*/
virtual String comment() const { return m_comment; }
/*!
* Returns the genre name; if no genre is present in the tag String::null
* Returns the genre name; if no genre is present in the tag a null String
* will be returned.
*/
virtual String genre() const { return m_genre; }
/*!
* Returns the composer name; if no composer is present in the tag String::null
* Returns the composer name; if no composer is present in the tag a null String
* will be returned.
*/
virtual String composer() const { return m_composer; }
@ -126,31 +126,31 @@ namespace TagLib {
virtual int compilation() const { return m_compilation; }
/*!
* Sets the title to \a s. If \a s is String::null then this value will be
* Sets the title to \a s. If \a s is a null String then this value will be
* cleared.
*/
virtual void setTitle(const String &s) { m_title = s; }
/*!
* Sets the artist to \a s. If \a s is String::null then this value will be
* Sets the artist to \a s. If \a s is a null String then this value will be
* cleared.
*/
virtual void setArtist(const String &s) { m_artist = s; }
/*!
* Sets the album to \a s. If \a s is String::null then this value will be
* Sets the album to \a s. If \a s is a null String then this value will be
* cleared.
*/
virtual void setAlbum(const String &s) { m_album = s; }
/*!
* Sets the album to \a s. If \a s is String::null then this value will be
* Sets the album to \a s. If \a s is a null String then this value will be
* cleared.
*/
virtual void setComment(const String &s) { m_comment = s; }
/*!
* Sets the genre to \a s. If \a s is String::null then this value will be
* Sets the genre to \a s. If \a s is a null String then this value will be
* cleared. For tag formats that use a fixed set of genres, the appropriate
* value will be selected based on a string comparison. A list of available
* genres for those formats should be available in that type's
@ -184,7 +184,7 @@ namespace TagLib {
virtual void setCompilation(bool compilation) { m_compilation = compilation ? 1 : 0; }
/*!
* Sets the composer to \a s. If \a s is String::null then this value will
* Sets the composer to \a s. If \a s is a null String then this value will
* be cleared.
*/
virtual void setComposer(const String &s) { m_composer = s; }

@ -51,7 +51,10 @@ using namespace TagLib::RealMedia;
RMFFile::RMFFile(const char *filename) : File(filename), m_id3tag(0)
{
if (isOpen())
m_id3tag = new ID3v1::Tag(this, length() - 128);
{
auto tagOffset = length() - 128;
m_id3tag = new ID3v1::Tag(this, tagOffset);
}
}
RMFFile::~RMFFile()
@ -91,12 +94,12 @@ String RealMediaFF::genre() const
return !m_err && m_id3v1tag ? m_id3v1tag->tag()->genre() : "";
}
TagLib::uint RealMediaFF::year() const
uint RealMediaFF::year() const
{
return !m_err && m_id3v1tag ? m_id3v1tag->tag()->year() : 0;
}
TagLib::uint RealMediaFF::track() const
uint RealMediaFF::track() const
{
return !m_err && m_id3v1tag ? m_id3v1tag->tag()->track() : 0;
}

@ -297,8 +297,8 @@ namespace TagLib
TagLib::String album () const;
TagLib::String comment () const;
TagLib::String genre () const;
TagLib::uint year () const;
TagLib::uint track () const;
uint year () const;
uint track () const;
// TODO write support
//void setTitle (const String &s);
//void setArtist (const String &s);

@ -78,12 +78,12 @@ String RealMedia::Tag::genre () const
return m_rmff->genre();
}
TagLib::uint RealMedia::Tag::year () const
uint RealMedia::Tag::year () const
{
return m_rmff->year();
}
TagLib::uint RealMedia::Tag::track () const
uint RealMedia::Tag::track () const
{
return m_rmff->track();
}

@ -49,7 +49,7 @@ namespace TagLib {
if(tag2)
return tag2->title();
return String::null;
return String();
}
virtual String artist() const {
@ -59,7 +59,7 @@ namespace TagLib {
if(tag2)
return tag2->artist();
return String::null;
return String();
}
virtual String album() const {
@ -69,7 +69,7 @@ namespace TagLib {
if(tag2)
return tag2->album();
return String::null;
return String();
}
virtual String comment() const {
@ -79,7 +79,7 @@ namespace TagLib {
if(tag2)
return tag2->comment();
return String::null;
return String();
}
virtual String genre() const {
@ -89,7 +89,7 @@ namespace TagLib {
if(tag2)
return tag2->genre();
return String::null;
return String();
}
virtual uint year() const {

@ -49,7 +49,7 @@ namespace TagLib {
if(tag2)
return tag2->title();
return String::null;
return String();
}
virtual String artist() const {
@ -59,7 +59,7 @@ namespace TagLib {
if(tag2)
return tag2->artist();
return String::null;
return String();
}
virtual String album() const {
@ -69,7 +69,7 @@ namespace TagLib {
if(tag2)
return tag2->album();
return String::null;
return String();
}
virtual String comment() const {
@ -79,7 +79,7 @@ namespace TagLib {
if(tag2)
return tag2->comment();
return String::null;
return String();
}
virtual String genre() const {
@ -89,7 +89,7 @@ namespace TagLib {
if(tag2)
return tag2->genre();
return String::null;
return String();
}
virtual uint year() const {

@ -570,14 +570,14 @@ ScriptManager::slotRunScript( bool silent )
TQListViewItem* const li = m_gui->listView->currentItem();
const TQString name = li->text( 0 );
if( m_scripts[name].type == "lyrics" && lyricsScriptRunning() != TQString() ) {
if( m_scripts[name].type == "lyrics" && !lyricsScriptRunning().isEmpty() ) {
if( !silent )
KMessageBox::sorry( 0, i18n( "Another lyrics script is already running. "
"You may only run one lyrics script at a time." ) );
return false;
}
if( m_scripts[name].type == "transcode" && transcodeScriptRunning() != TQString() ) {
if( m_scripts[name].type == "transcode" && !transcodeScriptRunning().isEmpty() ) {
if( !silent )
KMessageBox::sorry( 0, i18n( "Another transcode script is already running. "
"You may only run one transcode script at a time." ) );

@ -106,7 +106,7 @@ StarManager::reinitStars( int height, int margin )
CollectionView::instance()->triggerUpdate();
// FIXME
// Not ideal but should work sufficiently for now
emit ratingsColorsChanged(TQString::null);
emit ratingsColorsChanged(TQString());
}
TQPixmap*

@ -18,8 +18,6 @@
#include "tagguesserconfigdialog.h"
#include "trackpickerdialog.h"
#include <taglib/tfile.h> //TagLib::File::isWritable
#include <tqdom.h>
#include <tqfile.h>
#include <tqheader.h>
@ -1415,8 +1413,7 @@ TagDialog::openURLRequest(const KURL &url ) //SLOT
bool
TagDialog::writeTag( MetaBundle &mb, bool updateCB )
{
TQCString path = TQFile::encodeName( mb.url().path() );
if ( !TagLib::File::isWritable( path ) ) {
if (access(mb.url().path().local8Bit().data(), R_OK|W_OK)) {
Amarok::StatusBar::instance()->longMessage( i18n(
"The file %1 is not writable." ).arg( mb.url().fileName() ), KDE::StatusBar::Error );
return false;
@ -1455,8 +1452,7 @@ bool
TagDialogWriter::doJob()
{
for( int i = 0, size=m_tags.size(); i<size; ++i ) {
TQCString path = TQFile::encodeName( m_tags[i].url().path() );
if ( !TagLib::File::isWritable( path ) ) {
if (access(m_tags[i].url().path().local8Bit().data(), R_OK|W_OK)) {
Amarok::StatusBar::instance()->longMessageThreadSafe( i18n(
"The file %1 is not writable." ).arg( m_tags[i].url().fileName() ), KDE::StatusBar::Error );
m_failed += true;

Loading…
Cancel
Save