[vlc-commits] Lua: remove the never used hotkeys interface

Rémi Denis-Courmont git at videolan.org
Sun Mar 25 19:37:25 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Mar 25 20:25:41 2012 +0300| [5a08521ec75bb6f3005371af6287c22a3ac7993c] | committer: Rémi Denis-Courmont

Lua: remove the never used hotkeys interface

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5a08521ec75bb6f3005371af6287c22a3ac7993c
---

 modules/lua/vlc.c          |    3 -
 share/Makefile.am          |    2 -
 share/lua/intf/hotkeys.lua |  103 --------------------------------------------
 3 files changed, 0 insertions(+), 108 deletions(-)

diff --git a/modules/lua/vlc.c b/modules/lua/vlc.c
index 319bbbc..a54bdca 100644
--- a/modules/lua/vlc.c
+++ b/modules/lua/vlc.c
@@ -125,9 +125,6 @@ vlc_module_begin ()
         set_description( N_("Lua Telnet") )
         add_shortcut( "luatelnet", "telnet" )
 
-        /* add_shortcut( "luahotkeys" ) */
-        /* add_shortcut( "hotkeys" ) */
-
     add_submodule ()
         set_shortname( N_( "Lua Meta Fetcher" ) )
         set_description( N_("Fetch meta data using lua scripts") )
diff --git a/share/Makefile.am b/share/Makefile.am
index 75e22e5..0794c7f 100644
--- a/share/Makefile.am
+++ b/share/Makefile.am
@@ -158,7 +158,6 @@ nobase_vlclib_DATA = \
 	lua/intf/cli.luac \
 	lua/intf/dummy.luac \
 	lua/intf/dumpmeta.luac \
-	lua/intf/hotkeys.luac \
 	lua/intf/luac.luac \
 	lua/intf/modules/common.luac \
 	lua/intf/modules/host.luac \
@@ -222,7 +221,6 @@ EXTRA_DIST += \
 	lua/intf/cli.lua \
 	lua/intf/dummy.lua \
 	lua/intf/dumpmeta.lua \
-	lua/intf/hotkeys.lua \
 	lua/intf/http.lua \
 	lua/intf/luac.lua \
 	lua/intf/modules/common.lua \
diff --git a/share/lua/intf/hotkeys.lua b/share/lua/intf/hotkeys.lua
deleted file mode 100644
index 57e5228..0000000
--- a/share/lua/intf/hotkeys.lua
+++ /dev/null
@@ -1,103 +0,0 @@
---[==========================================================================[
- hotkeys.lua: hotkey handling for VLC
---[==========================================================================[
- Copyright (C) 2007 the VideoLAN team
- $Id$
-
- Authors: Antoine Cellerier <dionoea at videolan dot org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
---]==========================================================================]
-
---[==========================================================================[
-    This is meant to replace modules/control/hotkeys.c
-    (which will require some changes in the VLC core hotkeys stuff)
---]==========================================================================]
-
-require("common")
---common.table_print(vlc,"vlc.\t")
-
-bindings = {
-    ["Ctrl-q"] = "quit",
-    ["Space"] = "play-pause",
-    [113] --[[q]] = "quit",
-    [119] --[[w]] = "demo",
-    [120] --[[x]] = "demo2",
-    }
-
-function quit()
-    print("Bye-bye!")
-    vlc.misc.quit()
-end
-
-function demo()
-    vlc.osd.icon("speaker")
-end
-
-function demo2()
-    if not channel1 then
-        channel1 = vlc.osd.channel_register()
-        channel2 = vlc.osd.channel_register()
-    end
-    vlc.osd.message("Hey!",channel1)
-    vlc.osd.slider( 10, "horizontal", channel2 )
-end
-
-function action(func,delta)
-    return { func = func, delta = delta or 0, last = 0, times = 0 }
-end
-
-actions = {
-    ["quit"] = action(quit),
-    ["play-pause"] = action(play_pause),
-    ["demo"] = action(demo),
-    ["demo2"] = action(demo2),
-    }
-
-action = nil
-
-queue = {}
-
-function action_trigger( action )
-    print("action_trigger:",tostring(action))
-    local a = actions[action]
-    if a then
-        local ok, msg = pcall( a.func )
-        if not ok then
-            vlc.msg.err("Error while executing action `".. tostring(action) .."': "..msg)
-        end
-    else
-        vlc.msg.err("Key `"..key.."' points to unknown action `"..bindings[key].."'.")
-    end
-end
-
-function key_press( var, old, key, data )
-    print("key_press:",tostring(key))
-    if bindings[key] then
-        action_trigger(bindings[key])
-    else
-        vlc.msg.err("Key `"..key.."' isn't bound to any action.")
-    end
-end
-
-vlc.var.add_callback( vlc.object.libvlc(), "key-pressed", key_press )
---vlc.var.add_callback( vlc.object.libvlc(), "action-triggered", action_trigger )
-
-while not vlc.misc.lock_and_wait() do
-end
-
--- Clean up
-vlc.var.del_callback( vlc.object.libvlc(), "key-pressed", key_press )
---vlc.var.del_callback( vlc.object.libvlc(), "action-triggered", action_trigger )



More information about the vlc-commits mailing list