Plugin:MirLua/Module/m sounds: Difference between revisions

From Miranda NG
Jump to navigation Jump to search
(wrap language keywords with code tags)
(correct target of localized string after change (to be 'required_param' now))
Line 15: Line 15:


==== {{Ls|MirLua/Modules/parameters}} ====
==== {{Ls|MirLua/Modules/parameters}} ====
; {{nbsp|5}}''name'' {{Nobold|({{Ls|MirLua/Modules/obligatory_param}})}}
; {{nbsp|5}}''name'' {{Nobold|({{Ls|MirLua/Modules/required_param}})}}
:: {{Ls|MirLua/Modules/type}}: <code>string</code>
:: {{Ls|MirLua/Modules/type}}: <code>string</code>
:: <translate><!--T:4--> Unique name.</translate>
:: <translate><!--T:4--> Unique name.</translate>


; {{nbsp|5}}''description'' {{Nobold|({{Ls|MirLua/Modules/obligatory_param}})}}
; {{nbsp|5}}''description'' {{Nobold|({{Ls|MirLua/Modules/required_param}})}}
:: {{Ls|MirLua/Modules/type}}: <code>string</code>
:: {{Ls|MirLua/Modules/type}}: <code>string</code>
:: <translate><!--T:5--> Description.</translate>
:: <translate><!--T:5--> Description.</translate>
Line 44: Line 44:


==== {{Ls|MirLua/Modules/parameters}} ====
==== {{Ls|MirLua/Modules/parameters}} ====
; {{nbsp|5}}''name'' {{Nobold|({{Ls|MirLua/Modules/obligatory_param}})}}
; {{nbsp|5}}''name'' {{Nobold|({{Ls|MirLua/Modules/required_param}})}}
:: {{Ls|MirLua/Modules/type}}: <code>string</code>
:: {{Ls|MirLua/Modules/type}}: <code>string</code>
:: <translate><!--T:10--> Unique name.</translate>
:: <translate><!--T:10--> Unique name.</translate>
Line 61: Line 61:


==== {{Ls|MirLua/Modules/parameters}} ====
==== {{Ls|MirLua/Modules/parameters}} ====
; {{nbsp|5}}''path'' {{Nobold|({{Ls|MirLua/Modules/obligatory_param}})}}
; {{nbsp|5}}''path'' {{Nobold|({{Ls|MirLua/Modules/required_param}})}}
:: {{Ls|MirLua/Modules/type}}: <code>string</code>
:: {{Ls|MirLua/Modules/type}}: <code>string</code>
:: <translate><!--T:13--> Path to file.</translate>
:: <translate><!--T:13--> Path to file.</translate>

Revision as of 19:16, 17 April 2018

Other languages:

Allows you to work with sounds.

Include module:: local sounds = require('m_sounds')

Functions

AddSound

Registers a sound.

Parameters

     name (Required)
Type:: string
Unique name.
     description (Required)
Type:: string
Description.
     section
Type:: string
Section name in Miranda sound settings. By default plugin name (MirLua) is used.
     path
Type:: string
Path to sound file.

Result

     Type:: boolean

     Returns true if sound was registered successfully, otherwise false.

Example

local hIcon = sounds.AddSound('soundUniqueName', 'My super icon')

PlaySound

Plays sound by its unique name.

Parameters

     name (Required)
Type:: string
Unique name.

Result

     Type:: boolean

     Returns true if sound was played successfully, otherwise false.

Example

sounds.PlaySound('soundUniqueName')

PlayFile

Plays sound from file.

Parameters

     path (Required)
Type:: string
Path to file.

Result

     Type:: boolean

     Returns true if sound was played successfully, otherwise false.

Example

sounds.PlayFile('c:\\lambada.wav')