Parent: [fddc0d] (diff)

Child: [7bd73f] (diff)

Download this file

GUI_Player.h    216 lines (166 with data), 5.8 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
/* Copyright (C) 2011 Lucio Carreras
*
* This file is part of sayonara player
*
* 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 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GUI_SIMPLEPLAYER_H
#define GUI_SIMPLEPLAYER_H
#include <QMainWindow>
#include <QCloseEvent>
#include <QTranslator>
#include <QList>
#include <QCloseEvent>
#include <QKeySequence>
#include <QTranslator>
#include <QWidget>
#include <QAction>
#include <QDebug>
#include "ui_GUI_Player.h"
#include "GUI/player/GUI_TrayIcon.h"
#include "HelperStructs/Helper.h"
class GUI_Playlist;
class PlayerPlugin;
class GUI_Library_windowed;
class GUI_InfoDialog;
class PlayerPluginHandler;
class GUI_LibraryPath;
class GUI_Notifications;
class GUI_Startup_Dialog;
class CoverLookup;
class GUI_Alternate_Covers;
class GUI_Player : public QMainWindow {
Q_OBJECT
public:
explicit GUI_Player(QTranslator* translator, QWidget *parent = 0);
~GUI_Player();
public slots:
void covers_found(const QStringList& lst, QString call_id);
void update_track (const MetaData & in, int pos=0, bool playing=true);
void setCurrentPosition (quint32 pos_sec);
void really_close(bool=false);
void trayItemActivated (QSystemTrayIcon::ActivationReason reason);
void stopped();
void setVolume(int vol);
void setVolumeUi(int volume_percent);
/* Plugins */
void showPlugin(PlayerPlugin* plugin);
void hideAllPlugins();
void setRendererName(const QString& nm);
signals:
/* Player*/
void play();
void pause();
void stop();
void backward();
void forward();
void mute();
void sig_rec_button_toggled(bool);
void sig_volume_changed (int);
void search(int pos_percent);
/* File */
void sig_choose_renderer();
/* Preferences / View */
void show_playlists();
void show_small_playlist_items(bool);
void sig_skin_changed(bool);
/* Covers */
void sig_want_cover(const MetaData &);
void sig_fetch_alternate_covers(int);
void sig_want_more_covers();
void sig_fetch_all_covers();
void sig_stream_selected(const QString&, const QString&);
private slots:
void playClicked(bool b = true);
void stopClicked(bool b = true);
void backwardClicked(bool b = true);
void forwardClicked(bool b = true);
void sl_rec_button_toggled(bool b);
void coverClicked();
void setProgressJump(int percent);
void jump_forward();
void jump_backward();
void muteButtonPressed();
void volumeChanged(int volume_percent);
void volumeChangedByTick(int val);
void volumeHigher();
void volumeLower();
/* File */
void onChangeMediaRenderer();
/* View */
void showLibrary(bool, bool resize=true);
void changeSkin(bool);
void small_playlist_items_toggled(bool);
void show_notification_toggled(bool);
void show_fullscreen_toggled(bool);
/* Preferences */
void load_pl_on_startup_toggled(bool);
void min2tray_toggled(bool);
void only_one_instance_toggled(bool);
void sl_notify_new_version(bool);
void about(bool b=false);
void help(bool b=false);
void sl_alternate_cover_available(QString, QString);
void sl_no_cover_available();
void notification_changed(bool active, int ms);
public:
void setPlaylist(GUI_Playlist* playlist);
void setLibrary(GUI_Library_windowed* library);
void setInfoDialog(GUI_InfoDialog* info_dialog);
void setPlayerPluginHandler(PlayerPluginHandler* pph);
QWidget* getParentOfPlaylist();
QWidget* getParentOfLibrary();
QWidget* getParentOfPlugin();
void ui_loaded();
void setStyle(int);
protected:
void closeEvent(QCloseEvent* e);
void keyPressEvent(QKeyEvent* e);
void resizeEvent(QResizeEvent* e);
void moveEvent(QMoveEvent* e);
private:
Ui::Upplay *ui;
GUI_Playlist* ui_playlist;
GUI_Library_windowed* ui_library;
GUI_LibraryPath* ui_libpath;
GUI_InfoDialog* ui_info_dialog;
GUI_Notifications* ui_notifications;
GUI_Startup_Dialog* ui_startup_dialog;
CoverLookup* m_cov_lookup;
PlayerPluginHandler* _pph;
GUI_Alternate_Covers* m_alternate_covers;
QString m_class_name;
QString m_renderer_friendly_name;
quint32 m_completeLength_ms;
bool m_playing;
bool m_mute;
GUI_TrayIcon * m_trayIcon;
QString m_skinSuffix;
MetaData m_metadata;
MetaData m_metadata_corrected;
bool m_metadata_available;
bool m_min2tray;
int m_library_width;
int m_library_stretch_factor;
CSettingsStorage* m_settings;
QTranslator* m_translator;
void setupTrayActions ();
void setVolume(int vol, bool dostore, bool doemit);
void setupVolButton(int percent);
void initGUI();
void setupConnections();
void total_time_changed(qint64);
void fetch_cover();
QAction* createAction(QKeySequence key_sequence);
QAction* createAction(QList<QKeySequence>& key_sequences);
};
#endif // GUI_SIMPLEPLAYER_H