]> git.sesse.net Git - vlc/commitdiff
Add new common.volume(). Understands use of strings like "+10", "-10" or "10" for...
authorAntoine Cellerier <dionoea@videolan.org>
Mon, 21 Dec 2009 22:24:30 +0000 (23:24 +0100)
committerAntoine Cellerier <dionoea@videolan.org>
Mon, 21 Dec 2009 22:24:30 +0000 (23:24 +0100)
share/lua/http/requests/status.xml
share/lua/intf/modules/common.lua
share/lua/intf/rc.lua

index 328e65f8f360e1214383e8beafd3c92942c2e05e..a8ae70318a3223d5e23fd33d022808c47e622820 100644 (file)
@@ -89,7 +89,7 @@ elseif command == "fullscreen" then
 elseif command == "snapshot" then
   common.snapshot()
 elseif command == "volume" then
-  vlc.volume.set(tonumber(val))
+  common.volume(val)
 elseif command == "seek" then
   common.seek(val)
 elseif command == "key" then
index f0a1aa2bea68f3017e1cfd38e12d7f9b0912f648..f2c80618ed7c6c77952154b21e4caf4621325e93 100644 (file)
@@ -85,3 +85,11 @@ function seek(value)
         vlc.var.set(input,"time",tonumber(value))
     end
 end
+
+function volume(value)
+    if type(value)=="string" and string.sub(value,1,1) == "+" or string.sub(value,1,1) == "-" then
+        vlc.volume.set(vlc.volume.get()+tonumber(value))
+    else
+        vlc.volume.set(tostring(value))
+    end
+end
index 2348c4e6df5d895f8a9f1e8b4c643562e3e9ecb0..1926497ba2e29d68775fb3050f5573de5862d993 100644 (file)
@@ -397,7 +397,7 @@ end
 
 function volume(name,client,value)
     if value then
-        vlc.volume.set(value)
+        common.volume(value)
     else
         client:append(tostring(vlc.volume.get()))
     end