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

#include <jukebox.h>

Public Types

enum class  Cue { kNothing , kStart , kStop }
 What the track should do this frame. More...

Public Member Functions

Cue Update (float seconds, bool in_world, bool playing)
float volume () const
 From nothing to the track's full volume.

Static Public Attributes

static constexpr float kFadeIn = 3.0f
 In seconds.
static constexpr float kFadeOut = 1.5f
static constexpr float kRest = 45.0f

Detailed Description

When the music plays, and how loud, kept apart from raylib so that it can be tested without a sound card. The music fades in as the player enters the world, plays the track through, rests for a while in silence and plays it again, and it fades out as they leave.

Definition at line 10 of file jukebox.h.

Member Enumeration Documentation

◆ Cue

enum class nanommo::Jukebox::Cue
strong

What the track should do this frame.

Enumerator
kNothing 
kStart 
kStop 

Definition at line 18 of file jukebox.h.

Member Function Documentation

◆ Update()

Jukebox::Cue nanommo::Jukebox::Update ( float seconds,
bool in_world,
bool playing )

Moves on by the frame's time, from whether the player is in the world, and whether the track is playing.

Definition at line 7 of file jukebox.cc.

◆ volume()

float nanommo::Jukebox::volume ( ) const
inline

From nothing to the track's full volume.

Definition at line 25 of file jukebox.h.

Member Data Documentation

◆ kFadeIn

float nanommo::Jukebox::kFadeIn = 3.0f
staticconstexpr

In seconds.

Definition at line 13 of file jukebox.h.

◆ kFadeOut

float nanommo::Jukebox::kFadeOut = 1.5f
staticconstexpr

Definition at line 14 of file jukebox.h.

◆ kRest

float nanommo::Jukebox::kRest = 45.0f
staticconstexpr

Definition at line 15 of file jukebox.h.


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