063508d019c848fc38eb5aeec4ed2ad2942e16cd
[vlc-remote] / src / playermainwindow.h
1 /*   VLC-REMOTE for MAEMO 5
2 *   Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
3 *   This program is free software; you can redistribute it and/or modify
4 *   it under the terms of the GNU General Public License version 2,
5 *   or (at your option) any later version, as published by the Free
6 *   Software Foundation
7 *
8 *   This program is distributed in the hope that it will be useful,
9 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
10 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 *   GNU General Public License for more details
12 *
13 *   You should have received a copy of the GNU General Public
14 *   License along with this program; if not, write to the
15 *   Free Software Foundation, Inc.,
16 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 */
18 #ifndef PLAYERMAINWINDOW_H
19 #define PLAYERMAINWINDOW_H
20
21 #include <QMainWindow>
22 #include <QtNetwork>
23 #include <QtXml>
24 #include <QTimer>
25 #include "playlistmainwindow.h"
26 #include "browsemainwindow.h"
27 #include "favouritesmainwindow.h"
28 #include "vlcstatus.h"
29
30 namespace Ui {
31     class PlayerMainWindow;
32 }
33
34 class PlayerMainWindow : public QMainWindow {
35     Q_OBJECT
36 public:
37     explicit PlayerMainWindow(QWidget *parent = 0);
38     ~PlayerMainWindow();
39
40 public slots:
41     void askStatus();
42     void showSettings();
43     void showConfig();
44     void showAbout();
45     void showFavourites();
46     void play();
47     void playpause();
48     void stop();
49     void pause();
50     void previous();
51     void next();
52     void fullscreen();
53     void volUp();
54     void volDown();
55     void volMute();
56     void slide(int value);
57     void updateUiWithCurrentStatus();
58     void setCoverArt(const QByteArray data);
59     void setCoverArtFromPixmap(QPixmap image);
60     void getCoverArt(int id);
61     void finished(QNetworkReply * reply);
62     void error(QNetworkReply::NetworkError code);
63     void readReady();
64     void updateFromSettings();
65     void orientationChanged();
66     void setPortrait();
67     void setLandscape();
68     void setAutoRotate();
69     void playlistIdUpdated(int id, bool hasart, QString extension);
70
71
72 protected slots:
73     void parseXmlStatus();
74
75 protected:
76     void changeEvent(QEvent *e);
77     void closeEvent(QCloseEvent *);
78
79
80 private:
81     Ui::PlayerMainWindow *ui;
82     PlayListMainWindow * mPlayListMainWindow;
83     BrowseMainWindow * mBrowserMainWindow;
84     FavouritesMainWindow * mFavouritesMainWindow;
85     QNetworkAccessManager * mNetManager;
86     QString mIp;
87     QTimer * mTimer;
88     int mVolume;
89     int mMuted;
90     VlcStatus mCurrentStatus;
91     QByteArray mResponse;
92     bool mIsLandscape;
93     bool mHasImage;
94     bool mIsFirstStatusCall;
95
96 };
97
98 #endif // PLAYERMAINWINDOW_H