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

From Miranda NG
Jump to navigation Jump to search
(remove unnecessary 'Note')
(do not abuse definition tags - indent using spaces)
Line 32: Line 32:


==== {{Ls|MirLua/Modules/result}} ====
==== {{Ls|MirLua/Modules/result}} ====
: {{Ls|MirLua/Modules/type}}: '''boolean'''
{{nbsp|5}}{{Ls|MirLua/Modules/type}}: '''boolean'''
: Returns '''true''' if sound was registered successfully, otherwise '''false'''.
 
{{nbsp|5}}Returns '''true''' if sound was registered successfully, otherwise '''false'''.


==== {{Ls|MirLua/Modules/example}} ====
==== {{Ls|MirLua/Modules/example}} ====
Line 47: Line 48:


==== {{Ls|MirLua/Modules/result}} ====
==== {{Ls|MirLua/Modules/result}} ====
: {{Ls|MirLua/Modules/type}}: '''boolean'''
{{nbsp|5}}{{Ls|MirLua/Modules/type}}: '''boolean'''
: Returns '''true''' if sound was played successfully, otherwise '''false'''.
 
{{nbsp|5}}Returns '''true''' if sound was played successfully, otherwise '''false'''.


==== {{Ls|MirLua/Modules/example}} ====
==== {{Ls|MirLua/Modules/example}} ====
Line 62: Line 64:


==== {{Ls|MirLua/Modules/result}} ====
==== {{Ls|MirLua/Modules/result}} ====
: {{Ls|MirLua/Modules/type}}: '''boolean'''
{{nbsp|5}}{{Ls|MirLua/Modules/type}}: '''boolean'''
: Returns '''true''' if sound was played successfully, otherwise '''false'''.
 
{{nbsp|5}}Returns '''true''' if sound was played successfully, otherwise '''false'''.


==== {{Ls|MirLua/Modules/example}} ====
==== {{Ls|MirLua/Modules/example}} ====
{{Content:MirLua/Example|code=sounds.PlayFile('c:\\lambada.wav')}}
{{Content:MirLua/Example|code=sounds.PlayFile('c:\\lambada.wav')}}

Revision as of 17:59, 15 April 2018

Other languages:

Allows you to work with sounds.

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

Functions

AddSound

Registers a sound.

Parameters

      name (Translations:L10n:MirLua/Modules/obligatory param/en)
Type:: string
Unique name.
      description (Translations:L10n:MirLua/Modules/obligatory param/en)
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 (Translations:L10n:MirLua/Modules/obligatory param/en)
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 (Translations:L10n:MirLua/Modules/obligatory param/en)
Type:: string
Path to file.

Result

     Type:: boolean

     Returns true if sound was played successfully, otherwise false.

Example

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