Skip to content

Commit

Permalink
started docs on 'sndPlayer'
Browse files Browse the repository at this point in the history
  • Loading branch information
tpltnt committed May 30, 2015
1 parent 47e3144 commit 1096f5f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
3 changes: 3 additions & 0 deletions src/sndPlayer.cpp
@@ -1,5 +1,8 @@
#include "sndPlayer.h"

/**
* Constructor for the `sndPlayer` class to set default values.
*/
sndPlayer::sndPlayer() {
player = NULL;
params.volume = 50;
Expand Down
28 changes: 13 additions & 15 deletions src/sndPlayer.h
Expand Up @@ -2,53 +2,51 @@
#include "ofSoundPlayer.h"

struct paramsSND_t {
int volume;
bool mute;
int volume; /*!< volume of the sound */
bool mute; /*!< store if sound is currently muted */
};


class sndListener
{
public:
virtual void onSoundEnd() = 0;
virtual void onSoundFreeze() = 0;
};


class sndPlayer
{

public:

//RUN
sndPlayer();
void run();
void setListener(sndListener* myListener);

//CONTROL
void play(string file);
void stop();
void pause();
void resume();

void seek(int timemilli);

void volume(int v);
void setMuted(bool mute);

//STATE
bool isPlaying();
bool isPaused();
int getPositionMs();
int getDurationMs();

private:

//DISPLAY LOGICS
void applyVolume();
void iceBreak();

//PARAMS
paramsSND_t params;
void applyVolume();
void iceBreak();

//PARAMS
paramsSND_t params;
ofOpenALSoundPlayer* player;

//EVENTS
Expand All @@ -57,4 +55,4 @@ class sndPlayer
//END DETECT & ANTIFREEZE
float lastPos;
int freeze;
};
};

0 comments on commit 1096f5f

Please sign in to comment.