102 lines
2.5 KiB
Vala
102 lines
2.5 KiB
Vala
|
[CCode (cheader_filename = "mpv/client.h")]
|
||
|
namespace Mpv {
|
||
|
|
||
|
[CCode (cname = "mpv_error_string")]
|
||
|
public unowned string error_string (int error);
|
||
|
|
||
|
public delegate void WakeupCallback ();
|
||
|
|
||
|
[CCode (cname = "mpv_handle", free_function = "mpv_destroy")]
|
||
|
[Compact]
|
||
|
public class Handle {
|
||
|
[CCode (cname = "mpv_create")]
|
||
|
public Handle ();
|
||
|
|
||
|
[CCode (cname = "mpv_initialize")]
|
||
|
public int initialize ();
|
||
|
|
||
|
[CCode (cname = "mpv_wait_event")]
|
||
|
public unowned Event *wait_event (double timeout);
|
||
|
|
||
|
public WakeupCallback wakeup_callback {
|
||
|
[CCode (cname = "mpv_set_wakeup_callback")] set;
|
||
|
}
|
||
|
|
||
|
[CCode (cname = "mpv_set_property_string")]
|
||
|
public int set_property_string (string name, string data);
|
||
|
|
||
|
[CCode (cname = "mpv_set_property_async")]
|
||
|
public int set_property_async (uint64 reply_userdata, string name, Format format, void *data);
|
||
|
|
||
|
[CCode (cname = "mpv_command_async")]
|
||
|
public int command_async (
|
||
|
uint64 reply_userdata,
|
||
|
[CCode (array_length = false)]
|
||
|
string[] args);
|
||
|
|
||
|
[CCode (cname = "mpv_observe_property")]
|
||
|
public int observe_property (uint64 reply_userdata, string name, Format format);
|
||
|
}
|
||
|
|
||
|
[CCode (cname = "mpv_format", cprefix = "MPV_FORMAT_", has_type_id = false)]
|
||
|
public enum Format {
|
||
|
NONE,
|
||
|
STRING,
|
||
|
OSD_STRING,
|
||
|
FLAG,
|
||
|
INT64,
|
||
|
DOUBLE,
|
||
|
NODE,
|
||
|
NODE_ARRAY,
|
||
|
NODE_MAP,
|
||
|
BYTE_ARRAY,
|
||
|
}
|
||
|
|
||
|
[CCode (cname = "mpv_event_id", cprefix = "MPV_EVENT_", has_type_id = false)]
|
||
|
public enum EventId {
|
||
|
NONE,
|
||
|
SHUTDOWN,
|
||
|
LOG_MESSAGE,
|
||
|
GET_PROPERTY_REPLY,
|
||
|
SET_PROPERTY_REPLY,
|
||
|
COMMAND_REPLY,
|
||
|
START_FILE,
|
||
|
END_FILE,
|
||
|
FILE_LOADED,
|
||
|
CLIENT_MESSAGE,
|
||
|
VIDEO_RECONFIG,
|
||
|
AUDIO_RECONFIG,
|
||
|
SEEK,
|
||
|
PLAYBACK_RESTART,
|
||
|
PROPERTY_CHANGE,
|
||
|
QUEUE_OVERFLOW,
|
||
|
HOOK,
|
||
|
|
||
|
// deprecated
|
||
|
IDLE,
|
||
|
TICK,
|
||
|
}
|
||
|
|
||
|
[CCode (cname = "mpv_event")]
|
||
|
public struct Event {
|
||
|
EventId event_id;
|
||
|
int error;
|
||
|
uint64 reply_userdata;
|
||
|
void *data;
|
||
|
}
|
||
|
|
||
|
[CCode (cname = "mpv_event_start_file")]
|
||
|
public struct EventStartFile {
|
||
|
int64 playlist_entry_id;
|
||
|
}
|
||
|
|
||
|
[CCode (cname = "mpv_event_property")]
|
||
|
public struct EventProperty {
|
||
|
string name;
|
||
|
Format format;
|
||
|
void *data;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|