Jimmy's VLC project!
Posted: 06 Sep 2017 00:26
Hi guys,
I'm going to use this thread as my base of operations, for this project.
I have some experience in Visual basic and a touch in python.
No experience in C, so far.
Any help would be greatly appreciated, it's going to take a while for me to work on this.
Project:
1/ Button and keyboard-shortcut in VLC that deletes current file to recycling bin (so that it can be restored potentially later on!) In Windows10
2/ Button and keyboard-shortcut in VLC that creates a copy of current file to a particular directory (I want multiple of these to multiple directories. In Windows10
3/ same as the above 2 but on an android phone.
Regarding 1/
I have found some code, see below, my respect to Mark Morschhäuser.
However I want to remove the prompt, create a keyboard-shortcut, create button on the UI, and also have a similar system working for an android phone.
I'm not familiar with C, and don't even have an IDE (so I'm a total newb).
Regarding Project 2
Once Project 1 is done, should be a lot easier (I think?).
Regarding Project 3
I haven't a clue how to do this.
Again, Any help would be awesome! links or whatever, planning to work on this when I can. Bit busy right now.
Regards,
JimmyTheCool
I'm going to use this thread as my base of operations, for this project.
I have some experience in Visual basic and a touch in python.
No experience in C, so far.
Any help would be greatly appreciated, it's going to take a while for me to work on this.
Project:
1/ Button and keyboard-shortcut in VLC that deletes current file to recycling bin (so that it can be restored potentially later on!) In Windows10
2/ Button and keyboard-shortcut in VLC that creates a copy of current file to a particular directory (I want multiple of these to multiple directories. In Windows10
3/ same as the above 2 but on an android phone.
Regarding 1/
I have found some code, see below, my respect to Mark Morschhäuser.
However I want to remove the prompt, create a keyboard-shortcut, create button on the UI, and also have a similar system working for an android phone.
I'm not familiar with C, and don't even have an IDE (so I'm a total newb).
Code: Select all
--[[
INSTALLATION (create directories if they don't exist):
- put the file in the VLC subdir /lua/extensions, by default:
* Windows (all users): %ProgramFiles%\VideoLAN\VLC\lua\extensions\
* Windows (current user): %APPDATA%\VLC\lua\extensions\
* Linux (all users): /usr/share/vlc/lua/extensions/
* Linux (current user): ~/.local/share/vlc/lua/extensions/
* Mac OS X (all users): /Applications/VLC.app/Contents/MacOS/share/lua/extensions/
- Restart VLC.
]]--
--[[ Extension description ]]
function descriptor()
return {
title = "Diskdelete" ;
version = "0.2" ;
author = "Mark Morschhäuser" ;
shortdesc = "DELETE current playing FILE FROM DISK";
description = "<h1>Diskdelete</h1>"
.. "When you're playing a file, use Diskdelete to "
.. "easily delete this file <b>from your disk</b> with one click."
.. "<br>This will NOT change your playlist, it will <b>ERASE the file</b> itself!"
.. "<br>It will not use the Recycle Bin, the file will be gone immediately!"
.. "<br>This extension has been tested on GNU Linux with VLC 2.0.3."
.. "<br>The author is not responsible for damage caused by this extension.";
url = "https://github.com/VanNostrand/Diskdelete"
}
end
--[[ Hooks ]]
-- Activation hook
function activate()
vlc.msg.dbg("[Diskdelete] Activated")
d = vlc.dialog("Diskdelete")
d:add_label("<b>Clicking</b> this button will <b>delete</b> the currently playing file <b>from disk</b>.<br>You have to <b>be sure</b> as <b>you won't be asked</b> again!<br>You are responsible for your own actions, consider yourself warned.")
d:add_button("DELETE CURRENT FILE PERMANENTLY FROM DISK WITHOUT ASKING", delete)
d:show()
end
-- Deactivation hook
function deactivate()
vlc.msg.dbg("[Diskdelete] Deactivated")
vlc.deactivate()
end
function close()
deactivate()
end
--[[ The file deletion routine ]]
function delete()
item = vlc.input.item() -- get the current playing file
uri = item:uri() -- extract it's URI
filename = vlc.strings.decode_uri(uri) -- decode %foo stuff from the URI
vlc.playlist.skip(1)
--[[
--vlc.misc.mwait(vlc.misc.mdate() + 3000000)
--vlc.var.add_callback(vlc.object.input(), "time", vlc.playlist.skip(1), 3000000)
]]--
--retval, err = os.chmod(filename, 0777)
filename = string.sub(filename,9) -- remove 'file://' prefix which is 7 chars long
vlc.msg.dbg("[Diskdelete] selected for deletion: " .. filename)
retval, err = os.remove(filename) -- delete the file with this filename from disk
if(retval == nil) -- error handling; if deletion failed, print why
then
vlc.msg.dbg("[Diskdelete] error: " .. err)
end
end
-- This empty function is there, because vlc pested me otherwise
function meta_changed()
end
Regarding Project 2
Once Project 1 is done, should be a lot easier (I think?).
Regarding Project 3
I haven't a clue how to do this.
Again, Any help would be awesome! links or whatever, planning to work on this when I can. Bit busy right now.
Regards,
JimmyTheCool