Jamie Slowgrove - MGP Assignment 2 - JAM
 All Classes Namespaces Files Functions Variables Macros
Public Member Functions | Private Attributes | List of all members
JAM_Audio Class Reference

Creates an Audio object to handle the SDL_Mixer. More...

#include <Audio.h>

Collaboration diagram for JAM_Audio:
Collaboration graph

Public Member Functions

 JAM_Audio (std::string file, bool music)
 
 ~JAM_Audio ()
 
void startAudio ()
 
void playEffect ()
 
void stopAudio ()
 

Private Attributes

Mix_Music * audio
 
Mix_Chunk * sound
 

Detailed Description

Creates an Audio object to handle the SDL_Mixer.

Author
Jamie Slowgrove Reference ~ This is a modified version of my AI Assignment 1 Audio class.

Constructor & Destructor Documentation

JAM_Audio::JAM_Audio ( std::string  file,
bool  music 
)

Constructs the Audio object.

Parameters
fileThe file to be loaded.
musicTrue for music file. False for sound file.
JAM_Audio::~JAM_Audio ( )

Destructs the Audio object.

Member Function Documentation

void JAM_Audio::playEffect ( )

Plays the sound effect.

Here is the caller graph for this function:

void JAM_Audio::startAudio ( )

Starts the Audio playing, also checks if not playing and starts again.

Here is the caller graph for this function:

void JAM_Audio::stopAudio ( )

Stops the Audio playing.

Here is the caller graph for this function:

Member Data Documentation

Mix_Music* JAM_Audio::audio
private

Variable for if it's a Music audio type.

Mix_Chunk* JAM_Audio::sound
private

Variable for if it's a Sound effect type.


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