* web interface: add a snapshot button
authorYoann Peronneau <yoann@videolan.org>
Wed, 14 Jun 2006 18:31:45 +0000 (18:31 +0000)
committerYoann Peronneau <yoann@videolan.org>
Wed, 14 Jun 2006 18:31:45 +0000 (18:31 +0000)
modules/control/http/rpn.c
share/http/dialogs/main
share/http/images/snapshot.png [new file with mode: 0644]
share/http/js/functions.js
share/http/requests/status.xml

index 5d857d4..0bf7e10 100644 (file)
@@ -1062,6 +1062,24 @@ void E_(EvaluateRPN)( intf_thread_t *p_intf, mvar_t  *vars,
             free( psz_cmd );
             free( psz_error );
         }
+        else if( !strcmp( s, "snapshot" ) )
+        {
+            if( p_sys->p_input )
+            {
+                vout_thread_t *p_vout;
+                p_vout = vlc_object_find( p_sys->p_input,
+                                          VLC_OBJECT_VOUT, FIND_CHILD );
+
+                if( p_vout )
+                {
+                    vout_Control( p_vout, VOUT_SNAPSHOT );
+                    vlc_object_release( p_vout );
+                    msg_Dbg( p_intf, "requested snapshot" );
+                }
+            }
+            break;
+
+        }
         else
         {
             E_(SSPush)( st, s );
index 3cac7c0..30fde00 100644 (file)
@@ -81,6 +81,11 @@ sout and playlist .
       <span class="btn_text">Fullscreen</span>
     </button>
     &nbsp;
+    <button id="btn_snapshot" onclick="snapshot();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Take video snapshot" >
+      <img src="images/snapshot.png" alt="Take video snapshot" />
+      <span class="btn_text">Take video snapshot</span>
+    </button>
+    &nbsp;
     <button id="btn_volume_down" onclick="volume_down();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Decrease Volume" >
       <img src="images/volume_down.png" alt="Decrease Volume" />
       <span class="btn_text">Decrease Volume</span>
diff --git a/share/http/images/snapshot.png b/share/http/images/snapshot.png
new file mode 100644 (file)
index 0000000..6890d02
Binary files /dev/null and b/share/http/images/snapshot.png differ
index eea4d2a..86f9645 100644 (file)
@@ -377,6 +377,10 @@ function fullscreen()
 {
     loadXMLDoc( 'requests/status.xml?command=fullscreen', parse_status );
 }
+function snapshot()
+{
+    loadXMLDoc( 'requests/status.xml?command=snapshot', parse_status );
+}
 function update_status()
 {
     loadXMLDoc( 'requests/status.xml', parse_status );
index b73b0dd..26f4fa6 100644 (file)
@@ -91,6 +91,9 @@
       <vlc id="rpn" param1="'fullscreen' 'VLC_OBJECT_VOUT' vlc_var_get ! 'fullscreen' 'VLC_OBJECT_VOUT' vlc_var_set" />
     <vlc id="end" />
   <vlc id="end" />
+  <vlc id="if" param1="command value 'snapshot' strcmp 0 =" />
+    <vlc id="rpn" param1="snapshot" />
+  <vlc id="end" />
   <vlc id="if" param1="command value 'volume' strcmp 0 =" />
     <vlc id="rpn" param1="val value vlc_volume_set" />
   <vlc id="end"/>