Commit a98d11ef authored by Scott Wheeler's avatar Scott Wheeler

Adding the beginnings of a "history" playlist.

TODO:

*) Save and restore the history -- this will be handled at the same time
   that saving and restoring of vfolders happens
*) Fill in the details of the subclass to add things like making it read
   only and saving a date along with the items

svn path=/trunk/kdemultimedia/juk/; revision=241664
parent 8c8df11d
......@@ -12,7 +12,7 @@ juk_SOURCES = directorylistbase.ui genrelisteditorbase.ui \
tagguesserconfigdlgwidget.ui tagguesserconfigdlg.cpp jukIface.skel \
playlistsearch.cpp searchwidget.cpp filerenamer.cpp dynamicplaylist.cpp \
searchplaylist.cpp musicbrainzquery.cpp mediafiles.cpp viewmode.cpp \
advancedsearchdialog.cpp
advancedsearchdialog.cpp historyplaylist.cpp
tagguessertest_SOURCES = tagguessertest.cpp tagguesser.cpp
......
/***************************************************************************
historyplaylist.cpp
-------------------
begin : Fri Aug 8 2003
copyright : (C) 2003 by Scott Wheeler
email : wheeler@kde.org
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include <klocale.h>
#include "historyplaylist.h"
#include "collectionlist.h"
////////////////////////////////////////////////////////////////////////////////
// HistoryPlaylistItem public members
////////////////////////////////////////////////////////////////////////////////
HistoryPlaylistItem::HistoryPlaylistItem(CollectionListItem *item, Playlist *parent, QListViewItem *after) :
PlaylistItem(item, parent, after)
{
}
HistoryPlaylistItem::~HistoryPlaylistItem()
{
}
////////////////////////////////////////////////////////////////////////////////
// HistoryPlayList public members
////////////////////////////////////////////////////////////////////////////////
HistoryPlaylist::HistoryPlaylist(QWidget *parent) : Playlist(parent, i18n("History"))
{
}
HistoryPlaylist::~HistoryPlaylist()
{
}
void HistoryPlaylist::createItems(const PlaylistItemList &siblings)
{
Playlist::createItems<CollectionListItem, HistoryPlaylistItem, PlaylistItem>(siblings);
}
/***************************************************************************
historyplaylist.h
-------------------
begin : Fri Aug 8 2003
copyright : (C) 2003 by Scott Wheeler
email : wheeler@kde.org
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef HISTORYPLAYLIST_H
#define HISTORYPLAYLIST_H
#include "playlist.h"
#include "playlistitem.h"
class HistoryPlaylistItem;
class HistoryPlaylist : public Playlist
{
public:
HistoryPlaylist(QWidget *parent);
virtual ~HistoryPlaylist();
virtual void createItems(const PlaylistItemList &siblings);
};
class HistoryPlaylistItem : public PlaylistItem
{
public:
HistoryPlaylistItem(CollectionListItem *item, Playlist *parent, QListViewItem *after);
virtual ~HistoryPlaylistItem();
};
#endif
......@@ -29,6 +29,7 @@
#include "playlistsearch.h"
#include "dynamicplaylist.h"
#include "searchplaylist.h"
#include "historyplaylist.h"
#include "mediafiles.h"
#include "advancedsearchdialog.h"
......@@ -471,6 +472,9 @@ void PlaylistSplitter::setupLayout()
setupPlaylist(m_collection, true, "folder_sound", true);
connect(m_collection, SIGNAL(signalCollectionChanged()), m_editor, SLOT(slotUpdateCollection()));
m_history = new HistoryPlaylist(m_playlistStack);
setupPlaylist(m_history, false, "history", true);
// Create the search widget -- this must be done after the CollectionList is created.
m_searchWidget = new SearchWidget(editorSplitter, "searchWidget");
editorSplitter->moveToFirst(m_searchWidget);
......@@ -665,6 +669,12 @@ QString PlaylistSplitter::play(PlaylistItem *item)
m_playingItem = item;
if(m_history) {
PlaylistItemList l;
l.append(item);
m_history->createItems(l);
}
return item->absFilePath();
}
......
......@@ -34,6 +34,7 @@ class KActionMenu;
class KDirWatch;
class PlaylistItem;
class SearchWidget;
class HistoryPlaylist;
/**
* This is the main layout class of JuK. It should contain a PlaylistBox and
......@@ -397,6 +398,7 @@ private:
TagEditor *m_editor;
CollectionList *m_collection;
HistoryPlaylist *m_history;
Playlist *m_dynamicList;
StringHash m_playlistFiles;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment