xref: /haiku/src/apps/mediaplayer/playlist/FilePlaylistItem.h (revision c60fcc87e04b0af21ed9f01581b23d1f714a366f)
1 /*
2  * Copyright © 2009 Stephan Aßmus <superstippi@gmx.de>
3  * All rights reserved. Distributed under the terms of the MIT license.
4  */
5 #ifndef FILE_PLAYLIST_ITEM_H
6 #define FILE_PLAYLIST_ITEM_H
7 
8 #include "PlaylistItem.h"
9 
10 #include <Entry.h>
11 
12 class FilePlaylistItem : public PlaylistItem {
13 public:
14 								FilePlaylistItem(const entry_ref& ref);
15 								FilePlaylistItem(const FilePlaylistItem& item);
16 								FilePlaylistItem(const BMessage* archive);
17 	virtual						~FilePlaylistItem();
18 
19 	virtual	PlaylistItem*		Clone() const;
20 
21 	// archiving
22 	static	BArchivable*		Instantiate(BMessage* archive);
23 	virtual	status_t			Archive(BMessage* into,
24 									bool deep = true) const;
25 
26 	// attributes
27 	virtual	status_t			SetAttribute(const Attribute& attribute,
28 									const BString& string);
29 	virtual	status_t			GetAttribute(const Attribute& attribute,
30 									BString& string) const;
31 
32 	virtual	status_t			SetAttribute(const Attribute& attribute,
33 									const int32& value);
34 	virtual	status_t			GetAttribute(const Attribute& attribute,
35 									int32& value) const;
36 
37 	virtual	status_t			SetAttribute(const Attribute& attribute,
38 									const int64& value);
39 	virtual	status_t			GetAttribute(const Attribute& attribute,
40 									int64& value) const;
41 
42 	// methods
43 	virtual	BString				LocationURI() const;
44 	virtual	status_t			GetIcon(BBitmap* bitmap,
45 									icon_size iconSize) const;
46 
47 	virtual	status_t			MoveIntoTrash();
48 	virtual	status_t			RestoreFromTrash();
49 
50 	// playback
51 	virtual	BMediaFile*			CreateMediaFile() const;
52 
53 private:
54 			entry_ref			fRef;
55 			BString				fNameInTrash;
56 };
57 
58 #endif // FILE_PLAYLIST_ITEM_H
59