Zapping · ZVBIZapping Homepage

News | Download | Screenshots | Sourceforge | HelpHelp

Zapping Commands


Command Line

Commands can be given on the command line when Zapping starts. This was intended to change video device properties, the program terminates after executing the command.

zapping -c "command"

Up to version 0.6.x these commands are available:

set_channel (name | number)
Switch to the channel. By default the command tries to find the channel by its name (second column in the channel editor). When no such channel exists or the parameter is a number it selects the nth channel from the list, counted from zero up.

Starting with version 0.7 these commands are superseded by the new Python command set, see below. Further you can send commands to a running Zapping process with the zapping_remote tool:

zapping_remote "command"


Keyboard Customization

Commands can be assigned to keyboard keys in the preferences. Starting with version 0.7 we use the new Python command set, see below.

The old command set listed here is automatically converted for compatibility with older versions of Zapping. The commands are generally equivalent to their new Python counterparts. Parameters in [square brackets] are optional.

LIRC/ALIRC Plugin

These commands are mostly superseded by the new Python command set, see below. They are still supported for compatibility with older versions of Zapping.

QUIT
Terminate the program.
CHANUP
Switch to the next channel in the list.
CHANDOWN
Switch to the previous channel in the list.
SETCHANNEL n

The function of this command is affected by the preferences setting for entering channel numbers on the numeric keypad. By the default it switches to the nth channel in the list, the count starts at zero. Alternatively the number is interpreted as the RF channel number of the requested channel.

Single digits combine to numbers when the command is executed repeatedly within a short period. For example "SETCHANNEL 1", "SETCHANNEL 3" jumps to channel 13.

ZOOM
Switch between fullscreen and windowed mode.
MUTE
When audio is on, mute it, when muted switch it back on.
VOL_UP
Increase the audio volume.
VOL_UP
Decrease the audio volume.

Python Commands

Parameters in [square brackets] are optional. Parameters in 'single quotes' are strings, otherwise they are numbers. A toggle parameter can be zero to switch the property off, non-zero to switch it on, or it can be omitted to reverse the current setting.

General

zapping.quit()
Terminate the program.
zapping.switch_mode('mode')
Switch the current display mode:
'fullscreen'
display video fullscreen, in capture or overlay mode
'capture'
display video in a window in capture mode
'preview'
display video in a window in overlay mode
'teletext'
display Teletext in the main window
zapping.toggle_mode('mode')
Switch to this mode. When this is already the current mode, switch to the previous mode.
zapping.restore_mode('mode')
Synonym for zapping.toggle_mode(), deprecated.
zapping.channel_up()
Switch to the next channel in the list.
zapping.channel_down()
Switch to the previous channel in the list.
zapping.set_channel(nth)
Switch to the nth channel in the list, the count starts at zero.
zapping.lookup_channel('name')
Switch to the channel with this name (second column in the channel editor).
zapping.resize_screen(width, height)
Resize the video window.
zapping.picture_size_cycle([n])
Switch to the next entry in the list of favourite picture sizes (as displayed in the context menu), +1 forward, -1 back.
zapping.hide_controls(toggle)
Whether to hide the main menu and toolbar.
zapping.keep_on_top(toggle)
Whether to keep the main window on top of all other windows (if this is supported by the window manager).

Dialogs

zapping.control_box()
Start the picture controls dialog.
zapping.channel_editor()
Start the channel editing dialog.
zapping.properties(['group' [, 'item']])
Start the properties dialog, optionally the given group and item.
zapping.plugin_properties()
Start the plugin properties dialog.
zapping.about()
Start the about dialog.
zapping.help()
Open the Zapping documentation.

Teletext

zapping.ttx_open_new([page [, subpage]])
Open a Teletext window. When a page number is given, go to this page.
zapping.ttx_page_incr([n])
Advance the Teletext page number by n. This can be a positive or negative value, by default 1.
zapping.ttx_subpage_incr([n])
Advance the Teletext subpage number by n. This can be a positive or negative value, by default 1.
zapping.ttx_home()
Go to the Teletext home page, usually page 100.
zapping.ttx_history_prev()
Go to the previously visited page in the browse history.
zapping.ttx_history_next()
Go to the next visited page in the browse history.
zapping.ttx_hold(toggle)
Toggle the hold state of the displayed page. When off, Zapzilla will rotate through all subpages of the page, if it has any.
zapping.ttx_reveal(toggle)
Whether to reveal concealed characters on the displayed Teletext page.

Caption / Subtitles

zapping.closed_caption(toggle)
Whether to display closed caption superimposed onto the picture.
zapping.osd_render_markup('Hello <i>World</i>!')
Display text superimposed onto the picture, with Pango markup.
zapping.osd_render('Hello World!')
Display text superimposed onto the picture.

Audio

zapping.mute(toggle)
Change the audio mute control.
zapping.volume_incr([n])

This provisional command changed the audio recording volume, it is no longer supported.

As a replacement use zapping.control_incr('volume'[, n]) to change the soundcard mixer or video device volume as configured in the preferences dialog. Note that changing the volume does not unmute.

Controls

zapping.control_incr('name'[, n])
Advance the control value by n units, usually +1 or -1, default is +1. The following names are presently recognized:
'brightness'
picture brightness
'contrast'
picture contrast
'saturation'
picture color saturation
'hue'
picture color hue
'volume'
audio volume
'bass'
audio bass
'treble'
audio treble

Plugins

zapping.screenshot(['format'])
Start the screenshot dialog and if given switch to the format. Currently valid formats are: 'jpeg' and 'ppm'.
zapping.quickshot(['format'])
Take a screenshot without starting the dialog. The last select file name will be used, with an incrementing number appended. When no format is given the last selected format will be used.
zapping.record(['format'])
Start the record dialog and if given switch to the format. Note this is the name the user gives a particular configuration, not the name of the file format.
zapping.quickrec(['format'])
Start recording without confirmation. The last select file name will be used, with an incrementing number appended. When no format is given the last selected format will be used.
zapping.stoprec()
Stop recording.

Developer Notes

Switching to Python as our script language was an excellent idea, however we hardly use the language efficiently. Instead of zapping.mute() for example 'mute' should be simply a readable and writable boolean property of the zapping object. The Teletext commands implicitly refer to the window which has focus. Instead we should have a teletext object and methods to access all Teletext windows or choose the current one.

Python now almost forms a layer between the GUI and C functions, and integrates very well into Zapping. It may be worth pondering if some parts of the GUI itself could be implemented in Python, using the pygtk Gtk bindings, while resorting to C only for time critical and low level functions.