mirror of
https://github.com/zeldaret/ss
synced 2026-05-27 16:13:08 -04:00
snd_StrmSoundHandle OK
This commit is contained in:
+1
-1
@@ -1072,7 +1072,7 @@ config.libs = [
|
||||
Object(Matching, "nw4r/snd/snd_StrmFile.cpp"),
|
||||
Object(Matching, "nw4r/snd/snd_StrmPlayer.cpp"),
|
||||
Object(Matching, "nw4r/snd/snd_StrmSound.cpp"),
|
||||
Object(NonMatching, "nw4r/snd/snd_StrmSoundHandle.cpp"),
|
||||
Object(Matching, "nw4r/snd/snd_StrmSoundHandle.cpp"),
|
||||
Object(Matching, "nw4r/snd/snd_Task.cpp"),
|
||||
Object(Matching, "nw4r/snd/snd_TaskManager.cpp"),
|
||||
Object(Matching, "nw4r/snd/snd_TaskThread.cpp"),
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "common.h" // nullptr
|
||||
|
||||
#include "nw4r/snd/snd_SoundHandle.h"
|
||||
#include "nw4r/ut/ut_NonCopyable.h" // ut::NonCopyable
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -28,6 +29,7 @@ namespace nw4r { namespace snd
|
||||
// methods
|
||||
public:
|
||||
// methods
|
||||
StrmSoundHandle(SoundHandle*);
|
||||
bool IsAttachedSound() const { return mSound != nullptr; }
|
||||
|
||||
void DetachSound();
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
|
||||
#include "common.h" // nullptr
|
||||
|
||||
#include "nw4r/snd/snd_SoundHandle.h"
|
||||
#include "nw4r/snd/snd_StrmSound.h"
|
||||
#include "nw4r/ut/ut_RuntimeTypeInfo.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* functions
|
||||
@@ -19,6 +21,29 @@
|
||||
|
||||
namespace nw4r { namespace snd {
|
||||
|
||||
StrmSoundHandle::StrmSoundHandle(SoundHandle* handle)
|
||||
: mSound(nullptr)
|
||||
{
|
||||
if (!handle)
|
||||
return;
|
||||
|
||||
detail::BasicSound *basicSound = handle->detail_GetAttachedSound();
|
||||
if (!basicSound)
|
||||
return;
|
||||
|
||||
if (detail::StrmSound *sound =
|
||||
ut::DynamicCast<detail::StrmSound *>(basicSound))
|
||||
{
|
||||
|
||||
mSound = sound;
|
||||
|
||||
if (mSound->IsAttachedTempSpecialHandle())
|
||||
mSound->DetachTempSpecialHandle();
|
||||
|
||||
mSound->mTempSpecialHandle = this;
|
||||
}
|
||||
}
|
||||
|
||||
void StrmSoundHandle::DetachSound()
|
||||
{
|
||||
if (IsAttachedSound())
|
||||
|
||||
Reference in New Issue
Block a user