3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
Loading...
Searching...
No Matches
Engine3DRadSpace.Audio.Sound Class Reference

Represents a audio clip. More...

#include <Sound.hpp>

Inheritance diagram for Engine3DRadSpace.Audio.Sound:
Collaboration diagram for Engine3DRadSpace.Audio.Sound:

Public Member Functions

 Sound (AudioEngine audio, string path)
 Sound (IntPtr ptrSound)
void Dispose ()
 Sound (IService *audio, const std::filesystem::path &path)
 Constructs an sound from the given audio service and file path.
 Sound (const Sound &)=delete
 Removed copy constructor because the sound buffer is unique and cannot be copied.
 Sound (Sound &&snd) noexcept
 Move constructor. Transfers ownership of the sound buffer to this instance.
Sound & operator= (const Sound &)=delete
 Removed copy assignment operator because the sound buffer is unique and cannot be copied.
Sound & operator= (Sound &&snd) noexcept
 Move assignement operator. Transfers ownership of the sound buffer to this instance.
Reflection::UUID GetUUID () const noexcept override
 Returns an unique identifier for the sound asset type.
const char * FileExtension () const noexcept override
 Returns an WAV/OGG file filter.
std::type_index InitializationService () const noexcept override
 Returns the type info of the audio service used to initialize this sound asset.
 ~Sound () override
 Frees the audio buffer associated with this sound instance.
Public Member Functions inherited from Engine3DRadSpace.Content.IAsset
virtual ~IAsset ()=default

Protected Member Functions

virtual void Dispose (bool disposing)
AudioBuffer _attemptLoading (const std::filesystem::path &path)
 Sound (Internal::AssetUUIDReader dummy)
Protected Member Functions inherited from Engine3DRadSpace.Content.IAsset
 IAsset ()=default
 IAsset (const IAsset &)=default
IAsset & operator= (const IAsset &)=default
 IAsset (IAsset &&) noexcept=default
IAsset & operator= (IAsset &&) noexcept=default

Protected Attributes

AudioEngine * _audio
unsigned int _bufferID

Properties

nint Handle [get]
Properties inherited from Engine3DRadSpace.Content.IAsset
UUID UUID [get]
string FileExtension [get]

Friends

class SoundInstance
struct Internal::AssetUUIDReader

Detailed Description

Represents a audio clip.

Constructor & Destructor Documentation

◆ Sound() [1/6]

Engine3DRadSpace.Audio.Sound.Sound ( AudioEngine audio,
string path )
inline

◆ Sound() [2/6]

Engine3DRadSpace.Audio.Sound.Sound ( IntPtr ptrSound)
inline

◆ Sound() [3/6]

◆ Sound() [4/6]

Sound::Sound ( IService * audio,
const std::filesystem::path & path )

Constructs an sound from the given audio service and file path.

Parameters
audioAudio service
pathFile path to an WAV or OGG sound clip

◆ Sound() [5/6]

Removed copy constructor because the sound buffer is unique and cannot be copied.

unused

◆ Sound() [6/6]

Sound::Sound ( Sound && snd)
noexcept

Move constructor. Transfers ownership of the sound buffer to this instance.

Parameters
sndThe sound to move from

◆ ~Sound()

Engine3DRadSpace.Audio.Sound.~Sound ( )
override

Frees the audio buffer associated with this sound instance.

Member Function Documentation

◆ _attemptLoading()

AudioBuffer Sound::_attemptLoading ( const std::filesystem::path & path)
protected

◆ Dispose() [1/2]

void Engine3DRadSpace.Audio.Sound.Dispose ( )
inline

◆ Dispose() [2/2]

virtual void Engine3DRadSpace.Audio.Sound.Dispose ( bool disposing)
inlineprotectedvirtual

◆ FileExtension()

const char * Sound::FileExtension ( ) const
overridevirtualnoexcept

Returns an WAV/OGG file filter.

Returns
WAV/OGG file filter

Implements Engine3DRadSpace.Content.IAsset.

◆ GetUUID()

Reflection::UUID Sound::GetUUID ( ) const
overridevirtualnoexcept

Returns an unique identifier for the sound asset type.

Returns
Identifier for the sound asset type

Implements Engine3DRadSpace.Content.IAsset.

◆ InitializationService()

std::type_index Sound::InitializationService ( ) const
overridevirtualnoexcept

Returns the type info of the audio service used to initialize this sound asset.

Returns
type info of IAudioEngine

Implements Engine3DRadSpace.Content.IAsset.

◆ operator=() [1/2]

Sound & Engine3DRadSpace.Audio.Sound.operator= ( const Sound & )
delete

Removed copy assignment operator because the sound buffer is unique and cannot be copied.

Parameters
fromunused
Returns
unused

◆ operator=() [2/2]

Sound & Sound::operator= ( Sound && snd)
noexcept

Move assignement operator. Transfers ownership of the sound buffer to this instance.

Parameters
sndThe sound to move from
Returns
A reference to this sound instance

◆ Internal::AssetUUIDReader

friend struct Internal::AssetUUIDReader
friend

◆ SoundInstance

friend class SoundInstance
friend

Member Data Documentation

◆ _audio

AudioEngine* Engine3DRadSpace.Audio.Sound._audio
protected

◆ _bufferID

unsigned int Engine3DRadSpace.Audio.Sound._bufferID
protected

Property Documentation

◆ Handle

nint Engine3DRadSpace.Audio.Sound.Handle
get

The documentation for this class was generated from the following files:
  • E:/3DRadSpace/3DRadSpace_CSharp/Audio/Sound.cs
  • E:/3DRadSpace/Engine3DRadSpace/Audio/Sound.hpp
  • E:/3DRadSpace/Engine3DRadSpace/Audio/Sound.cpp