2 * messagewin_p.h - private declarations for MessageWin
4 * Copyright © 2009-2013 by David Jarvie <djarvie@kde.org>
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 of the License, or
9 * (at your option) 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 along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef MESSAGEWIN_P_H
22 #define MESSAGEWIN_P_H
24 #include <phonon/phononnamespace.h>
25 #include <phonon/path.h>
31 namespace Phonon
{ class MediaObject
; }
33 class AudioThread
: public QThread
37 AudioThread(MessageWin
* parent
, const QString
& audioFile
, float volume
, float fadeVolume
, int fadeSeconds
, int repeatPause
);
39 void stop(bool wait
= false);
40 QString
error() const;
42 static MessageWin
* mAudioOwner
; // window which owns the unique AudioThread
48 void run() Q_DECL_OVERRIDE
;
51 void checkAudioPlay();
52 void playStateChanged(Phonon::State
);
56 mutable QMutex mMutex
;
62 Phonon::MediaObject
* mAudioObject
;
65 bool mPlayedOnce
; // the sound file has started playing at least once
66 bool mPausing
; // currently pausing between repeats
69 #endif // MESSAGEWIN_P_H