moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / klettres / klettres / soundfactory.h
blobcb5d2db171e91dac45205813a32b715c865bc3cb
1 /* -------------------------------------------------------------
2 From KDE Tuberling
3 mailto:e.bischoff@noos.fr
4 ------------------------------------------------------------- */
5 /*
6 * Copyright (C) 2001
7 Eric Bischoff
8 2004-2005 Anne-Marie Mahfouf <annma@kde.org>
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of version 2 of the GNU General Public
12 License as published by the Free Software Foundation.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #ifndef _SOUNDFACTORY_H_
26 #define _SOUNDFACTORY_H_
28 #include <qdom.h>
30 class KLettres;
32 /**
33 * This class manages the sounds toplay in KLettres, reading the data about the sounds
34 * in the sounds.xml file which is in /data.
36 * @short Sounds factory class: find and play the right sound.
37 * @author Anne-Marie Mahfouf <annma@kde.org>
38 * @version 1.1
41 class SoundFactory : public QObject
43 Q_OBJECT
45 public:
47 SoundFactory(KLettres *parent, const char *name);
48 ~SoundFactory();
50 ///Call the main instance of the program
51 KLettres *klettres;
52 ///Change the language when the user changes the language in the Languages menu
53 void change(QString currentLanguage);
54 ///Play the sound associated to int soundRef
55 void playSound(int ) ;
56 ///Number of sounds corresponding to the current language and level (alphabet or syllables)
57 uint sounds;
58 ///List of sound names
59 QStringList namesList;
60 ///List of sound files associated with each sound name
61 QStringList filesList;
62 /**
63 * Load the sounds of one given language
64 * Call that when you read the language from Config and when the language changes
65 * or when the level changes
67 bool loadLanguage(QDomDocument &layoutDocument, QString currentLanguage);
68 ///The language document
69 QDomDocument m_layoutsDocument;
71 private:
72 ///Report a load failure
73 void loadFailure();
77 #endif