module MPV

See <libmpv/client.h>.

Constants

MPVEventID
MPVEventNames
VERSION

Public Class Methods

client_api_version() click to toggle source
# File lib/mpvlib/client_api_version.rb, line 5
def self.client_api_version
  MPV.mpv_client_api_version
end
client_api_version_elements() click to toggle source
# File lib/mpvlib/client_api_version.rb, line 13
def self.client_api_version_elements
  long = MPV.mpv_client_api_version
  [long >> 16, long & 0x00FF]
end
convert_data(data, format) click to toggle source
# File lib/mpvlib/data.rb, line 23
def self.convert_data(data, format)
  begin
    ptr = data.read_pointer
    case format
    when :MPV_FORMAT_NONE
      nil
    when :MPV_FORMAT_STRING, :MPV_FORMAT_OSD_STRING
      ptr.read_string
    else
      raise "Unknown format: #{format.inspect}"
    end
  rescue FFI::NullPointerError
    nil
  end
end
make_version(major, minor) click to toggle source
# File lib/mpvlib/client_api_version.rb, line 9
def self.make_version(major, minor)
  (major << 16) | minor
end