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

From Miranda NG
Jump to navigation Jump to search
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 2: Line 2:
Pozwala na pracę z dźwiękami.
Pozwala na pracę z dźwiękami.


Include module: <code>local sounds = require('m_sounds')</code>
{{Ls|MirLua/Modules/include_info}}: <code>local sounds = require('m_sounds')</code>
 
{{Note|Parameters written in '''''bold italics''''' are obligatory.}}
 


__TOC__
__TOC__
 
== Functions ==
=== AddSound ===
=== AddSound ===
Registers a sound.
Registers a sound.


; {{Ls|MirLua/Modules/parameters}}
==== {{Ls|MirLua/Modules/parameters}} ====
: '''''name'''''
; {{nbsp|5}}''name'' {{Nobold|({{Ls|MirLua/Modules/obligatory_param}})}}
:: Type: '''string'''
:: {{Ls|MirLua/Modules/type}}: '''string'''
:: Unique name.
:: Unique name.
: '''''description'''''
 
:: Type: '''string'''
; {{nbsp|5}}''description'' {{Nobold|({{Ls|MirLua/Modules/obligatory_param}})}}
:: {{Ls|MirLua/Modules/type}}: '''string'''
:: Description.
:: Description.
: ''section''
 
:: Type: '''string'''
; {{nbsp|5}}''section''
:: {{Ls|MirLua/Modules/type}}: '''string'''
:: Section name in Miranda sound settings. By default plugin name (''MirLua'') is used.
:: Section name in Miranda sound settings. By default plugin name (''MirLua'') is used.
: ''path''
 
:: Type: '''string'''
; {{nbsp|5}}''path''
:: {{Ls|MirLua/Modules/type}}: '''string'''
:: Path to sound file.
:: Path to sound file.


; Result
==== {{Ls|MirLua/Modules/result}} ====
: 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'''.


; Example
==== {{Ls|MirLua/Modules/example}} ====
{{Content:MirLua/Example|code=local hIcon = sounds.AddSound('soundUniqueName', 'My super icon')}}
{{Content:MirLua/Example|code=local hIcon = sounds.AddSound('soundUniqueName', 'My super icon')}}


Line 36: Line 37:
Plays sound by its unique name.
Plays sound by its unique name.


; Parameters
==== {{Ls|MirLua/Modules/parameters}} ====
: '''''name'''''
; {{nbsp|5}}''name'' {{Nobold|({{Ls|MirLua/Modules/obligatory_param}})}}
:: Type: '''string'''
:: {{Ls|MirLua/Modules/type}}: '''string'''
:: Unique name.
:: Unique name.


; Result
==== {{Ls|MirLua/Modules/result}} ====
: 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'''.


; Example
==== {{Ls|MirLua/Modules/example}} ====
{{Content:MirLua/Example|code=sounds.PlaySound('soundUniqueName')}}
{{Content:MirLua/Example|code=sounds.PlaySound('soundUniqueName')}}


Line 51: Line 53:
Plays sound from file.
Plays sound from file.


; Parameters
==== {{Ls|MirLua/Modules/parameters}} ====
: '''''path'''''
; {{nbsp|5}}''path'' {{Nobold|({{Ls|MirLua/Modules/obligatory_param}})}}
:: Type: '''string'''
:: {{Ls|MirLua/Modules/type}}: '''string'''
:: Path to file.
:: Path to file.


; Result
==== {{Ls|MirLua/Modules/result}} ====
: 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'''.


; 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 18:28, 15 April 2018

Other languages:

Pozwala na pracę z dźwiękami.

Dołącz moduł:: local sounds = require('m_sounds')

Functions

AddSound

Registers a sound.

Parametry

     name (Translations:L10n:MirLua/Modules/obligatory param/en)
Typ:: string
Unique name.
     description (Translations:L10n:MirLua/Modules/obligatory param/en)
Typ:: string
Description.
     section
Typ:: string
Section name in Miranda sound settings. By default plugin name (MirLua) is used.
     path
Typ:: string
Path to sound file.

Rezultat

     Typ:: boolean

     Returns true if sound was registered successfully, otherwise false.

Przykład

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

PlaySound

Plays sound by its unique name.

Parametry

     name (Translations:L10n:MirLua/Modules/obligatory param/en)
Typ:: string
Unique name.

Rezultat

     Typ:: boolean

     Returns true if sound was played successfully, otherwise false.

Przykład

sounds.PlaySound('soundUniqueName')

PlayFile

Plays sound from file.

Parametry

     path (Translations:L10n:MirLua/Modules/obligatory param/en)
Typ:: string
Path to file.

Rezultat

     Typ:: boolean

     Returns true if sound was played successfully, otherwise false.

Przykład

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