summaryrefslogtreecommitdiffstats
path: root/Src/playlist/pl_entry.h
blob: 852b584d9c6c206d1c207771b96d9f871006fe77 (plain) (blame)
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
#ifndef NULLSOFT_ML_PLAYLISTS_PL_ENTRY_H
#define NULLSOFT_ML_PLAYLISTS_PL_ENTRY_H

#include "ifc_plentryinfo.h"
#include <windows.h>
#include <map>
#include <iostream>


class pl_entry
{
public:
	pl_entry()                                                        {}
	pl_entry( const wchar_t *p_filename, const wchar_t *p_title, int p_length_ms );
	pl_entry( const wchar_t *p_filename, const wchar_t *p_title, int p_length_ms, int p_size );
	pl_entry( const wchar_t *p_filename, const wchar_t *p_title, int p_length_ms, ifc_plentryinfo *p_info );
	pl_entry( const wchar_t *p_filename, const wchar_t *p_title, int p_length_ms, int p_size, ifc_plentryinfo *p_info );
	pl_entry( const wchar_t *p_filename, const wchar_t *p_title, int p_length_ms,
			  const wchar_t *mediahash, const wchar_t *metahash,
			  const wchar_t *cloud_id, const wchar_t *cloud_status,
			  const wchar_t *cloud_devices );
	~pl_entry();

	size_t GetFilename( wchar_t *p_filename, size_t filenameCch );
	size_t GetTitle( wchar_t *title, size_t titleCch );
	int    GetLengthInMilliseconds();
	int    GetSizeInBytes();
	size_t GetExtendedInfo( const wchar_t *metadata, wchar_t *info, size_t infoCch );

	void   SetFilename( const wchar_t *p_filename );
	void   SetTitle( const wchar_t *title );
	void   SetLengthMilliseconds( int length );
	void   SetSizeBytes( int size );

	void   SetMediahash( const wchar_t *mediahash );
	void   SetMetahash( const wchar_t *metahash );
	void   SetCloudID( const wchar_t *cloud_id );
	void   SetCloudStatus( const wchar_t *cloud_status );
	void   SetCloudDevices( const wchar_t *cloud_devices );

	bool   isLocal() const                                            { return _is_local_file; }

	wchar_t *filename       = 0;
	wchar_t *filetitle      = 0;

	wchar_t *mediahash      = 0;
	wchar_t *metahash       = 0;
	wchar_t *cloud_id       = 0;
	wchar_t *cloud_status   = 0;
	wchar_t *cloud_devices  = 0;

	std::map<std::wstring, std::wstring> _extended_infos;

	int      length         = -1;
	int      size           = 0;

	bool     cached         = false;
	bool     _is_local_file = false;
};

#endif