EnglishУкраїнськаmRussian
Login/New
Topic with many replies

Реализация Phonon бекенда для Media виджета


Author Message
Written on: 25. 04. 2012 [12:35]
aleax
Alexey Bondarchuk
Topic creator
registered since: 27.01.2010
Posts: 73
Добавил выдачу сигнала Phonon:VideoPlayer::finished() в систему событий OpenSCADA как "ws_MediaFinished":
Патч на svn tag_0.8
JAVASCRIPT
Index: src/moduls/ui/Vision/vis_shapes.cpp
===================================================================
--- src/moduls/ui/Vision/vis_shapes.cpp	(revision 1804)
+++ src/moduls/ui/Vision/vis_shapes.cpp	(working copy)
@@ -1251,6 +1251,7 @@
 		{
 		    shD->addrWdg = new VideoPlayer(Phonon::VideoCategory, w);
 		    if(shD->videoRoll) connect(shD->addrWdg, SIGNAL(finished()), shD->addrWdg, SLOT(play()));
+		    connect(shD->addrWdg, SIGNAL(finished()), this, SLOT(MediaFinished()));
 		    ((VideoPlayer*)shD->addrWdg)->videoWidget()->installEventFilter(w);
 		    mk_new = true;
 		}
@@ -1312,6 +1313,12 @@
     return up;
 }
 
+void ShapeMedia::MediaFinished( )
+{
+    WdgView *w = (WdgView *)((QWidget*)sender())->parentWidget();
+    w->attrSet("event","ws_MediaFinished");
+}
+
 bool ShapeMedia::event( WdgView *w, QEvent *event )
 {
     ShpDt *shD = (ShpDt*)w->shpData;
Index: src/moduls/ui/Vision/vis_shapes.h
===================================================================
--- src/moduls/ui/Vision/vis_shapes.h	(revision 1804)
+++ src/moduls/ui/Vision/vis_shapes.h	(working copy)
@@ -234,6 +234,8 @@
 //************************************************
 class ShapeMedia : public WdgShape
 {
+    Q_OBJECT
+
     public:
 	//Methods
 	ShapeMedia( );
@@ -245,6 +247,11 @@
 	bool eventFilter( WdgView *view, QObject *object, QEvent *event );
 
 	void clear( WdgView *view );
+	
+    public slots:
+	//Public slots
+	//>> VideoPlayer emit signal finished
+	void MediaFinished();
 
     private:
 	//Data
Written on: 27. 04. 2012 [13:00]
roman
Roman Savochenko
Moderator
Contributor
Developer
registered since: 12.12.2007
Posts: 3750
"aleax" wrote:

Добавил выдачу сигнала Phonon:VideoPlayer::finished() в систему событий OpenSCADA как "ws_MediaFinished"

Добавил.
Тогда уже объединить с заворотом и снятием атрибута "Play".

Learn, learn and learn better than work, work and work.



8212