summaryrefslogtreecommitdiffstats
path: root/src/cdmanager.h
blob: 57d8c4cda3fabe11e260e51655a9a9310dae7240 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96


#ifndef CDMANAGER_H
#define CDMANAGER_H

#include "tagengine.h"

#include <tqobject.h>

class ConversionOptions;
class Paranoia;

/**
 * @short All data needed for a cd device
 * @author Daniel Faust <hessijames@gmail.com>
 * @version 0.3
 */
class CDDevice
{
public:
    /**
     * Constructor
     */
    CDDevice( const TQString& _device="" );

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

    TQString device;
    Paranoia* para;
    TQValueList<TagData*> tags;
    TagData* discTags;
    int trackCount;
    int timeCount;
};

/**
 * @short The CD manager
 * @author Daniel Faust <hessijames@gmail.com>
 * @version 0.3
 */
class CDManager : public TQObject
{
    Q_OBJECT
  
public:
    /**
     * Constructor
     */
    CDManager();

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

    /**
     * Create a new CDDevice entry in cdDevices. Use @param device or auto search for an audio cd
     * Return the used device (usefull, if auto searching was used)
     */
    TQString newCDDevice( const TQString& device="" );

    /**
     * Return a list of all tracks on the cd in drive @param device
     */
    TQValueList<TagData*> getTrackList( const TQString& device );

    /**
     * Return the tags of the track @param track on the cd in drive @param device
     */
    TagData* getTags( const TQString& device, int track );

    /**
     * Set the tags of the cd in drive @param device
     */
    void setDiscTags( const TQString& device, TagData* tags );

    /**
     * Return the sum of all tracks of the cd in drive @param device
     */
    int getTrackCount( const TQString& device );

    /**
     * Return the complete length of the cd in drive @param device
     */
    int getTimeCount( const TQString& device );

private:
    /** a list of all devices */
    TQValueList<CDDevice*> cdDevices;

};

#endif // CDMANAGER_H