2013-06-25 16:50:27 -04:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* 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.
|
2014-02-18 02:34:20 +01:00
|
|
|
*
|
2013-06-25 16:50:27 -04:00
|
|
|
* 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.
|
2014-02-18 02:34:20 +01:00
|
|
|
*
|
2013-06-25 16:50:27 -04:00
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FULLPIPE_SOUND_H
|
|
|
|
#define FULLPIPE_SOUND_H
|
|
|
|
|
2017-11-12 10:16:34 -06:00
|
|
|
#include "common/array.h"
|
|
|
|
#include "common/ptr.h"
|
|
|
|
|
2016-04-14 17:43:56 +03:00
|
|
|
namespace Audio {
|
|
|
|
class SoundHandle;
|
|
|
|
}
|
|
|
|
|
2013-06-25 16:50:27 -04:00
|
|
|
namespace Fullpipe {
|
|
|
|
|
|
|
|
class Sound : public MemoryObject {
|
|
|
|
int _id;
|
|
|
|
int _directSoundBuffer;
|
|
|
|
int _directSoundBuffers[7];
|
|
|
|
byte *_soundData;
|
2016-04-14 17:43:56 +03:00
|
|
|
Audio::SoundHandle *_handle;
|
2014-04-26 16:25:01 +03:00
|
|
|
int _volume;
|
2013-06-25 16:50:27 -04:00
|
|
|
|
2014-04-19 17:01:29 +03:00
|
|
|
public:
|
|
|
|
int16 _objectId;
|
|
|
|
|
2014-01-08 18:48:34 +02:00
|
|
|
public:
|
2013-06-25 16:50:27 -04:00
|
|
|
Sound();
|
2014-01-08 18:48:34 +02:00
|
|
|
virtual ~Sound();
|
|
|
|
|
2013-10-01 00:12:04 +03:00
|
|
|
virtual bool load(MfcArchive &file, NGIArchive *archive);
|
2013-10-01 01:04:25 +03:00
|
|
|
virtual bool load(MfcArchive &file) { assert(0); return false; } // Disable base class
|
2013-07-20 21:28:32 +03:00
|
|
|
void updateVolume();
|
2014-01-03 16:03:27 +02:00
|
|
|
int getId() const { return _id; }
|
2016-04-14 17:43:56 +03:00
|
|
|
Audio::SoundHandle *getHandle() const { return _handle; }
|
2013-08-19 23:19:00 +03:00
|
|
|
|
2014-04-26 16:25:01 +03:00
|
|
|
void play(int flag);
|
|
|
|
void freeSound();
|
|
|
|
int getVolume();
|
|
|
|
void stop();
|
|
|
|
|
2013-08-19 23:19:00 +03:00
|
|
|
void setPanAndVolumeByStaticAni();
|
2014-04-19 17:01:29 +03:00
|
|
|
void setPanAndVolume(int vol, int pan);
|
2013-06-25 16:50:27 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
class SoundList : public CObject {
|
2017-11-12 10:16:34 -06:00
|
|
|
Common::Array<Sound> _soundItems;
|
|
|
|
Common::ScopedPtr<NGIArchive> _libHandle;
|
2013-06-25 16:50:27 -04:00
|
|
|
|
|
|
|
public:
|
2017-03-24 00:35:37 +02:00
|
|
|
virtual bool load(MfcArchive &file, const Common::String &fname);
|
2013-10-01 01:04:25 +03:00
|
|
|
virtual bool load(MfcArchive &file) { assert(0); return false; } // Disable base class
|
2017-03-24 00:35:37 +02:00
|
|
|
bool loadFile(const Common::String &fname, const Common::String &libname);
|
2013-07-20 21:28:32 +03:00
|
|
|
|
2017-11-12 10:16:34 -06:00
|
|
|
int getCount() { return _soundItems.size(); }
|
|
|
|
Sound &getSoundByIndex(int idx) { return _soundItems[idx]; }
|
2014-04-26 21:58:20 +03:00
|
|
|
Sound *getSoundItemById(int id);
|
2013-06-25 16:50:27 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Fullpipe
|
|
|
|
|
|
|
|
#endif /* FULLPIPE_SOUND_H */
|