How to get notified when buttons are clicked?

Discuss your Lua playlist, album art and interface scripts.
dafengche
New Cone
New Cone
Posts: 6
Joined: 17 Feb 2012 15:05

How to get notified when buttons are clicked?

Postby dafengche » 18 Feb 2012 11:56

Any idea how an extension can get notified when a button in the main vlc windows is clicked? For example, the pause button. Thanks.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: How to get notified when buttons are clicked?

Postby Jean-Baptiste Kempf » 18 Feb 2012 14:14

You cannot know when buttons are clicked. But you can attach to events and variable callbacks.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

dafengche
New Cone
New Cone
Posts: 6
Joined: 17 Feb 2012 15:05

Re: How to get notified when buttons are clicked?

Postby dafengche » 18 Feb 2012 15:16

That's what I want to ask. For example, I know how to subscribe to "input-listener" as below.

function descriptor()
...
capabilities = { "input-listener" }
...
end

-- Input change hook
function input_changed()
...
end

Where to find the event names and callback method names which extensions can use? Thanks.

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: How to get notified when buttons are clicked?

Postby mederi » 19 Feb 2012 12:33

But you can attach to events and variable callbacks.
Please, Jean-Baptiste, could you reveal the secret of this? Just some brief example, please.
How great things could be done by users if there was any better documentation. But now only skilled programmers are able to find out how things work, what parameters to use... I am also trying to share my findings but it is not enough.

mineirtoikd
New Cone
New Cone
Posts: 2
Joined: 01 Mar 2012 19:45

Re: How to get notified when buttons are clicked?

Postby mineirtoikd » 01 Mar 2012 22:23

Hi
I have been searching a solution how to count pause, and I've just found this for playing status change callback

Code: Select all

function descriptor() return { ... capabilities = { "input-listener", "meta-listener", "playing-listener" } } end function playing_changed(stat) vlc.osd.message("Status:" .. tostring(stat)) end
I think it is good for watch when the movie is paused.


Sorry for bad English


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 7 guests