]> git.sesse.net Git - vlc/commitdiff
* 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 5d857d475c9e36c2a8d973da524c14539a03bc9a..0bf7e10b5ef78733076ab849e9ce91d54fadd4d3 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 3cac7c04ba9b45856f7a90db7399edfb4e5f0b20..30fde00ef300592c4c06cb4c1b09647baaa57bd4 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 eea4d2a389f59c4f16cf41a6600db813b0f6bad0..86f9645f3db8889bd450fb2ddd7a619ac0cbc7ce 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 b73b0ddf25c9c2114860f8a524ced48a24db0aff..26f4fa6fa3ec4e1949f52108fa6c25d34a3ca52b 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"/>