• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

kgoldrunner

  • sources
  • kde-4.14
  • kdegames
  • kgoldrunner
  • src
kgrsounds.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright 2011 Ian Wadham <iandw.au at gmail dot com>
3  * Copyright 2007 Luciano Montanaro <mikelima@cirulla.net> *
4  * *
5  * This program is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU General Public License as *
7  * published by the Free Software Foundation; either version 2 of *
8  * the License, or (at your option) any later version. *
9  * *
10  * This program 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 *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17  ****************************************************************************/
18 
19 #ifndef KGRSOUNDS_H
20 #define KGRSOUNDS_H
21 
22 #include <QObject>
23 #include <QVector>
24 #include <QTime>
25 
26 #include <kgsound.h>
27 
28 class KGrSounds : public QObject
29 {
30  Q_OBJECT
31 public:
32 
36  KGrSounds();
37  ~KGrSounds();
38 
44  int play (int effect);
45 
49  void stop (int token);
50 
55  int loadSound (const QString &fileName);
56 
60  void setTimedSound (int i);
61 
65  void reset();
66 
70  void stopAllSounds();
71 
76  void setEffectsVolume (double volume);
77 
82  void setMusicVolume (double volume);
83 
84  void setMuted (bool mute);
85 
90  void setVolume (int effect, qreal volume);
91 
92 private:
93  QVector<KgSound *> sounds;
94  QVector<int> startTime; // Start times of timed sounds, else 0.
95  bool muted;
96  QTime t;
97 };
98 
99 #endif // KGRSOUNDS_H
KGrSounds::setEffectsVolume
void setEffectsVolume(double volume)
Set volume for the sound effects.
KGrSounds::stop
void stop(int token)
Stop playing the sound associated with the given token.
Definition: kgrsounds.cpp:84
KGrSounds::KGrSounds
KGrSounds()
Construct the KGrSounds class.
Definition: kgrsounds.cpp:23
QTime
QObject
KGrSounds::~KGrSounds
~KGrSounds()
Definition: kgrsounds.cpp:30
KGrSounds
Definition: kgrsounds.h:28
QString
KGrSounds::play
int play(int effect)
Play a sound effect.
Definition: kgrsounds.cpp:60
KGrSounds::setMuted
void setMuted(bool mute)
Definition: kgrsounds.cpp:91
QVector< KgSound * >
KGrSounds::setMusicVolume
void setMusicVolume(double volume)
Set volume for the background music.
KGrSounds::stopAllSounds
void stopAllSounds()
Stop all sounds currently playing.
Definition: kgrsounds.cpp:47
KGrSounds::setTimedSound
void setTimedSound(int i)
Set up a sound to have its latest start-time recorded.
Definition: kgrsounds.cpp:42
KGrSounds::reset
void reset()
Stop sound and discard the loaded sound effects.
Definition: kgrsounds.cpp:54
KGrSounds::loadSound
int loadSound(const QString &fileName)
Load a sound sample.
Definition: kgrsounds.cpp:34
KGrSounds::setVolume
void setVolume(int effect, qreal volume)
Change the volume of one type of sound (e.g.
Definition: kgrsounds.cpp:99
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:24 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kgoldrunner

Skip menu "kgoldrunner"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal