Clementine-audio-player-Mac.../src/mainwindow.h

146 lines
3.5 KiB
C
Raw Normal View History

/* 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>
#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;
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;
class AddStreamDialog;
class AlbumCoverManager;
class PlaylistSequence;
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);
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();
void PlaylistRemoveCurrent();
2010-01-16 17:12:47 +01:00
void EditTracks();
void RenumberTracks();
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();
void HideShowTrayIcon();
void AddMedia();
void AddStream();
void AddStreamAccepted();
2009-12-24 20:16:07 +01:00
private:
void SaveGeometry();
2009-12-24 20:16:07 +01:00
private:
static const int kStateVersion;
static const char* kSettingsGroup;
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_;
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_;
Playlist* playlist_;
2009-12-24 20:16:07 +01:00
Player* player_;
Library* library_;
GlobalShortcuts* global_shortcuts_;
2009-12-24 20:16:07 +01:00
2010-02-03 19:32:48 +01:00
SettingsDialog* settings_dialog_;
AddStreamDialog* add_stream_dialog_;
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_;
QSettings settings_;
2009-12-24 20:16:07 +01:00
};
#endif // MAINWINDOW_H