
---------------------------------------------------------------------------
m_simpleTV.Interface.AddExtMenu = function (name,luastr,letter,mod_keys,location,code_page,submenu,image) 
local t={} 
t.utf8 = false 
t.codepage = code_page 
t.name = name 
t.luastring = luastr 
t.key = letter 
t.ctrlkey = mod_keys 
t.location = location 
t.submenu = submenu 
t.image = image 
return m_simpleTV.Interface.AddExtMenuT(t) 
end 
---------------------------------------------------------------------------
m_simpleTV.Interface.AddExtMenu_UTF8 = function (name,luastr,letter,mod_keys,location,code_page,submenu,image) 
local t={} 
t.name = name 
t.luastring = luastr 
t.key = letter 
t.ctrlkey = mod_keys 
t.location = location 
t.submenu = submenu 
t.image = image 
return m_simpleTV.Interface.AddExtMenuT(t) 
end
---------------------------------------------------------------------------
m_simpleTV.Interface.MessageBox = function(Message,Caption,Type)
if not Message then return 0 end
local params = {}
params.message = Message
params.caption = Caption
params.buttons = 'Ok'
params.icon = 'Information'
params.defButton = 'NoButton'

local buttons = math.fmod(Type,16)          --switch(lua_tointeger(L, CMyLua::ARG_3) & 0xF)
local icon = math.fmod(Type,256) - buttons  --switch(lua_tointeger(L, CMyLua::ARG_3) & 0xF0)

if icon == 0x10 then    
   params.icon  = 'Critical'
elseif icon == 0x20 then
   params.icon = 'Question'
elseif icon == 0x30 then
   params.icon = 'Warning'
end

if buttons == 2 then
    params.buttons = 'Abort|Retry|Ignore'
elseif buttons == 6 then
    params.buttons = 'Cancel|Retry|Ignore'
elseif buttons == 1 then
    params.buttons = 'Ok|Cancel'
elseif buttons == 5 then
    params.buttons = 'Retry|Cancel'
elseif buttons == 4 then
    params.buttons = 'Yes|No'
elseif buttons == 3 then
    params.buttons = 'Yes|No|Cancel'
end

local ret = m_simpleTV.Interface.MessageBoxT(params)

if ret == 'Ok' then return 1 end
if ret == 'Cancel' then return 2 end
if ret == 'Apply' then return 1 end
if ret == 'Yes' then return 6 end
if ret == 'No' then return 7 end
if ret == 'Abort' then return 3 end
if ret == 'Retry' then return 4 end
if ret == 'Ignore' then return 5 end

return 0
end
---------------------------------------------------------------------------
m_simpleTV.Interface.PlaylistGetSelectedItems = m_simpleTV.PlayList.PlaylistGetSelectedItems
m_simpleTV.Interface.PlaylistIsVisible = m_simpleTV.PlayList.PlaylistIsVisible
m_simpleTV.Interface.PlaylistShow = m_simpleTV.PlayList.PlaylistShow

m_simpleTV.Interface.SetElementDebugMode = m_simpleTV.OSD.SetElementDebugMode
m_simpleTV.Interface.AddElementToMainFrame = m_simpleTV.OSD.AddElement
m_simpleTV.Interface.RemoveElementFromMainFrame = m_simpleTV.OSD.RemoveElement
m_simpleTV.Interface.ControlElement = m_simpleTV.OSD.ControlElement
m_simpleTV.Interface.FolderPicker_UTF8 = m_simpleTV.Interface.FolderPicker