2 * SomePlayer - An alternate music player for Maemo 5
3 * Copyright (C) 2010 Nikolay (somebody) Tischenko <niktischenko@gmail.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #include "someplayer.h"
26 #include <QStandardItemModel>
27 #include <QStandardItem>
28 #include <QModelIndex>
35 using SomePlayer::DataObjects::Library;
36 using SomePlayer::DataObjects::Track;
37 using SomePlayer::DataObjects::Playlist;
39 enum LibraryFormListState {STATE_NONE, STATE_ARTIST, STATE_ALBUM, STATE_TRACK, STATE_PLAYLIST, STATE_PLAYLIST_TRACK, STATE_DYNAMIC};
41 class LibraryForm : public QWidget
46 explicit LibraryForm(Library *lib, QWidget *parent = 0);
53 void search(QString &);
62 void _dynamic_button();
63 void _playlists_button();
64 void _toggle_select_all_button();
66 void _delete_button();
69 void _process_list_click(QModelIndex);
74 QStandardItemModel *_model;
75 LibraryFormListState _state;
76 QString _current_artist;
77 QString _current_album;
78 Playlist _current_playlist;
79 QList<Track> _current_tracks;
80 QString _search_pattern;
81 int _search_current_id;
82 bool _current_playlist_changed;
84 void _add_artist(QString artist);
85 void _add_album(QString artist, QString album);
86 void _add_track(Track track);
87 void _add_playlist(QString name);
88 void _delete_track(Track track);
92 #endif // LIBRARYFORM_H