CriWare Unreal Engine
Plug-ins for CriWare solutions.
Loading...
Searching...
No Matches
UAtomWavePlayer Class Reference

#include <AtomWavePlayer.h>

Inheritance diagram for UAtomWavePlayer:

Public Member Functions

 UAtomWavePlayer (const FObjectInitializer &ObjectInitializer)
virtual ~UAtomWavePlayer ()
void AdjustVolume (float AdjustVolumeDuration, float AdjustVolumeLevel)
virtual void BeginDestroy () override
UAtomRackBase * GetAtomRack () const
FString GetDesc ()
virtual FString GetDetailedInfoInternal () const override
EAtomWavePlayState GetPlayState () const
UAtomSoundBase * GetSound () const
UAtomSoundBank * GetSoundBank () const
TStatId GetStatId () const override
FTimespan GetTime () const
FAtomWaveInfo GetWaveInfo () const
UWorld * GetWorld () const override
void HandleNativePlayerOnDecode (CriAtomPcmFormat format, CriSint32 num_channels, CriSint32 num_samples, void *data[])
void HandleNativePlayerOnStatusChanged (CriAtomPlayerStatus Status)
bool HasError () const
bool IsLooping () const
bool IsPaused () const
bool IsPlaying () const
bool IsTickable () const override
bool IsTickableInEditor () const override
bool IsTickableWhenPaused () const override
void Play (float StartTime=0.0f)
virtual void PostLoad () override
FORCEINLINE void RegisterFilterDataFunction (FAtomPcmFilterFunction Function)
virtual void Serialize (FArchive &Ar) override
void SetCue (UAtomSoundCue *InSoundCue)
bool SetLooping (bool Looping)
void SetPaused (bool bPause=true)
void SetWave (UAtomSoundWave *InSoundWave)
void Stop ()
void StopDelayed (float DelayTime)
void Tick (float DeltaTime) override

Public Attributes

TObjectPtr< UAtomRackBase > AtomRack
uint8 bIsFadingOut: 1
uint8 bIsPaused: 1
uint8 bIsPreviewSound: 1
uint8 bIsUISound: 1
uint8 bUsePCMFilter: 1
float FadeInTimeDuration
FOnWaveFinished OnWaveFinished
FOnWaveFinishedNative OnWaveFinishedNative
FOnWavePlaybackPercent OnWavePlaybackPercent
FOnWavePlaybackPercentNative OnWavePlaybackPercentNative
TObjectPtr< UAtomSoundBase > Sound
float TimeAtomWavePlayed
FAtomWaveInfo WaveInfo

Protected Member Functions

void PlayInternal (const float StartTime=0.0f, const float FadeInDuration=0.0f, const float FadeVolumeLevel=1.0f)

Protected Attributes

uint8 bIsRequestPlaying: 1
uint8 bIsSoundLoading: 1
uint32 bLoop: 1
CriAtomPlayerHn NativePlayer
float PlayFadeInDuration
float PlayFadeVolumeLevel
float PlayStartTime

Private Member Functions

void CacheWaveInfo ()
void PlaybackCompleted (bool bFailedToStart)

Private Attributes

FOnAtomWavePlayerStateChanged AtomWavePlayerStateChanged
FAtomPcmFilterFunction FilterDataFunction

Detailed Description

Native delegate that is invoked when PCM data need to be filtered out. Implements an Atom wave player asset that can play Atom waves.

Constructor & Destructor Documentation

◆ UAtomWavePlayer()

UAtomWavePlayer::UAtomWavePlayer ( const FObjectInitializer & ObjectInitializer)

◆ ~UAtomWavePlayer()

UAtomWavePlayer::~UAtomWavePlayer ( )
virtual

Member Function Documentation

◆ AdjustVolume()

void UAtomWavePlayer::AdjustVolume ( float AdjustVolumeDuration,
float AdjustVolumeLevel )

This will allow one to adjust the volume on the fly

◆ BeginDestroy()

void UAtomWavePlayer::BeginDestroy ( )
overridevirtual

◆ CacheWaveInfo()

void UAtomWavePlayer::CacheWaveInfo ( )
private

Called to get WaveformInfo from Atom native player.

◆ GetAtomRack()

UAtomRackBase * UAtomWavePlayer::GetAtomRack ( ) const
inline

An array of rack sends. Audio from this sound will send a portion of its audio to these racks. Returns the SoundSubmix used for this sound.

◆ GetDesc()

FString UAtomWavePlayer::GetDesc ( )
inline

◆ GetDetailedInfoInternal()

FString UAtomWavePlayer::GetDetailedInfoInternal ( ) const
overridevirtual

◆ GetPlayState()

EAtomWavePlayState UAtomWavePlayer::GetPlayState ( ) const

Returns the enumerated play states of the audio component.

◆ GetSound()

