2009-12-24 20:16:07 +01:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QSystemTrayIcon>
|
|
|
|
|
|
|
|
#include "ui_mainwindow.h"
|
|
|
|
|
|
|
|
class Playlist;
|
|
|
|
class Player;
|
|
|
|
class Library;
|
|
|
|
class LibraryConfig;
|
2009-12-26 16:13:38 +01:00
|
|
|
class RadioModel;
|
2009-12-24 20:16:07 +01:00
|
|
|
|
|
|
|
class QSortFilterProxyModel;
|
|
|
|
class SystemTrayIcon;
|
|
|
|
|
|
|
|
class MainWindow : public QMainWindow {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
MainWindow(QWidget *parent = 0);
|
|
|
|
~MainWindow();
|
|
|
|
|
|
|
|
void SetHiddenInTray(bool hidden);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void resizeEvent(QResizeEvent* event);
|
|
|
|
void closeEvent(QCloseEvent* event);
|
|
|
|
|
|
|
|
private slots:
|
2009-12-24 23:26:58 +01:00
|
|
|
void QueueFiles(const QList<QUrl>& urls);
|
2009-12-24 21:27:32 +01:00
|
|
|
void FilePathChanged(const QString& path);
|
2009-12-24 20:16:07 +01:00
|
|
|
|
|
|
|
void ReportError(const QString& message);
|
|
|
|
void MediaStopped();
|
|
|
|
void MediaPaused();
|
|
|
|
void MediaPlaying();
|
|
|
|
|
|
|
|
void PlayIndex(const QModelIndex& index);
|
|
|
|
void StopAfterCurrent();
|
|
|
|
|
|
|
|
void LibraryDoubleClick(const QModelIndex& index);
|
|
|
|
void ClearLibraryFilter();
|
|
|
|
|
|
|
|
void VolumeWheelEvent(int delta);
|
|
|
|
void TrayClicked(QSystemTrayIcon::ActivationReason reason);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void SaveGeometry();
|
|
|
|
|
|
|
|
private:
|
|
|
|
static const int kStateVersion;
|
|
|
|
static const char* kSettingsGroup;
|
|
|
|
|
|
|
|
Ui::MainWindow ui_;
|
|
|
|
|
|
|
|
Playlist* playlist_;
|
|
|
|
Player* player_;
|
|
|
|
Library* library_;
|
2009-12-26 16:13:38 +01:00
|
|
|
RadioModel* radio_model_;
|
2009-12-24 20:16:07 +01:00
|
|
|
|
|
|
|
QSortFilterProxyModel* library_sort_model_;
|
|
|
|
|
|
|
|
SystemTrayIcon* tray_icon_;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|