diff options
author | Paul Gilbert | 2015-05-31 14:45:10 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-05-31 14:45:10 -0400 |
commit | e5296ebf8dd09f603499b1894a33865ec71bb28f (patch) | |
tree | d7de032efd54dfdb3159cbc778a0c9ce8cd8aa91 /engines/mads/nebular/sound_nebular.h | |
parent | 673537bad93f0b440172a0cc263ebf19cc95ffc0 (diff) | |
parent | 141ff4d08dc24b6bb17098bd71801e2a58e6a38f (diff) | |
download | scummvm-rg350-e5296ebf8dd09f603499b1894a33865ec71bb28f.tar.gz scummvm-rg350-e5296ebf8dd09f603499b1894a33865ec71bb28f.tar.bz2 scummvm-rg350-e5296ebf8dd09f603499b1894a33865ec71bb28f.zip |
Merge branch 'master' into phantom
Diffstat (limited to 'engines/mads/nebular/sound_nebular.h')
-rw-r--r-- | engines/mads/nebular/sound_nebular.h | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/engines/mads/nebular/sound_nebular.h b/engines/mads/nebular/sound_nebular.h index abb6516030..9bc1a49458 100644 --- a/engines/mads/nebular/sound_nebular.h +++ b/engines/mads/nebular/sound_nebular.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -37,11 +37,15 @@ class SoundManager; namespace Nebular { +class ASound; + /** * Represents the data for a channel on the Adlib */ class AdlibChannel { public: + ASound *_owner; + int _activeCount; int _field1; int _field2; @@ -61,11 +65,12 @@ public: byte *_pSrc; byte *_ptr3; byte *_ptr4; + byte *_ptrEnd; int _field17; int _field19; byte *_soundData; int _field1D; - int _field1E; + int _volumeOffset; int _field1F; // TODO: Only used by asound.003. Figure out usage @@ -128,17 +133,20 @@ struct RegisterValue { #define ADLIB_CHANNEL_MIDWAY 5 #define CALLBACKS_PER_SECOND 60 +struct CachedDataEntry { + int _offset; + byte *_data; + byte *_dataEnd; +}; + /** * Base class for the sound player resource files */ class ASound : public Audio::AudioStream { private: - struct CachedDataEntry { - int _offset; - byte *_data; - }; Common::List<CachedDataEntry> _dataCache; uint16 _randomSeed; + int _masterVolume; /** * Does the initial Adlib initialisation @@ -318,6 +326,11 @@ public: virtual ~ASound(); /** + * Validates the Adlib sound files + */ + static void validate(); + + /** * Execute a player command. Most commands represent sounds to play, but some * low number commands also provide control operations. * @param commandId Player ommand to execute. @@ -345,6 +358,11 @@ public: */ int getFrameCounter() { return _frameCounter; } + /** + * Return the cached data block record for previously loaded sound data + */ + CachedDataEntry &getCachedData(byte *pData); + // AudioStream interface /** * Main buffer read @@ -365,6 +383,11 @@ public: * Return sample rate */ virtual int getRate() const { return 11025; } + + /** + * Set the volume + */ + void setVolume(int volume); }; class ASound1 : public ASound { |