summaryrefslogtreecommitdiffstats
path: root/src/replaygain.h
blob: 568d3a89854039fc88b9975bfcc4de2f596a6c00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59


#ifndef REPLAYGAIN_H
#define REPLAYGAIN_H

#include <tqobject.h>
#include <tqstringlist.h>

class Config;
class Logger;
class KProcess;

/**
 * @short Starts a process to add/remove Replay Gain tags to/from a given file
 * @author Daniel Faust <hessijames@gmail.com>
 * @version 0.3
 */
class ReplayGain : public TQObject
{
    Q_OBJECT
  TQ_OBJECT
public:
    enum Mode {
        calc_track        = 0x0001,
        calc_album        = 0x0002,
        remove            = 0x0004,
        force             = 0x0008
    };

    /**
     * Constructor
     */
    ReplayGain( Config*, Logger* );

    /**
     * Destructor
     */
    virtual ~ReplayGain();

    /**
     * Add/remove Replay Gain
     * @param files a list of files (of the same format)
     * @param format the format of the file/files (extension or mime type)
     * @param prc a pointer to a KProcess
     * @param remove if true the Replay Gain tags are being removed, if false (default) the tags are calculated and added
     */
    bool apply( TQStringList files, const TQString& format, KProcess* proc, int logID, Mode mode = Mode(calc_track|calc_album) ); // NOTE const TQStringList& ?

    /*
     * Returns the track and the album gain (in this order) of the @p file
     */
    //static TQValueList<float> getReplayGain( TQString file ); // obsolete

private:
    Config* config;
    Logger* logger;
};

#endif // REPLAYGAIN_H