MediaPlayer: Add UrlPlaylistItem
This commit is contained in:
@@ -70,6 +70,7 @@ Application MediaPlayer :
|
|||||||
PLItemsCommand.cpp
|
PLItemsCommand.cpp
|
||||||
RandomizePLItemsCommand.cpp
|
RandomizePLItemsCommand.cpp
|
||||||
RemovePLItemsCommand.cpp
|
RemovePLItemsCommand.cpp
|
||||||
|
UrlPlaylistItem.cpp
|
||||||
|
|
||||||
# settings
|
# settings
|
||||||
Settings.cpp
|
Settings.cpp
|
||||||
@@ -114,7 +115,7 @@ Application MediaPlayer :
|
|||||||
VideoView.cpp
|
VideoView.cpp
|
||||||
|
|
||||||
: be game media tracker translation textencoding [ TargetLibstdc++ ]
|
: be game media tracker translation textencoding [ TargetLibstdc++ ]
|
||||||
localestub shared
|
localestub shared bnetapi
|
||||||
: MediaPlayer.rdef
|
: MediaPlayer.rdef
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,154 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2016, Dario Casalinuovo
|
||||||
|
* All rights reserved. Distributed under the terms of the MIT license.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "UrlPlaylistItem.h"
|
||||||
|
|
||||||
|
#include <MediaFile.h>
|
||||||
|
|
||||||
|
#include "MediaFileTrackSupplier.h"
|
||||||
|
|
||||||
|
|
||||||
|
UrlPlaylistItem::UrlPlaylistItem(BUrl* url)
|
||||||
|
:
|
||||||
|
fUrl(url)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
UrlPlaylistItem::UrlPlaylistItem(const UrlPlaylistItem& item)
|
||||||
|
{
|
||||||
|
fUrl = new BUrl(item.Url()->UrlString());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
UrlPlaylistItem::UrlPlaylistItem(const BMessage* archive)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
UrlPlaylistItem::~UrlPlaylistItem()
|
||||||
|
{
|
||||||
|
delete fUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PlaylistItem*
|
||||||
|
UrlPlaylistItem::Clone() const
|
||||||
|
{
|
||||||
|
return new UrlPlaylistItem(new BUrl(fUrl->UrlString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BArchivable*
|
||||||
|
UrlPlaylistItem::Instantiate(BMessage* archive)
|
||||||
|
{
|
||||||
|
return new UrlPlaylistItem(archive);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
UrlPlaylistItem::Archive(BMessage* into, bool deep) const
|
||||||
|
{
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
UrlPlaylistItem::SetAttribute(const Attribute& attribute, const BString& string)
|
||||||
|
{
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
UrlPlaylistItem::GetAttribute(const Attribute& attribute, BString& string) const
|
||||||
|
{
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
UrlPlaylistItem::SetAttribute(const Attribute& attribute, const int32& value)
|
||||||
|
{
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
UrlPlaylistItem::GetAttribute(const Attribute& attribute, int32& value) const
|
||||||
|
{
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
UrlPlaylistItem::SetAttribute(const Attribute& attribute, const int64& value)
|
||||||
|
{
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
UrlPlaylistItem::GetAttribute(const Attribute& attribute, int64& value) const
|
||||||
|
{
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BString
|
||||||
|
UrlPlaylistItem::LocationURI() const
|
||||||
|
{
|
||||||
|
return fUrl->UrlString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
UrlPlaylistItem::GetIcon(BBitmap* bitmap, icon_size iconSize) const
|
||||||
|
{
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
UrlPlaylistItem::MoveIntoTrash()
|
||||||
|
{
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
UrlPlaylistItem::RestoreFromTrash()
|
||||||
|
{
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TrackSupplier*
|
||||||
|
UrlPlaylistItem::CreateTrackSupplier() const
|
||||||
|
{
|
||||||
|
MediaFileTrackSupplier* supplier
|
||||||
|
= new(std::nothrow) MediaFileTrackSupplier();
|
||||||
|
if (supplier == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
BMediaFile* mediaFile = new(std::nothrow) BMediaFile(fUrl);
|
||||||
|
if (mediaFile == NULL) {
|
||||||
|
delete supplier;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
if (supplier->AddMediaFile(mediaFile) != B_OK)
|
||||||
|
delete mediaFile;
|
||||||
|
|
||||||
|
return supplier;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BUrl*
|
||||||
|
UrlPlaylistItem::Url() const
|
||||||
|
{
|
||||||
|
return fUrl;
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2016, Dario Casalinuovo
|
||||||
|
* All rights reserved. Distributed under the terms of the MIT license.
|
||||||
|
*/
|
||||||
|
#ifndef URL_PLAYLIST_ITEM_H
|
||||||
|
#define URL_PLAYLIST_ITEM_H
|
||||||
|
|
||||||
|
#include "PlaylistItem.h"
|
||||||
|
|
||||||
|
#include <Url.h>
|
||||||
|
|
||||||
|
|
||||||
|
class UrlPlaylistItem : public PlaylistItem {
|
||||||
|
public:
|
||||||
|
UrlPlaylistItem(BUrl* url);
|
||||||
|
UrlPlaylistItem(const UrlPlaylistItem& item);
|
||||||
|
UrlPlaylistItem(const BMessage* archive);
|
||||||
|
virtual ~UrlPlaylistItem();
|
||||||
|
|
||||||
|
virtual PlaylistItem* Clone() const;
|
||||||
|
|
||||||
|
static BArchivable* Instantiate(BMessage* archive);
|
||||||
|
virtual status_t Archive(BMessage* into,
|
||||||
|
bool deep = true) const;
|
||||||
|
|
||||||
|
virtual status_t SetAttribute(const Attribute& attribute,
|
||||||
|
const BString& string);
|
||||||
|
virtual status_t GetAttribute(const Attribute& attribute,
|
||||||
|
BString& string) const;
|
||||||
|
|
||||||
|
virtual status_t SetAttribute(const Attribute& attribute,
|
||||||
|
const int32& value);
|
||||||
|
virtual status_t GetAttribute(const Attribute& attribute,
|
||||||
|
int32& value) const;
|
||||||
|
|
||||||
|
virtual status_t SetAttribute(const Attribute& attribute,
|
||||||
|
const int64& value);
|
||||||
|
virtual status_t GetAttribute(const Attribute& attribute,
|
||||||
|
int64& value) const;
|
||||||
|
|
||||||
|
virtual BString LocationURI() const;
|
||||||
|
virtual status_t GetIcon(BBitmap* bitmap,
|
||||||
|
icon_size iconSize) const;
|
||||||
|
|
||||||
|
virtual status_t MoveIntoTrash();
|
||||||
|
virtual status_t RestoreFromTrash();
|
||||||
|
|
||||||
|
virtual TrackSupplier* CreateTrackSupplier() const;
|
||||||
|
|
||||||
|
BUrl* Url() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
BUrl* fUrl;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user