nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
nanommo::Track Class Reference

#include <audio.h>

Public Member Functions

 ~Track ()
 Track (const Track &)=delete
Track & operator= (const Track &)=delete
void Play ()
 From the start.
void Stop ()
bool playing () const
void SetVolume (float volume)
 From nothing to the file's own loudness.
void Update ()

Static Public Member Functions

static absl::StatusOr< std::unique_ptr< Track > > Load (const AudioDevice &device, const std::string &path)
 Loading needs the device, so it takes one, even though it doesn't use it.

Detailed Description

A piece of music, which raylib streams from its file as it plays, a little at a time, so that the whole song never sits decoded in memory.

Definition at line 57 of file audio.h.

Constructor & Destructor Documentation

◆ ~Track()

nanommo::Track::~Track ( )

Definition at line 97 of file audio.cc.

◆ Track()

nanommo::Track::Track ( const Track & )
delete

Member Function Documentation

◆ Load()

absl::StatusOr< std::unique_ptr< Track > > nanommo::Track::Load ( const AudioDevice & device,
const std::string & path )
static

Loading needs the device, so it takes one, even though it doesn't use it.

Definition at line 85 of file audio.cc.

◆ operator=()

Track & nanommo::Track::operator= ( const Track & )
delete

◆ Play()

void nanommo::Track::Play ( )

From the start.

Definition at line 99 of file audio.cc.

◆ playing()

bool nanommo::Track::playing ( ) const

Definition at line 103 of file audio.cc.

◆ SetVolume()

void nanommo::Track::SetVolume ( float volume)

From nothing to the file's own loudness.

Definition at line 105 of file audio.cc.

◆ Stop()

void nanommo::Track::Stop ( )

Definition at line 101 of file audio.cc.

◆ Update()

void nanommo::Track::Update ( )

Refills the buffer the track plays from with what comes next in its file. raylib needs this each frame, or the buffer runs dry and the track goes quiet.

Definition at line 107 of file audio.cc.


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