oggtag.h 2.67 KB
Newer Older
1 2 3 4 5
/***************************************************************************
                          oggtag.h  -  description
                             -------------------
    begin                : Sat Oct 5 2002
    copyright            : (C) 2002 by Scott Wheeler
6
    email                : wheeler@kde.org
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef OGGTAG_H
#define OGGTAG_H

#include "tag.h"

class OggTag : public Tag
{
public: 
    OggTag(const QString &file);
    virtual ~OggTag();

    virtual void save();
30
    virtual bool hasTag() const;
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48

    virtual QString track() const;
    virtual QString artist() const;
    virtual QString album() const;
    virtual Genre genre() const;
    virtual int trackNumber() const;
    virtual QString trackNumberString() const;
    virtual int year() const;
    virtual QString yearString() const;
    virtual QString comment() const;

    virtual void setTrack(const QString &value);
    virtual void setArtist(const QString &value);
    virtual void setAlbum(const QString &value);
    virtual void setGenre(const Genre &value);
    virtual void setTrackNumber(int value);
    virtual void setYear(int value);
    virtual void setComment(const QString &value);
49

50 51 52 53
    virtual QString bitrateString() const;
    virtual QString lengthString() const;
    virtual int seconds() const;

54 55 56 57 58 59 60 61 62 63 64
private:
    /**
     * Simplifies reading a string from a KFMI group.  Returns QString::null if
     * something went wrong or the key was not found.
     */
    QString readCommentString(const QString &key) const;
    /**
     * Simplifies reading an int from a KFMI group.  Returns -1 if something went
     * wrong or the key was not found.
     */
    int readCommentInt(const QString &key) const;
65 66 67 68 69 70 71 72
    /**
     * Writes a string to the specified key.
     */
    void writeCommentItem(const QString &key, const QString &value);
    /**
     * Writes a string to the specified key.
     */
    void writeCommentItem(const QString &key, int value);
73 74 75
    
    KFileMetaInfo metaInfo;
    KFileMetaInfoGroup commentGroup;
76 77 78
};

#endif