svn-id: r11686
This commit is contained in:
Max Horn 2003-12-16 15:34:17 +00:00
parent 0c681181b8
commit de51f631be
2 changed files with 15 additions and 14 deletions

View File

@ -57,22 +57,24 @@ public:
virtual ~Channel();
void destroy();
virtual void mix(int16 *data, uint len);
virtual void pause(bool paused) {
virtual bool isMusicChannel() const = 0;
void pause(bool paused) {
_paused = paused;
}
virtual bool isPaused() {
bool isPaused() {
return _paused;
}
virtual void setChannelVolume(const byte volume) {
void setChannelVolume(const byte volume) {
_volume = volume;
}
virtual void setChannelPan(const int8 pan) {
void setChannelPan(const int8 pan) {
_pan = pan;
}
virtual int getVolume() const {
int getVolume() const {
return isMusicChannel() ? _mixer->getMusicVolume() : _mixer->getVolume();
}
virtual bool isMusicChannel() const = 0;
};
class ChannelRaw : public Channel {

View File

@ -50,14 +50,13 @@ public:
};
enum {
FLAG_UNSIGNED = 1 << 0, // unsigned samples (default: signed)
FLAG_STEREO = 1 << 1, // sound is in stereo (default: mono)
FLAG_16BITS = 1 << 2, // sound is 16 bits wide (default: 8bit)
FLAG_AUTOFREE = 1 << 3, // sound buffer is freed automagically at the end of playing
FLAG_REVERSE_STEREO = 1 << 4, // reverse the left and right stereo channel
FLAG_LOOP = 1 << 5, // loop the audio
FLAG_LITTLE_ENDIAN = 1 << 6 // sample is little endian (default: big endian)
FLAG_UNSIGNED = 1 << 0, /** unsigned samples (default: signed) */
FLAG_16BITS = 1 << 1, /** sound is 16 bits wide (default: 8bit) */
FLAG_LITTLE_ENDIAN = 1 << 2, /** sample is little endian (default: big endian) */
FLAG_STEREO = 1 << 3, /** sound is in stereo (default: mono) */
FLAG_REVERSE_STEREO = 1 << 4, /** reverse the left and right stereo channel */
FLAG_AUTOFREE = 1 << 5, /** sound buffer is freed automagically at the end of playing */
FLAG_LOOP = 1 << 6 /** loop the audio */
};
private: