OpenXcom  1.0
Open-source clone of the original X-Com
Music.h
1 #pragma once
2 /*
3  * Copyright 2010-2016 OpenXcom Developers.
4  *
5  * This file is part of OpenXcom.
6  *
7  * OpenXcom is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * OpenXcom is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #include <string>
21 #include <SDL_mixer.h>
22 
23 namespace OpenXcom
24 {
25 
30 class Music
31 {
32 private:
33  Mix_Music *_music;
34 public:
36  Music();
38  virtual ~Music();
40  virtual void load(const std::string &filename);
42  virtual void load(const void *data, int size);
44  virtual void play(int loop = -1) const;
46  static void stop();
48  static void pause();
50  static void resume();
52  static bool isPlaying();
53 };
54 
55 }
virtual ~Music()
Cleans up the music track.
Definition: Music.cpp:40
Container for music tracks.
Definition: Music.h:30
virtual void play(int loop=-1) const
Plays the music.
Definition: Music.cpp:86
static void pause()
Pauses all music.
Definition: Music.cpp:121
virtual void load(const std::string &filename)
Loads music from the specified file.
Definition: Music.cpp:52
static void stop()
Stops all music.
Definition: Music.cpp:106
static void resume()
Resumes all music.
Definition: Music.cpp:136
Music()
Creates a blank music track.
Definition: Music.cpp:33
static bool isPlaying()
Checks if music is playing.
Definition: Music.cpp:151
Definition: BaseInfoState.cpp:40