-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClassMusicPlayer.h
59 lines (46 loc) · 1.32 KB
/
ClassMusicPlayer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// --------------------------
// Kevin Doveton
// Copyright 2015
// --------------------------
// Bass Statuses
// 0: Stopped (or invalid handle)
// 1: Playing
// 2: Stalled (not enough data//buffering)
// 3: Paused
// #include <sstream> // String Streams - STD :: stringstream
#include "libraries/bass/bass.h" // Bass
#include <iostream> // General IO (cout/cin)
class MusicPlayer
{
public:
int playNewSong(std::string songPath);
// play a new song
// requires path to song including extension
// returns current status
int pause();
// Pause currently playing song
// Alias for BASS_ChannelPause(handle)
// Returns current status
int resume();
// Resume current song
// Alias for BASS_ChannelPlay(handle, FALSE)
// Returns current status
int stop();
// Stop current song
// Alias for BASS_ChannelPause(handle)
// Returns current status
int currentBassStatus();
// return the current status
// Alias for BASS_ChannelIsActive(handle);
int getOldBassStatus();
// Returns varOldBassStatus
int setOldBassStatus(int status);
// Sets varOldBassStatus
bool playing();
// check if song is active
protected:
HSTREAM defaultAudioChannel; // bass handle
int varCurrentBassStatus; // used in run loop
int varOldBassStatus; // used in run loop
bool _playing = false;
};