-
Notifications
You must be signed in to change notification settings - Fork 0
/
music.cpp
56 lines (44 loc) · 1.03 KB
/
music.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 "music.h"
using namespace std;
Music::Music(string _title)
{
filename = _title;
TagLib::FileRef data(filename.c_str(), true, TagLib::AudioProperties::Accurate);
title = data.tag()->title();
artist = data.tag()->artist();
album = data.tag()->album();
length = (int) data.audioProperties()->length();
minutes = length / 60;
seconds = length % 60;
}
void Music::print()
{
cout << "Title : " << title << endl;
cout << "Artist : " << artist << endl;
cout << "Album : " << album << endl;
cout << "Length : " << minutes << ":" << seconds << endl;
}
string Music::getfilename(){return filename;}
TagLib::String Music::gettitle(){return title;}
TagLib::String Music::getartist(){return artist;}
TagLib::String Music::getalbum(){return album;}
int Music::getminutes()
{
return minutes;
}
int Music::getseconds()
{
return seconds;
}
int Music::getlength()
{
return length;
}
int Music::getstarttime()
{
return starttime;
}
void Music::setstarttime(int val)
{
starttime = val;
}