19 mutable int channel, token;
25 Channel(
int channel,
int token);
55 std::shared_ptr<Impl> pimpl;
63 explicit Sample(
const std::string& filename);
75 Channel play(
double volume = 1,
double speed = 1,
bool looping =
false)
const;
86 Channel play_pan(
double pan,
double volume = 1,
double speed = 1,
87 bool looping =
false)
const;
95 std::unique_ptr<Impl> pimpl;
106 explicit Song(
const std::string& filename);
117 static Song* current_song();
121 void play(
bool looping =
false);
134 double volume()
const;
139 static void update();
Channel()
This creates an "empty" Channel which is expired and cannot be resumed.
void pause()
Pauses this instance to be resumed afterwards.
Utility class that points to a specific position in a resource and offers an interface for sequential...
void set_speed(double speed)
Sample::play returns a Channel that represents the sound being played.
Songs are less flexible than samples.
A sample is a short sound that is completely loaded in memory, can be played multiple times at once a...
int current_channel() const
For internal use only.
void stop()
Stops this channel if the sample is still being played.
void set_volume(double volume)
Contains everything related to input and output.