[vlc-devel] [PATCH] added control for speed in http interface

sunil kumar skstronghold at gmail.com
Tue Apr 12 14:09:47 CEST 2011


added speed controls in vlc http interface

 share/http/dialogs/main        |   10 ++++++++++
 share/http/images/fast.png     |  Bin 0 -> 126 bytes
 share/http/js/functions.js     |   10 ++++++++++
 share/http/requests/README.txt |    6 ++++++
 share/http/requests/status.xml |    4 ++++
 5 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/share/http/dialogs/main b/share/http/dialogs/main
index 244c4d9..a08021d 100644
--- a/share/http/dialogs/main
+++ b/share/http/dialogs/main
@@ -98,6 +98,14 @@ sout and playlist .
       <img src="images/volume_mute.png" alt="Mute Volume" />
       <span class="btn_text">Mute Volume</span>
     </button>
+    <button id="btn_speed_down" onclick="rate_down();"
onmouseover="button_over(this);" onmouseout="button_out(this);"
title="Increase Speed" >
+      <img src="images/fast.png" alt="Increase Speed" />
+      <span class="btn_text">Increase Speed</span>
+    </button>
+    <button id="btn_speed_up" onclick="rate_up();"
onmouseover="button_over(this);" onmouseout="button_out(this);"
title="Decrease Speed" >
+      <img src="images/slow.png" alt="Decrease Speed" />
+      <span class="btn_text">Decrease Speed</span>
+    </button>
   </div>
   <div id="status">
     <span id="state">(?)</span>
@@ -105,6 +113,8 @@ sout and playlist .
     Time : <span id="time">(?)</span>/<span id="length">(?)</span>
     -
     Volume : <span id="volume">(?)</span>
+    -
+    Speed : <span id="rate">(?)</span>
     <br/>
     <!-- progress bar -->
     <img src="images/slider_left.png" alt="slider left" /><span
id="progressbar" style="background-image: url( 'images/slider_bar.png' );
width: 408px; height:16px; position:absolute;" onclick="slider_seek( event,
this );" onmousemove="slider_move( event, this );"><img
src="images/slider_point.png" alt="slider point" style="position:relative;
left:0px;" id="main_slider_point" onmousedown="slider_down( event, this );"
onmouseup="slider_up( event, this.parentNode );" onmouseout="slider_up(
event, this.parentNode );"/></span><img src="images/slider_right.png"
alt="slider right" style="position:relative;left:408px;" />
diff --git a/share/http/images/fast.png b/share/http/images/fast.png
new file mode 100644
index 0000000..b16b74b
Binary files /dev/null and b/share/http/images/fast.png differ
diff --git a/share/http/js/functions.js b/share/http/js/functions.js
index c09222c..3d6c1bb 100644
--- a/share/http/js/functions.js
+++ b/share/http/js/functions.js
@@ -383,6 +383,14 @@ function volume_mute()
 {
     loadXMLDoc( 'requests/status.xml?command=volume&val=0', parse_status );
 }
