summaryrefslogtreecommitdiff
path: root/demo/player/playerpage.h
diff options
context:
space:
mode:
authorVsevolod Buzinov <ext-vsevolod.buzinov@nokia.com>2010-06-21 17:23:09 +0300
committerVsevolod Buzinov <ext-vsevolod.buzinov@nokia.com>2010-07-05 14:28:13 +0300
commitb026f0ad41985234416fa9ca1a2d054e8825961d (patch)
tree48b223aef928c293795d3fda1b1e60045e37a10f /demo/player/playerpage.h
parent3ad5033772ff8c1a331f0c0b208a4a90b698e57b (diff)
downloadlibresourceqt-b026f0ad41985234416fa9ca1a2d054e8825961d.tar.gz
Added initial version of the demo player
Updated documentation for the demo Added video resource acquisition
Diffstat (limited to 'demo/player/playerpage.h')
-rw-r--r--demo/player/playerpage.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/demo/player/playerpage.h b/demo/player/playerpage.h
new file mode 100644
index 0000000..32af2e7
--- /dev/null
+++ b/demo/player/playerpage.h
@@ -0,0 +1,79 @@
+#pragma once
+
+#include <QtGui>
+#include <QFileDialog>
+
+#include <MApplicationPage>
+#include <MVideoWidget>
+#include <MLayout>
+#include <MLinearLayoutPolicy>
+#include <MButton>
+#include <MSlider>
+#include <MOrientationChangeEvent>
+#include <MApplicationMenu>
+#include <MAction>
+#include <MLabel>
+#include <MSeekBar>
+#include <MSceneManager>
+
+#include "playerwidget.h"
+
+/**
+ * \mainpage Policy-aware Player
+ *
+ * Demonstrates how to use libresourceqt to create a policy-aware application.
+ *
+ * There are two classes:
+ * \see PlayerPage creates the UI consisting of a control bar and a video widget
+ * \see PlayerWidget contains all of policy-related customizations
+ * to make the application behave well in concurrent world.
+ *
+ */
+
+/**
+ * PlayerPage class creates the UI of the application. It contains a menu,
+ * a control bar to control the playback, and PlayerWidget that does the actual playback.
+ * For policy-related functionality please refer to PlayerWidget, this class merely
+ * creates the mechanics of the UI for the demo application.
+ *
+ * \see PlayerWidget
+ * \see MApplicationPage
+ */
+
+class PlayerPage : public MApplicationPage
+{
+ Q_OBJECT
+public:
+ PlayerPage();
+
+private:
+ void createContent();
+ void makeControlBar(MLinearLayoutPolicy *controlBarPolicy);
+ void orientationChangeEvent(MOrientationChangeEvent *event);
+ void openFile(QString dir);
+ void setEnabled(MWidget *widget, bool enabled);
+ MButton* makeButton(QString iconID, bool enabled = true);
+ void updateLabelsVisibility();
+
+ MLinearLayoutPolicy *layoutPolicy, *controlBarPolicy;
+ MButton *btnLoadAudio, *btnLoadVideo, *btnPlay;
+ MSeekBar *seekbar;
+ PlayerWidget *playerWidget;
+ MLabel *lblTitle, *lblPosition;
+ MAction *menuAction;
+
+ bool seekbarPressed;
+ bool labelsVisible;
+
+private slots:
+ void openAudioFile();
+ void openVideoFile();
+
+ void togglePolicyAwareness();
+ void setPlayingIcon();
+ void setPausedIcon();
+ void playOrPause();
+ void onPositionChanged();
+ void sliderPressed();
+ void seekToNewPosition();
+};