1 | /*************************************************************************** |
2 | * KBlocks, a falling blocks game for KDE * |
3 | * Copyright (C) 2009 Mauricio Piacentini <mauricio@tabuleiro.com> * |
4 | * Zhongjie Cai <squall.leonhart.cai@gmail.com> * |
5 | * * |
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. * |
10 | ***************************************************************************/ |
11 | #ifndef KBLOCKSSOUND_H |
12 | #define KBLOCKSSOUND_H |
13 | |
14 | class KGameTheme; |
15 | #include <QHash> |
16 | #include <Phonon/MediaObject> |
17 | |
18 | class KBlocksSound |
19 | { |
20 | public: |
21 | explicit KBlocksSound( const QString& themeFile ); |
22 | virtual ~KBlocksSound(); |
23 | |
24 | public: |
25 | bool loadTheme ( const QString& themeFile ); |
26 | void readThemeValues(); |
27 | void setSoundsEnabled(bool p_enabled); |
28 | void playSound(const QString& p_sound); |
29 | KGameTheme * theme() { return m_theme; } |
30 | |
31 | private: |
32 | KGameTheme * m_theme; |
33 | QString sndDirectory; |
34 | Phonon::MediaObject* m_media1; |
35 | Phonon::MediaObject* m_media2; |
36 | bool sndActive; |
37 | |
38 | }; |
39 | |
40 | |
41 | |
42 | #endif |
43 | |