+function rate_up()
+{
+    loadXMLDoc( 'requests/status.xml?command=rate&val=150', parse_status );
+}
+function rate_down()
+{
+    loadXMLDoc( 'requests/status.xml?command=rate&val=-150', parse_status
);
+}
 function seek( pos )
 {
     loadXMLDoc( 'requests/status.xml?command=seek&val='+pos, parse_status
);
@@ -471,6 +479,8 @@ function parse_status()
             set_text( 'length', format_time( length ) );
             if( status.getElementsByTagName( 'volume' ).length != 0 )
                 set_text( 'volume', Math.floor(status.getElementsByTagName(
'volume' )[0].firstChild.data/5.12)+'%' );
+    if( status.getElementsByTagName( 'rate' ).length != 0 )
+                set_text( 'rate', (status.getElementsByTagName( 'rate'
)[0].firstChild.data)+'%' );
             var statetag = status.getElementsByTagName( 'state' );
             if( statetag.length > 0 )
             {
diff --git a/share/http/requests/README.txt b/share/http/requests/README.txt
index cfd5a09..6e437b1 100644
--- a/share/http/requests/README.txt
+++ b/share/http/requests/README.txt
@@ -100,6 +100,12 @@ status.xml:
     +1H:2M -> seek 1 hour and 2 minutes forward
     -10% -> seek 10% back

+> change playing speed(rate)
+  ?command=rate&val=<val>
+  Allowed values are of the form:
+   <int> To increase speed
+  -<int> To decrease speed
+
 playlist.xml:
 =============
 < get the full playlist tree
diff --git a/share/http/requests/status.xml b/share/http/requests/status.xml
index da6d3ca..7088df6 100644
--- a/share/http/requests/status.xml
+++ b/share/http/requests/status.xml
@@ -116,6 +116,9 @@
   <vlc id="if" param1="command value 'volume' strcmp 0 =" />
     <vlc id="rpn" param1="val value vlc_volume_set" />
   <vlc id="end"/>
+  <vlc id="if" param1="command value 'rate' strcmp 0 =" />
+    <vlc id="rpn" param1="'rate' 'VLC_OBJECT_INPUT' vlc_var_get val +
'rate' 'VLC_OBJECT_INPUT' vlc_var_set" />
+  <vlc id="end"/>
   <vlc id="if" param1="command value 'seek' strcmp 0 =" />
     <vlc id="rpn" param1="val value vlc_seek" />
   <vlc id="end"/>
@@ -126,6 +129,7 @@
 <vlc id="end" />
 <root>
   <volume><vlc id="value" param1="volume" /></volume>
+  <rate><vlc id="value" param1="100000 'rate' 'VLC_OBJECT_INPUT'
vlc_var_get /"/></rate>
   <length><vlc id="value" param1="stream_length" /></length>
   <time><vlc id="value" param1="stream_time" /></time>
   <state><vlc id="value" param1="stream_state" /></state>



On Sun, Apr 10, 2011 at 3:44 PM, Rob <rob at hobbyistsoftware.com> wrote:

> Hi Sunil,
>
> I get
>
> error: cannot apply binary patch to 'share/http/images/fast.png' without
> full index line
>
> I'm guessing you need --full-index in git-format-patch
>
> Rob
>
>
>
> On Fri, 08 Apr 2011 12:23:39 +0100, sunil kumar <skstronghold at gmail.com>
> wrote:
>
>  added speed controls in vlc http interface
>>
>> diff --git a/share/http/dialogs/main b/share/http/dialogs/main
>> index 244c4d9..a08021d 100644
>> --- a/share/http/dialogs/main
>> +++ b/share/http/dialogs/main
>> @@ -98,6 +98,14 @@ sout and playlist .
>>       <img src="images/volume_mute.png" alt="Mute Volume" />
>>       <span class="btn_text">Mute Volume</span>
>>     </button>
>> +    <button id="btn_speed_down" onclick="rate_down();"
>> onmouseover="button_over(this);" onmouseout="button_out(this);"
>> title="Increase Speed" >
>> +      <img src="images/fast.png" alt="Increase Speed" />
>> +      <span class="btn_text">Increase Speed</span>
>> +    </button>
>> +    <button id="btn_speed_up" onclick="rate_up();"
>> onmouseover="button_over(this);" onmouseout="button_out(this);"
>> title="Decrease Speed" >
>> +      <img src="images/slow.png" alt="Decrease Speed" />
>> +      <span class="btn_text">Decrease Speed</span>
>> +    </button>
>>   </div>
>>   <div id="status">
>>     <span id="state">(?)</span>
>> @@ -105,6 +113,8 @@ sout and playlist .
>>     Time : <span id="time">(?)</span>/<span id="length">(?)</span>
>>     -
>>     Volume : <span id="volume">(?)</span>
>> +    -
>> +    Speed : <span id="rate">(?)</span>
>>     <br/>
>>     <!-- progress bar -->
>>     <img src="images/slider_left.png" alt="slider left" /><span
>> id="progressbar" style="background-image: url( 'images/slider_bar.png' );
>> width: 408px; height:16px; position:absolute;" onclick="slider_seek(
>> event,
>> this );" onmousemove="slider_move( event, this );"><img
>> src="images/slider_point.png" alt="slider point" style="position:relative;
>> left:0px;" id="main_slider_point" onmousedown="slider_down( event, this
>> );"
>> onmouseup="slider_up( event, this.parentNode );" onmouseout="slider_up(
>> event, this.parentNode );"/></span><img src="images/slider_right.png"
>> alt="slider right" style="position:relative;left:408px;" />
>> diff --git a/share/http/images/fast.png b/share/http/images/fast.png
>> new file mode 100644
>> index 0000000..b16b74b
>> Binary files /dev/null and b/share/http/images/fast.png differ
>> diff --git a/share/http/js/functions.js b/share/http/js/functions.js
>> index c09222c..3d6c1bb 100644
>> --- a/share/http/js/functions.js
>> +++ b/share/http/js/functions.js
>> @@ -383,6 +383,14 @@ function volume_mute()
>>  {
>>     loadXMLDoc( 'requests/status.xml?command=volume&val=0', parse_status
>> );
>>  }
>> +function rate_up()
>> +{
>> +    loadXMLDoc( 'requests/status.xml?command=rate&val=150', parse_status
>> );
>> +}
>> +function rate_down()
>> +{
>> +    loadXMLDoc( 'requests/status.xml?command=rate&val=-150', parse_status
>> );
>> +}
>>  function seek( pos )
>>  {
>>     loadXMLDoc( 'requests/status.xml?command=seek&val='+pos, parse_status
>> );
>> @@ -471,6 +479,8 @@ function parse_status()
>>             set_text( 'length', format_time( length ) );
>>             if( status.getElementsByTagName( 'volume' ).length != 0 )
>>                 set_text( 'volume',
>> Math.floor(status.getElementsByTagName(
>> 'volume' )[0].firstChild.data/5.12)+'%' );
>> +    if( status.getElementsByTagName( 'rate' ).length != 0 )
>> +                set_text( 'rate', (status.getElementsByTagName( 'rate'
>> )[0].firstChild.data)+'%' );
>>             var statetag = status.getElementsByTagName( 'state' );
>>             if( statetag.length > 0 )
>>             {
>> diff --git a/share/http/requests/README.txt
>> b/share/http/requests/README.txt
>> index cfd5a09..6e437b1 100644
>> --- a/share/http/requests/README.txt
>> +++ b/share/http/requests/README.txt
>> @@ -100,6 +100,12 @@ status.xml:
>>     +1H:2M -> seek 1 hour and 2 minutes forward
>>     -10% -> seek 10% back
>>
>> +> change playing speed(rate)
>> +  ?command=rate&val=<val>
>> +  Allowed values are of the form:
>> +   <int> To increase speed
>> +  -<int> To decrease speed
>> +
>>  playlist.xml:
>>  =============
>>  < get the full playlist tree
>> diff --git a/share/http/requests/status.xml
>> b/share/http/requests/status.xml
>> index da6d3ca..7088df6 100644
>> --- a/share/http/requests/status.xml
>> +++ b/share/http/requests/status.xml
>> @@ -116,6 +116,9 @@
>>   <vlc id="if" param1="command value 'volume' strcmp 0 =" />
>>     <vlc id="rpn" param1="val value vlc_volume_set" />
>>   <vlc id="end"/>
>> +  <vlc id="if" param1="command value 'rate' strcmp 0 =" />
>> +    <vlc id="rpn" param1="'rate' 'VLC_OBJECT_INPUT' vlc_var_get val +
>> 'rate' 'VLC_OBJECT_INPUT' vlc_var_set" />
>> +  <vlc id="end"/>
>>   <vlc id="if" param1="command value 'seek' strcmp 0 =" />
>>     <vlc id="rpn" param1="val value vlc_seek" />
>>   <vlc id="end"/>
>> @@ -126,6 +129,7 @@
>>  <vlc id="end" />
>>  <root>
>>   <volume><vlc id="value" param1="volume" /></volume>
>> +  <rate><vlc id="value" param1="100000 'rate' 'VLC_OBJECT_INPUT'
>> vlc_var_get /"/></rate>
>>   <length><vlc id="value" param1="stream_length" /></length>
>>   <time><vlc id="value" param1="stream_time" /></time>
>>   <state><vlc id="value" param1="stream_state" /></state>
>>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>



-- 
Sunil Kumar
RIT2009021,
IIIT Allahabad (Amethi Campus)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110412/e582284b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_updated
Type: application/octet-stream
Size: 4672 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110412/e582284b/attachment.obj>


More information about the vlc-devel mailing list