UAtomSoundBase * UAtomWavePlayer::GetSound ( ) const
inline

◆ GetSoundBank()

UAtomSoundBank * UAtomWavePlayer::GetSoundBank ( ) const

◆ GetStatId()

TStatId UAtomWavePlayer::GetStatId ( ) const
inlineoverride

◆ GetTime()

FTimespan UAtomWavePlayer::GetTime ( ) const
inline

Get the movie's current playback rate.

Returns
The playback rate.
See also
SetRate, SupportsRate Changes the movie's playback rate.
Parameters
RateThe playback rate to set.
Returns
true on success, false otherwise.
See also
GetRate, SupportsRate Get the Mana current total playback time.
Returns
Playback time.
See also
GetMovieTime, GetDuration, Seek

◆ GetWaveInfo()

FAtomWaveInfo UAtomWavePlayer::GetWaveInfo ( ) const
inline

◆ GetWorld()

UWorld * UAtomWavePlayer::GetWorld ( ) const
inlineoverride

◆ HandleNativePlayerOnDecode()

void UAtomWavePlayer::HandleNativePlayerOnDecode ( CriAtomPcmFormat format,
CriSint32 num_channels,
CriSint32 num_samples,
void * data[] )

◆ HandleNativePlayerOnStatusChanged()

void UAtomWavePlayer::HandleNativePlayerOnStatusChanged ( CriAtomPlayerStatus Status)

Returns the sound submix sends for this sound. Get an event delegate that is invoked when a Mana event occurred.

Returns
The delegate. Get an event delegate that is invoked when a next movie frame was sent to RenderThread.

This delegate if fired only once then removed automatically.

Returns
The delegate.

◆ HasError()

bool UAtomWavePlayer::HasError ( ) const

Check whether the player is in an error state.

When the player is in an error state, no further operations are possible. The current wave must be stopped, and a new wave source must be set before the player can be used again. Errors are usually caused by faulty sound files or interrupted network connections.

Returns
true if player is in an error state, false otherwise.

◆ IsLooping()

bool UAtomWavePlayer::IsLooping ( ) const
inline

Check whether playback is looping.

Returns
true if looping, false otherwise.
See also
IsPaused, IsPlaying, SetLooping

◆ IsPaused()

bool UAtomWavePlayer::IsPaused ( ) const
inline

Check whether playback is currently paused.

Returns
true if playback is paused, false otherwise.
See also
IsLooping, IsPaused, IsPlaying, Pause

◆ IsPlaying()

bool UAtomWavePlayer::IsPlaying ( ) const
inline

Check whether playback has started.

Returns
true if playback has started, false otherwise.
See also
IsLooping, IsPaused, IsPlaying, Play

◆ IsTickable()

bool UAtomWavePlayer::IsTickable ( ) const
override

◆ IsTickableInEditor()

bool UAtomWavePlayer::IsTickableInEditor ( ) const
inlineoverride

◆ IsTickableWhenPaused()

bool UAtomWavePlayer::IsTickableWhenPaused ( ) const
inlineoverride

◆ Play()

void UAtomWavePlayer::Play ( float StartTime = 0.0f)

Start a sound playing on an audio component

◆ PlaybackCompleted()

void UAtomWavePlayer::PlaybackCompleted ( bool bFailedToStart)
private

Called to inform that playback is finished.

◆ PlayInternal()

void UAtomWavePlayer::PlayInternal ( const float StartTime = 0.0f,
const float FadeInDuration = 0.0f,
const float FadeVolumeLevel = 1.0f )
protected

Utility function called by Play and FadeIn to start a sound playing.

◆ PostLoad()

void UAtomWavePlayer::PostLoad ( )
overridevirtual

◆ RegisterFilterDataFunction()

FORCEINLINE void UAtomWavePlayer::RegisterFilterDataFunction ( FAtomPcmFilterFunction Function)
inline

◆ Serialize()

void UAtomWavePlayer::Serialize ( FArchive & Ar)
overridevirtual

◆ SetCue()

void UAtomWavePlayer::SetCue ( UAtomSoundCue * InSoundCue)

Play the 1st wave of a cue

◆ SetLooping()

bool UAtomWavePlayer::SetLooping ( bool Looping)
inline

Get wave duration.

Returns
A time span representing the duration.
See also
GetTime, Seek Enables or disables playback looping.
Parameters
LoopingWhether playback should be looped.
Returns
true on success, false otherwise.
See also
IsLooping

◆ SetPaused()

void UAtomWavePlayer::SetPaused ( bool bPause = true)

Pause sound playing, issue any delegates if needed

◆ SetWave()

void UAtomWavePlayer::SetWave ( UAtomSoundWave * InSoundWave)

◆ Stop()

void UAtomWavePlayer::Stop ( )

Stop sound, issue any delegates if needed

◆ StopDelayed()

