Speech bubbles can point down right.
[scummvm-innocent.git] / sound / audiocd.h
blob4c4ff26147060a0010dec293d4933f4fc03d8a96
1 /* ScummVM - Graphic Adventure Engine
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program 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.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 * $URL$
22 * $Id$
26 #ifndef SOUND_AUDIOCD_H
27 #define SOUND_AUDIOCD_H
29 #include "common/scummsys.h"
30 #include "common/singleton.h"
31 #include "sound/mixer.h"
34 namespace Audio {
37 class AudioCDManager : public Common::Singleton<AudioCDManager> {
38 public:
39 struct Status {
40 bool playing;
41 int track;
42 int start;
43 int duration;
44 int numLoops;
47 /**
48 * Start playback of the specified "CD" track. This method mimics
49 * the interface of OSystem::playCD (which it in fact may call, if an Audio CD is
50 * present), but also can play digital audio tracks in various formats.
52 * @param track the track to play.
53 * @param num_loops how often playback should be repeated (-1 = infinitely often).
54 * @param start_frame the frame at which playback should start (75 frames = 1 second).
55 * @param duration the number of frames to play (0: play until end)
56 * @param only_emulate if true, don't try to play from a real CD
58 void play(int track, int numLoops, int startFrame, int duration, bool only_emulate = false);
59 void stop();
60 bool isPlaying() const;
62 void updateCD();
64 Status getStatus() const;
66 private:
67 friend class Common::Singleton<SingletonBaseType>;
68 AudioCDManager();
70 /* used for emulated CD music */
71 SoundHandle _handle;
72 bool _emulating;
74 Status _cd;
75 Mixer *_mixer;
78 /** Shortcut for accessing the audio CD manager. */
79 #define AudioCD Audio::AudioCDManager::instance()
81 } // End of namespace Audio
83 #endif