summaryrefslogtreecommitdiff
path: root/mg_item_gd.h
blob: f60a483cbe147e611470a0c0fda81a5c62fa6050 (plain)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*!								-*- c++ -*-
 * \file mg_item_gd.h
 * \brief A general interface to data items, currently only GiantDisc
 *
 * \version $Revision: 1.0 $
 * \date    $Date: 2004-12-07 10:10:35 +0200 (Tue, 07 Dec 2004) $
 * \author  Wolfgang Rohdewald
 * \author  Responsible author: $Author: wr $
 *
 */

#ifndef _MG_ITEM_GD_H
#define _MG_ITEM_GD_H
#include <stdlib.h>
#include <string>

using namespace std;

#include "mg_tools.h"
#include "mg_item.h"

//! \brief represents a GiantDisc content item
class mgItemGd : public mgItem
{
	public:
		mgListItem* getKeyItem(mgKeyTypes kt) const;

		//! \brief copy constructor
		mgItemGd(const mgItemGd* c);

		//! \brief construct an item from an SQL row
		mgItemGd (char **row);

		mgItemGd* Clone();

		//! \brief returns music filename
		string getSourceFile (bool AbsolutePath=true,bool Silent=false) const;

		bool HasLyrics();

		//! \brief returns music filename truncated at last dot
		string getTruncFilename (bool AbsolutePath=true) const;

		//! \brief returns cached music filename truncated at last dot
		string getCachedFilename (string extension,bool mkdir=true) const;

		//! \brief returns artist
		string getArtist () const;

		//! \brief returns the name of the album
		string getAlbum () const;

		//! \brief returns the name of genre
		string getGenre () const;

		//! \brief returns the bitrate
		string getBitrate () const;

		//! \brief returns samplerate
		int getSampleRate () const;

		//! \brief returns # of channels
		int getChannels () const;

		//! \brief returns tracknb
		int getTrack () const;

		string getImagePath(bool AbsolutePath=true) const;

								 // unknown
		void resetHasLyricsFile() {
			m_haslyrics=-1;
		}

		long getCheckedForTmpLyrics();
		void setCheckedForTmpLyrics(const long t);

	protected:
		void InitFrom(const mgItemGd* c);
	private:
		mutable string m_mp3file;
		string m_artist;
		string m_albumtitle;
		string m_genre2_id;
		string m_genre2;
		string m_bitrate;
		mutable string m_coverimg;
		int m_samplerate;
		int m_channels;
		int m_tracknb;
		mutable int m_covercount;
		int m_haslyrics;
		long m_checkedfortmplyrics;
		long m_loadexternalstart;

};
#endif