History

scripting (lua/js): utils.getpid: make wrapper of pid property

We now have at least 3 scripting APIs which are trivial wrappers around properties: mp.get_mouse_pos, utils.getcwd, utils.getpid. After some discussion on IRC it was decided that it's easier for us to maintain them as trivial wrappers than to deprecate them and inflict pain on users and script authors, so currently no plan to deprecate.

Avi Halachmi (:avih) committed 5 years ago

Commit 02fbdf81 parent f3b2ea94 files · +5 −16Browse files

Showing the changes to player/javascript (1 of 4 files). Show all

Unified · Split

player/javascript/defaults.js+1−0
@@ -663,6 +663,7 @@ mp.get_script_file = function() { return mp.script_file }; · 662 unmodified lines
663mp.get_script_directory = function() { return mp.script_path };663mp.get_script_directory = function() { return mp.script_path };
664mp.get_time = function() { return mp.get_time_ms() / 1000 };664mp.get_time = function() { return mp.get_time_ms() / 1000 };
665mp.utils.getcwd = function() { return mp.get_property("working-directory") };665mp.utils.getcwd = function() { return mp.get_property("working-directory") };
666mp.utils.getpid = function() { return mp.get_property_number("pid") }
666mp.get_mouse_pos = function() { return mp.get_property_native("mouse-pos") };667mp.get_mouse_pos = function() { return mp.get_property_native("mouse-pos") };
667mp.dispatch_event = dispatch_event;668mp.dispatch_event = dispatch_event;
668mp.process_timers = process_timers;669mp.process_timers = process_timers;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t