Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
4cf0140c
Commit
4cf0140c
authored
Dec 27, 2009
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement menu command. Disable eval command unless rc={eval=1} is set.
parent
d3480941
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
share/lua/intf/rc.lua
share/lua/intf/rc.lua
+21
-6
No files found.
share/lua/intf/rc.lua
View file @
4cf0140c
...
@@ -28,18 +28,20 @@ description=
...
@@ -28,18 +28,20 @@ description=
This is a modules/control/rc.c look alike (with a bunch of new features)
This is a modules/control/rc.c look alike (with a bunch of new features)
Use on local term:
Use on local term:
vlc -I
lua
rc
vlc -I rc
Use on tcp connection:
Use on tcp connection:
vlc -I
lua
rc --lua-config "rc={host='localhost:4212'}"
vlc -I rc --lua-config "rc={host='localhost:4212'}"
Use on multiple hosts (term + 2 tcp ports):
Use on multiple hosts (term + 2 tcp ports):
vlc -I
lua
rc --lua-config "rc={hosts={'*console','localhost:4212','localhost:5678'}}"
vlc -I rc --lua-config "rc={hosts={'*console','localhost:4212','localhost:5678'}}"
Note:
Note:
-I
luarc is an alia
s for -I lua --lua-intf rc
-I
rc and -I luarc are aliase
s for -I lua --lua-intf rc
Configuration options setable throught the --lua-config option are:
Configuration options setable throught the --lua-config option are:
* hosts: A list of hosts to listen on.
* hosts: A list of hosts to listen on.
* host: A host to listen on. (won't be used if `hosts' is set)
* host: A host to listen on. (won't be used if `hosts' is set)
* eval: Add eval command to evaluate lua expressions. Set to any value to
enable.
The following can be set using the --lua-config option or in the interface
The following can be set using the --lua-config option or in the interface
itself using the `set' command:
itself using the `set' command:
* prompt: The prompt.
* prompt: The prompt.
...
@@ -435,6 +437,15 @@ function listvalue(obj,var)
...
@@ -435,6 +437,15 @@ function listvalue(obj,var)
end
end
end
end
function
menu
(
name
,
client
,
value
)
local
map
=
{
on
=
'show'
,
off
=
'hide'
,
up
=
'up'
,
down
=
'down'
,
left
=
'prev'
,
right
=
'next'
,
[
'select'
]
=
'activate'
}
if
map
[
value
]
and
vlc
.
osd
.
menu
[
map
[
value
]]
then
vlc
.
osd
.
menu
[
map
[
value
]]()
else
client
:
append
(
"Unknown menu command '"
..
tostring
(
value
)
..
"'"
)
end
end
function
eval
(
client
,
val
)
function
eval
(
client
,
val
)
client
:
append
(
loadstring
(
"return "
..
val
)())
client
:
append
(
loadstring
(
"return "
..
val
)())
end
end
...
@@ -497,12 +508,11 @@ commands_ordered = {
...
@@ -497,12 +508,11 @@ commands_ordered = {
{
"snapshot"
;
{
func
=
common
.
snapshot
;
help
=
"take video snapshot"
}
};
{
"snapshot"
;
{
func
=
common
.
snapshot
;
help
=
"take video snapshot"
}
};
{
"strack"
;
{
func
=
skip
(
listvalue
(
"input"
,
"spu-es"
));
args
=
"[X]"
;
help
=
"set/get subtitles track"
}
};
{
"strack"
;
{
func
=
skip
(
listvalue
(
"input"
,
"spu-es"
));
args
=
"[X]"
;
help
=
"set/get subtitles track"
}
};
{
"hotkey"
;
{
func
=
skip
(
common
.
hotkey
);
args
=
"[hotkey name]"
;
help
=
"simulate hotkey press"
;
adv
=
true
;
aliases
=
{
"key"
}
}
};
{
"hotkey"
;
{
func
=
skip
(
common
.
hotkey
);
args
=
"[hotkey name]"
;
help
=
"simulate hotkey press"
;
adv
=
true
;
aliases
=
{
"key"
}
}
};
{
"menu"
;
{
func
=
fixme
;
args
=
"[on|off|up|down|left|right|select]"
;
help
=
"use menu"
;
adv
=
true
}
};
{
"menu"
;
{
func
=
menu
;
args
=
"[on|off|up|down|left|right|select]"
;
help
=
"use menu"
;
adv
=
true
}
};
{
""
};
{
""
};
{
"set"
;
{
func
=
set_env
;
args
=
"[var [value]]"
;
help
=
"set/get env var"
;
adv
=
true
}
};
{
"set"
;
{
func
=
set_env
;
args
=
"[var [value]]"
;
help
=
"set/get env var"
;
adv
=
true
}
};
{
"save_env"
;
{
func
=
save_env
;
help
=
"save env vars (for future clients)"
;
adv
=
true
}
};
{
"save_env"
;
{
func
=
save_env
;
help
=
"save env vars (for future clients)"
;
adv
=
true
}
};
{
"alias"
;
{
func
=
skip
(
alias
);
args
=
"[cmd]"
;
help
=
"set/get command aliases"
;
adv
=
true
}
};
{
"alias"
;
{
func
=
skip
(
alias
);
args
=
"[cmd]"
;
help
=
"set/get command aliases"
;
adv
=
true
}
};
{
"eval"
;
{
func
=
skip
(
eval
);
help
=
"eval some lua (*debug*)"
;
adv
=
true
}
};
-- FIXME: comment out if you're not debugging
{
"description"
;
{
func
=
print_text
(
"Description"
,
description
);
help
=
"describe this module"
}
};
{
"description"
;
{
func
=
print_text
(
"Description"
,
description
);
help
=
"describe this module"
}
};
{
"license"
;
{
func
=
print_text
(
"License message"
,
vlc
.
misc
.
license
());
help
=
"print VLC's license message"
;
adv
=
true
}
};
{
"license"
;
{
func
=
print_text
(
"License message"
,
vlc
.
misc
.
license
());
help
=
"print VLC's license message"
;
adv
=
true
}
};
{
"help"
;
{
func
=
help
;
args
=
"[pattern]"
;
help
=
"a help message"
;
aliases
=
{
"?"
}
}
};
{
"help"
;
{
func
=
help
;
args
=
"[pattern]"
;
help
=
"a help message"
;
aliases
=
{
"?"
}
}
};
...
@@ -511,6 +521,11 @@ commands_ordered = {
...
@@ -511,6 +521,11 @@ commands_ordered = {
{
"quit"
;
{
func
=
quit
;
help
=
"quit VLC (or logout if in a socket connection)"
}
};
{
"quit"
;
{
func
=
quit
;
help
=
"quit VLC (or logout if in a socket connection)"
}
};
{
"shutdown"
;
{
func
=
shutdown
;
help
=
"shutdown VLC"
}
};
{
"shutdown"
;
{
func
=
shutdown
;
help
=
"shutdown VLC"
}
};
}
}
if
config
.
eval
then
commands_ordered
[
#
commands_ordered
]
=
{
"eval"
;
{
func
=
skip
(
eval
);
help
=
"eval some lua (*debug*)"
;
adv
=
true
}
}
end
commands
=
{}
commands
=
{}
for
i
,
cmd
in
ipairs
(
commands_ordered
)
do
for
i
,
cmd
in
ipairs
(
commands_ordered
)
do
if
#
cmd
==
2
then
if
#
cmd
==
2
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment