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 "player/player.h"
31 #include <QPushButton>
32 #include "trackrenderer.h"
33 #include "tagresolver.h"
34 #include "dbusadaptor.h"
35 #include "toolswidget.h"
36 #include "coverfinder.h"
37 #include "clickablelabel.h"
43 using SomePlayer::DataObjects::Library;
44 using SomePlayer::DataObjects::Playlist;
45 using SomePlayer::DataObjects::Track;
46 using SomePlayer::Playback::Player;
47 using SomePlayer::Playback::PlayerState;
48 using SomePlayer::DataObjects::TagResolver;
50 class PlayerForm : public QWidget
55 explicit PlayerForm(Library *lib, QWidget *parent = 0);
57 bool isEqualizerEnabled() { return _player->equalizerEnabled(); }
58 bool isEqualizerAvailable() { return _player->equalizerAvailable(); }
62 void fullscreen(bool);
64 void refreshLibrary();
73 void addFiles(QList<QString> files);
75 void setEqualizerValue(int band, double value) { _player->setEqualizerValue(band, value); }
76 void equalizerValue(int band, double *value) { _player->equalizerValue(band, value); }
77 void enableEqualizer() { _player->enableEqualizer(); }
78 void disableEqualizer() { _player->disableEqualizer(); }
84 void showCountdown(QString);
86 void updateTranslations();
92 void _process_click(QModelIndex);
93 void _track_changed(Track);
95 void _slider_released();
96 void _custom_context_menu_requested ( const QPoint & pos );
98 void _c_delete_track();
99 void _enqueue_track();
100 void _add_to_favorites();
101 void _c_add_to_favorites();
102 void _add_to_playlists();
103 void _c_add_to_playlists();
106 void _state_changed(PlayerState);
107 void _toggle_repeat();
108 void _toggle_random();
109 void _track_decoded(Track);
110 void _tools_widget_toggle();
111 void _display_cover(QImage);
112 void _toggle_extra_buttons();
117 Playlist _current_playlist;
118 ClickableLabel *_cover;
120 QStandardItemModel *_model;
121 CoverFinder *_coverfinder;
123 QSlider *_seek_slider;
124 QMenu *_context_menu;
125 QString _search_pattern;
126 ToolsWidget *_tools_widget;
127 QPushButton *_fscreen_button;
129 QString _icons_theme;
130 QString _top_gradient;
131 QString _bottom_gradient;
132 bool _show_extra_buttons;
134 QAction *__clear_playlist;
135 QAction *__delete_action;
136 QAction *__add_to_favorites;
137 QAction *__enqueue_action;
138 QAction *__add_to_playlists;
139 QAction *__edit_tags;
141 TrackRenderer *_track_renderer;
142 TagResolver *_tag_resolver;
143 void _display_track(Track);
144 int _search_current_id;
146 DBusAdaptop *_dbusadaptor;
149 #endif // PLAYERFORM_H