Merge lp:~stellarium/stellarium/video-playback into lp:stellarium

Proposed by Alexander Wolf
Status: Merged
Merged at revision: 5374
Proposed branch: lp:~stellarium/stellarium/video-playback
Merge into: lp:stellarium
Diff against target: 555 lines (+437/-0)
8 files modified
scripts/tests/videotest.ssc (+19/-0)
src/CMakeLists.txt (+3/-0)
src/core/StelApp.cpp (+4/-0)
src/core/StelApp.hpp (+7/-0)
src/core/StelVideoMgr.cpp (+197/-0)
src/core/StelVideoMgr.hpp (+65/-0)
src/scripting/StelMainScriptAPI.cpp (+74/-0)
src/scripting/StelMainScriptAPI.hpp (+68/-0)
To merge this branch: bzr merge lp:~stellarium/stellarium/video-playback
Reviewer Review Type Date Requested Status
Alexander Wolf Approve
Bogdan Marinov Pending
treaves Pending
Matthew Gates Pending
gzotti Pending
Review via email: mp+104440@code.launchpad.net

This proposal supersedes a proposal from 2012-04-13.

Description of the change

Sibi Antony are add the video playback feature

To post a comment you must log in.
Revision history for this message
Alexander Wolf (alexwolf) wrote : Posted in a previous version of this proposal

I think we can merge this code

review: Approve
Revision history for this message
treaves (treaves) wrote : Posted in a previous version of this proposal

All conditional statements need to use braces.

review: Needs Fixing
Revision history for this message
Alexander Wolf (alexwolf) :
review: Approve
5296. By Alexander Wolf

sync with trunk

5297. By Alexander Wolf

