-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAudioTrack.cpp
56 lines (45 loc) · 1.52 KB
/
AudioTrack.cpp
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
#include "AudioTrack.h"
/** constructor creates a new AudioTrack with given values */
AudioTrack::AudioTrack(std::string _trackTitle,
std::string _trackLength,
std::string _sampleRate,
std::string _fileType,
std::string _filepath)
: trackTitle(_trackTitle),
trackLength(_trackLength),
sampleRate(_sampleRate),
fileType(_fileType),
filepath(_filepath)
{
}
/** Destructor for AudioTrack class */
AudioTrack::~AudioTrack(){
}
/** returns the track title as a string */
std::string AudioTrack::getTrackTitle(){
return this->trackTitle;
}
/** returns the track length as a string */
std::string AudioTrack::getTrackLength(){
return this->trackLength;
}
/** returns the tracks sample rate as a string */
std::string AudioTrack::getTrackSampleRate(){
return this->sampleRate;
}
/** returns the track type as a string */
std::string AudioTrack::getTrackType(){
return this->fileType;
}
/** returns the track filepath URL */
std::string AudioTrack::getTrackFilepath(){
return filepath;
}
/** converts a given AudioTrack object to a string */
std::string AudioTrack::toString(){
// create a new string
std::string trackString;
// create a comma seperated string of AudioTrack metadata - Title, Length, Filepath
trackString = this->getTrackTitle() + ", " + this->getTrackLength() + ", " + this->getTrackSampleRate() + ", " + this->getTrackType() + ", " + this->getTrackFilepath();
return trackString;
}