TriEngine  v0.0.16
General-purpose engine in C#/OpenGL
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
TriDevs.TriEngine.Audio.Song Class Reference

Song class that can be used with AudioManager. More...

Inheritance diagram for TriDevs.TriEngine.Audio.Song:
[legend]
Collaboration diagram for TriDevs.TriEngine.Audio.Song:
[legend]

Public Member Functions

void Dispose ()
 
void Play ()
 Starts playback of the song. More...
 
void Stop ()
 Stops playback of the song. More...
 
void Pause ()
 Pauses playback of the song. More...
 
void Resume ()
 Resumes playback of a paused song. More...
 

Properties

string Name [get]
 
string File [get]
 
float Volume [get, set]
 
bool IsLooped [get, set]
 
- Properties inherited from TriDevs.TriEngine.Audio.ISong
string File [get]
 Gets the file this song was loaded from. More...
 
float Volume [get, set]
 Gets or sets the song volume. More...
 
bool IsLooped [get, set]
 Gets or sets a value indicating that the song should be looped once it reaches the end. More...
 
- Properties inherited from TriDevs.TriEngine.Resources.IResource
string Name [get]
 Gets the name associated with this resource. More...
 

Detailed Description

Song class that can be used with AudioManager.

The song class will stream from a specified file, instead of loading it into memory.

Member Function Documentation

void TriDevs.TriEngine.Audio.Song.Dispose ( )
80  {
81  if (_stream == null)
82  return;
83 
84  Stop();
85  _stream.Dispose();
86  _stream = null;
87  }
void TriDevs.TriEngine.Audio.Song.Pause ( )

Pauses playback of the song.

Call the Resume or Play method to resume playback.

Implements TriDevs.TriEngine.Audio.ISong.

108  {
109  _stream.Pause();
110  }
void TriDevs.TriEngine.Audio.Song.Play ( )

Starts playback of the song.

Implements TriDevs.TriEngine.Audio.ISong.

90  {
91  try
92  {
93  _stream.Play();
94  }
95  catch (InvalidDataException)
96  {
97  Stop();
98  Play();
99  }
100  }
void TriDevs.TriEngine.Audio.Song.Resume ( )

Resumes playback of a paused song.

Implements TriDevs.TriEngine.Audio.ISong.

113  {
114  _stream.Resume();
115  }
void TriDevs.TriEngine.Audio.Song.Stop ( )

Stops playback of the song.

Implements TriDevs.TriEngine.Audio.ISong.

103  {
104  _stream.Stop();
105  }

Property Documentation

string TriDevs.TriEngine.Audio.Song.File
get
bool TriDevs.TriEngine.Audio.Song.IsLooped
getset
string TriDevs.TriEngine.Audio.Song.Name
get
float TriDevs.TriEngine.Audio.Song.Volume
getset

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