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)
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
27 #include <krandomsequence.h>
29 #include "kcompactdisc.h"
31 class KCompactDiscPrivate
: public QObject
36 KCompactDiscPrivate(KCompactDisc
*, const QString
&);
37 virtual ~KCompactDiscPrivate() { };
39 bool moveInterface(const QString
&, const QString
&, const QString
&);
40 virtual bool createInterface();
43 KCompactDisc::InformationMode m_infoMode
;
46 KCompactDisc::DiscStatus m_status
;
47 KCompactDisc::DiscStatus m_statusExpected
;
49 unsigned m_discLength
;
52 unsigned m_trackPosition
;
53 unsigned m_discPosition
;
54 unsigned m_trackExpectedPosition
;
57 QList
<unsigned> m_trackStartFrames
;
58 QStringList m_trackArtists
;
59 QStringList m_trackTitles
;
61 KRandomSequence m_randSequence
;
62 QList
<unsigned> m_playlist
;
64 bool m_randomPlaylist
;
68 unsigned getNextTrackInPlaylist();
69 unsigned getPrevTrackInPlaylist();
70 bool skipStatusChange(KCompactDisc::DiscStatus
);
71 static const QString
discStatusI18n(KCompactDisc::DiscStatus
);
75 virtual unsigned trackLength(unsigned);
76 virtual bool isTrackAudio(unsigned);
77 virtual void playTrackPosition(unsigned, unsigned);
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
;
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 */