2010-03-24 00:11:46 +01:00
|
|
|
/* This file is part of Clementine.
|
|
|
|
|
|
|
|
Clementine 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.
|
|
|
|
|
|
|
|
Clementine 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 Clementine. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2009-12-24 20:16:07 +01:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
2010-02-27 09:57:43 +01:00
|
|
|
#include <QSettings>
|
2009-12-24 20:16:07 +01:00
|
|
|
#include <QSystemTrayIcon>
|
|
|
|
|
|
|
|
#include "ui_mainwindow.h"
|
|
|
|
|
|
|
|
class Playlist;
|
|
|
|
class Player;
|
|
|
|
class Library;
|
2010-02-03 17:17:04 +01:00
|
|
|
class LibraryConfigDialog;
|
2009-12-26 16:13:38 +01:00
|
|
|
class RadioModel;
|
2009-12-29 21:48:50 +01:00
|
|
|
class Song;
|
2009-12-30 02:41:37 +01:00
|
|
|
class RadioItem;
|
2010-01-08 15:52:05 +01:00
|
|
|
class OSD;
|
2010-01-15 18:12:47 +01:00
|
|
|
class TrackSlider;
|
2010-01-16 17:12:47 +01:00
|
|
|
class EditTagDialog;
|
2010-01-16 18:52:51 +01:00
|
|
|
class MultiLoadingIndicator;
|
2010-02-03 17:17:04 +01:00
|
|
|
class SettingsDialog;
|
2010-02-03 21:45:32 +01:00
|
|
|
class About;
|
2010-02-24 23:26:01 +01:00
|
|
|
class AddStreamDialog;
|
2010-02-28 19:04:50 +01:00
|
|
|
class AlbumCoverManager;
|
2010-03-08 19:05:41 +01:00
|
|
|
class PlaylistSequence;
|
2010-03-21 20:02:56 +01:00
|
|
|
class GlobalShortcuts;
|
2009-12-24 20:16:07 +01:00
|
|
|
|
|
|
|
class QSortFilterProxyModel;
|
|
|
|
class SystemTrayIcon;
|
|
|
|
|
2010-03-03 21:35:19 +01:00
|
|
|
class QNetworkAccessManager;
|
|
|
|
|
2009-12-24 20:16:07 +01:00
|
|
|
class MainWindow : public QMainWindow {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2010-03-03 21:35:19 +01:00
|
|
|
MainWindow(QNetworkAccessManager* network, QWidget *parent = 0);
|
2009-12-24 20:16:07 +01:00
|
|
|
~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();
|
|
|
|
|
2010-01-15 17:22:19 +01:00
|
|
|
void PlaylistRightClick(const QPoint& global_pos, const QModelIndex& index);
|
|
|
|
void PlaylistPlay();
|
|
|
|
void PlaylistStopAfter();
|
2010-03-24 17:36:44 +01:00
|
|
|
void PlaylistRemoveCurrent();
|
2010-01-16 17:12:47 +01:00
|
|
|
void EditTracks();
|
2010-03-22 23:46:53 +01:00
|
|
|
void RenumberTracks();
|
2010-03-24 01:12:52 +01:00
|
|
|
void SelectionSetValue();
|
2010-01-15 17:22:19 +01:00
|
|
|
|
2009-12-24 20:16:07 +01:00
|
|
|
void PlayIndex(const QModelIndex& index);
|
|
|
|
void StopAfterCurrent();
|
|
|
|
|
|
|
|
void LibraryDoubleClick(const QModelIndex& index);
|
|
|
|
void ClearLibraryFilter();
|
|
|
|
|
|
|
|
void VolumeWheelEvent(int delta);
|
|
|
|
void TrayClicked(QSystemTrayIcon::ActivationReason reason);
|
|
|
|
|
2009-12-29 20:57:33 +01:00
|
|
|
void UpdateTrackPosition();
|
|
|
|
|
2009-12-30 00:17:54 +01:00
|
|
|
void RadioDoubleClick(const QModelIndex& index);
|
2009-12-30 02:41:37 +01:00
|
|
|
void InsertRadioItem(RadioItem*);
|
2009-12-29 21:48:50 +01:00
|
|
|
void ScrobblingEnabledChanged(bool value);
|
|
|
|
void Love();
|
|
|
|
|
2010-01-16 18:52:51 +01:00
|
|
|
void LibraryScanStarted();
|
|
|
|
void LibraryScanFinished();
|
|
|
|
|
2010-02-03 22:48:00 +01:00
|
|
|
void PlayerInitFinished();
|
|
|
|
|
2010-02-26 19:22:44 +01:00
|
|
|
void HideShowTrayIcon();
|
|
|
|
|
2010-02-24 23:26:01 +01:00
|
|
|
void AddMedia();
|
|
|
|
void AddStream();
|
|
|
|
void AddStreamAccepted();
|
|
|
|
|
2009-12-24 20:16:07 +01:00
|
|
|
private:
|
|
|
|
void SaveGeometry();
|
2010-03-06 16:33:57 +01:00
|
|
|
|
2009-12-24 20:16:07 +01:00
|
|
|
private:
|
|
|
|
static const int kStateVersion;
|
|
|
|
static const char* kSettingsGroup;
|
2010-03-07 15:42:51 +01:00
|
|
|
static const char* kMediaFilterSpec;
|
2009-12-24 20:16:07 +01:00
|
|
|
|
|
|
|
Ui::MainWindow ui_;
|
2009-12-29 20:57:33 +01:00
|
|
|
SystemTrayIcon* tray_icon_;
|
2010-01-08 15:52:05 +01:00
|
|
|
OSD* osd_;
|
2010-01-15 18:12:47 +01:00
|
|
|
TrackSlider* track_slider_;
|
2010-03-08 19:05:41 +01:00
|
|
|
PlaylistSequence* playlist_sequence_;
|
2010-01-16 17:12:47 +01:00
|
|
|
EditTagDialog* edit_tag_dialog_;
|
2010-01-16 18:52:51 +01:00
|
|
|
MultiLoadingIndicator* multi_loading_indicator_;
|
2010-02-03 17:17:04 +01:00
|
|
|
LibraryConfigDialog* library_config_dialog_;
|
2010-02-03 21:45:32 +01:00
|
|
|
About* about_dialog_;
|
2009-12-24 20:16:07 +01:00
|
|
|
|
2009-12-26 22:35:45 +01:00
|
|
|
RadioModel* radio_model_;
|
2010-03-10 01:04:04 +01:00
|
|
|
Playlist* playlist_;
|
2009-12-24 20:16:07 +01:00
|
|
|
Player* player_;
|
|
|
|
Library* library_;
|
2010-03-21 20:02:56 +01:00
|
|
|
GlobalShortcuts* global_shortcuts_;
|
2009-12-24 20:16:07 +01:00
|
|
|
|
2010-02-03 19:32:48 +01:00
|
|
|
SettingsDialog* settings_dialog_;
|
2010-02-24 23:26:01 +01:00
|
|
|
AddStreamDialog* add_stream_dialog_;
|
2010-02-28 19:04:50 +01:00
|
|
|
AlbumCoverManager* cover_manager_;
|
2010-02-03 19:32:48 +01:00
|
|
|
|
2010-01-15 17:22:19 +01:00
|
|
|
QMenu* playlist_menu_;
|
|
|
|
QAction* playlist_play_pause_;
|
|
|
|
QAction* playlist_stop_after_;
|
|
|
|
QModelIndex playlist_menu_index_;
|
|
|
|
|
2009-12-24 20:16:07 +01:00
|
|
|
QSortFilterProxyModel* library_sort_model_;
|
|
|
|
|
2009-12-29 20:57:33 +01:00
|
|
|
QTimer* track_position_timer_;
|
2010-02-27 17:52:18 +01:00
|
|
|
QSettings settings_;
|
2009-12-24 20:16:07 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|