TV cards configuration |
modules/Tv.ycp |
Data for configuration of tv, input and output functions. |
|
|
Representation of the configuration of TV cards.
Input and output routines.
Imports
- Confirm
- Directory
- Label
- Message
- Mode
- ModulesComments
- Package
- Progress
- Report
- Require
- Service
- Sound
- Sound
- Summary
Includes
- sound/write_routines.ycp
- tv/misc.ycp
Global Variables
Global Functions
- CardAddCurrent ()
- CardGet (integer index)
- CardIndexUniqKey (string uniq)
- CardRemove (integer index)
- CardReplaceWithCurrent (integer index)
- CardsAsItems ()
- CardsDBVendorGetCards (map autodetected, integer sel_vendor)
- CardsDBVendorsAsItems (map autodetected, map parameters, string mod)
- CardsUniqueKeys ()
- Detect ()
- DetectedCardGet (integer index)
- DetectedCardsAsItems ()
- Export ()
- GetIRCModule ()
- GetKernelModuleInfo (string modname)
- GetTuner (string kernel_name, string tuner_id)
- GetTvCard (string card_model, string modname)
- Import (map settings)
- InitializeStationsConfig ()
- InstalledCardsSummary ()
- IsDirty ()
- LoadIRCModulesDescription ()
- ModuleParametersAsItems (map modules, string selected_module, map parameters)
- ModulesAsItems (map modules, string selected_module)
- Propose ()
- Read (block<boolean> abort)
- ReadCardsDatabase ()
- ReadIRC ()
- ReadKernelModules ()
- ReadSettings ()
- ReadStationsConfig (path pth)
- ReadTunersDatabase ()
- ReadUserSettings ()
- Summary ()
- TunersDBAsItems (string kernel_module, map selected_tuner)
- TunersDBHasTunersFor (string kernel_module)
- TunersDBSelectTuner (string kernel_module, integer number)
- Write (block<boolean> abort)
- WriteIRC ()
- WriteStationsConfig ()
- tv_tmp_start ()
Local Variables
Local Functions
|
|
|
List of all the configured cards.
It is read in ReadDialog()
- Example:
-
[ $[ "name" : string
"module" : string,
"parameters" : $[ string : string ],
"unique_key" : string,
"sound_card_no" : integer
],
...
] |
local cards_to_del -> list
|
|
List of cards which user chooses to delete.
local cards_dirty -> boolean
|
|
If the list of the cards changes, this is set to true and Write()
must be called.
global current_card -> map
|
|
The card which is currently being configured.
It will become an entry in the "cards" list.
global current_card_no -> integer
|
|
The number of card which is currently being configured.
It has its meaning only when editing the entry.
local detected_cards -> list
|
|
List of all the detected cards.
It is initialized in ReadDialog()
- Example:
-
[ $[ "name" : string,
"module" : string,
"unique_key" : string,
],
...
] |
global cards_database -> list
|
|
Database of the TV cards for the manual configuration.
It is a list of maps with vendors, and each of the vendor
contains a list of cards with the kernel module and
its parameters. It is read in ReadDialog()
- Example:
-
[ $[ "name" : "ATI",
"cards" :
[ $[ "name" : "ATI TV-Wonder VE",
"module" : "bttv",
"parameters" : $[ "card" : "64" ]
],
...
],
],
...
] |
local tuners_database -> map
|
|
Database of the tuners for the manual configuration.
It is a map, where the name of the kernel module is the key
and a list of maps with name and the module parameters is the value.
It is read in ReadDialog()
- Example:
-
$[ "kernel_module1" :
[ $[ "name" : "Alps HSBH1",
"parameters" : $[ "tuner" : "9" ]
],
...
],
...
] |
local tuners_by_id -> map
|
|
Tuner database organized in map of the form $[ tuner_id : tuner_map]
- Example:
-
$[ "bttv" :
$[ "9": $[ "name" : "Alps HSBH1",
"parameters" : $[ "tuner" : "9" ]]
]
] |
global kernel_modules -> map
|
|
Map of available TV kernel modules and their parameters.
global proposal_valid -> boolean
|
|
Becomes true, when the module is initialized for proposal.
global not_ask -> boolean
|
|
If YaST should check the presence of TV/radio application
yast temporary directory
global used_modprobe_conf -> boolean
|
|
This is true, if tv data were read from /etc/modprobe.conf
On write, they shoud be removed and written only to /etc/modprobe.d/tv
global stations_modified -> boolean
|
|
Were TV stations modified?
global channels_config -> map
|
|
Configuration of TV stations (contents of /etc/X11/xawtvrc file)
global irc_module -> string
|
|
kerenel module used for lirc
global irc_config -> string
|
|
configuration file for IR control
global use_irc -> boolean
|
|
Is IRC used?
global irc_modified -> boolean
|
|
Is IRC modified?
global irc_modules_list -> list
|
|
Kernel modules for LIRC
global irc_modules -> map
|
|
Map of lirc modules, together with their description (from modinfo)
Paths to config files of various remote controls
local cards_with_ir_kbd_gpio -> map
|
|
TV cards using irc_kbd_gpio module
(matching card numbers from tv_cards.ycp)
local card_ids_ir_kbd_gpio -> list
|
|
id's of TV cards, using irc_kbd_gpio module
gathered from lirc_gpio.c and bttv-cards.c
local InstallApplication (list apps, string text) -> void
|
|
Dialog which asks for installing proposed application
- Parameters:
apps |
list of applications to install |
text |
text to show in dialog |
global ReadUserSettings () -> boolean
|
|
Read the state of "not_ask" variable
(if the TV/radio application presence should be checked again next time)
- Return value:
global ReadCardsDatabase () -> boolean
|
|
Read the database of the TV cards.
- Return value:
global ReadTunersDatabase () -> boolean
|
|
Read the database of the tuners.
- Return value:
global GetKernelModuleInfo (string modname) -> map
|
|
Return description of one kernel module
- Parameters:
global ReadKernelModules () -> boolean
|
|
Get a list of the available v4l kernel modules
and store it to kernel_modules map.
- Return value:
local GetMajor81Aliases (path mod_path) -> list<string>
|
|
Returns a list of all char-major-81-* in modprobe config file
- Parameters:
mod_path |
path to agent (using modprobe.conf or modprobe.d/tv) |
- Return value:
|
List [ "char-major-81-0", "char-major-81-3" ] or so... |
local GetMajorInstalls (path mod_path) -> list<string>
|
|
Returns a list of all char-major-212-* in modprobe config file
- Parameters:
mod_path |
path to agent (using modprobe.conf or modprobe.d/tv) |
- Return value:
|
List [ "char-major-212-3" ] or so... |
local ReadModuleParameters (path mod_path, string module_name) -> map
|
|
Read parameters of one module.
- Parameters:
mod_path |
path to agent (using modprobe.conf or modprobe.d/tv) |
module_name |
Name of the module |
- Return value:
- Example:
-
$[ parameter_name: // parameter name
$[ 0: nil, // its value for 1st card
1: "3", // 2nd card
... |
local read_modprobe (path mod_path) -> list
|
|
Reads saved TV cards data from given file
- Parameters:
mod_path |
path to agent (using modprobe.conf or modprobe.d/tv) |
- Return value:
local InstallFW () -> boolean
|
|
Install firmware for all configured cards
- Return value:
global ReadSettings () -> boolean
|
|
Fill the map of all tv settings from the SCR.
- Return value:
|
Was the reading succesfull? |
local WriteModulesParameters (map modules_parameters) -> boolean
|
|
Writes parameters of the modules. As an input, it uses a map
with modules and all their parameters:
$[ "module" : // name of the module
[ no_last_param, // number of cards using this modules
$[ parameter_name: // parameter name
$[ 0: nil, // its value for 1st card
1: "3", // 2nd card
- Parameters:
modules_parameters |
Map with the modules and parameters |
- Return value:
|
Was the write successful? |
local WriteSettings () -> boolean
|
|
Write the TV settings to the SCR.
- Return value:
|
Was the reading successful? |
local WriteSoundVolume () -> boolean
|
|
Write the sound settings needed for TV to the SCR.
- Return value:
|
Was the reading succesfull? |
global Detect () -> boolean
|
|
Scan for the TV cards.
- Return value:
|
Return false if the module should be terminated. |
global InstalledCardsSummary () -> list
|
|
Returns a list with the overview of the installed cards.
It can be used in Summary::DevicesList().
- Return value:
|
Description of the installed cards |
global CardGet (integer index) -> any
|
|
Get indexth card.
- Parameters:
index |
Index of the card to get. |
- Return value:
|
The 'index'th card or nil |
global CardAddCurrent () -> integer
|
|
Add the current_card to the cards. Try to fill holes
after removes.
- Return value:
global CardReplaceWithCurrent (integer index) -> boolean
|
|
Replace indexth card with the current_card.
- Parameters:
index |
The index of the card to replace. |
- Return value:
|
Returns true if successfully replaced. |
global CardRemove (integer index) -> boolean
|
|
Remove indexth card. Does not touch current_card.
(In fact, we just replace the card on the position of 'index' with nil.)
- Parameters:
index |
The index of the card to remove. |
- Return value:
|
Returns true if the card was erased. |
global IsDirty () -> boolean
|
|
If the configuration was changed by the user, this will return true.
- Return value:
|
Has the configuration changed? |
global CardsUniqueKeys () -> list
|
|
Creates a list of unique keys of cards that are already installed.
- Return value:
global CardIndexUniqKey (string uniq) -> integer
|
|
Return card index
- Parameters:
uniq |
Unique ID of the card |
- Return value:
|
index or nil if ID was not found |
global CardsAsItems () -> list
|
|
Creates the content of the "configured card" Table in OverviewDialog()
- Return value:
global DetectedCardGet (integer index) -> map
|
|
Get indexth card.
- Parameters:
index |
Index of the card to get. |
- Return value:
|
The 'index'th card or nil |
global DetectedCardsAsItems () -> list
|
|
List of the TV cards acceptable by the Selection Box widget in
the DetectedDialog(). The already installed cards are filtered out.
- Return value:
|
List of TV cards including Other (not detected) with `id(-1)) |
global GetTvCard (string card_model, string modname) -> map
|
|
Grab the TV card from the database
- Parameters:
card_model |
model ID (to be set as "card=xx" module parameter) |
modname |
kernel module name (not necessary, used only to differene
the cards with same id) |
- Return value:
global CardsDBVendorsAsItems (map autodetected, map parameters, string mod) -> list
|
|
Create a list of items for the "Vendors:" SelectionBox in the
ManualDialog() screen.
- Parameters:
autodetected |
The autodetected card must be present in the database
so we add it if needed. |
parameters |
Parameters of card that should be preselected. |
mod |
Kernel module the reselected card uses |
- Return value:
|
List of list of `item()s and number of the vendor to preselect |
global CardsDBVendorGetCards (map autodetected, integer sel_vendor) -> list
|
|
Create a list of cards of the selected vendor.
- Parameters:
autodetected |
The autodetected card must be present in the database
so we add it if needed. |
sel_vendor |
The number of the selected vendor. |
- Return value:
|
List of cards of the selected vendor. |
global GetTuner (string kernel_name, string tuner_id) -> map
|
|
Returns the tuner map according to its ID
- Parameters:
kernel_name |
Name of the main module for this card. |
tuner_id |
ID of selected tuner |
- Return value:
global TunersDBHasTunersFor (string kernel_module) -> boolean
|
|
Are there any tuners for the kernel_module?
- Parameters:
kernel_module |
Name of the main module for this card. |
- Return value:
|
Are there available tuners for it? |
global TunersDBAsItems (string kernel_module, map selected_tuner) -> list
|
|
List of tuners for TV cards acceptable by the SelectionBox widget.
- Parameters:
kernel_module |
The module for which do we need the list. |
selected_tuner |
The previously selected tuner. |
- Return value:
global TunersDBSelectTuner (string kernel_module, integer number) -> map
|
|
Return the numberth tuner.
- Parameters:
kernel_module |
The module for which do we need the list. |
number |
The number of the tuner to be selected. |
- Return value:
global ModulesAsItems (map modules, string selected_module) -> list
|
|
List of the kernel modules for radio cards acceptable by the Combo Box
widget in the ManualDetailsDialog().
- Parameters:
modules |
|
selected_module |
The module which should be selected in the widget |
- Return value:
global ModuleParametersAsItems (map modules, string selected_module, map parameters) -> list
|
|
List of the parameters for the selected kernel module acceptable by
the Table widget in the ManualDetailsDialog().
- Parameters:
modules |
|
selected_module |
The module which is selected in the Combo Box. |
parameters |
The current values of the kernel module parameters. |
- Return value:
Read IRC settings
- Return value:
|
Symbol for next or abort dialog. |
global WriteIRC () -> any
|
|
Write IRC settings
- Return value:
|
Symbol for next or abort dialog. |
global LoadIRCModulesDescription () -> void
|
|
Load the desription of irc kernel modules (modinfo)
global GetIRCModule () -> string
|
|
Decides which LIRC module can be used accoring to current TV card
- Return value:
global ReadStationsConfig (path pth) -> map
|
|
Read the whole contents of xawtvrc file and return it as a map
- Parameters:
global WriteStationsConfig () -> boolean
|
|
Write to /etc/X11/xawtvrc
global tv_tmp_start () -> string
|
|
Load the modules for TV suport now, use current (not yet saved) options
It calls something like 'modprobe -C /dev/null bttv card=2 tuner=23'
- Return value:
|
empty string on success, error message otherwise |
global InitializeStationsConfig () -> boolean
|
|
Initialize stations configuration (read global config etc.)
global Read (block<boolean> abort) -> boolean
|
|
Read all TV card settings from the SCR
- Parameters:
abort |
A block that can be called by Read to find
out whether abort is requested. Returns true if abort
was pressed. |
- Return value:
global Write (block<boolean> abort) -> boolean
|
|
Update the SCR according to tv settings
- Parameters:
abort |
A block that can be called by Write to find
out whether abort is requested. Returns true if abort
was pressed. |
- Return value:
global Import (map settings) -> boolean
|
|
Get all TV settings from the first parameter
(For use by autoinstallation.)
- Parameters:
settings |
The YCP structure to be imported. |
- Return value:
Dump the tv settings to a single map
(For use by autoinstallation.)
- Return value:
|
Dumped settings (later acceptable by Import ()) |
global Propose () -> void
|
|
Create a configuration automagically.
global Summary () -> string
|
|
Build a textual summary that can be used e.g. in inst_hw_config () or
something similar.
- Return value:
|
Summary of the configuration. |
|