xref: /haiku/src/apps/mediaplayer/playlist/UrlPlaylistItem.h (revision e81a954787e50e56a7f06f72705b7859b6ab06d1)
1 /*
2  * Copyright 2016, Dario Casalinuovo
3  * All rights reserved. Distributed under the terms of the MIT license.
4  */
5 #ifndef URL_PLAYLIST_ITEM_H
6 #define URL_PLAYLIST_ITEM_H
7 
8 #include "PlaylistItem.h"
9 
10 #include <Url.h>
11 
12 
13 class UrlPlaylistItem : public PlaylistItem {
14 public:
15 								UrlPlaylistItem(BUrl url);
16 								UrlPlaylistItem(const UrlPlaylistItem& item);
17 								UrlPlaylistItem(const BMessage* archive);
18 	virtual						~UrlPlaylistItem();
19 
20 	virtual	PlaylistItem*		Clone() const;
21 
22 	static	BArchivable*		Instantiate(BMessage* archive);
23 	virtual	status_t			Archive(BMessage* into,
24 									bool deep = true) const;
25 
26 	virtual	status_t			SetAttribute(const Attribute& attribute,
27 									const BString& string);
28 	virtual	status_t			GetAttribute(const Attribute& attribute,
29 									BString& string) const;
30 
31 	virtual	status_t			SetAttribute(const Attribute& attribute,
32 									const int32& value);
33 	virtual	status_t			GetAttribute(const Attribute& attribute,
34 									int32& value) const;
35 
36 	virtual	status_t			SetAttribute(const Attribute& attribute,
37 									const int64& value);
38 	virtual	status_t			GetAttribute(const Attribute& attribute,
39 									int64& value) const;
40 
41 	virtual	BString				LocationURI() const;
42 	virtual	status_t			GetIcon(BBitmap* bitmap,
43 									icon_size iconSize) const;
44 
45 	virtual	status_t			MoveIntoTrash();
46 	virtual	status_t			RestoreFromTrash();
47 
48 			BUrl				Url() const;
49 
50 protected:
51 	virtual	bigtime_t			_CalculateDuration();
52 
53 	virtual	TrackSupplier*		_CreateTrackSupplier() const;
54 
55 private:
56 			BUrl				fUrl;
57 			bigtime_t			fDuration;
58 };
59 
60 #endif
61