Skip to content

Config

DEFAULT_CONFIG_DATA module-attribute

DEFAULT_CONFIG_DATA = {
    "main.lang": "en-eng",
    "sound.sound_font_path": None,
    "sound.output_sound_device_id": None,
    "image.image_update_method": "sync",
    "image.image_resample_method": "bilinear",
    "playback.rewind_count_seconds": 5,
    "playback.volume_change_percent": 0.05,
    "playback.max_volume_percent": 2.0,
    "playlist.recursive_search": False,
    "keys.quit": "q,й",
    "keys.rewind_forward": "*",
    "keys.rewind_back": "/",
    "keys.volume_up": "+",
    "keys.volume_down": "-",
    "debag.logging": False,
}

Default configuration values.

SeaPlayerConfig

SeaPlayerConfig(
    filepath, *, default_data=DEFAULT_CONFIG_DATA
)

The main configuration class of the SeaPlayer.

Parameters
Parameter Default Description
filepath
str
required

The path to the configuration file.

default_data
Dict[str, Any]
DEFAULT_CONFIG_DATA

Default configuration values. Defaults to DEFAULT_CONFIG_DATA.

image_resample_method property writable

image_resample_method

The image resampling method.

Returns
Type Description
Literal['nearest', 'bilinear', 'bicubic', 'lanczos', 'hamming', 'box']

The image resampling method.

key_quit property writable

key_quit

The key to exit the SeaPlayer.

Returns
Type Description
str

The key char(s).

key_rewind_back property writable

key_rewind_back

The rewind back key.

Returns
Type Description
str

The key char(s).

key_rewind_forward property writable

key_rewind_forward

The rewind forward key.

Returns
Type Description
str

The key char(s).

key_volume_down property writable

key_volume_down

The volume down key.

Returns
Type Description
str

The key char(s).

key_volume_up property writable

key_volume_up

The volume up key.

Returns
Type Description
str

The key char(s).

lang property writable

lang

The current language.

Returns
Type Description
Union[Literal['en-eng'], str]

The file name without an extension.

logging property writable

logging

Enabling and disabling logging.

Returns
Type Description
bool

On or off.

max_volume_percent property writable

max_volume_percent

Maximum volume value.

Returns
Type Description
float

Value 0.01 == 1%.

output_sound_device_id property writable

output_sound_device_id

ID of the audio output device.

Returns
Type Description
Optional[int]

The device ID.

recursive_search

Recursive file search.

Returns
Type Description
bool

On or off.

rewind_count_seconds property writable

rewind_count_seconds

The value of the seconds by which the current sound will be rewound.

Returns
Type Description
int

Rewind in seconds.

sound_font_path property writable

sound_font_path

The path to the file with the audio font.

Returns
Type Description
Optional[str]

The full path to the file.

volume_change_percent property writable

volume_change_percent

Percentage by which the volume changes when the special keys are pressed.

Returns
Type Description
float

Value 0.01 == 1%.

refresh

refresh()

Overwriting configurations to a file.