ToyMaker Game Engine 0.0.2
ToyMaker is a game engine developed and maintained by Zoheb Shujauddin.
Loading...
Searching...
No Matches
ToyMaker::Sound Class Reference

Class representing a single playable piece of audio. More...

#include <types.hpp>

Inheritance diagram for ToyMaker::Sound:
ToyMaker::Resource< Sound > ToyMaker::IResource

Public Member Functions

 Sound (MIX_Audio *sound)
 Initializer for this sound.
 Sound (Sound &&other)
 Move constructor.
 Sound (const Sound &other)=delete
 Copy constructor.
Soundoperator= (Sound &&other)
 Move assignment.
Soundoperator= (const Sound &other)=delete
 Copy assignment.
int32_t getDuration () const
 Returns the duration of this sound in millis, with -1 indicating the audio is infinite.
Public Member Functions inherited from ToyMaker::Resource< Sound >
std::string getResourceTypeName_ () const override
 Get the resource type string for this resource.
Public Member Functions inherited from ToyMaker::IResource
virtual ~IResource ()=default
 Destroy the IResource object.

Static Public Member Functions

static std::string getResourceTypeName ()
 The id string representing this kind of resource.

Private Attributes

std::unique_ptr< MIX_Audio, decltype(&MIX_DestroyAudio)> mAudio
 The underlying SDL3_mixer audio object.

Friends

class SoundChannel

Additional Inherited Members

Protected Member Functions inherited from ToyMaker::Resource< Sound >
 Resource (int explicitlyInitializeMe)
 Construct a new resource object.
Protected Member Functions inherited from ToyMaker::IResource
 IResource ()=default
 Construct a new IResource object.
Static Protected Member Functions inherited from ToyMaker::IResource
template<typename TResource>
static void RegisterResource ()
 Registers this resource as a Resource type with the ResourceDatabase.

Detailed Description

Class representing a single playable piece of audio.


The documentation for this class was generated from the following files:
  • ToyMaker_Main/include/toymaker/engine/sound/types.hpp
  • ToyMaker_Main/src/sound/types.cpp