Class: KodiClient::Methods::Application

Inherits:
KodiMethod
  • Object
show all
Defined in:
lib/kodi_client/methods/application.rb

Overview

contains all Kodi Application methods

Constant Summary collapse

QUIT =
'Application.Quit'
SET_MUTE =
'Application.SetMute'
SET_VOLUME =
'Application.SetVolume'
GET_PROPERTIES =
'Application.GetProperties'

Instance Method Summary collapse

Methods inherited from KodiMethod

#apply_options, #invoke_api

Instance Method Details

#decrement_volume(kodi_id = 1) ⇒ Object



41
42
43
# File 'lib/kodi_client/methods/application.rb', line 41

def decrement_volume(kodi_id = 1)
  set_volume_incr_decr_vol(Types::Global::IncrementDecrement::INCREMENT, kodi_id)
end

#get_properties(properties = Types::Application::PropertyName.all_properties, kodi_id = 1) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/kodi_client/methods/application.rb', line 25

def get_properties(properties = Types::Application::PropertyName.all_properties, kodi_id = 1)
  request = KodiRequest.new(kodi_id, GET_PROPERTIES, { 'properties' => properties })
  json = invoke_api(request)
  result = Types::Application::PropertyValue.create(json['result'])
  json['result'] = result
  KodiResponse.new(json)
end

#increment_volume(kodi_id = 1) ⇒ Object



37
38
39
# File 'lib/kodi_client/methods/application.rb', line 37

def increment_volume(kodi_id = 1)
  set_volume_incr_decr_vol(Types::Global::IncrementDecrement::INCREMENT, kodi_id)
end

#mute(kodi_id = 1, mute_state: Types::Global::Toggle::TOGGLE) ⇒ Object



19
20
21
22
23
# File 'lib/kodi_client/methods/application.rb', line 19

def mute(kodi_id = 1, mute_state: Types::Global::Toggle::TOGGLE)
  request = KodiRequest.new(kodi_id, SET_MUTE, { 'mute' => mute_state })
  json = invoke_api(request)
  KodiResponse.new(json)
end

#quit(kodi_id = 1) ⇒ Object



13
14
15
16
17
# File 'lib/kodi_client/methods/application.rb', line 13

def quit(kodi_id = 1)
  request = KodiRequest.new(kodi_id, QUIT)
  json = invoke_api(request)
  KodiResponse.new(json)
end

#set_volume(volume, kodi_id = 1) ⇒ Object



33
34
35
# File 'lib/kodi_client/methods/application.rb', line 33

def set_volume(volume, kodi_id = 1)
  set_volume_incr_decr_vol(volume, kodi_id)
end