ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

imuse_track.h

Go to the documentation of this file.
00001 /* ResidualVM - A 3D game interpreter
00002  *
00003  * ResidualVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef GRIM_IMUSE_TRACK_H
00024 #define GRIM_IMUSE_TRACK_H
00025 
00026 #include "engines/grim/imuse/imuse_sndmgr.h"
00027 
00028 namespace Grim {
00029 
00030 enum {
00031     kFlagUnsigned = 1 << 0,
00032     kFlag16Bits = 1 << 1,
00033     kFlagLittleEndian = 1 << 2,
00034     kFlagStereo = 1 << 3,
00035     kFlagReverseStereo = 1 << 4
00036 };
00037 
00038 struct Track {
00039     int trackId;
00040 
00041     int32 pan;
00042     int32 panFadeDest;
00043     int32 panFadeStep;
00044     int32 panFadeDelay;
00045     bool panFadeUsed;
00046     int32 vol;
00047     int32 volFadeDest;
00048     int32 volFadeStep;
00049     int32 volFadeDelay;
00050     bool volFadeUsed;
00051 
00052     char soundName[32];
00053     bool used;
00054     bool toBeRemoved;
00055     int32 priority;
00056     int32 regionOffset;
00057     int32 dataOffset;
00058     int32 curRegion;
00059     int32 curHookId;
00060     int32 volGroupId;
00061     int32 feedSize;
00062     int32 mixerFlags;
00063 
00064     ImuseSndMgr::SoundDesc *soundDesc;
00065     Audio::SoundHandle handle;
00066     Audio::QueuingAudioStream *stream;
00067 
00068     Track() : used(false), stream(NULL) {
00069         soundName[0] = 0;
00070     }
00071 
00072     /* getPan() returns -127 ... 127 */
00073     int getPan() const { return (pan != 64000) ? 2 * (pan / 1000) - 127 : 0; }
00074     int getVol() const { return vol / 1000; }
00075     Audio::Mixer::SoundType getType() const {
00076         Audio::Mixer::SoundType type = Audio::Mixer::kPlainSoundType;
00077         if (volGroupId == IMUSE_VOLGRP_VOICE)
00078             type = Audio::Mixer::kSpeechSoundType;
00079         else if (volGroupId == IMUSE_VOLGRP_SFX)
00080             type = Audio::Mixer::kSFXSoundType;
00081         else if (volGroupId == IMUSE_VOLGRP_MUSIC)
00082             type = Audio::Mixer::kMusicSoundType;
00083         else if (volGroupId == IMUSE_VOLGRP_BGND)
00084             type = Audio::Mixer::kPlainSoundType;
00085         else if (volGroupId == IMUSE_VOLGRP_ACTION)
00086             type = Audio::Mixer::kPlainSoundType;
00087         return type;
00088     }
00089 };
00090 
00091 } // end of namespace Grim
00092 
00093 #endif


Generated on Sat May 18 2019 05:01:05 for ResidualVM by doxygen 1.7.1
curved edge   curved edge