Commit Graph

40 Commits

Author SHA1 Message Date
Ricardo Constantino dfd8a5ff06 TOOLS/lua/autoload: don't run if playlist is loaded 2015-08-10 00:07:31 +02:00
Ricardo Constantino 91b9dcf800 TOOLS/lua: Add zones.lua
Lua script that enables handling of certain commands depending on where
the mouse pointer is. Mostly useful for mouse-wheel handling via
input.conf.

Example:

MOUSE_BTN3 script-message-to zones commands "*-left: add volume +5"
"default: seek +10"
MOUSE_BTN4 script-message-to zones commands "*-left: add volume -5"
"default: seek -10"

Will changes behavior of Mouse Wheel Up/Down to alter volume if mouse is
in the left zone of the window, but re-adds the default to seek if wheel
is used on other parts.
2015-08-09 23:52:13 +02:00
wm4 c6b5645991 TOOLS: remove youtube-starttime.lua
Obsolete due to native youtube-dl start time support.
2015-07-29 13:23:12 +02:00
Kevin Mitchell ebdbb4f24c TOOLS: make autodeint detect telecine in parallel
This avoids having to rewind the video for a second telecine detection pass.
2015-07-16 16:14:58 -07:00
wm4 446a10020f TOOLS/lua/status-bar: update use of a deprecated property
Also mention that this code does not reflect the status line of current
mpv.
2015-05-25 22:01:34 +02:00
Michael Vetter 9251fa125f Remove trailing whitespaces 2015-05-15 11:02:44 +02:00
Marcin Kurczewski eb62d7ec40 TOOLS/autoload: load only files that make sense 2015-04-21 20:24:00 +02:00
Marcin Kurczewski eabd2ac9e4 TOOLS/autoload: add blank lines for readability 2015-04-21 20:23:55 +02:00
wm4 f51952441e TOOLS: autoload.lua: sort files case insensitive
Suggested by a user. The suggested code which was added her comes from
PIL.
2015-04-18 20:33:35 +02:00
Patrick Hipp dd08aa7364 TOOLS: add a lua scripts for extracting and setting starttime with ytdl
Signed-off-by: wm4 <wm4@nowhere>
2015-03-23 20:46:22 +01:00
Patrick Hipp c48de9e399 TOOLS: add a lua script for a -stay on top only during playback- mode
Signed-off-by: wm4 <wm4@nowhere>
2015-03-23 20:45:12 +01:00
James Ross-Gowan a26ea50694 w32_common: support the "window-minimized" property 2015-03-09 11:46:06 +01:00
Jaime Marquínez Ferrándiz d7f04e2085 cocoa: support the "window-minimized" property
Signed-off-by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
2015-03-08 22:00:47 +01:00
Stefano Pigozzi 70802d519f ao_coreaudio: add support for hotplug notifications
This commit adds notifications for hot plugging of devices. It also extends
the old behaviour of the `audio-out-detected-device` property which is now
backed by the hotplugging code. This allows clients to be notified when the
actual audio output device changes.

Maybe hotplugging should be supported for ao_coreaudio_exclusive too, but it's
device selection code is a bit fragile.
2015-02-14 12:51:15 +01:00
wm4 f061befb33 audio: add device change notification for hotplugging
Not very important for the command line player; but GUI applications
will want to know about this.

This only adds the internal API; support for specific audio outputs
comes later.

This reuses the ao struct as context for the hotplug event listener,
similar to how the "old" device listing API did. This is probably a bit
unclean and confusing. One argument got reusing it is that otherwise
rewriting parts of ao_pulse would be required (because the PulseAudio
API requires so damn much boilerplate). Another is that --ao-defaults is
applied to the hotplug dummy ao struct, which automatically applies such
defaults even to the hotplug context.

Notification works through the property observation mechanism in the
client API. The notification chain is a bit complicated: the AO notifies
the player, which in turn notifies the clients, which in turn will
actually retrieve the device list. (It still has the advantage that it's
slightly cleaner, since the AO stuff doesn't need to know about client
API issues.)

The weird handling of atomic flags in ao.c is because we still don't
require real atomics from the compiler. Otherwise we'd just use atomic
bitwise operations.
2015-02-12 17:17:41 +01:00
wm4 411109f484 TOOLS/lua/observe-all: add a warning
This is just natural, but it's also not that obvious.
2015-01-03 14:49:48 +01:00
wm4 44c0770247 TOOLS/lua/autoload: fix behavior with network URLs
readdir() fails if the directory is an URL, so just exit instead of
letting the Lua script fail.
2015-01-03 14:48:33 +01:00
Avi Halachmi (:avih) 39e04e9294 options: deprecate 'lua' based options/dirs for 'script'
- --lua and --lua-opts change to --script and --script-opts
- 'lua' default script dirs change to 'scripts'
- DOCS updated

- 'lua-settings' dir was _not_ modified

