2010-07-03 15:04:00 +02:00
|
|
|
#ifndef GAME_SOUND_SOUNDMANAGER_H
|
|
|
|
#define GAME_SOUND_SOUNDMANAGER_H
|
|
|
|
|
2012-03-27 02:50:45 -07:00
|
|
|
#include <map>
|
2015-11-30 17:42:25 +01:00
|
|
|
#include <memory>
|
2010-07-03 15:04:00 +02:00
|
|
|
#include <string>
|
2017-08-25 16:08:49 -04:00
|
|
|
#include <unordered_map>
|
2012-03-27 02:50:45 -07:00
|
|
|
#include <utility>
|
2010-07-03 15:04:00 +02:00
|
|
|
|
2016-11-27 21:19:52 +01:00
|
|
|
#include <components/fallback/fallback.hpp>
|
2020-06-28 17:17:43 +02:00
|
|
|
#include <components/misc/objectpool.hpp>
|
2024-03-12 00:40:03 +01:00
|
|
|
#include <components/misc/strings/algorithm.hpp>
|
2012-05-24 04:34:53 +02:00
|
|
|
#include <components/settings/settings.hpp>
|
2016-11-27 21:19:52 +01:00
|
|
|
|
2012-08-09 14:33:21 +02:00
|
|
|
#include "../mwbase/soundmanager.hpp"
|
2011-10-09 09:28:36 +02:00
|
|
|
|
2020-06-28 13:12:42 +02:00
|
|
|
#include "regionsoundselector.hpp"
|
2020-06-28 14:41:05 +02:00
|
|
|
#include "sound_buffer.hpp"
|
2020-07-01 18:37:31 +02:00
|
|
|
#include "type.hpp"
|
2020-07-18 23:56:14 +02:00
|
|
|
#include "watersoundupdater.hpp"
|
2020-06-28 13:12:42 +02:00
|
|
|
|
2015-04-13 22:48:37 +02:00
|
|
|
namespace VFS
|
|
|
|
{
|
|
|
|
class Manager;
|
|
|
|
}
|
|
|
|
|
2015-11-24 01:40:14 -08:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
struct Sound;
|
2020-06-28 14:52:50 +02:00
|
|
|
struct Cell;
|
2015-11-24 01:40:14 -08:00
|
|
|
}
|
|
|
|
|
2023-02-04 18:45:53 +01:00
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
class Cell;
|
|
|
|
}
|
|
|
|
|
2010-07-03 15:04:00 +02:00
|
|
|
namespace MWSound
|
|
|
|
{
|
2012-03-16 22:12:17 -07:00
|
|
|
class Sound_Output;
|
2012-03-27 00:36:53 +02:00
|
|
|
struct Sound_Decoder;
|
2021-11-04 15:56:05 -04:00
|
|
|
class SoundBase;
|
2012-03-17 02:45:18 -07:00
|
|
|
class Sound;
|
2017-09-11 21:33:18 -07:00
|
|
|
class Stream;
|
2012-03-31 10:06:12 -07:00
|
|
|
|
2020-06-28 18:25:23 +02:00
|
|
|
using SoundPtr = Misc::ObjectPtr<Sound>;
|
|
|
|
using StreamPtr = Misc::ObjectPtr<Stream>;
|
|
|
|
|
2012-08-09 14:33:21 +02:00
|
|
|
class SoundManager : public MWBase::SoundManager
|
2010-07-03 15:04:00 +02:00
|
|
|
{
|
2015-04-13 22:48:37 +02:00
|
|
|
const VFS::Manager* mVFS;
|
2012-03-16 22:12:17 -07:00
|
|
|
|
2017-04-28 17:30:26 +02:00
|
|
|
std::unique_ptr<Sound_Output> mOutput;
|
2012-03-16 22:12:17 -07:00
|
|
|
|
2020-06-28 14:41:05 +02:00
|
|
|
WaterSoundUpdater mWaterSoundUpdater;
|
|
|
|
|
2020-07-18 23:56:14 +02:00
|
|
|
SoundBufferPool mSoundBuffers;
|
2015-11-23 06:35:01 -08:00
|
|
|
|
2020-06-28 17:17:43 +02:00
|
|
|
Misc::ObjectPool<Sound> mSounds;
|
2017-09-11 21:33:18 -07:00
|
|
|
|
2020-06-28 17:17:43 +02:00
|
|
|
Misc::ObjectPool<Stream> mStreams;
|
2017-09-11 21:33:18 -07:00
|
|
|
|
2020-06-28 18:25:23 +02:00
|
|
|
typedef std::pair<SoundPtr, Sound_Buffer*> SoundBufferRefPair;
|
2015-11-26 01:26:33 -08:00
|
|
|
typedef std::vector<SoundBufferRefPair> SoundBufferRefPairList;
|
2022-05-20 23:07:50 +02:00
|
|
|
|
|
|
|
struct ActiveSound
|
|
|
|
{
|
|
|
|
const MWWorld::CellStore* mCell = nullptr;
|
|
|
|
SoundBufferRefPairList mList;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::map<const MWWorld::LiveCellRefBase*, ActiveSound> SoundMap;
|
2012-03-18 11:17:45 -07:00
|
|
|
SoundMap mActiveSounds;
|
2012-03-17 08:02:46 -07:00
|
|
|
|
2022-05-20 23:07:50 +02:00
|
|
|
struct SaySound
|
|
|
|
{
|
|
|
|
const MWWorld::CellStore* mCell;
|
|
|
|
StreamPtr mStream;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::map<const MWWorld::LiveCellRefBase*, SaySound> SaySoundMap;
|
2019-05-26 14:55:29 +03:00
|
|
|
SaySoundMap mSaySoundsQueue;
|
2015-11-23 04:00:10 -08:00
|
|
|
SaySoundMap mActiveSaySounds;
|
|
|
|
|
2020-06-28 18:25:23 +02:00
|
|
|
typedef std::vector<StreamPtr> TrackList;
|
2015-12-01 11:28:37 -08:00
|
|
|
TrackList mActiveTracks;
|
|
|
|
|
2020-06-28 18:25:23 +02:00
|
|
|
StreamPtr mMusic;
|
2024-06-02 09:29:28 +04:00
|
|
|
MusicType mMusicType;
|
2013-08-27 13:48:20 -07:00
|
|
|
|
2014-06-25 18:10:26 +02:00
|
|
|
bool mListenerUnderwater;
|
2015-05-12 19:02:56 +02:00
|
|
|
osg::Vec3f mListenerPos;
|
|
|
|
osg::Vec3f mListenerDir;
|
|
|
|
osg::Vec3f mListenerUp;
|
2012-08-09 17:01:03 +04:00
|
|
|
|
2020-04-05 18:10:05 +04:00
|
|
|
int mPausedSoundTypes[BlockerType::MaxCount] = {};
|
2012-12-18 04:35:24 -08:00
|
|
|
|
2017-09-11 21:33:18 -07:00
|
|
|
Sound* mUnderwaterSound;
|
|
|
|
Sound* mNearWaterSound;
|
2015-12-01 11:28:37 -08:00
|
|
|
|
2024-04-14 19:51:48 +02:00
|
|
|
VFS::Path::Normalized mNextMusic;
|
2020-03-31 13:15:26 +04:00
|
|
|
bool mPlaybackPaused;
|
|
|
|
|
2020-06-28 13:12:42 +02:00
|
|
|
RegionSoundSelector mRegionSoundSelector;
|
|
|
|
|
2020-10-28 18:02:31 +04:00
|
|
|
float mTimePassed;
|
2020-06-28 13:49:05 +02:00
|
|
|
|
2023-02-04 18:45:53 +01:00
|
|
|
const MWWorld::Cell* mLastCell;
|
2020-06-28 14:52:50 +02:00
|
|
|
|
2020-10-25 12:20:14 +01:00
|
|
|
Sound* mCurrentRegionSound;
|
|
|
|
|
2015-11-26 01:26:33 -08:00
|
|
|
Sound_Buffer* insertSound(const std::string& soundId, const ESM::Sound* sound);
|
2015-11-24 01:40:14 -08:00
|
|
|
|
2018-10-18 14:59:39 +04:00
|
|
|
// returns a decoder to start streaming, or nullptr if the sound was not found
|
2024-02-22 23:44:12 +01:00
|
|
|
DecoderPtr loadVoice(VFS::Path::NormalizedView voicefile);
|
2015-11-22 04:53:24 -08:00
|
|
|
|
2020-06-28 18:25:23 +02:00
|
|
|
SoundPtr getSoundRef();
|
|
|
|
StreamPtr getStreamRef();
|
2017-09-11 21:33:18 -07:00
|
|
|
|
2020-06-28 18:25:23 +02:00
|
|
|
StreamPtr playVoice(DecoderPtr decoder, const osg::Vec3f& pos, bool playlocal);
|
2015-11-27 09:47:14 -08:00
|
|
|
|
2024-04-14 19:51:48 +02:00
|
|
|
void streamMusicFull(VFS::Path::NormalizedView filename);
|
|
|
|
void advanceMusic(VFS::Path::NormalizedView filename, float fadeOut = 1.f);
|
2017-08-06 20:10:56 +02:00
|
|
|
|
2021-11-04 15:56:05 -04:00
|
|
|
void cull3DSound(SoundBase* sound);
|
|
|
|
|
2023-07-19 17:21:17 +04:00
|
|
|
bool remove3DSoundAtDistance(PlayMode mode, const MWWorld::ConstPtr& ptr) const;
|
|
|
|
|
|
|
|
Sound* playSound(Sound_Buffer* sfx, float volume, float pitch, Type type = Type::Sfx,
|
|
|
|
PlayMode mode = PlayMode::Normal, float offset = 0);
|
|
|
|
Sound* playSound3D(const MWWorld::ConstPtr& ptr, Sound_Buffer* sfx, float volume, float pitch, Type type,
|
|
|
|
PlayMode mode, float offset);
|
|
|
|
|
2012-03-21 19:21:36 -07:00
|
|
|
void updateSounds(float duration);
|
2012-03-17 06:18:59 -07:00
|
|
|
void updateRegionSound(float duration);
|
2020-06-28 13:50:02 +02:00
|
|
|
void updateWaterSound();
|
2017-08-06 20:10:56 +02:00
|
|
|
void updateMusic(float duration);
|
|
|
|
|
2020-06-28 15:38:30 +02:00
|
|
|
enum class WaterSoundAction
|
|
|
|
{
|
|
|
|
DoNothing,
|
|
|
|
SetVolume,
|
|
|
|
FinishSound,
|
|
|
|
PlaySound,
|
|
|
|
};
|
|
|
|
|
|
|
|
std::pair<WaterSoundAction, Sound_Buffer*> getWaterSoundAction(
|
2023-02-04 18:45:53 +01:00
|
|
|
const WaterSoundUpdate& update, const MWWorld::Cell* cell) const;
|
2020-06-28 15:38:30 +02:00
|
|
|
|
2012-03-24 03:49:03 -07:00
|
|
|
SoundManager(const SoundManager& rhs);
|
|
|
|
SoundManager& operator=(const SoundManager& rhs);
|
|
|
|
|
2012-03-17 23:30:43 -07:00
|
|
|
protected:
|
|
|
|
DecoderPtr getDecoder();
|
|
|
|
friend class OpenAL_Output;
|
|
|
|
|
2018-05-07 20:40:53 +04:00
|
|
|
void stopSound(Sound_Buffer* sfx, const MWWorld::ConstPtr& ptr);
|
|
|
|
///< Stop the given object from playing given sound buffer.
|
|
|
|
|
2012-03-16 22:12:17 -07:00
|
|
|
public:
|
2019-01-22 10:08:48 +04:00
|
|
|
SoundManager(const VFS::Manager* vfs, bool useSound);
|
2021-03-29 19:44:10 +02:00
|
|
|
~SoundManager() override;
|
2012-03-07 02:20:15 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void processChangedSettings(const Settings::CategorySettingVector& settings) override;
|
2012-05-24 04:34:53 +02:00
|
|
|
|
2023-09-14 12:54:20 +04:00
|
|
|
bool isEnabled() const override { return mOutput->isInitialized(); }
|
|
|
|
///< Returns true if sound system is enabled
|
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void stopMusic() override;
|
2012-03-16 22:12:17 -07:00
|
|
|
///< Stops music if it's playing
|
2012-03-07 17:46:51 +02:00
|
|
|
|
2024-06-02 13:18:06 +04:00
|
|
|
MWSound::MusicType getMusicType() const override { return mMusicType; }
|
|
|
|
|
2024-04-14 19:51:48 +02:00
|
|
|
void streamMusic(VFS::Path::NormalizedView filename, MWSound::MusicType type, float fade = 1.f) override;
|
2012-03-16 22:12:17 -07:00
|
|
|
///< Play a soundifle
|
2023-08-18 11:03:37 +04:00
|
|
|
/// \param filename name of a sound file in the data directory.
|
|
|
|
/// \param type music type.
|
|
|
|
/// \param fade time in seconds to fade out current track before start this one.
|
2012-03-07 02:20:15 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
bool isMusicPlaying() override;
|
2012-03-16 22:12:17 -07:00
|
|
|
///< Returns true if music is playing
|
2011-06-11 20:01:21 -04:00
|
|
|
|
2024-02-22 23:44:12 +01:00
|
|
|
void say(const MWWorld::ConstPtr& reference, VFS::Path::NormalizedView filename) override;
|
2012-03-16 22:12:17 -07:00
|
|
|
///< Make an actor say some text.
|
2023-07-19 17:21:17 +04:00
|
|
|
/// \param filename name of a sound file in the VFS
|
2011-06-15 22:33:31 +02:00
|
|
|
|
2024-02-22 23:44:12 +01:00
|
|
|
void say(VFS::Path::NormalizedView filename) override;
|
2012-05-01 20:30:31 -07:00
|
|
|
///< Say some text, without an actor ref
|
2023-07-19 17:21:17 +04:00
|
|
|
/// \param filename name of a sound file in the VFS
|
2012-05-01 20:30:31 -07:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
bool sayActive(const MWWorld::ConstPtr& reference = MWWorld::ConstPtr()) const override;
|
2012-03-16 22:12:17 -07:00
|
|
|
///< Is actor not speaking?
|
2011-06-15 22:33:31 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
bool sayDone(const MWWorld::ConstPtr& reference = MWWorld::ConstPtr()) const override;
|
2019-09-06 09:19:41 +04:00
|
|
|
///< For scripting backward compatibility
|
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void stopSay(const MWWorld::ConstPtr& reference = MWWorld::ConstPtr()) override;
|
2012-05-01 20:30:31 -07:00
|
|
|
///< Stop an actor speaking
|
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
float getSaySoundLoudness(const MWWorld::ConstPtr& reference) const override;
|
2014-07-29 00:26:26 +02:00
|
|
|
///< Check the currently playing say sound for this actor
|
|
|
|
/// and get an average loudness value (scale [0,1]) at the current time position.
|
|
|
|
/// If the actor is not saying anything, returns 0.
|
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
Stream* playTrack(const DecoderPtr& decoder, Type type) override;
|
2012-12-13 00:05:57 -08:00
|
|
|
///< Play a 2D audio track, using a custom decoder
|
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void stopTrack(Stream* stream) override;
|
2015-11-30 05:42:51 -08:00
|
|
|
///< Stop the given audio track from playing
|
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
double getTrackTimeDelay(Stream* stream) override;
|
2015-11-30 05:42:51 -08:00
|
|
|
///< Retives the time delay, in seconds, of the audio track (must be a sound
|
|
|
|
/// returned by \ref playTrack). Only intended to be called by the track
|
|
|
|
/// decoder's read method.
|
|
|
|
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
Sound* playSound(const ESM::RefId& soundId, float volume, float pitch, Type type = Type::Sfx,
|
2022-05-21 01:21:55 +02:00
|
|
|
PlayMode mode = PlayMode::Normal, float offset = 0) override;
|
2012-03-16 22:12:17 -07:00
|
|
|
///< Play a sound, independently of 3D-position
|
2015-11-26 23:40:02 -08:00
|
|
|
///< @param offset Number of seconds into the sound to start playback.
|
2010-10-31 12:23:03 -04:00
|
|
|
|
2023-07-19 17:21:17 +04:00
|
|
|
Sound* playSound(std::string_view fileName, float volume, float pitch, Type type = Type::Sfx,
|
|
|
|
PlayMode mode = PlayMode::Normal, float offset = 0) override;
|
|
|
|
///< Play a sound, independently of 3D-position
|
|
|
|
///< @param offset Number of seconds into the sound to start playback.
|
|
|
|
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
Sound* playSound3D(const MWWorld::ConstPtr& reference, const ESM::RefId& soundId, float volume, float pitch,
|
2020-10-16 22:18:54 +04:00
|
|
|
Type type = Type::Sfx, PlayMode mode = PlayMode::Normal, float offset = 0) override;
|
2014-05-16 13:09:23 +02:00
|
|
|
///< Play a 3D sound attached to an MWWorld::Ptr. Will be updated automatically with the Ptr's position, unless
|
|
|
|
///< Play_NoTrack is specified.
|
2015-11-26 23:40:02 -08:00
|
|
|
///< @param offset Number of seconds into the sound to start playback.
|
2014-05-16 13:09:23 +02:00
|
|
|
|
2023-07-19 17:21:17 +04:00
|
|
|
Sound* playSound3D(const MWWorld::ConstPtr& reference, std::string_view fileName, float volume, float pitch,
|
|
|
|
Type type = Type::Sfx, PlayMode mode = PlayMode::Normal, float offset = 0) override;
|
|
|
|
///< Play a 3D sound attached to an MWWorld::Ptr. Will be updated automatically with the Ptr's position, unless
|
|
|
|
///< Play_NoTrack is specified.
|
|
|
|
///< @param offset Number of seconds into the sound to start playback.
|
|
|
|
|
2022-10-18 09:26:55 +02:00
|
|
|
Sound* playSound3D(const osg::Vec3f& initialPos, const ESM::RefId& soundId, float volume, float pitch,
|
|
|
|
Type type, PlayMode mode, float offset = 0) override;
|
2015-11-24 23:24:42 -08:00
|
|
|
///< Play a 3D sound at \a initialPos. If the sound should be moving, it must be updated using
|
|
|
|
///< Sound::setPosition.
|
2015-11-26 23:40:02 -08:00
|
|
|
///< @param offset Number of seconds into the sound to start playback.
|
2012-03-07 17:46:51 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void stopSound(Sound* sound) override;
|
2015-11-30 05:42:51 -08:00
|
|
|
///< Stop the given sound from playing
|
2015-12-05 01:54:16 +01:00
|
|
|
/// @note no-op if \a sound is null
|
2015-11-30 05:42:51 -08:00
|
|
|
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
void stopSound3D(const MWWorld::ConstPtr& reference, const ESM::RefId& soundId) override;
|
2023-07-19 17:21:17 +04:00
|
|
|
///< Stop the given object from playing the given sound.
|
|
|
|
|
|
|
|
void stopSound3D(const MWWorld::ConstPtr& reference, std::string_view fileName) override;
|
|
|
|
///< Stop the given object from playing the given sound.
|
2012-03-27 03:20:50 -07:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void stopSound3D(const MWWorld::ConstPtr& reference) override;
|
2012-03-27 03:20:50 -07:00
|
|
|
///< Stop the given object from playing all sounds.
|
2012-03-07 17:46:51 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void stopSound(const MWWorld::CellStore* cell) override;
|
2012-03-16 22:12:17 -07:00
|
|
|
///< Stop all sounds for the given cell.
|
2010-08-14 07:54:51 +02:00
|
|
|
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
void fadeOutSound3D(const MWWorld::ConstPtr& reference, const ESM::RefId& soundId, float duration) override;
|
2013-07-26 18:43:06 +02:00
|
|
|
///< Fade out given sound (that is already playing) of given object
|
|
|
|
///< @param reference Reference to object, whose sound is faded out
|
|
|
|
///< @param soundId ID of the sound to fade out.
|
|
|
|
///< @param duration Time until volume reaches 0.
|
|
|
|
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
bool getSoundPlaying(const MWWorld::ConstPtr& reference, const ESM::RefId& soundId) const override;
|
2012-03-16 22:12:17 -07:00
|
|
|
///< Is the given sound currently playing on the given object?
|
2010-08-14 07:54:51 +02:00
|
|
|
|
2023-07-19 17:21:17 +04:00
|
|
|
bool getSoundPlaying(const MWWorld::ConstPtr& reference, std::string_view fileName) const override;
|
|
|
|
///< Is the given sound currently playing on the given object?
|
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void pauseSounds(MWSound::BlockerType blocker, int types = int(Type::Mask)) override;
|
2012-12-12 02:33:12 -08:00
|
|
|
///< Pauses all currently playing sounds, including music.
|
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void resumeSounds(MWSound::BlockerType blocker) override;
|
2012-12-12 02:33:12 -08:00
|
|
|
///< Resumes all previously paused sounds.
|
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void pausePlayback() override;
|
|
|
|
void resumePlayback() override;
|
2020-03-31 13:15:26 +04:00
|
|
|
|
2022-05-06 18:23:57 +02:00
|
|
|
void update(float duration);
|
2012-08-09 17:01:03 +04:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void setListenerPosDir(
|
|
|
|
const osg::Vec3f& pos, const osg::Vec3f& dir, const osg::Vec3f& up, bool underwater) override;
|
2014-01-20 12:05:13 +01:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void updatePtr(const MWWorld::ConstPtr& old, const MWWorld::ConstPtr& updated) override;
|
2014-02-01 18:16:32 +01:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void clear() override;
|
2012-03-16 22:12:17 -07:00
|
|
|
};
|
2010-07-03 15:04:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|