[Redbutton-devel] SF.net SVN: redbutton: [219] redbutton-browser/trunk/StreamClass.c
Brought to you by:
skilvington
|
From: <ski...@us...> - 2007-02-16 20:56:33
|
Revision: 219
http://svn.sourceforge.net/redbutton/?rev=219&view=rev
Author: skilvington
Date: 2007-02-16 12:56:28 -0800 (Fri, 16 Feb 2007)
Log Message:
-----------
play/stop StreamComponents when they are activated/deactivated
Modified Paths:
--------------
redbutton-browser/trunk/StreamClass.c
Modified: redbutton-browser/trunk/StreamClass.c
===================================================================
--- redbutton-browser/trunk/StreamClass.c 2007-02-16 12:54:40 UTC (rev 218)
+++ redbutton-browser/trunk/StreamClass.c 2007-02-16 20:56:28 UTC (rev 219)
@@ -246,47 +246,88 @@
void
StreamClass_activateVideoComponent(StreamClass *t, VideoClass *c)
{
-/* TODO */
-printf("TODO: StreamClass_activateVideoComponent (tag=%d)\n", c->component_tag);
-// basically:
-// MHEGStreamPlayer_stop(t)
-// MHEGStreamPlayer_setVideoStream(t, c) - may get the "only using last video stream" warning
-// MHEGStreamPlayer_play(t)
-// MHEGEngine_generateAstncEvent(&t->rootClass.inst.ref, EventType_stream_playing, NULL)
+ verbose("StreamClass_activateVideoComponent (tag=%d)", c->component_tag);
+ /*
+ * don't think we need to generate stream_playing/stopped events
+ * but I'm not entirely shore
+ */
+
+ /* if we are activated, stop playing while we change the component */
+ if(t->rootClass.inst.RunningStatus)
+ MHEGStreamPlayer_stop(&t->inst.player);
+
+ MHEGStreamPlayer_setVideoStream(&t->inst.player, c);
+
+ if(t->rootClass.inst.RunningStatus)
+ MHEGStreamPlayer_play(&t->inst.player);
+
return;
}
void
StreamClass_activateAudioComponent(StreamClass *t, AudioClass *c)
{
-/* TODO */
-printf("TODO: StreamClass_activateAudioComponent (tag=%d)\n", c->component_tag);
+ verbose("StreamClass_activateAudioComponent (tag=%d)", c->component_tag);
+ /*
+ * don't think we need to generate stream_playing/stopped events
+ * but I'm not entirely shore
+ */
+
+ /* if we are activated, stop playing while we change the component */
+ if(t->rootClass.inst.RunningStatus)
+ MHEGStreamPlayer_stop(&t->inst.player);
+
+ MHEGStreamPlayer_setAudioStream(&t->inst.player, c);
+
+ if(t->rootClass.inst.RunningStatus)
+ MHEGStreamPlayer_play(&t->inst.player);
+
return;
}
void
StreamClass_deactivateVideoComponent(StreamClass *t, VideoClass *c)
{
-/* TODO */
-printf("TODO: StreamClass_deactivateVideoComponent (tag=%d)\n", c->component_tag);
-// basically:
-// MHEGStreamPlayer_stop(t)
-// MHEGStreamPlayer_setVideoStream(t, NULL)
-// MHEGStreamPlayer_play(t)
-// MHEGEngine_generateAstncEvent(&t->rootClass.inst.ref, EventType_stream_stopped, NULL)
-// => need to make MHEGStreamPlayer_setVideoStream(t, NULL) disable video
+ verbose("StreamClass_deactivateVideoComponent (tag=%d)", c->component_tag);
+ /*
+ * don't think we need to generate stream_playing/stopped events
+ * but I'm not entirely shore
+ */
+
+ /* if we are activated, stop playing while we change the component */
+ if(t->rootClass.inst.RunningStatus)
+ MHEGStreamPlayer_stop(&t->inst.player);
+
+ MHEGStreamPlayer_setVideoStream(&t->inst.player, NULL);
+
+ if(t->rootClass.inst.RunningStatus)
+ MHEGStreamPlayer_play(&t->inst.player);
+
return;
}
void
StreamClass_deactivateAudioComponent(StreamClass *t, AudioClass *c)
{
-/* TODO */
-printf("TODO: StreamClass_deactivateAudioComponent (tag=%d)\n", c->component_tag);
+ verbose("StreamClass_deactivateAudioComponent (tag=%d)", c->component_tag);
+ /*
+ * don't think we need to generate stream_playing/stopped events
+ * but I'm not entirely shore
+ */
+
+ /* if we are activated, stop playing while we change the component */
+ if(t->rootClass.inst.RunningStatus)
+ MHEGStreamPlayer_stop(&t->inst.player);
+
+ MHEGStreamPlayer_setAudioStream(&t->inst.player, NULL);
+
+ if(t->rootClass.inst.RunningStatus)
+ MHEGStreamPlayer_play(&t->inst.player);
+
return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|