Remove dead code
[kdepim.git] / kalarm / messagewin_p.h
bloba5d7a8f071514dd4e1f76364f6cab4f0ae670481
1 /*
2 * messagewin_p.h - private declarations for MessageWin
3 * Program: kalarm
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>
26 #include <QThread>
27 #include <QMutex>
29 class MessageWin;
31 namespace Phonon { class MediaObject; }
33 class AudioThread : public QThread
35 Q_OBJECT
36 public:
37 AudioThread(MessageWin* parent, const QString& audioFile, float volume, float fadeVolume, int fadeSeconds, int repeatPause);
38 ~AudioThread();
39 void stop(bool wait = false);
40 QString error() const;
42 static MessageWin* mAudioOwner; // window which owns the unique AudioThread
44 Q_SIGNALS:
45 void readyToPlay();
47 protected:
48 void run() Q_DECL_OVERRIDE;
50 private Q_SLOTS:
51 void checkAudioPlay();
52 void playStateChanged(Phonon::State);
53 void stopPlay();
55 private:
56 mutable QMutex mMutex;
57 QString mFile;
58 float mVolume;
59 float mFadeVolume;
60 int mFadeSeconds;
61 int mRepeatPause;
62 Phonon::MediaObject* mAudioObject;
63 Phonon::Path mPath;
64 QString mError;
65 bool mPlayedOnce; // the sound file has started playing at least once
66 bool mPausing; // currently pausing between repeats
69 #endif // MESSAGEWIN_P_H
71 // vim: et sw=4: