Sound |
options.ycp |
Module for setting options passed to the module
String corrections by Christian Steinruecken |
|
|
|
This module has an unstable interface. |
parameters: 1st: parameter list
Imports
Includes
Local Functions
|
local
check_value (string value, string type, list<string> poss)
->
string
checks whether param #1 is if type of param #2
- Parameters:
-
value value type expected type. one of {int, string} poss if poss is nonempty, checks if value is one of them returns error message, empty string if ok
- Return value:
-
error message
local
create_table (list lm, list lk)
->
list<term>
creates itemized table entries,
- Parameters:
-
lm list of maps to take keys from lk list of keys to look for in 1st param
- Return value:
-
of items
local
parse_bracket (string input)
->
list
parses string (eg. '{{0,2},{0,100,20}}') to a list (in this case [0,1,2,0,20,40,60,80,100])
- Parameters:
-
input input string
- Return value:
-
of possible values
local
string2vallist (string input)
->
list<string>
gets an 'modules.generic_string' like options description string and returns a list of possible values
- Parameters:
-
input string
- Return value:
-
of values
local
defWidget ()
->
term
default widget when there are no known values
- Return value:
-
widget
local
gen_list (list<string> vals, string preselected)
->
term
widget for choosing one value from list
- Parameters:
-
vals string with values eg. "12,3,4,6" preselected string default value (preselected in combo)
- Return value:
-
combobox widget
local
updatePossibleValues (string values, string default_item)
->
void
when the selected option in table is changed, we need to update combo with values
- Parameters:
-
values list of values default_item default item
local
getDescr (any arg)
->
string
Returns description of card module option
- Parameters:
-
arg type of arg can be string or list
- Return value:
-
description
local
OptionsCon (string cardlabel, list itemized_descriptions, string current_option_name, string current_option_value)
->
term
UI controls for options setting dialog
- Parameters:
-
cardlabel card model string itemized_descriptions option list (preformated using 'create_table' with tripples: description, name, value) current_option_name initially selected item name current_option_value value of current option
- Return value:
-
options dialog contents
local
OptionsDialog (string cardlabel, map opts)
->
map
displays dialog with card options
- Parameters:
-
cardlabel string label for the card opts list. list where each item is map with keys: name, value, type, default, description. values in map are strings
- Return value:
-
result
local
sound_options (map save_entry)
->
map
just calls options dialog
- Parameters:
-
save_entry map with card configuration
- Return value:
-
result