drop videotest.flv file

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'scripts/tests/videotest.ssc'
--- scripts/tests/videotest.ssc 1970-01-01 00:00:00 +0000
+++ scripts/tests/videotest.ssc 2012-06-02 18:10:26 +0000
@@ -0,0 +1,19 @@
1// Name: Video Test
2// Author: Alexander Wolf
3// License: Public Domain
4// Description: This script plays several formats of video file.
5// Note that video support is a build-time option and
6// may not be supported for the version of Stellarium
7// which you have. Also, different playforms may
8// support different video formats.
9//
10
11core.loadVideo("tests/videotest.flv", "flv", 100, 70, true, 0.5);
12
13lab = LabelMgr.labelScreen("Playing video file...", 100, 20, true, 20, "#ff0000");
14core.playVideo("flv");
15core.wait(182);
16LabelMgr.deleteLabel(lab);
17core.wait(0.4);
18
19core.dropVideo("flv");
020
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2012-04-24 14:53:02 +0000
+++ src/CMakeLists.txt 2012-06-02 18:10:26 +0000
@@ -38,6 +38,8 @@
38SET(stellarium_lib_SRCS38SET(stellarium_lib_SRCS
39 core/StelAudioMgr.hpp39 core/StelAudioMgr.hpp
40 core/StelAudioMgr.cpp40 core/StelAudioMgr.cpp
41 core/StelVideoMgr.hpp
42 core/StelVideoMgr.cpp
41 core/StelGeodesicGrid.cpp43 core/StelGeodesicGrid.cpp
42 core/StelGeodesicGrid.hpp44 core/StelGeodesicGrid.hpp
43 core/StelMovementMgr.cpp45 core/StelMovementMgr.cpp
@@ -335,6 +337,7 @@
335# that is, all the headers with SIGNAL/SLOTS/PLUGIN_INTERFACE etc..337# that is, all the headers with SIGNAL/SLOTS/PLUGIN_INTERFACE etc..
336SET(stellarium_MOC_HDRS338SET(stellarium_MOC_HDRS
337 core/StelAudioMgr.hpp339 core/StelAudioMgr.hpp
340 core/StelVideoMgr.hpp
338 core/StelModuleMgr.hpp341 core/StelModuleMgr.hpp
339 core/StelObjectMgr.hpp342 core/StelObjectMgr.hpp
340 core/StelObserver.hpp343 core/StelObserver.hpp
341344
=== modified file 'src/core/StelApp.cpp'
--- src/core/StelApp.cpp 2012-03-22 06:18:01 +0000
+++ src/core/StelApp.cpp 2012-06-02 18:10:26 +0000
@@ -44,6 +44,7 @@
44#include "StelJsonParser.hpp"44#include "StelJsonParser.hpp"
45#include "StelSkyLayerMgr.hpp"45#include "StelSkyLayerMgr.hpp"
46#include "StelAudioMgr.hpp"46#include "StelAudioMgr.hpp"
47#include "StelVideoMgr.hpp"
47#include "StelGuiBase.hpp"48#include "StelGuiBase.hpp"
48#include "StelPainter.hpp"49#include "StelPainter.hpp"
4950
@@ -292,6 +293,9 @@
292 // Init audio manager293 // Init audio manager
293 audioMgr = new StelAudioMgr();294 audioMgr = new StelAudioMgr();
294295
296 // Init video manager
297 videoMgr = new StelVideoMgr();
298
295 // Constellations299 // Constellations
296 ConstellationMgr* asterisms = new ConstellationMgr(hip_stars);300 ConstellationMgr* asterisms = new ConstellationMgr(hip_stars);
297 asterisms->init();301 asterisms->init();
298302
=== modified file 'src/core/StelApp.hpp'
--- src/core/StelApp.hpp 2012-02-17 18:12:37 +0000
+++ src/core/StelApp.hpp 2012-06-02 18:10:26 +0000
@@ -38,6 +38,7 @@
38class StelLocationMgr;38class StelLocationMgr;
39class StelSkyLayerMgr;39class StelSkyLayerMgr;
40class StelAudioMgr;40class StelAudioMgr;
41class StelVideoMgr;
41class StelGuiBase;42class StelGuiBase;
4243
43//! @class StelApp44//! @class StelApp
@@ -109,6 +110,9 @@
109 //! Get the audio manager110 //! Get the audio manager
110 StelAudioMgr* getStelAudioMgr() {return audioMgr;}111 StelAudioMgr* getStelAudioMgr() {return audioMgr;}
111112
113 //! Get the video manager
114 StelVideoMgr* getStelVideoMgr() {return videoMgr;}
115
112 //! Get the core of the program.116 //! Get the core of the program.
113 //! It is the one which provide the projection, navigation and tone converter.117 //! It is the one which provide the projection, navigation and tone converter.
114 //! @return the StelCore instance of the program118 //! @return the StelCore instance of the program
@@ -226,6 +230,9 @@
226 // The audio manager. Must execute in the main thread.230 // The audio manager. Must execute in the main thread.
227 StelAudioMgr* audioMgr;231 StelAudioMgr* audioMgr;
228232
233 // The video manager. Must execute in the main thread.
234 StelVideoMgr* videoMgr;
235
229 StelSkyLayerMgr* skyImageMgr;236 StelSkyLayerMgr* skyImageMgr;
230237
231 StelGuiBase* stelGui;238 StelGuiBase* stelGui;
232239
=== added file 'src/core/StelVideoMgr.cpp'
--- src/core/StelVideoMgr.cpp 1970-01-01 00:00:00 +0000
+++ src/core/StelVideoMgr.cpp 2012-06-02 18:10:26 +0000
@@ -0,0 +1,197 @@
1/*
2 * Copyright (C) 2012 Sibi Antony
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
17 */
18
19#include "StelVideoMgr.hpp"
20#include "StelMainGraphicsView.hpp"
21#include <QDebug>
22
23
24StelVideoMgr::StelVideoMgr()
25{
26}
27
28#ifdef HAVE_QT_PHONON
29StelVideoMgr::~StelVideoMgr()
30{
31 foreach(QString id, videoObjects.keys())
32 {
33 dropVideo(id);
34 }
35}
36
37void StelVideoMgr::loadVideo(const QString& filename, const QString& id, float x, float y, bool show, float alpha)
38{
39 if (videoObjects.contains(id))
40 {
41 qWarning() << "[StelVideoMgr] Video object with ID" << id << "already exists, dropping it";
42 dropVideo(id);
43 }
44
45 videoObjects[id] = new VideoPlayer;
46 videoObjects[id]->widget = new QWidget();
47 videoObjects[id]->player = new Phonon::VideoPlayer(Phonon::VideoCategory, videoObjects[id]->widget);
48
49 videoObjects[id]->player->load(Phonon::MediaSource(filename));
50 videoObjects[id]->pWidget =
51 StelMainGraphicsView::getInstance().scene()->addWidget(videoObjects[id]->widget, Qt::FramelessWindowHint);
52
53 videoObjects[id]->pWidget->setPos(x, y);
54 videoObjects[id]->pWidget->setOpacity(alpha);
55 videoObjects[id]->pWidget->setVisible(show);
56 videoObjects[id]->player->show();
57
58}
59
60void StelVideoMgr::playVideo(const QString& id)
61{
62 if (videoObjects.contains(id))
63 {
64 if (videoObjects[id]->player!=NULL)
65 {
66 // if already playing, stop and play from the start
67 if (videoObjects[id]->player->isPlaying() == true)
68 {
69 videoObjects[id]->player->stop();
70 }
71
72 // otherwise just play it
73 videoObjects[id]->player->play();
74 }
75 }
76}
77
78void StelVideoMgr::pauseVideo(const QString& id)
79{
80 if (videoObjects.contains(id))
81 {
82 if (videoObjects[id]->player!=NULL)
83 {
84 videoObjects[id]->player->pause();
85 }
86 }
87}
88
89void StelVideoMgr::stopVideo(const QString& id)
90{
91 if (videoObjects.contains(id))
92 {
93 if (videoObjects[id]->player!=NULL)
94 {
95 videoObjects[id]->player->stop();
96 }
97 }
98}
99
100void StelVideoMgr::seekVideo(const QString& id, qint64 ms)
101{
102 if (videoObjects.contains(id))
103 {
104 if (videoObjects[id]->player!=NULL)
105 {
106 if (videoObjects[id]->player->mediaObject()->isSeekable())
107 {
108 videoObjects[id]->player->seek(ms);
109 // Seek capability depends on the backend used.
110 }
111 else
112 {
113 qDebug() << "[StelVideoMgr] Cannot seek media source.";
114 }
115 }
116 }
117}
118
119void StelVideoMgr::dropVideo(const QString& id)
120{
121 if (!videoObjects.contains(id))
122 return;
123 if (videoObjects[id]->player!=NULL)
124 {
125 videoObjects[id]->player->stop();
126 delete videoObjects[id]->player;
127 delete videoObjects[id]->pWidget;
128 delete videoObjects[id];
129
130 videoObjects.remove(id);
131 }
132}
133
134void StelVideoMgr::setVideoXY(const QString& id, float x, float y)
135{
136 if (videoObjects.contains(id))
137 {
138 if (videoObjects[id]->pWidget!=NULL)
139 {
140 videoObjects[id]->pWidget->setPos(x, y);
141 }
142 }
143
144}
145
146void StelVideoMgr::setVideoAlpha(const QString& id, float alpha)
147{
148 if (videoObjects.contains(id))
149 {
150 if (videoObjects[id]->pWidget!=NULL)
151 {
152 videoObjects[id]->pWidget->setOpacity(alpha);
153 }
154 }
155}
156
157void StelVideoMgr::resizeVideo(const QString& id, float w, float h)
158{
159 if (videoObjects.contains(id))
160 {
161 if (videoObjects[id]->pWidget!=NULL)
162 {
163 videoObjects[id]->pWidget->resize(w, h);
164 videoObjects[id]->player->resize(w, h);
165 }
166 }
167}
168
169void StelVideoMgr::showVideo(const QString& id, bool show)
170{
171 if (videoObjects.contains(id))
172 {
173 if (videoObjects[id]->pWidget!=NULL)
174 {
175 videoObjects[id]->pWidget->setVisible(show);
176 }
177 }
178}
179
180#else // HAVE_QT_PHONON
181void StelVideoMgr::loadVideo(const QString& filename, const QString& id, float x, float y, bool show, float alpha)
182{
183 qWarning() << "[StelVideoMgr] This build of Stellarium does not support video - cannot load video" << filename << id << x << y << show << alpha;
184}
185StelVideoMgr::~StelVideoMgr() {;}
186void StelVideoMgr::playVideo(const QString&) {;}
187void StelVideoMgr::pauseVideo(const QString&) {;}
188void StelVideoMgr::stopVideo(const QString&) {;}
189void StelVideoMgr::dropVideo(const QString&) {;}
190void StelVideoMgr::seekVideo(const QString&, qint64) {;}
191void StelVideoMgr::setVideoXY(const QString&, float, float) {;}
192void StelVideoMgr::setVideoAlpha(const QString&, float) {;}
193void StelVideoMgr::resizeVideo(const QString&, float, float) {;}
194void StelVideoMgr::showVideo(const QString&, bool) {;}
195#endif // HAVE_QT_PHONON
196
197
0198
=== added file 'src/core/StelVideoMgr.hpp'
--- src/core/StelVideoMgr.hpp 1970-01-01 00:00:00 +0000
+++ src/core/StelVideoMgr.hpp 2012-06-02 18:10:26 +0000
@@ -0,0 +1,65 @@
1/*
2 * Copyright (C) 2012 Sibi Antony
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
17 */
18
19#ifndef _STELVIDEOMGR_HPP_
20#define _STELVIDEOMGR_HPP_
21
22#ifdef HAVE_QT_PHONON
23#include <phonon/videoplayer.h>
24#include <phonon/videowidget.h>
25#include <phonon/mediaobject.h>
26#endif
27
28#include <QObject>
29#include <QMap>
30#include <QString>
31#include <QGraphicsProxyWidget>
32
33class StelVideoMgr : public QObject
34{
35 Q_OBJECT
36
37public:
38 StelVideoMgr();
39 ~StelVideoMgr();
40
41public slots:
42 void loadVideo(const QString& filename, const QString& id, float x, float y, bool show, float alpha);
43 void playVideo(const QString& id);
44 void pauseVideo(const QString& id);
45 void stopVideo(const QString& id);
46 void dropVideo(const QString& id);
47 void seekVideo(const QString& id, qint64 ms);
48 void setVideoXY(const QString& id, float x, float y);
49 void setVideoAlpha(const QString& id, float alpha);
50 void resizeVideo(const QString& id, float w, float h);
51 void showVideo(const QString& id, bool show);
52
53private:
54#ifdef HAVE_QT_PHONON
55 typedef struct {
56 QWidget *widget;
57 Phonon::VideoPlayer *player;
58 QGraphicsProxyWidget *pWidget;
59 } VideoPlayer;
60 QMap<QString, VideoPlayer*> videoObjects;
61#endif
62
63};
64
65#endif // _STELVIDEOMGR_HPP_
066
=== modified file 'src/scripting/StelMainScriptAPI.cpp'
--- src/scripting/StelMainScriptAPI.cpp 2012-02-20 06:15:32 +0000
+++ src/scripting/StelMainScriptAPI.cpp 2012-06-02 18:10:26 +0000
@@ -33,6 +33,7 @@
33#include "StarMgr.hpp"33#include "StarMgr.hpp"
34#include "StelApp.hpp"34#include "StelApp.hpp"
35#include "StelAudioMgr.hpp"35#include "StelAudioMgr.hpp"
36#include "StelVideoMgr.hpp"
36#include "StelCore.hpp"37#include "StelCore.hpp"
37#include "StelFileMgr.hpp"38#include "StelFileMgr.hpp"
38#include "StelLocation.hpp"39#include "StelLocation.hpp"
@@ -76,6 +77,18 @@
76 connect(this, SIGNAL(requestPauseSound(const QString&)), StelApp::getInstance().getStelAudioMgr(), SLOT(pauseSound(const QString&)));77 connect(this, SIGNAL(requestPauseSound(const QString&)), StelApp::getInstance().getStelAudioMgr(), SLOT(pauseSound(const QString&)));
77 connect(this, SIGNAL(requestStopSound(const QString&)), StelApp::getInstance().getStelAudioMgr(), SLOT(stopSound(const QString&)));78 connect(this, SIGNAL(requestStopSound(const QString&)), StelApp::getInstance().getStelAudioMgr(), SLOT(stopSound(const QString&)));
78 connect(this, SIGNAL(requestDropSound(const QString&)), StelApp::getInstance().getStelAudioMgr(), SLOT(dropSound(const QString&)));79 connect(this, SIGNAL(requestDropSound(const QString&)), StelApp::getInstance().getStelAudioMgr(), SLOT(dropSound(const QString&)));
80
81 connect(this, SIGNAL(requestLoadVideo(const QString&, const QString&, float, float, bool, float)), StelApp::getInstance().getStelVideoMgr(), SLOT(loadVideo(const QString&, const QString&, float, float, bool, float)));
82 connect(this, SIGNAL(requestPlayVideo(const QString&)), StelApp::getInstance().getStelVideoMgr(), SLOT(playVideo(const QString&)));
83 connect(this, SIGNAL(requestPauseVideo(const QString&)), StelApp::getInstance().getStelVideoMgr(), SLOT(pauseVideo(const QString&)));
84 connect(this, SIGNAL(requestStopVideo(const QString&)), StelApp::getInstance().getStelVideoMgr(), SLOT(stopVideo(const QString&)));
85 connect(this, SIGNAL(requestDropVideo(const QString&)), StelApp::getInstance().getStelVideoMgr(), SLOT(dropVideo(const QString&)));
86 connect(this, SIGNAL(requestSeekVideo(const QString&, qint64)), StelApp::getInstance().getStelVideoMgr(), SLOT(seekVideo(const QString&, qint64)));
87 connect(this, SIGNAL(requestSetVideoXY(const QString&, float, float)), StelApp::getInstance().getStelVideoMgr(), SLOT(setVideoXY(const QString&, float, float)));
88 connect(this, SIGNAL(requestSetVideoAlpha(const QString&, float)), StelApp::getInstance().getStelVideoMgr(), SLOT(setVideoAlpha(const QString&, float)));
89 connect(this, SIGNAL(requestResizeVideo(const QString&, float, float)), StelApp::getInstance().getStelVideoMgr(), SLOT(resizeVideo(const QString&, float, float)));
90 connect(this, SIGNAL(requestShowVideo(const QString&, bool)), StelApp::getInstance().getStelVideoMgr(), SLOT(showVideo(const QString&, bool)));
91
79 connect(this, SIGNAL(requestExit()), this->parent(), SLOT(stopScript()));92 connect(this, SIGNAL(requestExit()), this->parent(), SLOT(stopScript()));
80 connect(this, SIGNAL(requestSetNightMode(bool)), &StelApp::getInstance(), SLOT(setVisionModeNight(bool)));93 connect(this, SIGNAL(requestSetNightMode(bool)), &StelApp::getInstance(), SLOT(setVisionModeNight(bool)));
81 connect(this, SIGNAL(requestSetProjectionMode(QString)), StelApp::getInstance().getCore(), SLOT(setCurrentProjectionTypeKey(QString)));94 connect(this, SIGNAL(requestSetProjectionMode(QString)), StelApp::getInstance().getCore(), SLOT(setCurrentProjectionTypeKey(QString)));
@@ -385,6 +398,67 @@
385 emit(requestDropSound(id));398 emit(requestDropSound(id));
386}399}
387400
401void StelMainScriptAPI::loadVideo(const QString& filename, const QString& id, float x, float y, bool show, float alpha)
402{
403 QString path;
404 try
405 {
406 path = StelFileMgr::findFile("scripts/" + filename);
407 }
408 catch(std::runtime_error& e)
409 {
410 qWarning() << "cannot play video" << filename << ":" << e.what();
411 return;
412 }
413
414 emit(requestLoadVideo(path, id, x, y, show, alpha));
415}
416
417void StelMainScriptAPI::playVideo(const QString& id)
418{
419 emit(requestPlayVideo(id));
420}
421
422void StelMainScriptAPI::pauseVideo(const QString& id)
423{
424 emit(requestPauseVideo(id));
425}
426
427void StelMainScriptAPI::stopVideo(const QString& id)
428{
429 emit(requestStopVideo(id));
430}
431
432void StelMainScriptAPI::dropVideo(const QString& id)
433{
434 emit(requestDropVideo(id));
435}
436
437void StelMainScriptAPI::seekVideo(const QString& id, qint64 ms)
438{
439 emit(requestSeekVideo(id, ms));
440}
441
442void StelMainScriptAPI::setVideoXY(const QString& id, float x, float y)
443{
444 emit(requestSetVideoXY(id, x, y));
445}
446
447void StelMainScriptAPI::setVideoAlpha(const QString& id, float alpha)
448{
449 emit(requestSetVideoAlpha(id, alpha));
450}
451
452void StelMainScriptAPI::resizeVideo(const QString& id, float w, float h)
453{
454 emit(requestResizeVideo(id, w, h));
455}
456
457void StelMainScriptAPI::showVideo(const QString& id, bool show)
458{
459 emit(requestShowVideo(id, show));
460}
461
388int StelMainScriptAPI::getScreenWidth()462int StelMainScriptAPI::getScreenWidth()
389{463{
390 return StelMainGraphicsView::getInstance().size().width();464 return StelMainGraphicsView::getInstance().size().width();
391465
=== modified file 'src/scripting/StelMainScriptAPI.hpp'
--- src/scripting/StelMainScriptAPI.hpp 2012-01-11 10:50:37 +0000
+++ src/scripting/StelMainScriptAPI.hpp 2012-06-02 18:10:26 +0000
@@ -386,6 +386,63 @@
386 //! @param id the identifier used when loadSound was called386 //! @param id the identifier used when loadSound was called
387 void dropSound(const QString& id);387 void dropSound(const QString& id);
388388
389 //! Load a video from a file.
390 //! @param filename the name of the file to load.
391 //! @param id the identifier which will be used to refer to the video
392 //! when calling playVideo, pauseVideo, stopVideo and dropVideo.
393 //! @param x the x-coordinate for the video widget.
394 //! @param y the y-coordinate for the video widget.
395 //! @param show the visibility state for the video.
396 //! @param alpha the initial alpha value of the video.
397 void loadVideo(const QString& filename, const QString& id, float x, float y, bool show, float alpha);
398
399 //! Play a video which has previously been loaded with loadVideo
400 //! @param id the identifier used when loadVideo was called
401 void playVideo(const QString& id);
402
403 //! Pause a video which is playing. Subsequent playVideo calls will
404 //! resume playing from the position in the file when it was paused.
405 //! @param id the identifier used when loadVideo was called
406 void pauseVideo(const QString& id);
407
408 //! Stop a video from playing. This resets the position in the
409 //! video to the start so that subsequent playVideo calls will
410 //! start from the beginning.
411 //! @param id the identifier used when loadVideo was called
412 void stopVideo(const QString& id);
413
414 //! Drop a video from memory. You should do this before the end
415 //! of your script.
416 //! @param id the identifier used when loadVideo was called
417 void dropVideo(const QString& id);
418
419 //! Seeks a video to the requested time.
420 //! @param id the identifier used when loadVideo was called
421 //! @param ms the time in milliseconds from the start of the media.
422 void seekVideo(const QString& id, qint64 ms);
423
424 //! Sets the position of the video widget.
425 //! @param id the identifier used when loadVideo was called
426 //! @param x the new x-coordinate for the video.
427 //! @param y the new y-coordinate for the video.
428 void setVideoXY(const QString& id, float x, float y);
429
430 //! Set the alpha value of a video when visible.
431 //! @param id the identifier used when loadVideo was called
432 //! @param alpha the new alpha value to set.
433 void setVideoAlpha(const QString& id, float alpha);
434
435 //! Resize the video widget to the specified width, height.
436 //! @param id the identifier used when loadVideo was called
437 //! @param w the new width for the widget.
438 //! @param h the new height for the widget.
439 void resizeVideo(const QString& id, float w, float h);
440
441 //! Set the visibility state of a video.
442 //! @param id the identifier used when loadVideo was called
443 //! @param show the new visible state of the video.
444 void showVideo(const QString& id, bool show);
445
389 //! Get the screen width in pixels.446 //! Get the screen width in pixels.
390 //! @return The screen width in pixels447 //! @return The screen width in pixels
391 int getScreenWidth();448 int getScreenWidth();
@@ -452,6 +509,17 @@
452 void requestPauseSound(const QString& id);509 void requestPauseSound(const QString& id);
453 void requestStopSound(const QString& id);510 void requestStopSound(const QString& id);
454 void requestDropSound(const QString& id);511 void requestDropSound(const QString& id);
512 void requestLoadVideo(const QString& filename, const QString& id, float x, float y, bool show, float alpha);
513 void requestPlayVideo(const QString& id);
514 void requestPauseVideo(const QString& id);
515 void requestStopVideo(const QString& id);
516 void requestDropVideo(const QString& id);
517 void requestSeekVideo(const QString& id, qint64 ms);
518 void requestSetVideoXY(const QString& id, float x, float y);
519 void requestSetVideoAlpha(const QString& id, float alpha);
520 void requestResizeVideo(const QString& id, float w, float h);
521 void requestShowVideo(const QString& id, bool show);
522
455 void requestSetNightMode(bool b);523 void requestSetNightMode(bool b);
456 void requestSetProjectionMode(QString id);524 void requestSetProjectionMode(QString id);
457 void requestSetSkyCulture(QString id);525 void requestSetSkyCulture(QString id);