1 /***************************************************************************
2 * Copyright (C) 2008 by Andrzej Rybczak *
3 * electricityispower@gmail.com *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
30 #include "libmpdclient.h"
37 Song() : itsSlash(string::npos
), itsHash(0), copyPtr(0), isStream(0) { itsSong
= mpd_newSong(); }
38 Song(mpd_Song
*, bool = 0);
42 string
GetFile() const;
43 string
GetName() const;
44 string
GetDirectory() const;
45 string
GetArtist() const;
46 string
GetTitle() const;
47 string
GetAlbum() const;
48 string
GetTrack() const;
49 string
GetYear() const;
50 string
GetGenre() const;
51 string
GetComposer() const;
52 string
GetPerformer() const;
53 string
GetDisc() const;
54 string
GetComment() const;
55 string
GetLength() const;
56 const long long &GetHash() const { return itsHash
; }
57 int GetTotalLength() const { return itsSong
->time
< 0 ? 0 : itsSong
->time
; }
58 int GetPosition() const { return itsSong
->pos
; }
59 int GetID() const { return itsSong
->id
; }
61 void SetFile(const string
&);
62 void SetArtist(const string
&);
63 void SetTitle(const string
&);
64 void SetAlbum(const string
&);
65 void SetTrack(const string
&);
67 void SetYear(const string
&);
69 void SetGenre(const string
&);
70 void SetComposer(const string
&);
71 void SetPerformer(const string
&);
72 void SetDisc(const string
&);
73 void SetComment(const string
&);
74 void SetPosition(int);
76 void SetNewName(const string
&name
) { itsNewName
= name
== GetName() ? "" : name
; }
77 string
GetNewName() const { return itsNewName
; }
79 std::string
toString(const std::string
&) const;
81 void NullMe() { itsSong
= 0; }
82 void CopyPtr(bool copy
) { copyPtr
= copy
; }
84 //void GetEmptyFields(bool get) { itsGetEmptyFields = get; }
87 bool IsFromDB() const;
88 bool IsStream() const { return isStream
; }
90 Song
& operator=(const Song
&);
91 bool operator==(const Song
&) const;
92 bool operator!=(const Song
&) const;
93 bool operator<(const Song
&rhs
) const;
95 static string
ShowTime(int);
103 //bool itsGetEmptyFields;