Final polisihing for KDE4:
[kdemultimedia.git] / libkcompactdisc / kcompactdisc_p.h
blob06c7b924257ecab9b80f8fbbe0cf07a441c4a958
1 /*
2 * KCompactDisc - A CD drive interface for the KDE Project.
4 * Copyright (C) 2007 Alexander Kern <alex.kern@gmx.de>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef KCOMPACTDISC_P_H
22 #define KCOMPACTDISC_P_H
24 #include <QString>
25 #include <QList>
27 #include <krandomsequence.h>
28 #include <kurl.h>
29 #include "kcompactdisc.h"
31 class KCompactDiscPrivate : public QObject
33 Q_OBJECT
35 public:
36 KCompactDiscPrivate(KCompactDisc *, const QString&);
37 virtual ~KCompactDiscPrivate() { };
39 bool moveInterface(const QString &, const QString &, const QString &);
40 virtual bool createInterface();
42 QString m_interface;
43 KCompactDisc::InformationMode m_infoMode;
44 QString m_deviceName;
46 KCompactDisc::DiscStatus m_status;
47 KCompactDisc::DiscStatus m_statusExpected;
48 unsigned m_discId;
49 unsigned m_discLength;
50 unsigned m_track;
51 unsigned m_tracks;
52 unsigned m_trackPosition;
53 unsigned m_discPosition;
54 unsigned m_trackExpectedPosition;
55 int m_seek;
57 QList<unsigned> m_trackStartFrames;
58 QStringList m_trackArtists;
59 QStringList m_trackTitles;
61 KRandomSequence m_randSequence;
62 QList<unsigned> m_playlist;
63 bool m_loopPlaylist;
64 bool m_randomPlaylist;
65 bool m_autoMetadata;
67 void make_playlist();
68 unsigned getNextTrackInPlaylist();
69 unsigned getPrevTrackInPlaylist();
70 bool skipStatusChange(KCompactDisc::DiscStatus);
71 static const QString discStatusI18n(KCompactDisc::DiscStatus);
73 void clearDiscInfo();
75 virtual unsigned trackLength(unsigned);
76 virtual bool isTrackAudio(unsigned);
77 virtual void playTrackPosition(unsigned, unsigned);
78 virtual void pause();
79 virtual void stop();
80 virtual void eject();
81 virtual void closetray();
83 virtual void setVolume(unsigned);
84 virtual void setBalance(unsigned);
85 virtual unsigned volume();
86 virtual unsigned balance();
88 virtual void queryMetadata();
90 QString m_deviceVendor;
91 QString m_deviceModel;
92 QString m_deviceRevision;
94 public:
95 Q_DECLARE_PUBLIC(KCompactDisc)
96 KCompactDisc * const q_ptr;
100 #define SEC2FRAMES(sec) ((sec) * 75)
101 #define FRAMES2SEC(frames) ((frames) / 75)
102 #define MS2SEC(ms) ((ms) / 1000)
103 #define SEC2MS(sec) ((sec) * 1000)
104 #define MS2FRAMES(ms) (((ms) * 75) / 1000)
105 #define FRAMES2MS(frames) (((frames) * 1000) / 75)
107 #endif /* KCOMPACTDISC_P_H */