The old lua-based names/dirs still work, but display a warning.

Signed-off-by: wm4 <wm4@nowhere>
2014-12-15 04:39:56 +01:00
wm4 3295caca3d lua: add a function that formats Lua values as strings
Yep, Lua is so crappy that the stdlib doesn't provide anything like
this.

Repurposes the undocumented mp.format_table() function and moves it to
mp.utils.
2014-11-29 00:03:46 +01:00
wm4 9666d48aa3 TOOLS/lua: add script that pauses playback when minimizing the window
Uses functionality that was added a month ago for exactly this purpose.

Fixes #1237.
2014-11-29 00:03:46 +01:00
wm4 078f5f300d TOOLS/lua/autoload: fix operation outside of working dir
Fixes #1222. (This commit is based on a patch posted there.)
2014-10-26 14:34:46 +01:00
wm4 dd91c09a71 TOOLS/lua/autoload: don't shadow local variable
"dir" is already used somewhere above. This was ok, but not nice.
2014-10-26 14:34:37 +01:00
Kevin Mitchell bbf4a8aa5d TOOLS/lua: update README.md 2014-10-21 00:55:15 +02:00
Kevin Mitchell 3617399a46 TOOLS/lua: remove tabs from some lua scripts 2014-10-21 00:55:15 +02:00
Kevin Mitchell e68cc34c99 TOOLS/lua: add autodeint.lua
This isn't quite as robust as idet.sh as the default detection
interval is only 4 seconds vs 35 for idet.sh. idet.sh can have such a
large sample time since it turns off the vo and uses --untimed, which
is currently not possible from lua.
2014-10-21 00:55:15 +02:00
wm4 f9d2ad6c17 Move status-line.lua
Looks like TOOLS/lua/ is now established as dumping ground for random
Lua scripts, so DOCS/lua_examples/ is not needed anymore.
2014-08-11 17:08:32 +02:00
wm4 82a223e4e0 TOOLS: add test script for property change notifications 2014-08-02 01:53:21 +02:00
wm4 6f20d6b74e lua: fix compilation with lua 5.2
Commit e2e450f9 started making use of luaL_register(), but OF COURSE
this function disappeared in Lua 5.2, and was replaced with a 5.2-only
alternative, slightly different mechanism.

So just NIH our own function. This is actually slightly more correct,
since it forces the user to call "require" to actually make the module
visible for builtin C-only modules other than "mp". Fix autoload.lua
accordingly.
2014-05-26 21:59:29 +02:00
wm4 0e1ab2a8da autoload.lua: fix autoloading of files to prepend
This used the wrong index variable, and thus didn't work.
2014-05-25 20:17:03 +02:00
wm4 fea1bad856 TOOLS: add a Lua script to autoload playlist entries
This will load other files in the same directory when a single file is
played. It's an often requested feature, but we definitely don't want it
in the core.
2014-05-25 19:52:26 +02:00
Kevin Mitchell 0467e13725 TOOLS/lua: add cycle-deinterlace-pullup script
Override the shift+d hotkey to add a pullup step to the cycle.
2014-05-06 10:02:41 -07:00
Kevin Mitchell 6e62779e98 TOOLS/lua: conform to whitespace coding-style 2014-05-06 09:59:59 -07:00
Kevin Mitchell 20b5fecdf1 TOOLS/lua: use double quotes unless there's a good reason 2014-05-04 12:59:21 -07:00
Kevin Mitchell c91373a202 TOOLS/lua/autocrop: handle case of user hitting hotkey while cropdetection already running 2014-05-04 12:54:03 -07:00
Kevin Mitchell 74984aaff1 TOOLS/lua: no longer gsub out "lua/" prefix, now that its no longer there 2014-05-04 12:29:32 -07:00
Kevin Mitchell 8e8758dbe1 TOOLS: better documentation of lua scripts 2014-04-29 08:31:44 -07:00
Kevin Mitchell 4b0a760d86 TOOLS: improve autocrop.lua
It now inserts no filters and does nothing until the hot-key is pressed.
This makes it more suitable to be put in ~/.mpv/lua.

When the hot-key is pressed, it now inserts the cropdetect filter and
waits 1 second (or a --lua-opts specified duration) before gathering
the cropdetect metadata and inserting the appropriate crop filter. A
second press of the hotkey removes the crop.
2014-04-29 08:31:44 -07:00
Kevin Mitchell 4e973c059a TOOLS: indent lua scripts by 4 spaces instead of 3 2014-04-27 15:34:53 +02:00
Kevin Mitchell 7ef045555d TOOLS: add lua/drc-control
allows live insertion/deletion/adjustment of drc audio filter
2014-04-27 15:34:53 +02:00
Kevin Mitchell ae56b8d237 TOOLS: move autocrop.lua to TOOLS/lua
in anticipation of more lua scripts
2014-04-27 15:34:52 +02:00