ScummVM API documentation
audio_channel.h
1 /* ScummVM - Graphic Adventure Engine
2  *
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.
6  *
7  * This program 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  * 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.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef ULTIMA8_AUDIO_AUDIOCHANNEL_H
23 #define ULTIMA8_AUDIO_AUDIOCHANNEL_H
24 
25 #include "audio/mixer.h"
26 
27 namespace Ultima {
28 namespace Ultima8 {
29 
30 class AudioSample;
31 
32 class AudioChannel {
33 private:
34  Audio::SoundHandle _soundHandle;
35  Audio::Mixer *_mixer;
36  int _priority;
37 
38 public:
39  AudioChannel(Audio::Mixer *mixer, uint32 sampleRate, bool stereo);
40  ~AudioChannel(void);
41 
42  void stop();
43 
44  void playSample(AudioSample *sample, int loop, int priority,
45  bool isSpeech, uint32 pitchShift, byte volume, int8 balance);
46 
47  bool isPlaying();
48 
49  void setVolume(byte volume, int8 balance) {
50  _mixer->setChannelVolume(_soundHandle, volume);
51  _mixer->setChannelBalance(_soundHandle, balance);
52  }
53 
54  void setPriority(int priority) {
55  _priority = priority;
56  }
57  int getPriority() const {
58  return _priority;
59  }
60 
61  void setPaused(bool paused);
62 };
63 
64 } // End of namespace Ultima8
65 } // End of namespace Ultima
66 
67 #endif
virtual void setChannelBalance(SoundHandle handle, int8 balance)=0
Definition: detection.h:27
Definition: mixer.h:49
virtual void setChannelVolume(SoundHandle handle, byte volume)=0
Definition: mixer.h:59
Definition: audio_channel.h:32
Definition: audio_sample.h:32