Leviathan  0.8.0.0
Leviathan game engine
Leviathan::Sound::ProceduralSoundStream Class Reference

Used to feed data retrieved from a callback to cAudio::IAudioSource. More...

#include <SoundInternalTypes.h>

+ Inheritance diagram for Leviathan::Sound::ProceduralSoundStream:

Public Member Functions

DLLEXPORT ProceduralSoundStream (ProceduralSoundData::pointer data)
 
DLLEXPORT ~ProceduralSoundStream ()
 
DLLEXPORT cAudio::AudioFormats getFormat () override
 
DLLEXPORT int getFrequency () override
 
DLLEXPORT bool isSeekingSupported () override
 
DLLEXPORT bool isValid () override
 
DLLEXPORT int readAudioData (void *output, int amount) override
 
DLLEXPORT bool setPosition (int position, bool relative) override
 
DLLEXPORT bool seek (float seconds, bool relative) override
 
DLLEXPORT float getTotalTime () override
 
DLLEXPORT int getTotalSize () override
 
DLLEXPORT int getCompressedSize () override
 
DLLEXPORT float getCurrentTime () override
 
DLLEXPORT int getCurrentPosition () override
 
DLLEXPORT int getCurrentCompressedPosition () override
 
DLLEXPORT cAudio::cAudioString getType () const override
 

Protected Member Functions

DLLEXPORT void onStreamEnded ()
 Called when the stream should close or if the data source has been closed. More...
 

Detailed Description

Used to feed data retrieved from a callback to cAudio::IAudioSource.

Definition at line 16 of file SoundInternalTypes.h.

Constructor & Destructor Documentation

◆ ProceduralSoundStream()

DLLEXPORT ProceduralSoundStream::ProceduralSoundStream ( ProceduralSoundData::pointer  data)

Definition at line 71 of file SoundInternalTypes.cpp.

71  :
72  IAudioDecoder(nullptr), Data(data)
73 {
74  LEVIATHAN_ASSERT(Data, "ProceduralSoundStream created without data source");
75 
76  // if(Data)
77  // Data->StreamReportingIn(this);
78 }

◆ ~ProceduralSoundStream()

DLLEXPORT ProceduralSoundStream::~ProceduralSoundStream ( )

Definition at line 80 of file SoundInternalTypes.cpp.

80 {}

Member Function Documentation

◆ getCompressedSize()

DLLEXPORT int ProceduralSoundStream::getCompressedSize ( )
override

Definition at line 132 of file SoundInternalTypes.cpp.

133 {
134  return -1;
135 }

◆ getCurrentCompressedPosition()

DLLEXPORT int ProceduralSoundStream::getCurrentCompressedPosition ( )
override

Definition at line 147 of file SoundInternalTypes.cpp.

148 {
149  return -1;
150 }

◆ getCurrentPosition()

DLLEXPORT int ProceduralSoundStream::getCurrentPosition ( )
override

Definition at line 142 of file SoundInternalTypes.cpp.

143 {
144  return -1;
145 }

◆ getCurrentTime()

DLLEXPORT float ProceduralSoundStream::getCurrentTime ( )
override

Definition at line 137 of file SoundInternalTypes.cpp.

138 {
139  return -1.f;
140 }

◆ getFormat()

DLLEXPORT cAudio::AudioFormats ProceduralSoundStream::getFormat ( )
override

Definition at line 83 of file SoundInternalTypes.cpp.

84 {
85  return Data->Properties.Format;
86 }

◆ getFrequency()

DLLEXPORT int ProceduralSoundStream::getFrequency ( )
override

Definition at line 88 of file SoundInternalTypes.cpp.

89 {
90  return Data->Properties.SampleRate;
91 }

◆ getTotalSize()

DLLEXPORT int ProceduralSoundStream::getTotalSize ( )
override

Definition at line 127 of file SoundInternalTypes.cpp.

128 {
129  return -1;
130 }

◆ getTotalTime()

DLLEXPORT float ProceduralSoundStream::getTotalTime ( )
override

Definition at line 122 of file SoundInternalTypes.cpp.

123 {
124  return -1.f;
125 }

◆ getType()

DLLEXPORT cAudio::cAudioString ProceduralSoundStream::getType ( ) const
override

Definition at line 152 of file SoundInternalTypes.cpp.

153 {
154  return "Leviathan::ProceduralSoundStream";
155 }

◆ isSeekingSupported()

DLLEXPORT bool ProceduralSoundStream::isSeekingSupported ( )
override

Definition at line 93 of file SoundInternalTypes.cpp.

94 {
95  return false;
96 }

◆ isValid()

DLLEXPORT bool ProceduralSoundStream::isValid ( )
override

Definition at line 98 of file SoundInternalTypes.cpp.

99 {
100  return Data->IsValid();
101 }

◆ onStreamEnded()

DLLEXPORT void ProceduralSoundStream::onStreamEnded ( )
protected

Called when the stream should close or if the data source has been closed.

Definition at line 157 of file SoundInternalTypes.cpp.

158 {
159  // Data->StreamReportingIn(nullptr);
160 }

◆ readAudioData()

DLLEXPORT int ProceduralSoundStream::readAudioData ( void *  output,
int  amount 
)
override

Definition at line 103 of file SoundInternalTypes.cpp.

104 {
105  return Data->ReadAudioData(output, amount);
106 }

◆ seek()

DLLEXPORT bool ProceduralSoundStream::seek ( float  seconds,
bool  relative 
)
override

Definition at line 115 of file SoundInternalTypes.cpp.

116 {
117  (void)seconds;
118  (void)relative;
119  return false;
120 }

◆ setPosition()

DLLEXPORT bool ProceduralSoundStream::setPosition ( int  position,
bool  relative 
)
override

Definition at line 108 of file SoundInternalTypes.cpp.

109 {
110  (void)position;
111  (void)relative;
112  return false;
113 }

The documentation for this class was generated from the following files: