I was thinking earlier that I’d like to be able to cut up a video clip in the same way you cut up a break in Renoise, but I’m assuming that it would just not be possible. So is there any similar way to edit video files? What I really love about Renoise is the ease of work flow when slicing.
I use Sony Vegas for my video editing, it works like the sample editor in Renoise; you just cut and slice, then move the pieces anywhere you’d like
being able to use 09xx commands and the like on video would be awesome. i have no idea, but could this be possible through scripting? i know there are possibilities for external apps, right?
dblue, take the challenge
He’ll fix this overnight, just for you
I would like to cut up JPEGs with Renoise. Also, MS WORD Documents. Is this possible?
Sorry guys. It might be possible to create something that sends offset commands via OSC to some other video application, but it’s definitely a bit more than I’m able to do during my casual scripting time
It would be awesome if there would be a tool in which you can load one or several .jpgs of which the code gets cut up, pasted in random order on the beat so you get crazy pictures like this:
VLC would be good for this.
It has a LUA script for a remote control interface:
this is the rc.lua file included in VLC’s interface directory showing the available functions or commands
[details=“Click to view contents”] --[==========================================================================[
rc.lua: remote control module for VLC
–[==========================================================================[
Copyright © 2007-2009 the VideoLAN team
$Id$
Authors: Antoine Cellerier
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.
–]==========================================================================]
description=
[============================================================================[
Remote control interface for VLC
This is a modules/control/rc.c look alike (with a bunch of new features)
Use on local term:
vlc -I luarc
Use on tcp connection:
vlc -I luarc --lua-config “rc={host=‘localhost:4212’}”
Use on multiple hosts (term + 2 tcp ports):
vlc -I luarc --lua-config “rc={hosts={'console’,‘localhost:4212’,‘localhost:5678’}}"
Note:
-I luarc is an alias for -I lua --lua-intf rc
Configuration options setable throught the --lua-config option are:
* hosts: A list of hosts to listen on.
* host: A host to listen on. (won’t be used if hosts' is set)<br> The following can be set using the --lua-config option or in the interface<br> itself using the
set’ command:
* prompt: The prompt.
* welcome: The welcome message.
* width: The default terminal width (used to format text).
* autocompletion: When issuing an unknown command, print a list of
possible commands to autocomplete with. (0 to disable,
1 to enable).
* autoalias: If autocompletion returns only one possibility, use it
(0 to disable, 1 to enable).
* flatplaylist: 0 to disable, 1 to enable.
]============================================================================]
require(“common”)
skip = common.skip
skip2 = function(foo) return skip(skip(foo)) end
setarg = common.setarg
strip = common.strip
–[[Setup default environement]]
env = { prompt = “> “;
width = 70;
autocompletion = 1;
autoalias = 1;
welcome = “Remote control interface initialized. Type help' for help.";<br> flatplaylist = 0;<br> }<br> <br> --[[Import custom environement variables from the command line config (if possible)]]<br> for k,v in pairs(env) do<br> if config[k] then<br> if type(env[k]) == type(config[k]) then<br> env[k] = config[k]<br> vlc.msg.dbg("set environement variable
“…k…”’ to “…tostring(env[k]))
else
vlc.msg.err(“environement variable "..k.."' should be of type "..type(env[k])..". config value will be discarded.")<br> end<br> end<br> end<br> <br> --[[Command functions]]<br> function set_env(name,client,value)<br> if value then<br> local var,val = split_input(value)<br> if val then<br> s = string.gsub(val,"\"(.*)\"","%1")<br> if type(client.env[var])==type(1) then<br> client.env[var] = tonumber(s)<br> else<br> client.env[var] = s<br> end<br> else<br> client:append( tostring(client.env[var]) )<br> end<br> else<br> for e,v in common.pairs_sorted(client.env) do<br> client:append(e.."="..v)<br> end<br> end<br> end<br> <br> function save_env(name,client,value)<br> env = common.table_copy(client.env)<br> end<br> <br> function alias(client,value)<br> if value then<br> local var,val = split_input(value)<br> if commands[var] and type(commands[var]) ~= type("") then<br> client:append("Error: cannot use a primary command as an alias name")<br> else<br> if commands[val] then<br> commands[var]=val<br> else<br> client:append("Error: unknown primary command
“…val…”’.”)
end
end
else
for c,v in common.pairs_sorted(commands) do
if type(v)==type(””) then
client:append(c…”=”…v)
end
end
end
end
function fixme(name,client)
client:append( “FIXME: unimplemented command "..name.."'." )<br> end<br> <br> function logout(name,client)<br> if client.type == host.client_type.net then<br> client:send("Bye-bye!")<br> client:del()<br> else<br> client:append("Error: Can't logout of stdin/stdout. Use quit or shutdown to close VLC.")<br> end<br> end<br> <br> function shutdown(name,client)<br> client:append("Bye-bye!")<br> h:broadcast("Shutting down.")<br> vlc.msg.info("Requested shutdown.")<br> vlc.misc.quit()<br> end<br> <br> function quit(name,client)<br> if client.type == host.client_type.net then<br> logout(name,client)<br> else<br> shutdown(name,client)<br> end<br> end<br> <br> function add(name,client,arg)<br> -- TODO: par single and double quotes properly<br> local f<br> if name == "enqueue" then<br> f = vlc.playlist.enqueue<br> else<br> f = vlc.playlist.add<br> end<br> local options = {}<br> for o in string.gmatch(arg," +<img src="https://files.renoise.com/forum/emoticons/default/sad.gif" class="bbc_emoticon" alt=":(">[^]*)") do<br> table.insert(options,o)<br> end<br> arg = string.gsub(arg," +:.*$","")<br> f({{path=arg,options=options}})<br> end<br> <br> function playlist_is_tree( client )<br> if client.env.flatplaylist == 0 then<br> return true<br> else<br> return false<br> end<br> end<br> <br> function playlist(name,client,arg)<br> function playlist0(item,prefix)<br> local prefix = prefix or ""<br> if not item.flags.disabled then<br> local str = "| "..prefix..tostring(item.id).." - "..item.name<br> if item.duration > 0 then<br> str = str.." ("..common.durationtostring(item.duration)..")"<br> end<br> if item.nb_played > 0 then<br> str = str.." [played "..tostring(item.nb_played).." time"<br> if item.nb_played > 1 then<br> str = str .. "s"<br> end<br> str = str .. "]"<br> end<br> client:append(str)<br> end<br> if item.children then<br> for _, c in ipairs(item.children) do<br> playlist0(c,prefix.." ")<br> end<br> end<br> end<br> local playlist<br> local tree = playlist_is_tree(client)<br> if name == "search" then<br> playlist = vlc.playlist.search(arg or "", tree)<br> else<br> if tonumber(arg) then<br> playlist = vlc.playlist.get(tonumber(arg), tree)<br> elseif arg then<br> playlist = vlc.playlist.get(arg, tree)<br> else<br> playlist = vlc.playlist.get(nil, tree)<br> end<br> end<br> if name == "search" then<br> client:append("+----[Search - "..(arg or "
reset’”)…"]")
else
client:append(“±—[Playlist - “…playlist.name…”]”)
end
if playlist.children then
for _, item in ipairs(playlist.children) do
playlist0(item)
end
else
playlist0(playlist)
end
if name == “search” then
client:append("±—[End of search - Use search' to reset ]")<br> else<br> client:append("+----[End of playlist]")<br> end<br> end<br> <br> function playlist_sort(name,client,arg)<br> if not arg then<br> client:append("Valid sort keys are: id, title, artist, genre, random, duration, album.")<br> else<br> local tree = playlist_is_tree(client)<br> vlc.playlist.sort(arg,false,tree)<br> end<br> end<br> <br> function services_discovery(name,client,arg)<br> if arg then<br> if vlc.sd.is_loaded(arg) then<br> vlc.sd.remove(arg)<br> client:append(arg.." disabled.")<br> else<br> vlc.sd.add(arg)<br> client:append(arg.." enabled.")<br> end<br> else<br> local sd = vlc.sd.get_services_names()<br> client:append("+----[Services discovery]")<br> for n,ln in pairs(sd) do<br> local status<br> if vlc.sd.is_loaded(n) then<br> status = "enabled"<br> else<br> status = "disabled"<br> end<br> client:append("| "..n..": " .. ln .. " (" .. status .. ")")<br> end<br> client:append("+----[End of services discovery]")<br> end<br> end<br> <br> function print_text(label,text)<br> return function(name,client)<br> client:append("+----["..label.."]")<br> client:append "|"<br> for line in string.gmatch(text,".-\r?\n") do<br> client:append("| "..string.gsub(line,"\r?\n",""))<br> end<br> client:append "|"<br> client:append("+----[End of "..string.lower(label).."]")<br> end<br> end<br> <br> function help(name,client,arg)<br> local width = client.env.width<br> local long = (name == "longhelp")<br> local extra = ""<br> if arg then extra = "matching
" … arg … "’ " end
client:append(“±—[Remote control commands “…extra…”]”)
for i, cmd in ipairs(commands_ordered) do
if (cmd == “” or not commands[cmd].adv or long)
and (not arg or string.match(cmd,arg)) then
local str = "| " … cmd
if cmd ~= “” then
local val = commands[cmd]
if val.aliases then
for ,a in ipairs(val.aliases) do
str = str … “, " … a
end
end
if val.args then str = str … " " … val.args end
if #str%2 == 1 then str = str … " " end
str = str … string.rep(” .",(width-(#str+#val.help)-1)/2)
str = str … string.rep(" “,width-#str-#val.help) … val.help
end
client:append(str)
end
end
client:append(“±—[end of help]”)
end
function input_info(name,client)
local categories = vlc.input_info()
for cat, infos in pairs(categories) do
client:append(“±—[”…cat…”]")
client:append("|")
for name, value in pairs(infos) do
client:append("| “…name…”: “…value)
end
client:append(”|")
end
client:append(“±—[end of stream info]”)
end
function playlist_status(name,client)
local a,b,c = vlc.playlist.status()
client:append( “( new input: " … tostring(a) … " )” )
client:append( “( audio volume: " … tostring( … " )”)
client:append( “( state " … tostring© … " )”)
end
function is_playing(name,client)
if vlc.input.is_playing() then client:append “1” else client:append “0” end
end
function ret_print(foo,start,stop)
local start = start or “”
local stop = stop or “”
return function(discard,client,…) client:append(start…tostring(foo(…))…stop) end
end
function get_time(var)
return function(name,client)
local input = vlc.object.input()
client:append(math.floor(vlc.var.get( input, var )))
end
end
function titlechap(name,client,value)
local input = vlc.object.input()
local var = string.gsub( name, ".$”, “” )
if value then
vlc.var.set( input, var, value )
else
local item = vlc.var.get( input, var )
– Todo: add item name conversion
client:apped(item)
end
end
function titlechap_offset(client,offset)
return function(name,value)
local input = vlc.object.input()
local var = string.gsub( name, ".*$", “” )
vlc.var.set( input, var, vlc.var.get( input, var )+offset )
end
end
function seek(name,client,value)
common.seek(value)
end
function volume(name,client,value)
if value then
vlc.volume.set(value)
else
client:append(tostring(vlc.volume.get()))
end
end
function rate(name,client)
local input = vlc.object.input()
if name == “normal” then
vlc.var.set(input,“rate”,1000) – FIXME: INPUT_RATE_DEFAULT
else
vlc.var.set(input,“rate-”…name,nil)
end
end
function listvalue(obj,var)
return function(client,value)
local o = vlc.object.find(nil,obj,“anywhere”)
if not o then return end
if value then
vlc.var.set( o, var, value )
else
local c = vlc.var.get( o, var )
local v, l = vlc.var.get_list( o, var )
client:append(“±—[”…var…"]")
for i,val in ipairs(v) do
local mark = (val==c)and " " or “”
client:append("| “…tostring(val)…” - "…tostring(l[i])…mark)
end
client:append(“±—[end of “…var…”]”)
end
end
end
function eval(client,val)
client:append(loadstring(“return “…val)())
end
–[[ Declare commands, register their callback functions and provide
help strings here.
Syntax is:
“”; { func = ; [args = “”;] help = “”; [adv = ;] [aliases = { [””;] }; ] }
]]
commands_ordered = {
{ “add”; { func = add; args = “XYZ”; help = “add XYZ to playlist” } };
{ “enqueue”; { func = add; args = “XYZ”; help = “queue XYZ to playlist” } };
{ “playlist”; { func = playlist; help = “show items currently in playlist” } };
{ “search”; { func = playlist; args = “[string]”; help = “search for items in playlist (or reset search)” } };
{ “sort”; { func = playlist_sort; args = “key”; help = “sort the playlist” } };
{ “sd”; { func = services_discovery; args = “[sd]”; help = “show services discovery or toggle” } };
{ “play”; { func = skip2(vlc.playlist.play); help = “play stream” } };
{ “stop”; { func = skip2(vlc.playlist.stop); help = “stop stream” } };
{ “next”; { func = skip2(vlc.playlist.next); help = “next playlist item” } };
{ “prev”; { func = skip2(vlc.playlist.prev); help = “previous playlist item” } };
{ “goto”; { func = skip2(vlc.playlist.goto); help = “goto item at index” } };
{ “repeat”; { func = skip2(vlc.playlist.repeat); args = “[on|off]”; help = “toggle playlist repeat” } };
{ “loop”; { func = skip2(vlc.playlist.loop); args = “[on|off]”; help = “toggle playlist loop” } };
{ “random”; { func = skip2(vlc.playlist.random); args = “[on|off]”; help = “toggle playlist random” } };
{ “clear”; { func = skip2(vlc.playlist.clear); help = “clear the playlist” } };
{ “status”; { func = playlist_status; help = “current playlist status” } };
{ “title”; { func = titlechap; args = “[X]”; help = “set/get title in current item” } };
{ “title_n”; { func = titlechap_offset(1); help = “next title in current item” } };
{ “title_p”; { func = titlechap_offset(-1); help = “previous title in current item” } };
{ “chapter”; { func = titlechap; args = “[X]”; help = “set/get chapter in current item” } };
{ “chapter_n”; { func = titlechap_offset(1); help = “next chapter in current item” } };
{ “chapter_p”; { func = titlechap_offset(-1); help = “previous chapter in current item” } };
{ “” };
{ “seek”; { func = seek; args = “X”; help = "seek in seconds, for instance seek 12'" } };<br> { "pause"; { func = setarg(common.hotkey,"key-play-pause"); help = "toggle pause" } };<br> { "fastforward"; { func = setarg(common.hotkey,"key-jump+extrashort"); help = "set to maximum rate" } };<br> { "rewind"; { func = setarg(common.hotkey,"key-jump-extrashort"); help = "set to minimum rate" } };<br> { "faster"; { func = rate; help = "faster playing of stream" } };<br> { "slower"; { func = rate; help = "slower playing of stream" } };<br> { "normal"; { func = rate; help = "normal playing of stream" } };<br> { "fullscreen"; { func = skip2(vlc.video.fullscreen); args = "[on|off]"; help = "toggle fullscreen"; aliases = { "f", "F" } } };<br> { "info"; { func = input_info; help = "information about the current stream" } };<br> { "get_time"; { func = get_time("time"); help = "seconds elapsed since stream's beginning" } };<br> { "is_playing"; { func = is_playing; help = "1 if a stream plays, 0 otherwise" } };<br> { "get_title"; { func = ret_print(vlc.input.get_title); help = "the title of the current stream" } };<br> { "get_length"; { func = get_time("length"); help = "the length of the current stream" } };<br> { "" };<br> { "volume"; { func = volume; args = "[X]"; help = "set/get audio volume" } };<br> { "volup"; { func = ret_print(vlc.volume.up,"( audio volume: "," )"); args = "[X]"; help = "raise audio volume X steps" } };<br> { "voldown"; { func = ret_print(vlc.volume.down,"( audio volume: "," )"); args = "[X]"; help = "lower audio volume X steps" } };<br> { "adev"; { func = skip(listvalue("aout","audio-device")); args = "[X]"; help = "set/get audio device" } };<br> { "achan"; { func = skip(listvalue("aout","audio-channels")); args = "[X]"; help = "set/get audio channels" } };<br> { "atrack"; { func = skip(listvalue("input","audio-es")); args = "[X]"; help = "set/get audio track" } };<br> { "vtrack"; { func = skip(listvalue("input","video-es")); args = "[X]"; help = "set/get video track" } };<br> { "vratio"; { func = skip(listvalue("vout","aspect-ratio")); args = "[X]"; help = "set/get video aspect ratio" } };<br> { "vcrop"; { func = skip(listvalue("vout","crop")); args = "[X]"; help = "set/get video crop"; aliases = { "crop" } } };<br> { "vzoom"; { func = skip(listvalue("vout","zoom")); args = "[X]"; help = "set/get video zoom"; aliases = { "zoom" } } };<br> { "snapshot"; { func = common.snapshot; help = "take video snapshot" } };<br> { "strack"; { func = skip(listvalue("input","spu-es")); args = "[X]"; help = "set/get subtitles track" } };<br> { "hotkey"; { func = skip(common.hotkey); args = "[hotkey name]"; help = "simulate hotkey press"; adv = true; aliases = { "key" } } };<br> { "menu"; { func = fixme; args = "[on|off|up|down|left|right|select]"; help = "use menu"; adv = true } };<br> { "" };<br> { "set"; { func = set_env; args = "[var [value]]"; help = "set/get env var"; adv = true } };<br> { "save_env"; { func = save_env; help = "save env vars (for future clients)"; adv = true } };<br> { "alias"; { func = skip(alias); args = "[cmd]"; help = "set/get command aliases"; adv = true } };<br> { "eval"; { func = skip(eval); help = "eval some lua (*debug*)"; adv =true } }; -- FIXME: comment out if you're not debugging<br> { "description"; { func = print_text("Description",description); help = "describe this module" } };<br> { "license"; { func = print_text("License message",vlc.misc.license()); help = "print VLC's license message"; adv = true } };<br> { "help"; { func = help; args = "[pattern]"; help = "a help message"; aliases = { "?" } } };<br> { "longhelp"; { func = help; args = "[pattern]"; help = "a longer help message" } };<br> { "logout"; { func = logout; help = "exit (if in a socket connection)" } };<br> { "quit"; { func = quit; help = "quit VLC (or logout if in a socket connection)" } };<br> { "shutdown"; { func = shutdown; help = "shutdown VLC" } };<br> }<br> commands = {}<br> for i, cmd in ipairs( commands_ordered ) do<br> if #cmd == 2 then<br> commands[cmd[1]]=cmd[2]<br> if cmd[2].aliases then<br> for _,a in ipairs(cmd[2].aliases) do<br> commands[a]=cmd[1]<br> end<br> end<br> end<br> commands_ordered[i]=cmd[1]<br> end<br> --[[ From now on commands_ordered is a list of the different command names<br> and commands is a associative array indexed by the command name. ]]<br> <br> -- Compute the column width used when printing a the autocompletion list<br> env.colwidth = 0<br> for c,_ in pairs(commands) do<br> if #c > env.colwidth then env.colwidth = #c end<br> end<br> env.coldwidth = env.colwidth + 1<br> <br> -- Count unimplemented functions<br> do<br> local count = 0<br> local list = "("<br> for c,v in pairs(commands) do<br> if v.func == fixme then<br> count = count + 1<br> if count ~= 1 then<br> list = list..","<br> end<br> list = list..c<br> end<br> end<br> list = list..")"<br> if count ~= 0 and env.welcome then<br> env.welcome = env.welcome .. "\r\nWarning: "..count.." functions are still unimplemented "..list.."."<br> end<br> end<br> <br> --[[Utils]]<br> function split_input(input)<br> local input = strip(input)<br> local s = string.find(input," ")<br> if s then<br> return string.sub(input,0,s-1), strip(string.sub(input,s))<br> else<br> return input<br> end<br> end<br> <br> function call_command(cmd,client,arg)<br> if type(commands[cmd]) == type("") then<br> cmd = commands[cmd]<br> end<br> local ok, msg<br> if arg ~= nil then<br> ok, msg = pcall( commands[cmd].func, cmd, client, arg )<br> else<br> ok, msg = pcall( commands[cmd].func, cmd, client )<br> end<br> if not ok then<br> local a = arg or ""<br> if a ~= "" then a = " " .. a end<br> client:append("Error in
“…cmd…a…”’ "… msg)
end
end
function call_libvlc_command(cmd,client,arg)
local ok, vlcerr, vlcmsg = pcall( vlc.var.libvlc_command, cmd, arg )
if not ok then
local a = arg or “”
if a ~= “” then a = " " … a end
client:append(“Error in "..cmd..a.."' ".. vlcerr) -- when pcall fails, the 2nd arg is the error message.<br> end<br> return vlcerr<br> end<br> <br> function call_object_command(cmd,client,arg)<br> local var, val = split_input(arg)<br> local ok, vlcmsg, vlcerr, vlcerrmsg = pcall( vlc.var.command, cmd, var, val )<br> if not ok then<br> client:append("Error in
“…cmd…” “…var…” “…val…”’ “… vlcmsg) – when pcall fails the 2nd arg is the error message
end
if vlcmsg ~= “” then
client:append(vlcmsg)
end
return vlcerr
end
–[[ Setup host]]
require(“host”)
h = host.host()
– No auth
h.status_callbacks[host.status.password] = function(client)
client.env = common.table_copy( env )
client:send( client.env.welcome … “\r\n”)
client:switch_status(host.status.read)
end
– Print prompt when switching a client’s status to read'<br> h.status_callbacks[host.status.read] = function(client)<br> client:send( client.env.prompt )<br> end<br> <br> h:listen( config.hosts or config.host or "*console" )<br> <br> --[[The main loop]]<br> while not vlc.misc.should_die() do<br> h:accept()<br> local write, read = h:select(0.1)<br> <br> for _, client in pairs(write) do<br> local len = client:send()<br> client.buffer = string.sub(client.buffer,len+1)<br> if client.buffer == "" then client:switch_status(host.status.read) end<br> end<br> <br> for _, client in pairs(read) do<br> local input = client:recv(1000)<br> local done = false<br> if string.match(input,"\n$") then<br> client.buffer = string.gsub(client.buffer..input,"\r?\n$","")<br> done = true<br> elseif client.buffer == ""<br> and ((client.type == host.client_type.stdio and input == "")<br> or (client.type == host.client_type.net and input == "\004")) then<br> -- Caught a ^D<br> client.buffer = "quit"<br> done = true<br> else<br> client.buffer = client.buffer .. input<br> end<br> if done then<br> local cmd,arg = split_input(client.buffer)<br> client.buffer = ""<br> client:switch_status(host.status.write)<br> if commands[cmd] then<br> call_command(cmd,client,arg)<br> elseif string.sub(cmd,0,1)=='@'<br> and call_object_command(string.sub(cmd,2,#cmd),client,arg) == 0 then<br> --<br> elseif client.type == host.client_type.stdio<br> and call_libvlc_command(cmd,client,arg) == 0 then<br> --<br> else<br> local choices = {}<br> if client.env.autocompletion ~= 0 then<br> for v,_ in common.pairs_sorted(commands) do<br> if string.sub(v,0,#cmd)==cmd then<br> table.insert(choices, v)<br> end<br> end<br> end<br> if #choices == 1 and client.env.autoalias ~= 0 then<br> -- client:append("Aliasing to \""..choices[1].."\".")<br> cmd = choices[1]<br> call_command(cmd,client,arg)<br> else<br> client:append("Unknown command
“…cmd…”’. Type `help’ for help.”)
if #choices ~= 0 then
client:append(“Possible choices are:”)
local cols = math.floor(client.env.width/(client.env.colwidth+1))
local fmt = “%-”…client.env.colwidth…“s”
for i = 1, #choices do
choices[i] = string.format(fmt,choices[i])
end
for i = 1, #choices, cols do
local j = i + cols - 1
if j > #choices then j = #choices end
client:append(” “…table.concat(choices,” ",i,j))
end
end
end
end
end
end
end
[/details]
the area worth noting is this part:
[quote]
commands_ordered = {
{ "add"; { func = add; args = "XYZ"; help = "add XYZ to playlist" } };
{ "enqueue"; { func = add; args = "XYZ"; help = "queue XYZ to playlist" } };
{ "playlist"; { func = playlist; help = "show items currently in playlist" } };
{ "search"; { func = playlist; args = "[string]"; help = "search for items in playlist (or reset search)" } };
{ "sort"; { func = playlist_sort; args = "key"; help = "sort the playlist" } };
{ "sd"; { func = services_discovery; args = "[sd]"; help = "show services discovery or toggle" } };
{ "play"; { func = skip2(vlc.playlist.play); help = "play stream" } };
{ "stop"; { func = skip2(vlc.playlist.stop); help = "stop stream" } };
{ "next"; { func = skip2(vlc.playlist.next); help = "next playlist item" } };
{ "prev"; { func = skip2(vlc.playlist.prev); help = "previous playlist item" } };
{ "goto"; { func = skip2(vlc.playlist.goto); help = "goto item at index" } };
{ "repeat"; { func = skip2(vlc.playlist.repeat_); args = "[on|off]"; help = "toggle playlist repeat" } };
{ "loop"; { func = skip2(vlc.playlist.loop); args = "[on|off]"; help = "toggle playlist loop" } };
{ "random"; { func = skip2(vlc.playlist.random); args = "[on|off]"; help = "toggle playlist random" } };
{ "clear"; { func = skip2(vlc.playlist.clear); help = "clear the playlist" } };
{ "status"; { func = playlist_status; help = "current playlist status" } };
{ "title"; { func = titlechap; args = "[X]"; help = "set/get title in current item" } };
{ "title_n"; { func = titlechap_offset(1); help = "next title in current item" } };
{ "title_p"; { func = titlechap_offset(-1); help = "previous title in current item" } };
{ "chapter"; { func = titlechap; args = "[X]"; help = "set/get chapter in current item" } };
{ "chapter_n"; { func = titlechap_offset(1); help = "next chapter in current item" } };
{ "chapter_p"; { func = titlechap_offset(-1); help = "previous chapter in current item" } };
{ "" };
{ "seek"; { func = seek; args = "X"; help = "seek in seconds, for instance `seek 12'" } };
{ "pause"; { func = setarg(common.hotkey,"key-play-pause"); help = "toggle pause" } };
{ "fastforward"; { func = setarg(common.hotkey,"key-jump+extrashort"); help = "set to maximum rate" } };
{ "rewind"; { func = setarg(common.hotkey,"key-jump-extrashort"); help = "set to minimum rate" } };
{ "faster"; { func = rate; help = "faster playing of stream" } };
{ "slower"; { func = rate; help = "slower playing of stream" } };
{ "normal"; { func = rate; help = "normal playing of stream" } };
{ "fullscreen"; { func = skip2(vlc.video.fullscreen); args = "[on|off]"; help = "toggle fullscreen"; aliases = { "f", "F" } } };
{ "info"; { func = input_info; help = "information about the current stream" } };
{ "get_time"; { func = get_time("time"); help = "seconds elapsed since stream's beginning" } };
{ "is_playing"; { func = is_playing; help = "1 if a stream plays, 0 otherwise" } };
{ "get_title"; { func = ret_print(vlc.input.get_title); help = "the title of the current stream" } };
{ "get_length"; { func = get_time("length"); help = "the length of the current stream" } };
{ "" };
{ "volume"; { func = volume; args = "[X]"; help = "set/get audio volume" } };
{ "volup"; { func = ret_print(vlc.volume.up,"( audio volume: "," )"); args = "[X]"; help = "raise audio volume X steps" } };
{ "voldown"; { func = ret_print(vlc.volume.down,"( audio volume: "," )"); args = "[X]"; help = "lower audio volume X steps" } };
{ "adev"; { func = skip(listvalue("aout","audio-device")); args = "[X]"; help = "set/get audio device" } };
{ "achan"; { func = skip(listvalue("aout","audio-channels")); args = "[X]"; help = "set/get audio channels" } };
{ "atrack"; { func = skip(listvalue("input","audio-es")); args = "[X]"; help = "set/get audio track" } };
{ "vtrack"; { func = skip(listvalue("input","video-es")); args = "[X]"; help = "set/get video track" } };
{ "vratio"; { func = skip(listvalue("vout","aspect-ratio")); args = "[X]"; help = "set/get video aspect ratio" } };
{ "vcrop"; { func = skip(listvalue("vout","crop")); args = "[X]"; help = "set/get video crop"; aliases = { "crop" } } };
{ "vzoom"; { func = skip(listvalue("vout","zoom")); args = "[X]"; help = "set/get video zoom"; aliases = { "zoom" } } };
{ "snapshot"; { func = common.snapshot; help = "take video snapshot" } };
{ "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" } } };
{ "menu"; { func = fixme; 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 } };
{ "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 } };
{ "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" } };
{ "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 = { "?" } } };
{ "longhelp"; { func = help; args = "[pattern]"; help = "a longer help message" } };
{ "logout"; { func = logout; help = "exit (if in a socket connection)" } };
{ "quit"; { func = quit; help = "quit VLC (or logout if in a socket connection)" } };
{ "shutdown"; { func = shutdown; help = "shutdown VLC" } };
[/quote]
[quote=“101010, post:8, topic:30915”]
VLC would be good for this.
It has a LUA script for a remote control interface:
this is the rc.lua file included in VLC’s interface directory showing the available functions or commands
[details=“Click to view contents”] --[==========================================================================[
rc.lua: remote control module for VLC
–[==========================================================================[
Copyright © 2007-2009 the VideoLAN team
$Id$
Authors: Antoine Cellerier
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.
–]==========================================================================]
description=
[============================================================================[
Remote control interface for VLC
This is a modules/control/rc.c look alike (with a bunch of new features)
Use on local term:
vlc -I luarc
Use on tcp connection:
vlc -I luarc --lua-config “rc={host=‘localhost:4212’}”
Use on multiple hosts (term + 2 tcp ports):
vlc -I luarc --lua-config “rc={hosts={'console’,‘localhost:4212’,‘localhost:5678’}}"
Note:
-I luarc is an alias for -I lua --lua-intf rc
Configuration options setable throught the --lua-config option are:
* hosts: A list of hosts to listen on.
* host: A host to listen on. (won’t be used if hosts' is set)<br> The following can be set using the --lua-config option or in the interface<br> itself using the
set’ command:
* prompt: The prompt.
* welcome: The welcome message.
* width: The default terminal width (used to format text).
* autocompletion: When issuing an unknown command, print a list of
possible commands to autocomplete with. (0 to disable,
1 to enable).
* autoalias: If autocompletion returns only one possibility, use it
(0 to disable, 1 to enable).
* flatplaylist: 0 to disable, 1 to enable.
]============================================================================]
require(“common”)
skip = common.skip
skip2 = function(foo) return skip(skip(foo)) end
setarg = common.setarg
strip = common.strip
–[[Setup default environement]]
env = { prompt = “> “;
width = 70;
autocompletion = 1;
autoalias = 1;
welcome = “Remote control interface initialized. Type help' for help.";<br> flatplaylist = 0;<br> }<br> <br> --[[Import custom environement variables from the command line config (if possible)]]<br> for k,v in pairs(env) do<br> if config[k] then<br> if type(env[k]) == type(config[k]) then<br> env[k] = config[k]<br> vlc.msg.dbg("set environement variable
“…k…”’ to “…tostring(env[k]))
else
vlc.msg.err(“environement variable "..k.."' should be of type "..type(env[k])..". config value will be discarded.")<br> end<br> end<br> end<br> <br> --[[Command functions]]<br> function set_env(name,client,value)<br> if value then<br> local var,val = split_input(value)<br> if val then<br> s = string.gsub(val,"\"(.*)\"","%1")<br> if type(client.env[var])==type(1) then<br> client.env[var] = tonumber(s)<br> else<br> client.env[var] = s<br> end<br> else<br> client:append( tostring(client.env[var]) )<br> end<br> else<br> for e,v in common.pairs_sorted(client.env) do<br> client:append(e.."="..v)<br> end<br> end<br> end<br> <br> function save_env(name,client,value)<br> env = common.table_copy(client.env)<br> end<br> <br> function alias(client,value)<br> if value then<br> local var,val = split_input(value)<br> if commands[var] and type(commands[var]) ~= type("") then<br> client:append("Error: cannot use a primary command as an alias name")<br> else<br> if commands[val] then<br> commands[var]=val<br> else<br> client:append("Error: unknown primary command
“…val…”’.”)
end
end
else
for c,v in common.pairs_sorted(commands) do
if type(v)==type(””) then
client:append(c…”=”…v)
end
end
end
end
function fixme(name,client)
client:append( “FIXME: unimplemented command "..name.."'." )<br> end<br> <br> function logout(name,client)<br> if client.type == host.client_type.net then<br> client:send("Bye-bye!")<br> client:del()<br> else<br> client:append("Error: Can't logout of stdin/stdout. Use quit or shutdown to close VLC.")<br> end<br> end<br> <br> function shutdown(name,client)<br> client:append("Bye-bye!")<br> h:broadcast("Shutting down.")<br> vlc.msg.info("Requested shutdown.")<br> vlc.misc.quit()<br> end<br> <br> function quit(name,client)<br> if client.type == host.client_type.net then<br> logout(name,client)<br> else<br> shutdown(name,client)<br> end<br> end<br> <br> function add(name,client,arg)<br> -- TODO: par single and double quotes properly<br> local f<br> if name == "enqueue" then<br> f = vlc.playlist.enqueue<br> else<br> f = vlc.playlist.add<br> end<br> local options = {}<br> for o in string.gmatch(arg," +<img src="https://files.renoise.com/forum/emoticons/default/sad.gif" class="bbc_emoticon" alt=":(">[^]*)") do<br> table.insert(options,o)<br> end<br> arg = string.gsub(arg," +:.*$","")<br> f({{path=arg,options=options}})<br> end<br> <br> function playlist_is_tree( client )<br> if client.env.flatplaylist == 0 then<br> return true<br> else<br> return false<br> end<br> end<br> <br> function playlist(name,client,arg)<br> function playlist0(item,prefix)<br> local prefix = prefix or ""<br> if not item.flags.disabled then<br> local str = "| "..prefix..tostring(item.id).." - "..item.name<br> if item.duration > 0 then<br> str = str.." ("..common.durationtostring(item.duration)..")"<br> end<br> if item.nb_played > 0 then<br> str = str.." [played "..tostring(item.nb_played).." time"<br> if item.nb_played > 1 then<br> str = str .. "s"<br> end<br> str = str .. "]"<br> end<br> client:append(str)<br> end<br> if item.children then<br> for _, c in ipairs(item.children) do<br> playlist0(c,prefix.." ")<br> end<br> end<br> end<br> local playlist<br> local tree = playlist_is_tree(client)<br> if name == "search" then<br> playlist = vlc.playlist.search(arg or "", tree)<br> else<br> if tonumber(arg) then<br> playlist = vlc.playlist.get(tonumber(arg), tree)<br> elseif arg then<br> playlist = vlc.playlist.get(arg, tree)<br> else<br> playlist = vlc.playlist.get(nil, tree)<br> end<br> end<br> if name == "search" then<br> client:append("+----[Search - "..(arg or "
reset’”)…"]")
else
client:append(“±—[Playlist - “…playlist.name…”]”)
end
if playlist.children then
for _, item in ipairs(playlist.children) do
playlist0(item)
end
else
playlist0(playlist)
end
if name == “search” then
client:append("±—[End of search - Use search' to reset ]")<br> else<br> client:append("+----[End of playlist]")<br> end<br> end<br> <br> function playlist_sort(name,client,arg)<br> if not arg then<br> client:append("Valid sort keys are: id, title, artist, genre, random, duration, album.")<br> else<br> local tree = playlist_is_tree(client)<br> vlc.playlist.sort(arg,false,tree)<br> end<br> end<br> <br> function services_discovery(name,client,arg)<br> if arg then<br> if vlc.sd.is_loaded(arg) then<br> vlc.sd.remove(arg)<br> client:append(arg.." disabled.")<br> else<br> vlc.sd.add(arg)<br> client:append(arg.." enabled.")<br> end<br> else<br> local sd = vlc.sd.get_services_names()<br> client:append("+----[Services discovery]")<br> for n,ln in pairs(sd) do<br> local status<br> if vlc.sd.is_loaded(n) then<br> status = "enabled"<br> else<br> status = "disabled"<br> end<br> client:append("| "..n..": " .. ln .. " (" .. status .. ")")<br> end<br> client:append("+----[End of services discovery]")<br> end<br> end<br> <br> function print_text(label,text)<br> return function(name,client)<br> client:append("+----["..label.."]")<br> client:append "|"<br> for line in string.gmatch(text,".-\r?\n") do<br> client:append("| "..string.gsub(line,"\r?\n",""))<br> end<br> client:append "|"<br> client:append("+----[End of "..string.lower(label).."]")<br> end<br> end<br> <br> function help(name,client,arg)<br> local width = client.env.width<br> local long = (name == "longhelp")<br> local extra = ""<br> if arg then extra = "matching
" … arg … "’ " end
client:append(“±—[Remote control commands “…extra…”]”)
for i, cmd in ipairs(commands_ordered) do
if (cmd == “” or not commands[cmd].adv or long)
and (not arg or string.match(cmd,arg)) then
local str = "| " … cmd
if cmd ~= “” then
local val = commands[cmd]
if val.aliases then
for ,a in ipairs(val.aliases) do
str = str … “, " … a
end
end
if val.args then str = str … " " … val.args end
if #str%2 == 1 then str = str … " " end
str = str … string.rep(” .",(width-(#str+#val.help)-1)/2)
str = str … string.rep(" “,width-#str-#val.help) … val.help
end
client:append(str)
end
end
client:append(“±—[end of help]”)
end
function input_info(name,client)
local categories = vlc.input_info()
for cat, infos in pairs(categories) do
client:append(“±—[”…cat…”]")
client:append("|")
for name, value in pairs(infos) do
client:append("| “…name…”: “…value)
end
client:append(”|")
end
client:append(“±—[end of stream info]”)
end
function playlist_status(name,client)
local a,b,c = vlc.playlist.status()
client:append( “( new input: " … tostring(a) … " )” )
client:append( “( audio volume: " … tostring( … " )”)
client:append( “( state " … tostring© … " )”)
end
function is_playing(name,client)
if vlc.input.is_playing() then client:append “1” else client:append “0” end
end
function ret_print(foo,start,stop)
local start = start or “”
local stop = stop or “”
return function(discard,client,…) client:append(start…tostring(foo(…))…stop) end
end
function get_time(var)
return function(name,client)
local input = vlc.object.input()
client:append(math.floor(vlc.var.get( input, var )))
end
end
function titlechap(name,client,value)
local input = vlc.object.input()
local var = string.gsub( name, ".$”, “” )
if value then
vlc.var.set( input, var, value )
else
local item = vlc.var.get( input, var )
– Todo: add item name conversion
client:apped(item)
end
end
function titlechap_offset(client,offset)
return function(name,value)
local input = vlc.object.input()
local var = string.gsub( name, ".*$", “” )
vlc.var.set( input, var, vlc.var.get( input, var )+offset )
end
end
function seek(name,client,value)
common.seek(value)
end
function volume(name,client,value)
if value then
vlc.volume.set(value)
else
client:append(tostring(vlc.volume.get()))
end
end
function rate(name,client)
local input = vlc.object.input()
if name == “normal” then
vlc.var.set(input,“rate”,1000) – FIXME: INPUT_RATE_DEFAULT
else
vlc.var.set(input,“rate-”…name,nil)
end
end
function listvalue(obj,var)
return function(client,value)
local o = vlc.object.find(nil,obj,“anywhere”)
if not o then return end
if value then
vlc.var.set( o, var, value )
else
local c = vlc.var.get( o, var )
local v, l = vlc.var.get_list( o, var )
client:append(“±—[”…var…"]")
for i,val in ipairs(v) do
local mark = (val==c)and " " or “”
client:append("| “…tostring(val)…” - "…tostring(l[i])…mark)
end
client:append(“±—[end of “…var…”]”)
end
end
end
function eval(client,val)
client:append(loadstring(“return “…val)())
end
–[[ Declare commands, register their callback functions and provide
help strings here.
Syntax is:
“”; { func = ; [args = “”;] help = “”; [adv = ;] [aliases = { [””;] }; ] }
]]
commands_ordered = {
{ “add”; { func = add; args = “XYZ”; help = “add XYZ to playlist” } };
{ “enqueue”; { func = add; args = “XYZ”; help = “queue XYZ to playlist” } };
{ “playlist”; { func = playlist; help = “show items currently in playlist” } };
{ “search”; { func = playlist; args = “[string]”; help = “search for items in playlist (or reset search)” } };
{ “sort”; { func = playlist_sort; args = “key”; help = “sort the playlist” } };
{ “sd”; { func = services_discovery; args = “[sd]”; help = “show services discovery or toggle” } };
{ “play”; { func = skip2(vlc.playlist.play); help = “play stream” } };
{ “stop”; { func = skip2(vlc.playlist.stop); help = “stop stream” } };
{ “next”; { func = skip2(vlc.playlist.next); help = “next playlist item” } };
{ “prev”; { func = skip2(vlc.playlist.prev); help = “previous playlist item” } };
{ “goto”; { func = skip2(vlc.playlist.goto); help = “goto item at index” } };
{ “repeat”; { func = skip2(vlc.playlist.repeat); args = “[on|off]”; help = “toggle playlist repeat” } };
{ “loop”; { func = skip2(vlc.playlist.loop); args = “[on|off]”; help = “toggle playlist loop” } };
{ “random”; { func = skip2(vlc.playlist.random); args = “[on|off]”; help = “toggle playlist random” } };
{ “clear”; { func = skip2(vlc.playlist.clear); help = “clear the playlist” } };
{ “status”; { func = playlist_status; help = “current playlist status” } };
{ “title”; { func = titlechap; args = “[X]”; help = “set/get title in current item” } };
{ “title_n”; { func = titlechap_offset(1); help = “next title in current item” } };
{ “title_p”; { func = titlechap_offset(-1); help = “previous title in current item” } };
{ “chapter”; { func = titlechap; args = “[X]”; help = “set/get chapter in current item” } };
{ “chapter_n”; { func = titlechap_offset(1); help = “next chapter in current item” } };
{ “chapter_p”; { func = titlechap_offset(-1); help = “previous chapter in current item” } };
{ “” };
{ “seek”; { func = seek; args = “X”; help = "seek in seconds, for instance seek 12'" } };<br> { "pause"; { func = setarg(common.hotkey,"key-play-pause"); help = "toggle pause" } };<br> { "fastforward"; { func = setarg(common.hotkey,"key-jump+extrashort"); help = "set to maximum rate" } };<br> { "rewind"; { func = setarg(common.hotkey,"key-jump-extrashort"); help = "set to minimum rate" } };<br> { "faster"; { func = rate; help = "faster playing of stream" } };<br> { "slower"; { func = rate; help = "slower playing of stream" } };<br> { "normal"; { func = rate; help = "normal playing of stream" } };<br> { "fullscreen"; { func = skip2(vlc.video.fullscreen); args = "[on|off]"; help = "toggle fullscreen"; aliases = { "f", "F" } } };<br> { "info"; { func = input_info; help = "information about the current stream" } };<br> { "get_time"; { func = get_time("time"); help = "seconds elapsed since stream's beginning" } };<br> { "is_playing"; { func = is_playing; help = "1 if a stream plays, 0 otherwise" } };<br> { "get_title"; { func = ret_print(vlc.input.get_title); help = "the title of the current stream" } };<br> { "get_length"; { func = get_time("length"); help = "the length of the current stream" } };<br> { "" };<br> { "volume"; { func = volume; args = "[X]"; help = "set/get audio volume" } };<br> { "volup"; { func = ret_print(vlc.volume.up,"( audio volume: "," )"); args = "[X]"; help = "raise audio volume X steps" } };<br> { "voldown"; { func = ret_print(vlc.volume.down,"( audio volume: "," )"); args = "[X]"; help = "lower audio volume X steps" } };<br> { "adev"; { func = skip(listvalue("aout","audio-device")); args = "[X]"; help = "set/get audio device" } };<br> { "achan"; { func = skip(listvalue("aout","audio-channels")); args = "[X]"; help = "set/get audio channels" } };<br> { "atrack"; { func = skip(listvalue("input","audio-es")); args = "[X]"; help = "set/get audio track" } };<br> { "vtrack"; { func = skip(listvalue("input","video-es")); args = "[X]"; help = "set/get video track" } };<br> { "vratio"; { func = skip(listvalue("vout","aspect-ratio")); args = "[X]"; help = "set/get video aspect ratio" } };<br> { "vcrop"; { func = skip(listvalue("vout","crop")); args = "[X]"; help = "set/get video crop"; aliases = { "crop" } } };<br> { "vzoom"; { func = skip(listvalue("vout","zoom")); args = "[X]"; help = "set/get video zoom"; aliases = { "zoom" } } };<br> { "snapshot"; { func = common.snapshot; help = "take video snapshot" } };<br> { "strack"; { func = skip(listvalue("input","spu-es")); args = "[X]"; help = "set/get subtitles track" } };<br> { "hotkey"; { func = skip(common.hotkey); args = "[hotkey name]"; help = "simulate hotkey press"; adv = true; aliases = { "key" } } };<br> { "menu"; { func = fixme; args = "[on|off|up|down|left|right|select]"; help = "use menu"; adv = true } };<br> { "" };<br> { "set"; { func = set_env; args = "[var [value]]"; help = "set/get env var"; adv = true } };<br> { "save_env"; { func = save_env; help = "save env vars (for future clients)"; adv = true } };<br> { "alias"; { func = skip(alias); args = "[cmd]"; help = "set/get command aliases"; adv = true } };<br> { "eval"; { func = skip(eval); help = "eval some lua (*debug*)"; adv =true } }; -- FIXME: comment out if you're not debugging<br> { "description"; { func = print_text("Description",description); help = "describe this module" } };<br> { "license"; { func = print_text("License message",vlc.misc.license()); help = "print VLC's license message"; adv = true } };<br> { "help"; { func = help; args = "[pattern]"; help = "a help message"; aliases = { "?" } } };<br> { "longhelp"; { func = help; args = "[pattern]"; help = "a longer help message" } };<br> { "logout"; { func = logout; help = "exit (if in a socket connection)" } };<br> { "quit"; { func = quit; help = "quit VLC (or logout if in a socket connection)" } };<br> { "shutdown"; { func = shutdown; help = "shutdown VLC" } };<br> }<br> commands = {}<br> for i, cmd in ipairs( commands_ordered ) do<br> if #cmd == 2 then<br> commands[cmd[1]]=cmd[2]<br> if cmd[2].aliases then<br> for _,a in ipairs(cmd[2].aliases) do<br> commands[a]=cmd[1]<br> end<br> end<br> end<br> commands_ordered[i]=cmd[1]<br> end<br> --[[ From now on commands_ordered is a list of the different command names<br> and commands is a associative array indexed by the command name. ]]<br> <br> -- Compute the column width used when printing a the autocompletion list<br> env.colwidth = 0<br> for c,_ in pairs(commands) do<br> if #c > env.colwidth then env.colwidth = #c end<br> end<br> env.coldwidth = env.colwidth + 1<br> <br> -- Count unimplemented functions<br> do<br> local count = 0<br> local list = "("<br> for c,v in pairs(commands) do<br> if v.func == fixme then<br> count = count + 1<br> if count ~= 1 then<br> list = list..","<br> end<br> list = list..c<br> end<br> end<br> list = list..")"<br> if count ~= 0 and env.welcome then<br> env.welcome = env.welcome .. "\r\nWarning: "..count.." functions are still unimplemented "..list.."."<br> end<br> end<br> <br> --[[Utils]]<br> function split_input(input)<br> local input = strip(input)<br> local s = string.find(input," ")<br> if s then<br> return string.sub(input,0,s-1), strip(string.sub(input,s))<br> else<br> return input<br> end<br> end<br> <br> function call_command(cmd,client,arg)<br> if type(commands[cmd]) == type("") then<br> cmd = commands[cmd]<br> end<br> local ok, msg<br> if arg ~= nil then<br> ok, msg = pcall( commands[cmd].func, cmd, client, arg )<br> else<br> ok, msg = pcall( commands[cmd].func, cmd, client )<br> end<br> if not ok then<br> local a = arg or ""<br> if a ~= "" then a = " " .. a end<br> client:append("Error in
“…cmd…a…”’ "… msg)
end
end
function call_libvlc_command(cmd,client,arg)
local ok, vlcerr, vlcmsg = pcall( vlc.var.libvlc_command, cmd, arg )
if not ok then
local a = arg or “”
if a ~= “” then a = " " … a end
client:append(“Error in "..cmd..a.."' ".. vlcerr) -- when pcall fails, the 2nd arg is the error message.<br> end<br> return vlcerr<br> end<br> <br> function call_object_command(cmd,client,arg)<br> local var, val = split_input(arg)<br> local ok, vlcmsg, vlcerr, vlcerrmsg = pcall( vlc.var.command, cmd, var, val )<br> if not ok then<br> client:append("Error in
“…cmd…” “…var…” “…val…”’ “… vlcmsg) – when pcall fails the 2nd arg is the error message
end
if vlcmsg ~= “” then
client:append(vlcmsg)
end
return vlcerr
end
–[[ Setup host]]
require(“host”)
h = host.host()
– No auth
h.status_callbacks[host.status.password] = function(client)
client.env = common.table_copy( env )
client:send( client.env.welcome … “\r\n”)
client:switch_status(host.status.read)
end
– Print prompt when switching a client’s status to read'<br> h.status_callbacks[host.status.read] = function(client)<br> client:send( client.env.prompt )<br> end<br> <br> h:listen( config.hosts or config.host or "*console" )<br> <br> --[[The main loop]]<br> while not vlc.misc.should_die() do<br> h:accept()<br> local write, read = h:select(0.1)<br> <br> for _, client in pairs(write) do<br> local len = client:send()<br> client.buffer = string.sub(client.buffer,len+1)<br> if client.buffer == "" then client:switch_status(host.status.read) end<br> end<br> <br> for _, client in pairs(read) do<br> local input = client:recv(1000)<br> local done = false<br> if string.match(input,"\n$") then<br> client.buffer = string.gsub(client.buffer..input,"\r?\n$","")<br> done = true<br> elseif client.buffer == ""<br> and ((client.type == host.client_type.stdio and input == "")<br> or (client.type == host.client_type.net and input == "\004")) then<br> -- Caught a ^D<br> client.buffer = "quit"<br> done = true<br> else<br> client.buffer = client.buffer .. input<br> end<br> if done then<br> local cmd,arg = split_input(client.buffer)<br> client.buffer = ""<br> client:switch_status(host.status.write)<br> if commands[cmd] then<br> call_command(cmd,client,arg)<br> elseif string.sub(cmd,0,1)=='@'<br> and call_object_command(string.sub(cmd,2,#cmd),client,arg) == 0 then<br> --<br> elseif client.type == host.client_type.stdio<br> and call_libvlc_command(cmd,client,arg) == 0 then<br> --<br> else<br> local choices = {}<br> if client.env.autocompletion ~= 0 then<br> for v,_ in common.pairs_sorted(commands) do<br> if string.sub(v,0,#cmd)==cmd then<br> table.insert(choices, v)<br> end<br> end<br> end<br> if #choices == 1 and client.env.autoalias ~= 0 then<br> -- client:append("Aliasing to \""..choices[1].."\".")<br> cmd = choices[1]<br> call_command(cmd,client,arg)<br> else<br> client:append("Unknown command
“…cmd…”’. Type `help’ for help.”)
if #choices ~= 0 then
client:append(“Possible choices are:”)
local cols = math.floor(client.env.width/(client.env.colwidth+1))
local fmt = “%-”…client.env.colwidth…“s”
for i = 1, #choices do
choices[i] = string.format(fmt,choices[i])
end
for i = 1, #choices, cols do
local j = i + cols - 1
if j > #choices then j = #choices end
client:append(” “…table.concat(choices,” ",i,j))
end
end
end
end
end
end
end
[/details]
the area worth noting is this part:
[/quote]
^^^What he said.
[quote="101010, post:8, topic:30915"]
I would like to cut up JPEGs with Renoise. Also, MS WORD Documents. Is this possible?
[/quote]
My house mate somehow forced word files and games and things into Audacity and just made it try as hard as it could to recognise it as a sound file (I have no idea how he did it but will ask next time I see him), it created some insane glitched out madness.
Renoise opens any raw file straight out of the box [check the . button in the disk-op to see all file types], + glitch artists have been doing this for a long time.
aww…waddya have to tell me that for…!?! it’s late and now i’m gonna have to try it out!
hi people
i had a play around this last year, involving midi messages shipped from renoise to pure data gem : its a bit old but still works
so anyhow if you have a midi enabled VJ software you can make a link (!!) or now with osc you could talk to blender (!!!) for some serious geek high tech vjing…
works with linux
get in touch if you want more details, im a bit drunk drunk right now
basicaly you just send midi messages to a some VJ software
peace
I’m +1ing this only because I want to be able to trigger some video clips directly on renoise too(even with only one compression format), or just use it to create music upon a video and get in real sync with it (instead of doing a rewire with protools wich cannibalise by the way my midi devices)