KCompactDisc

audio_phonon.h
1/* This file is part of the KDE project
2 Copyright (C) 2006 Alexander Kern <alex.kern@gmx.de>
3
4 based on example for Phonon Architecture, Matthias Kretz <kretz@kde.org>
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
31namespace Phonon { class MediaObject; }
32
33class LibWMPcmPlayer : public Phonon::AbstractMediaStream {
35
36public:
37 LibWMPcmPlayer();
38 ~LibWMPcmPlayer();
39
40 QByteArray wavHeader() const;
41 void setNextBuffer(struct cdda_block *blk);
42
43public 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
50protected:
51 void reset();
52 void needData();
53
55 void cmdChanged(int cmd);
56 void nextBuffer(struct cdda_block *blk);
57
58private:
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__ */
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:10:51 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.