1
/****************************************************************************************
2
* Copyright (c) 2007 Bart Cerneels <bart.cerneels@kde.org> *
4
* This program is free software; you can redistribute it and/or modify it under *
5
* the terms of the GNU General Public License as published by the Free Software *
6
* Foundation; either version 2 of the License, or (at your option) any later *
9
* This program is distributed in the hope that it will be useful, but WITHOUT ANY *
10
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
11
* PARTICULAR PURPOSE. See the GNU General Public License for more details. *
13
* You should have received a copy of the GNU General Public License along with *
14
* this program. If not, see <http://www.gnu.org/licenses/>. *
15
****************************************************************************************/
17
#ifndef METAM3UPLAYLIST_H
18
#define METAM3UPLAYLIST_H
20
#include <PlaylistFile.h>
30
typedef KSharedPtr<M3UPlaylist> M3UPlaylistPtr;
31
typedef QList<M3UPlaylistPtr> M3UPlaylistList;
34
@author Bart Cerneels <bart.cerneels@kde.org>
36
class AMAROK_EXPORT_TESTS M3UPlaylist : public PlaylistFile
40
M3UPlaylist( Meta::TrackList tracks );
41
M3UPlaylist( const KUrl &url );
45
/* Playlist virtual functions */
46
virtual QString name() const { return prettyName(); }
47
virtual QString prettyName() const { return m_url.fileName(); }
48
virtual QString description() const;
50
virtual int trackCount() const { return -1; }
51
/** returns all tracks in this playlist */
52
virtual TrackList tracks();
54
/* the following has been copied from Meta.h
55
* it is my hope that we can integrate Playlists
56
* better into the rest of the Meta framework someday ~Bart Cerneels
57
* TODO: Playlist : public MetaBase
59
bool hasCapabilityInterface( Meta::Capability::Type type ) const { Q_UNUSED( type ); return false; }
61
Capability* createCapabilityInterface( Capability::Type type ) { Q_UNUSED( type ); return 0; }
63
KUrl retrievableUrl() { return m_url; }
65
/* PlaylistFile methods */
67
void setName( const QString &name );
69
bool save( const KUrl &location, bool relative );
70
bool load( QTextStream &stream ) { return loadM3u( stream ); }
73
bool loadM3u( QTextStream &stream );
83
Q_DECLARE_METATYPE( Meta::M3UPlaylistPtr )
84
Q_DECLARE_METATYPE( Meta::M3UPlaylistList )