void UAtomWavePlayer::StopDelayed ( float DelayTime)

Cues request to stop sound after the provided delay, stopping immediately if delay is zero or negative

◆ Tick()

void UAtomWavePlayer::Tick ( float DeltaTime)
override

Member Data Documentation

◆ AtomRack

TObjectPtr<UAtomRackBase> UAtomWavePlayer::AtomRack

Rack to route sound output to. If unset, falls back to the 'Master Submix' as set in the 'Atom' category of CriWare Plugin in Project Settings'.

◆ AtomWavePlayerStateChanged

FOnAtomWavePlayerStateChanged UAtomWavePlayer::AtomWavePlayerStateChanged
private

An event delegate that is invoked when a new state occurred.

◆ bIsFadingOut

uint8 UAtomWavePlayer::bIsFadingOut

Whether or not fade out was triggered.

◆ bIsPaused

uint8 UAtomWavePlayer::bIsPaused

Whether or not this wave player has been paused

◆ bIsPreviewSound

uint8 UAtomWavePlayer::bIsPreviewSound

Whether or not this sound is a preview sound

◆ bIsRequestPlaying

uint8 UAtomWavePlayer::bIsRequestPlaying
protected

◆ bIsSoundLoading

uint8 UAtomWavePlayer::bIsSoundLoading
protected

◆ bIsUISound

uint8 UAtomWavePlayer::bIsUISound

Whether or not this sound plays when the game is paused in the UI

◆ bLoop

uint32 UAtomWavePlayer::bLoop
protected

Whether the player should loop when media playback reaches the end.

Use the SetLooping function to change this value at runtime.

See also
IsLooping, SetLooping

◆ bUsePCMFilter

uint8 UAtomWavePlayer::bUsePCMFilter

Whether or not the sound is out to PCM filter.

◆ FadeInTimeDuration

float UAtomWavePlayer::FadeInTimeDuration

How much time the player was told to fade in.

◆ FilterDataFunction

FAtomPcmFilterFunction UAtomWavePlayer::FilterDataFunction
private

◆ NativePlayer

CriAtomPlayerHn UAtomWavePlayer::NativePlayer
protected

Process the given Mana event.

Parameters
EventThe event to process. The CriAtom native player handle.

◆ OnWaveFinished

FOnWaveFinished UAtomWavePlayer::OnWaveFinished

called when we finish playing audio, either because it played to completion or because a Stop() call turned it off early

◆ OnWaveFinishedNative

FOnWaveFinishedNative UAtomWavePlayer::OnWaveFinishedNative

shadow delegate for non UObject subscribers

◆ OnWavePlaybackPercent

FOnWavePlaybackPercent UAtomWavePlayer::OnWavePlaybackPercent

Called as a sound plays on the player to allow BP to perform actions based on playback percentage. Computed as samples played divided by total samples, taking into account pitch.

◆ OnWavePlaybackPercentNative

FOnWavePlaybackPercentNative UAtomWavePlayer::OnWavePlaybackPercentNative

shadow delegate for non UObject subscribers

◆ PlayFadeInDuration

float UAtomWavePlayer::PlayFadeInDuration
protected

◆ PlayFadeVolumeLevel

float UAtomWavePlayer::PlayFadeVolumeLevel
protected

◆ PlayStartTime

float UAtomWavePlayer::PlayStartTime
protected

◆ Sound

TObjectPtr<UAtomSoundBase> UAtomWavePlayer::Sound

Filter data to PCM A delegate that is invoked when playback has reached the end of the media. A delegate that is invoked when a media source has been closed. A delegate that is invoked when a Mana movie source has been opened.

Depending on whether the underlying player implementation opens the media synchronously or asynchronously, this event may be executed before or after the call to OpenSource / OpenUrl returns.

See also
OnMediaOpenFailed, OnTracksChanged A delegate that is invoked when a Mana movie source has failed to open.

This delegate is only executed if OpenSource / OpenUrl returned true and the media failed to open asynchronously later. It is not executed if OpenSource / OpenUrl returned false, indicating an immediate failure.

See also
OnMediaOpened A delegate that is invoked when movie playback has been resumed.
OnPlaybackSuspended A delegate that is invoked when movie playback has been suspended.
OnPlaybackResumed

◆ TimeAtomWavePlayed

float UAtomWavePlayer::TimeAtomWavePlayed

What time the player was told to play. Used to compute state.

◆ WaveInfo

FAtomWaveInfo UAtomWavePlayer::WaveInfo

The documentation for this class was generated from the following files:
  • C:/git/uev2/Engine/Plugins/Runtime/CriWare/CriWare/Source/CriWareCore/Public/Atom/AtomWavePlayer.h
  • C:/git/uev2/Engine/Plugins/Runtime/CriWare/CriWare/Source/CriWareCore/Private/Atom/AtomWavePlayer.cpp