Инструменты пользователя

  • Зашли как Anonymous (Anonymous)
  • Выйти

Инструменты сайта


mantis:simpletv:api:osd

OSD

ShowMessageT(param)

param - table
param.text - utf8 string
param.id - string (by default «luaOsdMessage»)
param.color - color in ARGB (optional)
param.showTime - add time (by default 0)
param.append - boolean (by default false)

ShowSelect(Head,DefaultID,Content,TimeOut,Flags,LuaScript)

Creates a select menu on the OSD.

Parameters
Head      - menu title (type: string (ANSI))
DefaultID - ID of the item selected by default (type: number)
Content   - menu items (type: table)
            Content[ID] = {}
            Content[ID].Id   - ID of item (type: number)
            Content[ID].Name - Name of item (type: string (ANSI))
            Content[ID].Address - Address of item (type: string (ANSI))
            Content[ID].InfoPanelLogo - Address of pictures used as Logo of item in InfoPanel(optional field, type: string (ANSI)
            Content[ID].InfoPanelDesk - Description of item in InfoPanel (optional field, type: string (ANSI))
TimeOut   - Time after which the menu will be closed if user inactive. (type: number, 0 - disable autoclose)
Flags     - Settings of SelectMenu (type: number). 
              The sum of the flags: 
               MODAL_MODE=1 - modal mode of MenuSelect
               STOP_LOAD_ANIMATION=2 - hide wait cursor
               NO_GLOBAL_ADDRESS_INFO=4
               ALLOW_OK_ON_CURRENT_ITEM=8 - allows to click 'OK' on default Item
               ALWAYS_OK=16 - Pressed 'ok' if pressed ESC or timeout
               NOT_SHOW=32  - Not show select window  (only when MODAL_MODE==0 and NO_GLOBAL_ADDRESS_INFO==0)
               NOT_CHANGE_MAIN_TITLE=64 - Not show row name in main title(control panel and etc)
               IS_ONE_ITEM=128 - no auto next play (All items is one stream(maybe different resolution etc) 
               IS_NOT_VISIBLE=256 (only when MODAL_MODE==0 and NO_GLOBAL_ADDRESS_INFO==1)                 
               NOT_CLOSE_ON_CHOISE=512 (only when MODAL_MODE==0)
               
LuaScript - name of file LuaScript (type: string (ANSI))
Return Value
select_error - returns the result of a user action (type: number): nil - error, 0 - Escape (Pressed 'ESC' or timer), 1 - pressed 'OK'
ID           - ID of selected item
Sample
local t= {}
local i = 1
t[i] = {}
t[i].Id = i
t[i].Name = 'Film'
t[i].Address = 'http://test.net/film.avi'


--ALL OTHER ARE OPTIONAL
t[i].Checked = boolean 

--info panel support 
t[i].InfoPanelName  - string
t[i].InfoPanelTitle - string
t[i].InfoPanelDesc  - string
t[i].InfoPanelShowTime - number
t.ExtParams = {}
t.ExtParams.FilterType - SMART_FILTER  = 0  (shown if number of items > 15)
                         ALWAYS_FILTER = 1
                         NO_FILTER     = 2
  
t.ExtParams.Random - -1 - use global settings
                      0 - off
                      1 - on
t.ExtParams.PlayMode - - 1 - use global settings
                         PLAYMODE_NEXT        = 0 - play and stop
                         PLAYMODE_REPEATE     = 1 - play and repeat all list
                         PLAYMODE_REPEATE_ONE = 2 - play and repeat one item
                         PLAYMODE_ONCE        = 3 - play one item and stop 
  t.ExtParams.StopAfterPlay - -1 - use global settings
                               0 - off
                               1 - on
  t.ExtParams.StopOnError  -  -1 - use global settings
                               0 - off
                               1 - on
 t.ExtParams.sortOrder  - (0,1,2) (NO/DESC/ASC)
 t.ExtParams.AutoNumberFormat    - string (for example "%1 - %2")
  
 t.ExtParams.LuaOnOkFunName      - string
 t.ExtParams.LuaOnCancelFunName  - string
 t.ExtParams.LuaOnTimeoutFunName - string
 t.ExtParams.ExtButton0 ={}
 t.ExtParams.ExtButton0.ButtonEnable  - boolean
 t.ExtParams.ExtButton0.ButtonName    - string
 t.ExtParams.ExtButton0.ButtonScript  - string
 t.ExtParams.ExtButton0.ButtonImage   - string
 t.ExtParams.ExtButton0.ButtonImageCx - number
 t.ExtParams.ExtButton0.ButtonImageCy - number
 t.ExtParams.ExtButton1 ={}
 t.ExtParams.ExtButton1.ButtonEnable  - boolean 
 t.ExtParams.ExtButton1.ButtonName    - string
 t.ExtParams.ExtButton1.ButtonScript  - string
 t.ExtParams.ExtButton1.ButtonImage   - string
 t.ExtParams.ExtButton1.ButtonImageCx - number 
 t.ExtParams.ExtButton1.ButtonImageCy - number
 t.ExtParams.OkButton = {}
 t.ExtParams.OkButton.ButtonName      - string 
 t.ExtParams.OkButton.ButtonImage     - string
 t.ExtParams.OkButton.ButtonImageCx   - number
 t.ExtParams.OkButton.ButtonImageCy   - number
 
 
 local select_error,ID = m_simpleTV.OSD.ShowSelect('My best film collection',1,t,5000,2+4+8)
Additional button

ShowSelect_UTF8(Head,DefaultID,Content,TimeOut,Flags,LuaScript)

utf8 version of ShowSelect

id = AddEventListener(t)

example
function testcallback(typeEvent)
end
t ={}
t.type = 1 --
t.callback = 'testcallback'
id = m_simpleTV.OSD.AddEventListener(t)

type - битовая маска
1 - OSD_STATE_CHANGED (создание, normal/fullscreen mode, изменение шрифта и тп)

RemoveEventListener(id)

AddElement(table,parentID)

RemoveElement(elementId)

ControlElement(elementId,params...)

SetElementDebugMode(boolean)

PlayInSinglePiP(channelId)

ShowMessageBox(table)

Parameters
 local t ={}
 t.message   - string  (empty string mean close current messageBox)
 --All other field are optional
 t.header    - string 
 t.extMessage - string
 t.textColor  - ARGB  
 t.linkColor  - ARGB  
 t.richTextMode - boolean
 t.addFontHeight  - number
 t.addHeaderFontHeight  - number
 t.showTime  - number
 t.once      - boolean (auto close if current play stopped or changed)
 t.textAlignment  - Qt::Alignment
 t.windowAlignment  - number
 t.windowMaxSizeH   - number 
 t.windowMaxSizeV   - number

deprecated from 0.5

  • ShowMessage(Message string,COLORREF_color number,add_time number,append number)
  • ShowMessage_UTF8(Message string_utf8,COLORREF_color number,add_time number,append number)
mantis/simpletv/api/osd.txt · Последние изменения: 2020/08/23 17:24 — SergeyVS