KCompactDisc

audio_phonon.h
1 /* This file is part of the KDE project
2  Copyright (C) 2006 Alexander Kern <[email protected]>
3 
4  based on example for Phonon Architecture, Matthias Kretz <[email protected]>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef __AUDIO_PHONON_H__
22 #define __AUDIO_PHONON_H__
23 
24 #include <QByteArray>
25 #include <QTimer>
26 #include <QWaitCondition>
27 #include <QMutex>
28 
29 #include <Phonon/AbstractMediaStream>
30 
31 namespace Phonon { class MediaObject; }
32 
33 class LibWMPcmPlayer : public Phonon::AbstractMediaStream {
34  Q_OBJECT
35 
36 public:
37  LibWMPcmPlayer();
38  ~LibWMPcmPlayer();
39 
40  QByteArray wavHeader() const;
41  void setNextBuffer(struct cdda_block *blk);
42 
43 public Q_SLOTS:
44  void playBuffer(struct cdda_block *blk);
45  void pause(void);
46  void stop(void);
47  void executeCmd(int cmd);
48  void stateChanged( Phonon::State newstate, Phonon::State oldstate );
49 
50 protected:
51  void reset();
52  void needData();
53 
54 Q_SIGNALS:
55  void cmdChanged(int cmd);
56  void nextBuffer(struct cdda_block *blk);
57 
58 private:
59  Phonon::MediaObject* m_media;
60  unsigned char m_cmd;
61  struct cdda_block *m_blk;
62  QWaitCondition m_readyToPlay;
63  QMutex m_mutex;
64 };
65 
66 #endif /* __AUDIO_PHONON_H__ */
KToggleAction * pause(const QObject *recvr, const char *slot, QObject *parent)
KGuiItem stop()
KGuiItem reset()
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Oct 18 2021 23:23:11 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.