diff --git a/README.md b/README.md index 719a77d..298efae 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,8 @@ Supports the following audio file formats: `MP3`, `OGG`, `WAV`, `FLAC`, `MIDI`. Supports the following languages: `English`, `Русский`, `Українська`. ## Screenshots -![MainScreen-v0 8 1](https://github.com/romanin-rf/SeaPlayer/assets/60302782/84e1f498-beab-463b-ba2a-a8a109e607c0) -![ConfigurateScreen-v0 8 1](https://github.com/romanin-rf/SeaPlayer/assets/60302782/c8f0fa20-b4b8-4858-ac4a-bb8ddb8c0a39) +![Main Screen](https://github.com/romanin-rf/SeaPlayer/assets/60302782/84e1f498-beab-463b-ba2a-a8a109e607c0) +![Configurate Screen](https://github.com/romanin-rf/SeaPlayer/assets/60302782/c8f0fa20-b4b8-4858-ac4a-bb8ddb8c0a39) ## Using ```shell diff --git a/changelog.md b/changelog.md index 25aa803..18147ba 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ | Version | Date | Tag | Changelog | | ------- | ---- | --- | --------- | +| [v0.8.9](https://github.com/romanin-rf/SeaPlayer/releases/tag/v0.8.9) | 21.12.2023 | **HOTFIX** | - Fixed is `TypeError` in `AnySound.from_url`
- Update `VKMusic` plugin to **v0.4.0** | | [v0.8.8](https://github.com/romanin-rf/SeaPlayer/releases/tag/v0.8.8) | 21.12.2023 | **HOTFIX** | - Fixed critical error: **TypeError: @deprecated decorator with non-None category must be applied to a class or callable, not ** | | [v0.8.7](https://github.com/romanin-rf/SeaPlayer/releases/tag/v0.8.7) | 21.12.2023 | **DEPRECATED** | - Added comments for documentation (not fully)
- Added API documentation (not fully)
- Removed `secrets`
- Fixed documentation | | [v0.8.6](https://github.com/romanin-rf/SeaPlayer/releases/tag/v0.8.6) | 17.12.2023 | **STABLE** | - Added new methods for `seaplayer.plug.pluginloader.PluginLoaderConfigManager`: **remove_plugin** & **remove_plugin_by_name_id**
- Added new command for `seaplug`: **unload**
- Added version message for `seaplug`
- Fixed typing for: `seaplayer.plug.pluginloader.PluginLoader.search_plugins_paths` & `seaplayer.plug.pluginloader.PluginLoader.aio_search_plugins_paths`
- Replaced option `--recreate` with `--overwrite` in `seaplayer.plug.cli.cli.creating`
- Replaced option `--rewrite` with `--overwrite` in `seaplayer.plug.cli.cli.loading` | diff --git a/docs-source/docs/changelog.md b/docs-source/docs/changelog.md index 25aa803..c2faae3 100644 --- a/docs-source/docs/changelog.md +++ b/docs-source/docs/changelog.md @@ -2,6 +2,7 @@ | Version | Date | Tag | Changelog | | ------- | ---- | --- | --------- | +| [v0.8.9](https://github.com/romanin-rf/SeaPlayer/releases/tag/v0.8.9) | 21.12.2023 | **HOTFIX** | - Fixed is `TypeError` in `AnySound.from_url`
- Update `VKMusic` plugin to v0.4.0 | | [v0.8.8](https://github.com/romanin-rf/SeaPlayer/releases/tag/v0.8.8) | 21.12.2023 | **HOTFIX** | - Fixed critical error: **TypeError: @deprecated decorator with non-None category must be applied to a class or callable, not ** | | [v0.8.7](https://github.com/romanin-rf/SeaPlayer/releases/tag/v0.8.7) | 21.12.2023 | **DEPRECATED** | - Added comments for documentation (not fully)
- Added API documentation (not fully)
- Removed `secrets`
- Fixed documentation | | [v0.8.6](https://github.com/romanin-rf/SeaPlayer/releases/tag/v0.8.6) | 17.12.2023 | **STABLE** | - Added new methods for `seaplayer.plug.pluginloader.PluginLoaderConfigManager`: **remove_plugin** & **remove_plugin_by_name_id**
- Added new command for `seaplug`: **unload**
- Added version message for `seaplug`
- Fixed typing for: `seaplayer.plug.pluginloader.PluginLoader.search_plugins_paths` & `seaplayer.plug.pluginloader.PluginLoader.aio_search_plugins_paths`
- Replaced option `--recreate` with `--overwrite` in `seaplayer.plug.cli.cli.creating`
- Replaced option `--rewrite` with `--overwrite` in `seaplayer.plug.cli.cli.loading` | diff --git a/docs/changelog/index.html b/docs/changelog/index.html index dbb1d65..ed0d521 100644 --- a/docs/changelog/index.html +++ b/docs/changelog/index.html @@ -768,6 +768,12 @@

Changelogv0.8.9 +21.12.2023 +HOTFIX +- Fixed is TypeError in AnySound.from_url
- Update VKMusic plugin to v0.4.0 + + v0.8.8 21.12.2023 HOTFIX diff --git a/docs/search/search_index.json b/docs/search/search_index.json index 0c8f2dc..e77de28 100644 --- a/docs/search/search_index.json +++ b/docs/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Welcome to SeaPlayer","text":""},{"location":"#description","title":"Description","text":"

SeaPlayer is a player that works in the terminal.

Supports the following audio file formats: MP3, OGG, WAV, FLAC, MIDI.

Supports the following languages: English, \u0420\u0443\u0441\u0441\u043a\u0438\u0439, \u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430.

"},{"location":"#screenshots","title":"Screenshots","text":""},{"location":"#using","title":"Using","text":"via seaplayervia python -m
seaplayer\n
python -m seaplayer\n
"},{"location":"#installation","title":"Installation","text":"
pip install -U seaplayer\n
"},{"location":"#playing-for-midi","title":"Playing for MIDI","text":"

In order to play MIDI files you need to install FluidSynth.

Windows Ubuntu Arch Linux Mac OS
  • Download a zip file suitable for your version of Windows.
  • Unpack the archive anywhere, but it is recommended to put it in a folder C:\\Program Files\\FluidSynth
  • Next, open Settings > System > About the system > Additional system parameters > Environment variables > [Double click on Path] > Create > [Enter the full path to the folder with FluidSynth]
  • That's it, FluidSynth is installed!
sudo apt-get install fluidsynth\n
sudo pacman -S fluidsynth\n
FinkHomebrewMacPorts
fink install fluidsynth\n
brew install fluidsynth\n
sudo port install fluidsynth\n
"},{"location":"changelog/","title":"Changelog","text":"Version Date Tag Changelog v0.8.8 21.12.2023 HOTFIX - Fixed critical error: TypeError: @deprecated decorator with non-None category must be applied to a class or callable, not v0.8.7 21.12.2023 DEPRECATED - Added comments for documentation (not fully)- Added API documentation (not fully)- Removed secrets- Fixed documentation v0.8.6 17.12.2023 STABLE - Added new methods for seaplayer.plug.pluginloader.PluginLoaderConfigManager: remove_plugin & remove_plugin_by_name_id- Added new command for seaplug: unload- Added version message for seaplug- Fixed typing for: seaplayer.plug.pluginloader.PluginLoader.search_plugins_paths & seaplayer.plug.pluginloader.PluginLoader.aio_search_plugins_paths- Replaced option --recreate with --overwrite in seaplayer.plug.cli.cli.creating- Replaced option --rewrite with --overwrite in seaplayer.plug.cli.cli.loading v0.8.5 16.12.2023 STABLE - Added support for python3.8- Added on_ready abstract methods for plugins- Added new widgets: PopUpWindow, WaitButton- Fixed method add_sounds_to_list- Fixed seaplayer.plug.cli- Fixed build.py- Updated all child custom modules v0.8.4 11.12.2023 DEPRECATED - Added widgets: Rheostat, ClickableLabel- Added widget: Rheostat- Added a new widget: PopUp- Fixed all language- More attempts to make Confiturate screen clearer- Moved all CSS from objects.tcss to DEFAULT_CSS separately for each widget v0.8.3 10.12.2023 STABLE - Added plugin VKMusic- Added priority system for codecs- Added system handhers of value- Fixed build.py- Moved method load_plugin_info in seaplayer.plug.pluginloader v0.8.2 08.12.2023 STABLE - Added language merge (for translating plugins)- Fixed in translation files (Log Menu Enable -> Logging )- Changed object.css (classes will no longer be used to specify standard properties)- Improved widget FillLabel v0.8.1 07.12.2023 STABLE - Revisioned of the LanguageLoader- Added new language: \u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430 v0.8.0 07.12.2023 STABLE - Added a new experimental PopUp widget (pop-up window)- Added new exception type Error- Added language loader system- Added full translate: English, \u0420\u0443\u0441\u0441\u043a\u0438\u0439- Added changelog.md- Added secrets- Added widgets: DataRadioButton, ClikableButton and Rheostat (experemental)- Fixed: self.last_playback_status not is int- Changed CSS for LogMenu- Updated build.py- Renamed *.css files to .tcss- Removing excess in DataOptions (from past updates)- Deprecated method seaplayer.functions.check_status- The first part of the attempts to make the Configurate Screen understandable to the average user v0.7.5 02.12.2023 STABLE - Updated the Rich Discord Status plugin (v0.2.1)- Updated the PluginLoader (v0.3.0)- Changed the backlight in the logs- Transferred some methods to functions.py- Removed excess (remaining from other updates) v0.7.4 01.12.2023 HOTFIX - Correction of errors in custom modules v0.7.3 01.12.2023 DEPRECATED - Added log on loading of SeaPlayer- Updated README.md- Updated dependencies- Updated class Log- Fixed the NotAContainer bug- Fixed CLI operation- Fixed the pip install startup error v0.7.2 29.11.2023 DEPRECATED - Added small optimizations v0.7.1 28.11.2023 DEPRECATED - Optimization due to more transplanting to a newer version of playsoundsimple v0.7.0 28.11.2023 DEPRECATED - Added installation of modules from a file requirements.txt in the folder of any plugin, if there is one- Added more intuitive logging"},{"location":"plugin-cli-home/","title":"Plugin CLI","text":""},{"location":"plugin-cli-home/#description","title":"Description","text":"

The CLI for managing plugins.

"},{"location":"plugin-cli-home/#using","title":"Using","text":"via seaplugvia python -m
seaplug [--init-config] [load/list/enable/disable/create] [OPTIONS]\n
python -m seaplayer.plug [--init-config] [load/list/enable/disable/create] [OPTIONS]\n
"},{"location":"plugin-cli-home/#commands","title":"Commands","text":""},{"location":"plugin-cli-home/#load","title":"Load","text":"

The command to load plugins.

ConsoleOutput
seaplug load [--overwrite/-o] ./plugins/ExamplePlugin\n
Plugin loaded!\n
"},{"location":"plugin-cli-home/#unload","title":"Unload","text":"

The command to unload plugins.

ConsoleOutput
seaplug unload seaplayer.plugins.example \n
Plugin unloaded!\n
"},{"location":"plugin-cli-home/#list","title":"List","text":"

List of all loaded plugins.

ConsoleOutput
seaplug list\n
1. ExamplePlugin (seaplayer.plugins.example) v1.0.0 from Romanin (Disabled)\n
"},{"location":"plugin-cli-home/#enable","title":"Enable","text":"

Enabling the plugin.

ConsoleOutput
seaplug enable seaplayer.plugins.example\n
The 'seaplayer.plugins.example' plug-in is enabled.\"\n
"},{"location":"plugin-cli-home/#disable","title":"Disable","text":"

Disabling the plugin.

ConsoleOutput
seaplug disable seaplayer.plugins.example\n
The 'seaplayer.plugins.example' plug-in is disabled.\"\n
"},{"location":"plugin-cli-home/#create","title":"Create","text":"

Create plugin environment. More information in Plugin Development.

ConsoleOutput
seaplug create [--name/--name-id/--version/--author/--description/--url/--overwrite] .\n
The plugin directory has been created.\n
"},{"location":"plugin-dev-home/","title":"Plugin Development","text":""},{"location":"plugin-dev-home/#description","title":"Description","text":"

Creation/Testing the plugin requires using the Plugin CLI.

It is recommended to read it.

Be sure to read the Plugin CLI guide.

"},{"location":"plugin-dev-home/#create-directory","title":"Create Directory","text":"
mkdir ExamplePlugin\n
"},{"location":"plugin-dev-home/#create-environment","title":"Create Environment","text":"
seaplug create ExamplePlugin\n

The following file structure will be created:

graph LR\n    A{ExamplePlugin} --> B[__init__.py];\n    A{ExamplePlugin} --> C[info.json];\n    A{ExamplePlugin} --> D[requirements.txt];

About requirements.txt

The default file is requirements.txt it's not being created, you have to create it yourself if our plugin uses third-party modules.

"},{"location":"plugin-dev-home/#file-infojson","title":"File info.json","text":""},{"location":"plugin-dev-home/#source","title":"Source","text":"

This is just information about your plugin.

ExamplePlugin/info.json
{\n    \"name\": \"ExamplePlugin\",\n    \"name_id\": \"seaplayer.plugins.example\",\n    \"version\": \"1.0.0\",\n    \"author\": \"Romanin\",\n    \"description\": null,    // optional\n    \"url\": null             // optional\n}\n

Very important!

Think carefully about the name_id, because if it matches the name_id of another plugin, there may be a conflict when loading plugins.

"},{"location":"plugin-dev-home/#file-requirementstxt","title":"File requirements.txt","text":"

As mentioned above, the file requirements.txt it is not created after calling seaplug create ExamplePlugin, and it is recommended to create it only if your plugin has dependencies with other modules.

"},{"location":"plugin-dev-home/#source_1","title":"Source","text":"ExamplePlugin/requirements.txt
module>=version\n...\n

Nothing is difficult!

File requirements.txt it is filled in according to the same principle as a regular file requirements.txt in Python. More information.

"},{"location":"plugin-dev-home/#file-__init__py","title":"File __init__.py","text":""},{"location":"plugin-dev-home/#source_2","title":"Source","text":"ExamplePlugin/__init.py__
from seaplayer.plug import PluginBase\n\nclass Plugin(PluginBase):\n    pass\n\n__plugin__ = Plugin\n

Very important!

You don't have to write everything in one __init__.py, the most important thing is that in __init__.py, there was a variable __plugin__ containing a reference to the class.

"},{"location":"plugin-dev-home/#the-queue-for-launching-the-seaplayer","title":"The queue for launching the SeaPlayer","text":"
graph LR\n    SP{SeaPlayer} --> SP_RUN[SeaPlayer.run] --> SP_COMPOSE[SeaPlayer.compose] --> SP_ONREADY[SeaPlayer.on_ready];\n    SP{SeaPlayer} --> SP_INIT[SeaPlayer.__init__];\n    SP_INIT[SeaPlayer.__init__] --> PL_ONINIT[PluginLoader.on_init] --> P_ONINIT[Plugin.on_init];\n    SP_INIT[SeaPlayer.__init__] --> PL_INIT[PluginLoader.__init__];\n    PL_ONINIT[PluginLoader.on_init] --> P_INIT[Plugin.__init__];\n    SP_RUN[SeaPlayer.run] --> PL_ONRUN[PluginLoader.on_run] --> P_ONRUN[Plugin.on_run];\n    SP_COMPOSE[SeaPlayer.compose] --> PL_ONCOMPOSE[PluginLoader.on_compose] --> P_ONCOMPOSE[Plugin.on_compose];\n    SP_ONREADY[SeaPlayer.on_ready] --> PL_ONREADY[PluginLoader.on_ready] --> P_ONREADY[Plugin.on_ready];
"},{"location":"plugin-dev-home/#basic-usage","title":"Basic Usage","text":""},{"location":"plugin-dev-home/#method-on_init","title":"Method on_init","text":"

The method called immediately after initialization of the SeaPlayer.__init__ class.

ExamplePlugin/__init.py__
from seaplayer.plug import PluginBase\n\nclass Plugin(PluginBase):\n    def on_init(self) -> None:\n        pass\n\n__plugin__ = Plugin\n
"},{"location":"plugin-dev-home/#method-on_run","title":"Method on_run","text":"

This method is called during a call to the SeaPlayer.run function.

ExamplePlugin/__init.py__
from seaplayer.plug import PluginBase\n\nclass Plugin(PluginBase):\n    def on_run(self) -> None:\n        pass\n\n__plugin__ = Plugin\n
"},{"location":"plugin-dev-home/#method-on_compose","title":"Method on_compose","text":"

This method is called after all the interface elements have been arranged SeaPlayer.compose.

A nuance!

It is also important to note that the function is launched via SeaPlayer.run_worker.

ExamplePlugin/__init.py__
from seaplayer.plug import PluginBase\n\nclass Plugin(PluginBase):\n    async def on_compose(self) -> None: ...\n        pass\n\n__plugin__ = Plugin\n
"},{"location":"plugin-dev-home/#method-on_ready","title":"Method on_ready","text":"

The function called after the SeaPlayer is fully started SeaPlayer.on_ready.

ExamplePlugin/__init.py__
class Plugin(PluginBase):\n    async def on_ready(self) -> None: ...\n        pass\n
"},{"location":"plugin-dev-home/#method-on_quit","title":"Method on_quit","text":"

Called when closing SeaPlayer.on_quit.

ExamplePlugin/__init.py__
class Plugin(PluginBase):\n    async def on_quit(self) -> None: ...\n        pass\n
"},{"location":"api/","title":"Welcome to SeaPlayer API","text":"

\u041f\u0443\u0441\u0442\u043e

"},{"location":"api/codecbase/","title":"Codecbase","text":""},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase","title":"CodecBase","text":"
CodecBase(path, **kwargs)\n

The base class of the codec.

Parameters Parameter Default Description path str required

File path (optional file path).

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.album","title":"album instance-attribute","text":"
album\n

The album title is taken from the metadata.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.artist","title":"artist instance-attribute","text":"
artist\n

The artist is taken from the metadata.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.bitrate","title":"bitrate instance-attribute","text":"
bitrate\n

The number of bits per second of playback (determines the sound quality).

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.channels","title":"channels instance-attribute","text":"
channels\n

The number of channels in the file.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.codec_name","title":"codec_name class-attribute instance-attribute","text":"
codec_name = 'None'\n

The name of the codec (abbreviation).

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.codec_priority","title":"codec_priority class-attribute instance-attribute","text":"
codec_priority = 0.0\n

Sorting priority (the lower the value, the earlier it will be processed, checked for compatibility and initialized)

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.duration","title":"duration instance-attribute","text":"
duration\n

The duration of the sound in seconds.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.icon_data","title":"icon_data instance-attribute","text":"
icon_data\n

A poster in bytes format is obtained from metadata.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.name","title":"name instance-attribute","text":"
name\n

File path (optional file path).

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.paused","title":"paused instance-attribute","text":"
paused\n

The playback status (True if paused).

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.playing","title":"playing instance-attribute","text":"
playing\n

The playback status (True if playing).

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.samplerate","title":"samplerate instance-attribute","text":"
samplerate\n

The sampling rate in hertz (Hz).

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.title","title":"title instance-attribute","text":"
title\n

The title of the sound is taken from the metadata.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.__aio_sha1__","title":"__aio_sha1__ async","text":"
__aio_sha1__(buffer_size)\n

Calculating the hash of the file.

Parameters Parameter Default Description buffer_size int required

The size of the temporary buffer.

Returns Name Type Description str str

SHA256 in string format.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.__sha1__","title":"__sha1__","text":"
__sha1__(buffer_size)\n

Calculating the hash of the file.

Parameters Parameter Default Description buffer_size int required

The size of the temporary buffer.

Returns Name Type Description str str

SHA256 in string format.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.aio_is_this_codec","title":"aio_is_this_codec async staticmethod","text":"
aio_is_this_codec(path)\n

Compatibility check.

Parameters Parameter Default Description path str required

File path (optional file path).

Returns Name Type Description bool bool

True if compatible.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.get_pos","title":"get_pos","text":"
get_pos()\n

Getting the audio playback position in seconds.

Returns Name Type Description float float

The position of the audio playback in seconds.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.get_volume","title":"get_volume","text":"
get_volume()\n

Getting the current volume as a percentage.

Returns Name Type Description float float

Volume percentage (0.01 == 1%).

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.is_this_codec","title":"is_this_codec staticmethod","text":"
is_this_codec(path)\n

Compatibility check.

Parameters Parameter Default Description path str required

File path (optional file path).

Returns Name Type Description bool bool

True if compatible.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.pause","title":"pause","text":"
pause()\n

Put it on pause.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.play","title":"play","text":"
play()\n

Start playing the sound.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.set_pos","title":"set_pos","text":"
set_pos(value)\n

Setting the audio playback position in seconds.

Parameters Parameter Default Description value float required

The position of the audio playback in seconds.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.set_volume","title":"set_volume","text":"
set_volume(value)\n

Setting the volume value as a percentage.

Parameters Parameter Default Description value float required

Volume percentage (0.01 == 1%).

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.stop","title":"stop","text":"
stop()\n

Stop playing the sound.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.unpause","title":"unpause","text":"
unpause()\n

Take it off the pause.

"},{"location":"api/config/","title":"Config","text":""},{"location":"api/config/#seaplayer.config.DEFAULT_CONFIG_DATA","title":"DEFAULT_CONFIG_DATA module-attribute","text":"
DEFAULT_CONFIG_DATA = {\n    \"main.lang\": \"en-eng\",\n    \"sound.sound_font_path\": None,\n    \"sound.output_sound_device_id\": None,\n    \"image.image_update_method\": \"sync\",\n    \"image.image_resample_method\": \"bilinear\",\n    \"playback.rewind_count_seconds\": 5,\n    \"playback.volume_change_percent\": 0.05,\n    \"playback.max_volume_percent\": 2.0,\n    \"playlist.recursive_search\": False,\n    \"keys.quit\": \"q,\u0439\",\n    \"keys.rewind_forward\": \"*\",\n    \"keys.rewind_back\": \"/\",\n    \"keys.volume_up\": \"+\",\n    \"keys.volume_down\": \"-\",\n    \"debag.log_menu_enable\": False,\n}\n

Default configuration values.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig","title":"SeaPlayerConfig","text":"
SeaPlayerConfig(\n    filepath, *, default_data=DEFAULT_CONFIG_DATA\n)\n

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.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.image_resample_method","title":"image_resample_method property writable","text":"
image_resample_method\n

The image resampling method.

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

The image resampling method.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_quit","title":"key_quit property writable","text":"
key_quit\n

The key to exit the SeaPlayer.

Returns Type Description str

The key char(s).

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_rewind_back","title":"key_rewind_back property writable","text":"
key_rewind_back\n

The rewind back key.

Returns Type Description str

The key char(s).

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_rewind_forward","title":"key_rewind_forward property writable","text":"
key_rewind_forward\n

The rewind forward key.

Returns Type Description str

The key char(s).

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_volume_down","title":"key_volume_down property writable","text":"
key_volume_down\n

The volume down key.

Returns Type Description str

The key char(s).

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_volume_up","title":"key_volume_up property writable","text":"
key_volume_up\n

The volume up key.

Returns Type Description str

The key char(s).

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.lang","title":"lang property writable","text":"
lang\n

The current language.

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

The file name without an extension.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.log_menu_enable","title":"log_menu_enable property writable","text":"
log_menu_enable\n

Enabling and disabling logging.

Returns Type Description bool

On or off.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.max_volume_percent","title":"max_volume_percent property writable","text":"
max_volume_percent\n

Maximum volume value.

Returns Type Description float

Value 0.01 == 1%.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.output_sound_device_id","title":"output_sound_device_id property writable","text":"
output_sound_device_id\n

ID of the audio output device.

Returns Type Description Optional[int]

The device ID.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.recursive_search","title":"recursive_search property writable","text":"
recursive_search\n

Recursive file search.

Returns Type Description bool

On or off.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.rewind_count_seconds","title":"rewind_count_seconds property writable","text":"
rewind_count_seconds\n

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

Returns Type Description int

Rewind in seconds.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.sound_font_path","title":"sound_font_path property writable","text":"
sound_font_path\n

The path to the file with the audio font.

Returns Type Description Optional[str]

The full path to the file.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.volume_change_percent","title":"volume_change_percent property writable","text":"
volume_change_percent\n

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

Returns Type Description float

Value 0.01 == 1%.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.refresh","title":"refresh","text":"
refresh()\n

Overwriting configurations to a file.

"},{"location":"api/exceptions/","title":"Exceptions","text":""},{"location":"api/exceptions/#seaplayer.exceptions.Error","title":"Error","text":"
Error(*args, **kwargs)\n

Bases: Exception

The base class of the error.

"},{"location":"api/exceptions/#seaplayer.exceptions.Error.__error_text__","title":"__error_text__","text":"
__error_text__(*args, **kwargs)\n

Error text generator.

Yields:

Type Description Optional[str]

Generator[Optional[str], Any, None]: Returns the error text.

"},{"location":"api/exceptions/#seaplayer.exceptions.LanguageNotExistError","title":"LanguageNotExistError","text":"
LanguageNotExistError(*args, **kwargs)\n

Bases: Error

The error class indicates that the translation file is missing.

"},{"location":"api/exceptions/#seaplayer.exceptions.LanguageNotLoadedError","title":"LanguageNotLoadedError","text":"
LanguageNotLoadedError(*args, **kwargs)\n

Bases: Error

The error class indicates an unloaded translation file.

"},{"location":"api/exceptions/#seaplayer.exceptions.NotBooleanError","title":"NotBooleanError","text":"
NotBooleanError(data)\n

Bases: Exception

Exception class indicating an error when converting data to bool.

"},{"location":"api/exceptions/#seaplayer.exceptions.PathNotExistsError","title":"PathNotExistsError","text":"
PathNotExistsError(path)\n

Bases: Exception

An exception class indicating the absence of a path.

"},{"location":"api/languages/","title":"Languages","text":""},{"location":"api/languages/#seaplayer.languages.Language","title":"Language","text":"
Language(language_filepath)\n

The class reflects the file with the translation.

Parameters Parameter Default Description language_filepath str required

The path to the file with the translation.

Raises Type Description FileNotFoundError

It is called if the file with the translation does not exist.

"},{"location":"api/languages/#seaplayer.languages.Language.author","title":"author property","text":"
author\n

The author of the translation taken from the translation file.

Returns Type Description str

The author's nickname.

"},{"location":"api/languages/#seaplayer.languages.Language.author_url","title":"author_url property","text":"
author_url\n

The link to the author of the translation is taken from the translation file.

Returns Type Description Optional[str]

Link to the author.

"},{"location":"api/languages/#seaplayer.languages.Language.loaded","title":"loaded property","text":"
loaded\n

If True, then the file with the translation is fully loaded in memory.

Returns Type Description bool

If loaded, then True.

"},{"location":"api/languages/#seaplayer.languages.Language.mark","title":"mark property","text":"
mark\n

The name of the file without an extension.

Returns Type Description str

The name of the file without the extension.

"},{"location":"api/languages/#seaplayer.languages.Language.name","title":"name property","text":"
name\n

The path to the file with the translation.

Returns Type Description str

The full path to the file.

"},{"location":"api/languages/#seaplayer.languages.Language.title","title":"title property","text":"
title\n

The name of the translation language taken from the file.

Returns Type Description str

The purpose of the language.

"},{"location":"api/languages/#seaplayer.languages.Language.words","title":"words property","text":"
words\n

Special values that you need to have even if the language is not loaded.

Returns Type Description Dict[str, str]

Dictionary of special meanings.

"},{"location":"api/languages/#seaplayer.languages.Language.get","title":"get","text":"
get(key, default=None)\n

Getting a line feed.

Parameters Parameter Default Description key str required

The key to the variable with the translation, which is registered in the file with the translation.

default Optional[str] None

The default value. Defaults to None.

Raises Type Description LanguageNotLoadedError

It is called if the translation file is not fully loaded into memory.

Returns Type Description Optional[str]

Optional[str]: The translated string.

"},{"location":"api/languages/#seaplayer.languages.Language.load","title":"load","text":"
load()\n

Full load of the file with the translation in memory.

"},{"location":"api/languages/#seaplayer.languages.Language.unload","title":"unload","text":"
unload()\n

Unload a file with a translation from memory.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader","title":"LanguageLoader","text":"
LanguageLoader(\n    langs_dirpath,\n    main_lang_mark,\n    default_lang_mark=\"en-eng\",\n)\n

The loader of files with translation.

Parameters Parameter Default Description langs_dirpath str required

The path to the folder with the translation files.

main_lang_mark str required

The name of the file with the main translation without the extension.

default_lang_mark str 'en-eng'

The name of the file with the default translation without an extension. Defaults to \"en-eng\".

Raises Type Description FileNotFoundError

Called if the file with the default translation without the extension could not be found.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.alangs","title":"alangs property","text":"
alangs\n

Additional languages, for example, translation of plugins.

Returns Type Description

A list with an additional translation.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.default_lang","title":"default_lang property","text":"
default_lang\n

An image of the Language class reflecting the uploaded file with the default translation.

Returns Type Description Language

The translation.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.default_lang_mark","title":"default_lang_mark property","text":"
default_lang_mark\n

The name of the file with the default translation without an extension.

Returns Type Description str

The file name without an extension.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.langs","title":"langs property","text":"
langs\n

A list with images of the Language class, reflecting the files found in the folder with the translation files.

Returns Type Description List[Language]

A list with translations.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.main_lang","title":"main_lang property","text":"
main_lang\n

An image of the Language class reflecting the uploaded file with the main translation.

Returns Type Description Optional[Language]

The translation or None.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.main_lang_mark","title":"main_lang_mark property","text":"
main_lang_mark\n

The name of the file with the main translation without the extension.

Returns Type Description str

The file name without an extension.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.name","title":"name property","text":"
name\n

The path to the folder with the translation files.

Returns Type Description str

The full path to the file.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.get","title":"get","text":"
get(key)\n

First, it tries to get the translation from the file with the main translation, if it failed, it tries to get it from the file with the default translation, if it failed again, it tries to get them from additional languages (self.alangs). If in the end None is still output, then returns the string \"<LTNF>\", that is, the Language Text Not Found.

Parameters Parameter Default Description key str required

The key to the variable with the translation, which is registered in the file with the translation.

Returns Name Type Description str str

The translated string.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.merge","title":"merge","text":"
merge(ll)\n

Adding additional languages (self.alangs).

Parameters Parameter Default Description ll LanguageLoader required

The image of the LanguageLoader class.

"},{"location":"api/pluginbase/","title":"PluginBase","text":""},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase","title":"PluginBase","text":"
PluginBase(app, pl, info)\n

The base class of the plugin.

Parameters Parameter Default Description app SeaPlayer required

A link to the image of the SeaPlayer class.

pl PluginLoader required

A link to the image of the PluginLoader class.

info PluginInfo required

Contains all variables from info.json.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.app","title":"app instance-attribute","text":"
app = app\n

A link to the image of the SeaPlayer class.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.info","title":"info instance-attribute","text":"
info = info\n

Contains all variables from info.json.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.pl","title":"pl instance-attribute","text":"
pl = pl\n

A link to the image of the PluginLoader class.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.__init_repr__","title":"__init_repr__","text":"
__init_repr__()\n

The string that is output to the logs after initialization of the class.

Returns Name Type Description str str

A string indicating the initialization of the class.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.add_codecs","title":"add_codecs","text":"
add_codecs(*codecs)\n

Adding codecs.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.add_value_handlers","title":"add_value_handlers","text":"
add_value_handlers(*handlers)\n

Adding handlers for user-entered values.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.install_screen","title":"install_screen","text":"
install_screen(name, screen)\n

Adding a new Screen.

Parameters Parameter Default Description name str required

The name by which it will be accessed by SeaPlayer.

screen Screen required

The image of the Screen class.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.on_bindings","title":"on_bindings","text":"
on_bindings()\n

A generator for binding information classes about keys.

Yields:

Type Description Binding

Generator[Binding, Any, None]: A class with information about key bindings.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.on_compose","title":"on_compose async","text":"
on_compose()\n

A function called after initializing the SeaPlayer widgets.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.on_init","title":"on_init","text":"
on_init()\n

A function called during the initialization of the SeaPlayer.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.on_quit","title":"on_quit async","text":"
on_quit()\n

The function starts after sending a signal to close the SeaPlayer.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.on_ready","title":"on_ready async","text":"
on_ready()\n

The function starts immediately after the SeaPlayer is fully launched.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.on_run","title":"on_run","text":"
on_run()\n

A function called before launching SeaPlayer.

"},{"location":"api/pluginloader/","title":"PluginLoader","text":""},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoader","title":"PluginLoader","text":"
PluginLoader(\n    app,\n    plugins_dirpath=None,\n    plugins_config_path=None,\n    *args,\n    **kwargs\n)\n
"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoader.app","title":"app instance-attribute","text":"
app = app\n

A link to the image of the SeaPlayer class.

"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoader.error_plugins","title":"error_plugins instance-attribute","text":"
error_plugins = []\n

A list with plugins (more precisely, with the paths to them) that could not be loaded.

"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoader.off_plugins","title":"off_plugins instance-attribute","text":"
off_plugins = []\n

A list with disabled plugins (more precisely, with information about them).

"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoader.on_plugins","title":"on_plugins instance-attribute","text":"
on_plugins = []\n

A list with initialized plugin classes.

"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoader.plugins_config_path","title":"plugins_config_path instance-attribute","text":"
plugins_config_path = Path(\n    os.path.abspath(\n        plugins_config_path or PLUGINS_CONFIG_PATH\n    )\n)\n

The path to the plugin loader configuration file.

"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoader.plugins_dirpath","title":"plugins_dirpath instance-attribute","text":"
plugins_dirpath = Path(\n    os.path.abspath(plugins_dirpath or PLUGINS_DIRPATH)\n)\n

The path to the plugin folder.

"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoaderConfigManager","title":"PluginLoaderConfigManager","text":"
PluginLoaderConfigManager(path)\n
"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoaderConfigManager.config","title":"config instance-attribute","text":"
config = self.load(self.filepath, default_data)\n

Contains attributes from the plugin configuration file.

"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoaderConfigManager.filepath","title":"filepath instance-attribute","text":"
filepath = Path(path)\n

The path to the plugin configuration file.

"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoaderConfigManager.dump","title":"dump staticmethod","text":"
dump(path, data)\n

Overwriting configurations.

Parameters Parameter Default Description path str required

The path to the plugin configuration file.

data PluginLoaderConfigModel required

Contains attributes from the plugin configuration file.

"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoaderConfigManager.load","title":"load staticmethod","text":"
load(path, default_data)\n

Loading configurations.

Parameters Parameter Default Description path str required

The path to the plugin configuration file.

default_data Dict[str, Any] required

The standard values of the configuration file.

Returns Name Type Description PluginLoaderConfigModel PluginLoaderConfigModel

Contains attributes from the plugin configuration file.

"},{"location":"api/seaplayer/","title":"SeaPlayer","text":""},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer","title":"SeaPlayer","text":"
SeaPlayer(*args, **kwargs)\n

Bases: App

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.CODECS","title":"CODECS class-attribute instance-attribute","text":"
CODECS = [*codecs]\n

The list of codec types, can be supplemented while SeaPlayer is running.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.CODECS_KWARGS","title":"CODECS_KWARGS class-attribute instance-attribute","text":"
CODECS_KWARGS = {\n    \"sound_fonts_path\": config.sound_font_path,\n    \"sound_device_id\": config.output_sound_device_id,\n}\n

The values that are given to each codec type during initialization (codec(**CODEC_KWARGS)).

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.cache","title":"cache class-attribute instance-attribute","text":"
cache = Cacher(CACHE_DIRPATH)\n

An image of a class for caching variables.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.config","title":"config class-attribute instance-attribute","text":"
config = SeaPlayerConfig(CONFIG_FILEPATH)\n

The image of the SeaPlayer configuration file.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.currect_volume","title":"currect_volume class-attribute instance-attribute","text":"
currect_volume = cache.var('currect_volume', 1.0)\n

The current volume value (cached).

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.ll","title":"ll class-attribute instance-attribute","text":"
ll = LanguageLoader(LANGUAGES_DIRPATH, config.lang)\n

An image of the class for receiving the loaded SeaPlayer translation. With the translation uploaded from the seaplayer/langs/ directory.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.playback_mode","title":"playback_mode class-attribute instance-attribute","text":"
playback_mode = cache.var('playback_mode', 0)\n

The current playback mode (cached).

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.action_quit","title":"action_quit async","text":"
action_quit()\n

The function called by our when the SeaPlayer stops working.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.aio_callnofy","title":"aio_callnofy async","text":"
aio_callnofy(text, dosk='top')\n

Creating a notification.

Parameters Parameter Default Description text str required

The text of the notification.

dosk Literal[bottom, left, right, top] 'top'

Regarding the screen. Defaults to \"top\".

Returns Name Type Description CallNofy CallNofy

To delete the notification image, use the CallNofy.remove() method.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.aio_gcs","title":"aio_gcs async","text":"
aio_gcs()\n

Getting the currently selected sound.

Returns Type Description Optional[CodecBase]

Optional[CodecBase]: The image of the codec in which the sound is wrapped.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.aio_get_sound_selected_label_text","title":"aio_get_sound_selected_label_text async","text":"
aio_get_sound_selected_label_text(sound=None)\n

Generating a string for self.music_selected_label.

Parameters Parameter Default Description sound Optional[CodecBase] None

The image of the code\u0441 in which the sound is wrapped. Defaults to None.

Returns Name Type Description str str

String for self.music_selected_label.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.aio_nofy","title":"aio_nofy async","text":"
aio_nofy(text, life_time=3, dosk='top')\n

Creating a temporary notification.

Parameters Parameter Default Description text str required

The text of the notification.

life_time float 3

The time in seconds after which the notification will disappear. Defaults to 3.

dosk Literal[bottom, left, right, top] 'top'

Regarding the screen. Defaults to \"top\".

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.aio_update_select_label","title":"aio_update_select_label async","text":"
aio_update_select_label(sound=None)\n

Updating the string in self.music_selected_label.

Parameters Parameter Default Description sound Optional[CodecBase] None

The image of the code\u0441 in which the sound is wrapped. Defaults to None.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.callnofy","title":"callnofy","text":"
callnofy(text, dosk='top')\n

Creating a notification.

Parameters Parameter Default Description text str required

The text of the notification.

dosk Literal[bottom, left, right, top] 'top'

Regarding the screen. Defaults to \"top\".

Returns Name Type Description CallNofy CallNofy

To delete the notification image, use the CallNofy.remove() method.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.currect_sound_pause","title":"currect_sound_pause async","text":"
currect_sound_pause(sound=None)\n

Pauses the currently selected sound.

Parameters Parameter Default Description sound Optional[CodecBase] None

\u0421urrently selected sound. Defaults to None.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.currect_sound_play","title":"currect_sound_play async","text":"
currect_sound_play(sound=None)\n

Plays playback of the currently selected sound.

Parameters Parameter Default Description sound Optional[CodecBase] None

\u0421urrently selected sound. Defaults to None.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.currect_sound_stop","title":"currect_sound_stop async","text":"
currect_sound_stop(sound=None)\n

Stops playback of the currently selected sound.

Parameters Parameter Default Description sound Optional[CodecBase] None

\u0421urrently selected sound. Defaults to None.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.currect_sound_unpause","title":"currect_sound_unpause async","text":"
currect_sound_unpause(sound=None)\n

Unpauses the currently selected sound.

Parameters Parameter Default Description sound Optional[CodecBase] None

\u0421urrently selected sound. Defaults to None.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.gcs","title":"gcs","text":"
gcs()\n

Getting the currently selected sound.

Returns Type Description Optional[CodecBase]

Optional[CodecBase]: The image of the codec in which the sound is wrapped.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.get_sound_selected_label_text","title":"get_sound_selected_label_text","text":"
get_sound_selected_label_text(sound=None)\n

Generating a string for self.music_selected_label.

Parameters Parameter Default Description sound Optional[CodecBase] None

The image of the code\u0441 in which the sound is wrapped. Defaults to None.

Returns Name Type Description str str

String for self.music_selected_label.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.get_sound_tstatus","title":"get_sound_tstatus","text":"
get_sound_tstatus(sound)\n

Getting the audio status in text format in the language selected by the user.

Parameters Parameter Default Description sound CodecBase required

The image of the code\u0441 in which the sound is wrapped.

Returns Name Type Description str str

Audio status in text format in the language selected by the user.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.nofy","title":"nofy","text":"
nofy(text, life_time=3, dosk='top')\n

Creating a temporary notification.

Parameters Parameter Default Description text str required

The text of the notification.

life_time float 3

The time in seconds after which the notification will disappear. Defaults to 3.

dosk Literal[bottom, left, right, top] 'top'

Regarding the screen. Defaults to \"top\".

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.on_ready","title":"on_ready","text":"
on_ready(*args, **kwargs)\n

A function called when the SeaPlayer is completely confused.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.update_select_label","title":"update_select_label","text":"
update_select_label(sound=None)\n

Updating the string in self.music_selected_label.

Parameters Parameter Default Description sound Optional[CodecBase] None

The image of the code\u0441 in which the sound is wrapped. Defaults to None.

"},{"location":"api/types/","title":"Types","text":""},{"location":"api/types/#seaplayer.types.Cache.Cacher","title":"Cacher","text":"
Cacher(cache_dirpath)\n

The caching management class.

Parameters Parameter Default Description cache_dirpath str required

The path to the directory with the cache.

"},{"location":"api/types/#seaplayer.types.Cache.Cacher.var","title":"var","text":"
var(name, default, *, group='main')\n

Caching a variable, wraps the value of the variable in property and saves it when the value is changed, and the next time SeaPlayer is started, the value is loaded from the cache.

Parameters Parameter Default Description name str required

The name of the cached variable.

default D required

The default value of the variable.

group str 'main'

A group of variables. Defaults to \"main\".

Returns Name Type Description D D

Returns property, but as part of convenience, typing has been done that says that the same type that was set is returned.

"},{"location":"api/types/#seaplayer.types.Convert.Converter","title":"Converter","text":"
Converter(*args, **kwargs)\n

A class for converting values entered by the user.

"},{"location":"api/types/#seaplayer.types.Convert.Converter.boolean","title":"boolean staticmethod","text":"
boolean(value)\n

Converting to bool.

"},{"location":"api/types/#seaplayer.types.Convert.Converter.filepath","title":"filepath staticmethod","text":"
filepath(value)\n

Check if there is a file on the path.

Parameters Parameter Default Description value str required

The value entered by the user.

Raises Type Description PathNotExistsError

Called if the path does not point to a non-existent file.

Returns Name Type Description str str

The path to the file.

"},{"location":"api/types/#seaplayer.types.Convert.Converter.optional","title":"optional staticmethod","text":"
optional(tp)\n

This is a type or function decorator for converting a value.

"},{"location":"api/types/#seaplayer.types.Convert.Converter.path","title":"path staticmethod","text":"
path(value)\n

Checking the existence of a path.

Parameters Parameter Default Description value str required

The value entered by the user.

Raises Type Description PathNotExistsError

Called if the path does not point to a non-existent file or directory.

Returns Name Type Description str str

The path to the file or directory.

"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Welcome to SeaPlayer","text":""},{"location":"#description","title":"Description","text":"

SeaPlayer is a player that works in the terminal.

Supports the following audio file formats: MP3, OGG, WAV, FLAC, MIDI.

Supports the following languages: English, \u0420\u0443\u0441\u0441\u043a\u0438\u0439, \u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430.

"},{"location":"#screenshots","title":"Screenshots","text":""},{"location":"#using","title":"Using","text":"via seaplayervia python -m
seaplayer\n
python -m seaplayer\n
"},{"location":"#installation","title":"Installation","text":"
pip install -U seaplayer\n
"},{"location":"#playing-for-midi","title":"Playing for MIDI","text":"

In order to play MIDI files you need to install FluidSynth.

Windows Ubuntu Arch Linux Mac OS
  • Download a zip file suitable for your version of Windows.
  • Unpack the archive anywhere, but it is recommended to put it in a folder C:\\Program Files\\FluidSynth
  • Next, open Settings > System > About the system > Additional system parameters > Environment variables > [Double click on Path] > Create > [Enter the full path to the folder with FluidSynth]
  • That's it, FluidSynth is installed!
sudo apt-get install fluidsynth\n
sudo pacman -S fluidsynth\n
FinkHomebrewMacPorts
fink install fluidsynth\n
brew install fluidsynth\n
sudo port install fluidsynth\n
"},{"location":"changelog/","title":"Changelog","text":"Version Date Tag Changelog v0.8.9 21.12.2023 HOTFIX - Fixed is TypeError in AnySound.from_url- Update VKMusic plugin to v0.4.0 v0.8.8 21.12.2023 HOTFIX - Fixed critical error: TypeError: @deprecated decorator with non-None category must be applied to a class or callable, not v0.8.7 21.12.2023 DEPRECATED - Added comments for documentation (not fully)- Added API documentation (not fully)- Removed secrets- Fixed documentation v0.8.6 17.12.2023 STABLE - Added new methods for seaplayer.plug.pluginloader.PluginLoaderConfigManager: remove_plugin & remove_plugin_by_name_id- Added new command for seaplug: unload- Added version message for seaplug- Fixed typing for: seaplayer.plug.pluginloader.PluginLoader.search_plugins_paths & seaplayer.plug.pluginloader.PluginLoader.aio_search_plugins_paths- Replaced option --recreate with --overwrite in seaplayer.plug.cli.cli.creating- Replaced option --rewrite with --overwrite in seaplayer.plug.cli.cli.loading v0.8.5 16.12.2023 STABLE - Added support for python3.8- Added on_ready abstract methods for plugins- Added new widgets: PopUpWindow, WaitButton- Fixed method add_sounds_to_list- Fixed seaplayer.plug.cli- Fixed build.py- Updated all child custom modules v0.8.4 11.12.2023 DEPRECATED - Added widgets: Rheostat, ClickableLabel- Added widget: Rheostat- Added a new widget: PopUp- Fixed all language- More attempts to make Confiturate screen clearer- Moved all CSS from objects.tcss to DEFAULT_CSS separately for each widget v0.8.3 10.12.2023 STABLE - Added plugin VKMusic- Added priority system for codecs- Added system handhers of value- Fixed build.py- Moved method load_plugin_info in seaplayer.plug.pluginloader v0.8.2 08.12.2023 STABLE - Added language merge (for translating plugins)- Fixed in translation files (Log Menu Enable -> Logging )- Changed object.css (classes will no longer be used to specify standard properties)- Improved widget FillLabel v0.8.1 07.12.2023 STABLE - Revisioned of the LanguageLoader- Added new language: \u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430 v0.8.0 07.12.2023 STABLE - Added a new experimental PopUp widget (pop-up window)- Added new exception type Error- Added language loader system- Added full translate: English, \u0420\u0443\u0441\u0441\u043a\u0438\u0439- Added changelog.md- Added secrets- Added widgets: DataRadioButton, ClikableButton and Rheostat (experemental)- Fixed: self.last_playback_status not is int- Changed CSS for LogMenu- Updated build.py- Renamed *.css files to .tcss- Removing excess in DataOptions (from past updates)- Deprecated method seaplayer.functions.check_status- The first part of the attempts to make the Configurate Screen understandable to the average user v0.7.5 02.12.2023 STABLE - Updated the Rich Discord Status plugin (v0.2.1)- Updated the PluginLoader (v0.3.0)- Changed the backlight in the logs- Transferred some methods to functions.py- Removed excess (remaining from other updates) v0.7.4 01.12.2023 HOTFIX - Correction of errors in custom modules v0.7.3 01.12.2023 DEPRECATED - Added log on loading of SeaPlayer- Updated README.md- Updated dependencies- Updated class Log- Fixed the NotAContainer bug- Fixed CLI operation- Fixed the pip install startup error v0.7.2 29.11.2023 DEPRECATED - Added small optimizations v0.7.1 28.11.2023 DEPRECATED - Optimization due to more transplanting to a newer version of playsoundsimple v0.7.0 28.11.2023 DEPRECATED - Added installation of modules from a file requirements.txt in the folder of any plugin, if there is one- Added more intuitive logging"},{"location":"plugin-cli-home/","title":"Plugin CLI","text":""},{"location":"plugin-cli-home/#description","title":"Description","text":"

The CLI for managing plugins.

"},{"location":"plugin-cli-home/#using","title":"Using","text":"via seaplugvia python -m
seaplug [--init-config] [load/list/enable/disable/create] [OPTIONS]\n
python -m seaplayer.plug [--init-config] [load/list/enable/disable/create] [OPTIONS]\n
"},{"location":"plugin-cli-home/#commands","title":"Commands","text":""},{"location":"plugin-cli-home/#load","title":"Load","text":"

The command to load plugins.

ConsoleOutput
seaplug load [--overwrite/-o] ./plugins/ExamplePlugin\n
Plugin loaded!\n
"},{"location":"plugin-cli-home/#unload","title":"Unload","text":"

The command to unload plugins.

ConsoleOutput
seaplug unload seaplayer.plugins.example \n
Plugin unloaded!\n
"},{"location":"plugin-cli-home/#list","title":"List","text":"

List of all loaded plugins.

ConsoleOutput
seaplug list\n
1. ExamplePlugin (seaplayer.plugins.example) v1.0.0 from Romanin (Disabled)\n
"},{"location":"plugin-cli-home/#enable","title":"Enable","text":"

Enabling the plugin.

ConsoleOutput
seaplug enable seaplayer.plugins.example\n
The 'seaplayer.plugins.example' plug-in is enabled.\"\n
"},{"location":"plugin-cli-home/#disable","title":"Disable","text":"

Disabling the plugin.

ConsoleOutput
seaplug disable seaplayer.plugins.example\n
The 'seaplayer.plugins.example' plug-in is disabled.\"\n
"},{"location":"plugin-cli-home/#create","title":"Create","text":"

Create plugin environment. More information in Plugin Development.

ConsoleOutput
seaplug create [--name/--name-id/--version/--author/--description/--url/--overwrite] .\n
The plugin directory has been created.\n
"},{"location":"plugin-dev-home/","title":"Plugin Development","text":""},{"location":"plugin-dev-home/#description","title":"Description","text":"

Creation/Testing the plugin requires using the Plugin CLI.

It is recommended to read it.

Be sure to read the Plugin CLI guide.

"},{"location":"plugin-dev-home/#create-directory","title":"Create Directory","text":"
mkdir ExamplePlugin\n
"},{"location":"plugin-dev-home/#create-environment","title":"Create Environment","text":"
seaplug create ExamplePlugin\n

The following file structure will be created:

graph LR\n    A{ExamplePlugin} --> B[__init__.py];\n    A{ExamplePlugin} --> C[info.json];\n    A{ExamplePlugin} --> D[requirements.txt];

About requirements.txt

The default file is requirements.txt it's not being created, you have to create it yourself if our plugin uses third-party modules.

"},{"location":"plugin-dev-home/#file-infojson","title":"File info.json","text":""},{"location":"plugin-dev-home/#source","title":"Source","text":"

This is just information about your plugin.

ExamplePlugin/info.json
{\n    \"name\": \"ExamplePlugin\",\n    \"name_id\": \"seaplayer.plugins.example\",\n    \"version\": \"1.0.0\",\n    \"author\": \"Romanin\",\n    \"description\": null,    // optional\n    \"url\": null             // optional\n}\n

Very important!

Think carefully about the name_id, because if it matches the name_id of another plugin, there may be a conflict when loading plugins.

"},{"location":"plugin-dev-home/#file-requirementstxt","title":"File requirements.txt","text":"

As mentioned above, the file requirements.txt it is not created after calling seaplug create ExamplePlugin, and it is recommended to create it only if your plugin has dependencies with other modules.

"},{"location":"plugin-dev-home/#source_1","title":"Source","text":"ExamplePlugin/requirements.txt
module>=version\n...\n

Nothing is difficult!

File requirements.txt it is filled in according to the same principle as a regular file requirements.txt in Python. More information.

"},{"location":"plugin-dev-home/#file-__init__py","title":"File __init__.py","text":""},{"location":"plugin-dev-home/#source_2","title":"Source","text":"ExamplePlugin/__init.py__
from seaplayer.plug import PluginBase\n\nclass Plugin(PluginBase):\n    pass\n\n__plugin__ = Plugin\n

Very important!

You don't have to write everything in one __init__.py, the most important thing is that in __init__.py, there was a variable __plugin__ containing a reference to the class.

"},{"location":"plugin-dev-home/#the-queue-for-launching-the-seaplayer","title":"The queue for launching the SeaPlayer","text":"
graph LR\n    SP{SeaPlayer} --> SP_RUN[SeaPlayer.run] --> SP_COMPOSE[SeaPlayer.compose] --> SP_ONREADY[SeaPlayer.on_ready];\n    SP{SeaPlayer} --> SP_INIT[SeaPlayer.__init__];\n    SP_INIT[SeaPlayer.__init__] --> PL_ONINIT[PluginLoader.on_init] --> P_ONINIT[Plugin.on_init];\n    SP_INIT[SeaPlayer.__init__] --> PL_INIT[PluginLoader.__init__];\n    PL_ONINIT[PluginLoader.on_init] --> P_INIT[Plugin.__init__];\n    SP_RUN[SeaPlayer.run] --> PL_ONRUN[PluginLoader.on_run] --> P_ONRUN[Plugin.on_run];\n    SP_COMPOSE[SeaPlayer.compose] --> PL_ONCOMPOSE[PluginLoader.on_compose] --> P_ONCOMPOSE[Plugin.on_compose];\n    SP_ONREADY[SeaPlayer.on_ready] --> PL_ONREADY[PluginLoader.on_ready] --> P_ONREADY[Plugin.on_ready];
"},{"location":"plugin-dev-home/#basic-usage","title":"Basic Usage","text":""},{"location":"plugin-dev-home/#method-on_init","title":"Method on_init","text":"

The method called immediately after initialization of the SeaPlayer.__init__ class.

ExamplePlugin/__init.py__
from seaplayer.plug import PluginBase\n\nclass Plugin(PluginBase):\n    def on_init(self) -> None:\n        pass\n\n__plugin__ = Plugin\n
"},{"location":"plugin-dev-home/#method-on_run","title":"Method on_run","text":"

This method is called during a call to the SeaPlayer.run function.

ExamplePlugin/__init.py__
from seaplayer.plug import PluginBase\n\nclass Plugin(PluginBase):\n    def on_run(self) -> None:\n        pass\n\n__plugin__ = Plugin\n
"},{"location":"plugin-dev-home/#method-on_compose","title":"Method on_compose","text":"

This method is called after all the interface elements have been arranged SeaPlayer.compose.

A nuance!

It is also important to note that the function is launched via SeaPlayer.run_worker.

ExamplePlugin/__init.py__
from seaplayer.plug import PluginBase\n\nclass Plugin(PluginBase):\n    async def on_compose(self) -> None: ...\n        pass\n\n__plugin__ = Plugin\n
"},{"location":"plugin-dev-home/#method-on_ready","title":"Method on_ready","text":"

The function called after the SeaPlayer is fully started SeaPlayer.on_ready.

ExamplePlugin/__init.py__
class Plugin(PluginBase):\n    async def on_ready(self) -> None: ...\n        pass\n
"},{"location":"plugin-dev-home/#method-on_quit","title":"Method on_quit","text":"

Called when closing SeaPlayer.on_quit.

ExamplePlugin/__init.py__
class Plugin(PluginBase):\n    async def on_quit(self) -> None: ...\n        pass\n
"},{"location":"api/","title":"Welcome to SeaPlayer API","text":"

\u041f\u0443\u0441\u0442\u043e

"},{"location":"api/codecbase/","title":"Codecbase","text":""},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase","title":"CodecBase","text":"
CodecBase(path, **kwargs)\n

The base class of the codec.

Parameters Parameter Default Description path str required

File path (optional file path).

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.album","title":"album instance-attribute","text":"
album\n

The album title is taken from the metadata.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.artist","title":"artist instance-attribute","text":"
artist\n

The artist is taken from the metadata.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.bitrate","title":"bitrate instance-attribute","text":"
bitrate\n

The number of bits per second of playback (determines the sound quality).

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.channels","title":"channels instance-attribute","text":"
channels\n

The number of channels in the file.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.codec_name","title":"codec_name class-attribute instance-attribute","text":"
codec_name = 'None'\n

The name of the codec (abbreviation).

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.codec_priority","title":"codec_priority class-attribute instance-attribute","text":"
codec_priority = 0.0\n

Sorting priority (the lower the value, the earlier it will be processed, checked for compatibility and initialized)

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.duration","title":"duration instance-attribute","text":"
duration\n

The duration of the sound in seconds.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.icon_data","title":"icon_data instance-attribute","text":"
icon_data\n

A poster in bytes format is obtained from metadata.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.name","title":"name instance-attribute","text":"
name\n

File path (optional file path).

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.paused","title":"paused instance-attribute","text":"
paused\n

The playback status (True if paused).

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.playing","title":"playing instance-attribute","text":"
playing\n

The playback status (True if playing).

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.samplerate","title":"samplerate instance-attribute","text":"
samplerate\n

The sampling rate in hertz (Hz).

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.title","title":"title instance-attribute","text":"
title\n

The title of the sound is taken from the metadata.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.__aio_sha1__","title":"__aio_sha1__ async","text":"
__aio_sha1__(buffer_size)\n

Calculating the hash of the file.

Parameters Parameter Default Description buffer_size int required

The size of the temporary buffer.

Returns Name Type Description str str

SHA256 in string format.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.__sha1__","title":"__sha1__","text":"
__sha1__(buffer_size)\n

Calculating the hash of the file.

Parameters Parameter Default Description buffer_size int required

The size of the temporary buffer.

Returns Name Type Description str str

SHA256 in string format.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.aio_is_this_codec","title":"aio_is_this_codec async staticmethod","text":"
aio_is_this_codec(path)\n

Compatibility check.

Parameters Parameter Default Description path str required

File path (optional file path).

Returns Name Type Description bool bool

True if compatible.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.get_pos","title":"get_pos","text":"
get_pos()\n

Getting the audio playback position in seconds.

Returns Name Type Description float float

The position of the audio playback in seconds.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.get_volume","title":"get_volume","text":"
get_volume()\n

Getting the current volume as a percentage.

Returns Name Type Description float float

Volume percentage (0.01 == 1%).

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.is_this_codec","title":"is_this_codec staticmethod","text":"
is_this_codec(path)\n

Compatibility check.

Parameters Parameter Default Description path str required

File path (optional file path).

Returns Name Type Description bool bool

True if compatible.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.pause","title":"pause","text":"
pause()\n

Put it on pause.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.play","title":"play","text":"
play()\n

Start playing the sound.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.set_pos","title":"set_pos","text":"
set_pos(value)\n

Setting the audio playback position in seconds.

Parameters Parameter Default Description value float required

The position of the audio playback in seconds.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.set_volume","title":"set_volume","text":"
set_volume(value)\n

Setting the volume value as a percentage.

Parameters Parameter Default Description value float required

Volume percentage (0.01 == 1%).

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.stop","title":"stop","text":"
stop()\n

Stop playing the sound.

"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.unpause","title":"unpause","text":"
unpause()\n

Take it off the pause.

"},{"location":"api/config/","title":"Config","text":""},{"location":"api/config/#seaplayer.config.DEFAULT_CONFIG_DATA","title":"DEFAULT_CONFIG_DATA module-attribute","text":"
DEFAULT_CONFIG_DATA = {\n    \"main.lang\": \"en-eng\",\n    \"sound.sound_font_path\": None,\n    \"sound.output_sound_device_id\": None,\n    \"image.image_update_method\": \"sync\",\n    \"image.image_resample_method\": \"bilinear\",\n    \"playback.rewind_count_seconds\": 5,\n    \"playback.volume_change_percent\": 0.05,\n    \"playback.max_volume_percent\": 2.0,\n    \"playlist.recursive_search\": False,\n    \"keys.quit\": \"q,\u0439\",\n    \"keys.rewind_forward\": \"*\",\n    \"keys.rewind_back\": \"/\",\n    \"keys.volume_up\": \"+\",\n    \"keys.volume_down\": \"-\",\n    \"debag.log_menu_enable\": False,\n}\n

Default configuration values.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig","title":"SeaPlayerConfig","text":"
SeaPlayerConfig(\n    filepath, *, default_data=DEFAULT_CONFIG_DATA\n)\n

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.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.image_resample_method","title":"image_resample_method property writable","text":"
image_resample_method\n

The image resampling method.

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

The image resampling method.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_quit","title":"key_quit property writable","text":"
key_quit\n

The key to exit the SeaPlayer.

Returns Type Description str

The key char(s).

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_rewind_back","title":"key_rewind_back property writable","text":"
key_rewind_back\n

The rewind back key.

Returns Type Description str

The key char(s).

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_rewind_forward","title":"key_rewind_forward property writable","text":"
key_rewind_forward\n

The rewind forward key.

Returns Type Description str

The key char(s).

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_volume_down","title":"key_volume_down property writable","text":"
key_volume_down\n

The volume down key.

Returns Type Description str

The key char(s).

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_volume_up","title":"key_volume_up property writable","text":"
key_volume_up\n

The volume up key.

Returns Type Description str

The key char(s).

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.lang","title":"lang property writable","text":"
lang\n

The current language.

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

The file name without an extension.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.log_menu_enable","title":"log_menu_enable property writable","text":"
log_menu_enable\n

Enabling and disabling logging.

Returns Type Description bool

On or off.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.max_volume_percent","title":"max_volume_percent property writable","text":"
max_volume_percent\n

Maximum volume value.

Returns Type Description float

Value 0.01 == 1%.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.output_sound_device_id","title":"output_sound_device_id property writable","text":"
output_sound_device_id\n

ID of the audio output device.

Returns Type Description Optional[int]

The device ID.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.recursive_search","title":"recursive_search property writable","text":"
recursive_search\n

Recursive file search.

Returns Type Description bool

On or off.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.rewind_count_seconds","title":"rewind_count_seconds property writable","text":"
rewind_count_seconds\n

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

Returns Type Description int

Rewind in seconds.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.sound_font_path","title":"sound_font_path property writable","text":"
sound_font_path\n

The path to the file with the audio font.

Returns Type Description Optional[str]

The full path to the file.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.volume_change_percent","title":"volume_change_percent property writable","text":"
volume_change_percent\n

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

Returns Type Description float

Value 0.01 == 1%.

"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.refresh","title":"refresh","text":"
refresh()\n

Overwriting configurations to a file.

"},{"location":"api/exceptions/","title":"Exceptions","text":""},{"location":"api/exceptions/#seaplayer.exceptions.Error","title":"Error","text":"
Error(*args, **kwargs)\n

Bases: Exception

The base class of the error.

"},{"location":"api/exceptions/#seaplayer.exceptions.Error.__error_text__","title":"__error_text__","text":"
__error_text__(*args, **kwargs)\n

Error text generator.

Yields:

Type Description Optional[str]

Generator[Optional[str], Any, None]: Returns the error text.

"},{"location":"api/exceptions/#seaplayer.exceptions.LanguageNotExistError","title":"LanguageNotExistError","text":"
LanguageNotExistError(*args, **kwargs)\n

Bases: Error

The error class indicates that the translation file is missing.

"},{"location":"api/exceptions/#seaplayer.exceptions.LanguageNotLoadedError","title":"LanguageNotLoadedError","text":"
LanguageNotLoadedError(*args, **kwargs)\n

Bases: Error

The error class indicates an unloaded translation file.

"},{"location":"api/exceptions/#seaplayer.exceptions.NotBooleanError","title":"NotBooleanError","text":"
NotBooleanError(data)\n

Bases: Exception

Exception class indicating an error when converting data to bool.

"},{"location":"api/exceptions/#seaplayer.exceptions.PathNotExistsError","title":"PathNotExistsError","text":"
PathNotExistsError(path)\n

Bases: Exception

An exception class indicating the absence of a path.

"},{"location":"api/languages/","title":"Languages","text":""},{"location":"api/languages/#seaplayer.languages.Language","title":"Language","text":"
Language(language_filepath)\n

The class reflects the file with the translation.

Parameters Parameter Default Description language_filepath str required

The path to the file with the translation.

Raises Type Description FileNotFoundError

It is called if the file with the translation does not exist.

"},{"location":"api/languages/#seaplayer.languages.Language.author","title":"author property","text":"
author\n

The author of the translation taken from the translation file.

Returns Type Description str

The author's nickname.

"},{"location":"api/languages/#seaplayer.languages.Language.author_url","title":"author_url property","text":"
author_url\n

The link to the author of the translation is taken from the translation file.

Returns Type Description Optional[str]

Link to the author.

"},{"location":"api/languages/#seaplayer.languages.Language.loaded","title":"loaded property","text":"
loaded\n

If True, then the file with the translation is fully loaded in memory.

Returns Type Description bool

If loaded, then True.

"},{"location":"api/languages/#seaplayer.languages.Language.mark","title":"mark property","text":"
mark\n

The name of the file without an extension.

Returns Type Description str

The name of the file without the extension.

"},{"location":"api/languages/#seaplayer.languages.Language.name","title":"name property","text":"
name\n

The path to the file with the translation.

Returns Type Description str

The full path to the file.

"},{"location":"api/languages/#seaplayer.languages.Language.title","title":"title property","text":"
title\n

The name of the translation language taken from the file.

Returns Type Description str

The purpose of the language.

"},{"location":"api/languages/#seaplayer.languages.Language.words","title":"words property","text":"
words\n

Special values that you need to have even if the language is not loaded.

Returns Type Description Dict[str, str]

Dictionary of special meanings.

"},{"location":"api/languages/#seaplayer.languages.Language.get","title":"get","text":"
get(key, default=None)\n

Getting a line feed.

Parameters Parameter Default Description key str required

The key to the variable with the translation, which is registered in the file with the translation.

default Optional[str] None

The default value. Defaults to None.

Raises Type Description LanguageNotLoadedError

It is called if the translation file is not fully loaded into memory.

Returns Type Description Optional[str]

Optional[str]: The translated string.

"},{"location":"api/languages/#seaplayer.languages.Language.load","title":"load","text":"
load()\n

Full load of the file with the translation in memory.

"},{"location":"api/languages/#seaplayer.languages.Language.unload","title":"unload","text":"
unload()\n

Unload a file with a translation from memory.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader","title":"LanguageLoader","text":"
LanguageLoader(\n    langs_dirpath,\n    main_lang_mark,\n    default_lang_mark=\"en-eng\",\n)\n

The loader of files with translation.

Parameters Parameter Default Description langs_dirpath str required

The path to the folder with the translation files.

main_lang_mark str required

The name of the file with the main translation without the extension.

default_lang_mark str 'en-eng'

The name of the file with the default translation without an extension. Defaults to \"en-eng\".

Raises Type Description FileNotFoundError

Called if the file with the default translation without the extension could not be found.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.alangs","title":"alangs property","text":"
alangs\n

Additional languages, for example, translation of plugins.

Returns Type Description

A list with an additional translation.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.default_lang","title":"default_lang property","text":"
default_lang\n

An image of the Language class reflecting the uploaded file with the default translation.

Returns Type Description Language

The translation.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.default_lang_mark","title":"default_lang_mark property","text":"
default_lang_mark\n

The name of the file with the default translation without an extension.

Returns Type Description str

The file name without an extension.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.langs","title":"langs property","text":"
langs\n

A list with images of the Language class, reflecting the files found in the folder with the translation files.

Returns Type Description List[Language]

A list with translations.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.main_lang","title":"main_lang property","text":"
main_lang\n

An image of the Language class reflecting the uploaded file with the main translation.

Returns Type Description Optional[Language]

The translation or None.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.main_lang_mark","title":"main_lang_mark property","text":"
main_lang_mark\n

The name of the file with the main translation without the extension.

Returns Type Description str

The file name without an extension.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.name","title":"name property","text":"
name\n

The path to the folder with the translation files.

Returns Type Description str

The full path to the file.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.get","title":"get","text":"
get(key)\n

First, it tries to get the translation from the file with the main translation, if it failed, it tries to get it from the file with the default translation, if it failed again, it tries to get them from additional languages (self.alangs). If in the end None is still output, then returns the string \"<LTNF>\", that is, the Language Text Not Found.

Parameters Parameter Default Description key str required

The key to the variable with the translation, which is registered in the file with the translation.

Returns Name Type Description str str

The translated string.

"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.merge","title":"merge","text":"
merge(ll)\n

Adding additional languages (self.alangs).

Parameters Parameter Default Description ll LanguageLoader required

The image of the LanguageLoader class.

"},{"location":"api/pluginbase/","title":"PluginBase","text":""},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase","title":"PluginBase","text":"
PluginBase(app, pl, info)\n

The base class of the plugin.

Parameters Parameter Default Description app SeaPlayer required

A link to the image of the SeaPlayer class.

pl PluginLoader required

A link to the image of the PluginLoader class.

info PluginInfo required

Contains all variables from info.json.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.app","title":"app instance-attribute","text":"
app = app\n

A link to the image of the SeaPlayer class.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.info","title":"info instance-attribute","text":"
info = info\n

Contains all variables from info.json.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.pl","title":"pl instance-attribute","text":"
pl = pl\n

A link to the image of the PluginLoader class.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.__init_repr__","title":"__init_repr__","text":"
__init_repr__()\n

The string that is output to the logs after initialization of the class.

Returns Name Type Description str str

A string indicating the initialization of the class.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.add_codecs","title":"add_codecs","text":"
add_codecs(*codecs)\n

Adding codecs.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.add_value_handlers","title":"add_value_handlers","text":"
add_value_handlers(*handlers)\n

Adding handlers for user-entered values.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.install_screen","title":"install_screen","text":"
install_screen(name, screen)\n

Adding a new Screen.

Parameters Parameter Default Description name str required

The name by which it will be accessed by SeaPlayer.

screen Screen required

The image of the Screen class.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.on_bindings","title":"on_bindings","text":"
on_bindings()\n

A generator for binding information classes about keys.

Yields:

Type Description Binding

Generator[Binding, Any, None]: A class with information about key bindings.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.on_compose","title":"on_compose async","text":"
on_compose()\n

A function called after initializing the SeaPlayer widgets.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.on_init","title":"on_init","text":"
on_init()\n

A function called during the initialization of the SeaPlayer.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.on_quit","title":"on_quit async","text":"
on_quit()\n

The function starts after sending a signal to close the SeaPlayer.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.on_ready","title":"on_ready async","text":"
on_ready()\n

The function starts immediately after the SeaPlayer is fully launched.

"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.on_run","title":"on_run","text":"
on_run()\n

A function called before launching SeaPlayer.

"},{"location":"api/pluginloader/","title":"PluginLoader","text":""},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoader","title":"PluginLoader","text":"
PluginLoader(\n    app,\n    plugins_dirpath=None,\n    plugins_config_path=None,\n    *args,\n    **kwargs\n)\n
"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoader.app","title":"app instance-attribute","text":"
app = app\n

A link to the image of the SeaPlayer class.

"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoader.error_plugins","title":"error_plugins instance-attribute","text":"
error_plugins = []\n

A list with plugins (more precisely, with the paths to them) that could not be loaded.

"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoader.off_plugins","title":"off_plugins instance-attribute","text":"
off_plugins = []\n

A list with disabled plugins (more precisely, with information about them).

"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoader.on_plugins","title":"on_plugins instance-attribute","text":"
on_plugins = []\n

A list with initialized plugin classes.

"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoader.plugins_config_path","title":"plugins_config_path instance-attribute","text":"
plugins_config_path = Path(\n    os.path.abspath(\n        plugins_config_path or PLUGINS_CONFIG_PATH\n    )\n)\n

The path to the plugin loader configuration file.

"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoader.plugins_dirpath","title":"plugins_dirpath instance-attribute","text":"
plugins_dirpath = Path(\n    os.path.abspath(plugins_dirpath or PLUGINS_DIRPATH)\n)\n

The path to the plugin folder.

"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoaderConfigManager","title":"PluginLoaderConfigManager","text":"
PluginLoaderConfigManager(path)\n
"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoaderConfigManager.config","title":"config instance-attribute","text":"
config = self.load(self.filepath, default_data)\n

Contains attributes from the plugin configuration file.

"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoaderConfigManager.filepath","title":"filepath instance-attribute","text":"
filepath = Path(path)\n

The path to the plugin configuration file.

"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoaderConfigManager.dump","title":"dump staticmethod","text":"
dump(path, data)\n

Overwriting configurations.

Parameters Parameter Default Description path str required

The path to the plugin configuration file.

data PluginLoaderConfigModel required

Contains attributes from the plugin configuration file.

"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoaderConfigManager.load","title":"load staticmethod","text":"
load(path, default_data)\n

Loading configurations.

Parameters Parameter Default Description path str required

The path to the plugin configuration file.

default_data Dict[str, Any] required

The standard values of the configuration file.

Returns Name Type Description PluginLoaderConfigModel PluginLoaderConfigModel

Contains attributes from the plugin configuration file.

"},{"location":"api/seaplayer/","title":"SeaPlayer","text":""},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer","title":"SeaPlayer","text":"
SeaPlayer(*args, **kwargs)\n

Bases: App

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.CODECS","title":"CODECS class-attribute instance-attribute","text":"
CODECS = [*codecs]\n

The list of codec types, can be supplemented while SeaPlayer is running.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.CODECS_KWARGS","title":"CODECS_KWARGS class-attribute instance-attribute","text":"
CODECS_KWARGS = {\n    \"sound_fonts_path\": config.sound_font_path,\n    \"sound_device_id\": config.output_sound_device_id,\n}\n

The values that are given to each codec type during initialization (codec(**CODEC_KWARGS)).

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.cache","title":"cache class-attribute instance-attribute","text":"
cache = Cacher(CACHE_DIRPATH)\n

An image of a class for caching variables.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.config","title":"config class-attribute instance-attribute","text":"
config = SeaPlayerConfig(CONFIG_FILEPATH)\n

The image of the SeaPlayer configuration file.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.currect_volume","title":"currect_volume class-attribute instance-attribute","text":"
currect_volume = cache.var('currect_volume', 1.0)\n

The current volume value (cached).

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.ll","title":"ll class-attribute instance-attribute","text":"
ll = LanguageLoader(LANGUAGES_DIRPATH, config.lang)\n

An image of the class for receiving the loaded SeaPlayer translation. With the translation uploaded from the seaplayer/langs/ directory.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.playback_mode","title":"playback_mode class-attribute instance-attribute","text":"
playback_mode = cache.var('playback_mode', 0)\n

The current playback mode (cached).

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.action_quit","title":"action_quit async","text":"
action_quit()\n

The function called by our when the SeaPlayer stops working.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.aio_callnofy","title":"aio_callnofy async","text":"
aio_callnofy(text, dosk='top')\n

Creating a notification.

Parameters Parameter Default Description text str required

The text of the notification.

dosk Literal[bottom, left, right, top] 'top'

Regarding the screen. Defaults to \"top\".

Returns Name Type Description CallNofy CallNofy

To delete the notification image, use the CallNofy.remove() method.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.aio_gcs","title":"aio_gcs async","text":"
aio_gcs()\n

Getting the currently selected sound.

Returns Type Description Optional[CodecBase]

Optional[CodecBase]: The image of the codec in which the sound is wrapped.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.aio_get_sound_selected_label_text","title":"aio_get_sound_selected_label_text async","text":"
aio_get_sound_selected_label_text(sound=None)\n

Generating a string for self.music_selected_label.

Parameters Parameter Default Description sound Optional[CodecBase] None

The image of the code\u0441 in which the sound is wrapped. Defaults to None.

Returns Name Type Description str str

String for self.music_selected_label.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.aio_nofy","title":"aio_nofy async","text":"
aio_nofy(text, life_time=3, dosk='top')\n

Creating a temporary notification.

Parameters Parameter Default Description text str required

The text of the notification.

life_time float 3

The time in seconds after which the notification will disappear. Defaults to 3.

dosk Literal[bottom, left, right, top] 'top'

Regarding the screen. Defaults to \"top\".

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.aio_update_select_label","title":"aio_update_select_label async","text":"
aio_update_select_label(sound=None)\n

Updating the string in self.music_selected_label.

Parameters Parameter Default Description sound Optional[CodecBase] None

The image of the code\u0441 in which the sound is wrapped. Defaults to None.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.callnofy","title":"callnofy","text":"
callnofy(text, dosk='top')\n

Creating a notification.

Parameters Parameter Default Description text str required

The text of the notification.

dosk Literal[bottom, left, right, top] 'top'

Regarding the screen. Defaults to \"top\".

Returns Name Type Description CallNofy CallNofy

To delete the notification image, use the CallNofy.remove() method.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.currect_sound_pause","title":"currect_sound_pause async","text":"
currect_sound_pause(sound=None)\n

Pauses the currently selected sound.

Parameters Parameter Default Description sound Optional[CodecBase] None

\u0421urrently selected sound. Defaults to None.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.currect_sound_play","title":"currect_sound_play async","text":"
currect_sound_play(sound=None)\n

Plays playback of the currently selected sound.

Parameters Parameter Default Description sound Optional[CodecBase] None

\u0421urrently selected sound. Defaults to None.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.currect_sound_stop","title":"currect_sound_stop async","text":"
currect_sound_stop(sound=None)\n

Stops playback of the currently selected sound.

Parameters Parameter Default Description sound Optional[CodecBase] None

\u0421urrently selected sound. Defaults to None.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.currect_sound_unpause","title":"currect_sound_unpause async","text":"
currect_sound_unpause(sound=None)\n

Unpauses the currently selected sound.

Parameters Parameter Default Description sound Optional[CodecBase] None

\u0421urrently selected sound. Defaults to None.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.gcs","title":"gcs","text":"
gcs()\n

Getting the currently selected sound.

Returns Type Description Optional[CodecBase]

Optional[CodecBase]: The image of the codec in which the sound is wrapped.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.get_sound_selected_label_text","title":"get_sound_selected_label_text","text":"
get_sound_selected_label_text(sound=None)\n

Generating a string for self.music_selected_label.

Parameters Parameter Default Description sound Optional[CodecBase] None

The image of the code\u0441 in which the sound is wrapped. Defaults to None.

Returns Name Type Description str str

String for self.music_selected_label.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.get_sound_tstatus","title":"get_sound_tstatus","text":"
get_sound_tstatus(sound)\n

Getting the audio status in text format in the language selected by the user.

Parameters Parameter Default Description sound CodecBase required

The image of the code\u0441 in which the sound is wrapped.

Returns Name Type Description str str

Audio status in text format in the language selected by the user.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.nofy","title":"nofy","text":"
nofy(text, life_time=3, dosk='top')\n

Creating a temporary notification.

Parameters Parameter Default Description text str required

The text of the notification.

life_time float 3

The time in seconds after which the notification will disappear. Defaults to 3.

dosk Literal[bottom, left, right, top] 'top'

Regarding the screen. Defaults to \"top\".

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.on_ready","title":"on_ready","text":"
on_ready(*args, **kwargs)\n

A function called when the SeaPlayer is completely confused.

"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.update_select_label","title":"update_select_label","text":"
update_select_label(sound=None)\n

Updating the string in self.music_selected_label.

Parameters Parameter Default Description sound Optional[CodecBase] None

The image of the code\u0441 in which the sound is wrapped. Defaults to None.

"},{"location":"api/types/","title":"Types","text":""},{"location":"api/types/#seaplayer.types.Cache.Cacher","title":"Cacher","text":"
Cacher(cache_dirpath)\n

The caching management class.

Parameters Parameter Default Description cache_dirpath str required

The path to the directory with the cache.

"},{"location":"api/types/#seaplayer.types.Cache.Cacher.var","title":"var","text":"
var(name, default, *, group='main')\n

Caching a variable, wraps the value of the variable in property and saves it when the value is changed, and the next time SeaPlayer is started, the value is loaded from the cache.

Parameters Parameter Default Description name str required

The name of the cached variable.

default D required

The default value of the variable.

group str 'main'

A group of variables. Defaults to \"main\".

Returns Name Type Description D D

Returns property, but as part of convenience, typing has been done that says that the same type that was set is returned.

"},{"location":"api/types/#seaplayer.types.Convert.Converter","title":"Converter","text":"
Converter(*args, **kwargs)\n

A class for converting values entered by the user.

"},{"location":"api/types/#seaplayer.types.Convert.Converter.boolean","title":"boolean staticmethod","text":"
boolean(value)\n

Converting to bool.

"},{"location":"api/types/#seaplayer.types.Convert.Converter.filepath","title":"filepath staticmethod","text":"
filepath(value)\n

Check if there is a file on the path.

Parameters Parameter Default Description value str required

The value entered by the user.

Raises Type Description PathNotExistsError

Called if the path does not point to a non-existent file.

Returns Name Type Description str str

The path to the file.

"},{"location":"api/types/#seaplayer.types.Convert.Converter.optional","title":"optional staticmethod","text":"
optional(tp)\n

This is a type or function decorator for converting a value.

"},{"location":"api/types/#seaplayer.types.Convert.Converter.path","title":"path staticmethod","text":"
path(value)\n

Checking the existence of a path.

Parameters Parameter Default Description value str required

The value entered by the user.

Raises Type Description PathNotExistsError

Called if the path does not point to a non-existent file or directory.

Returns Name Type Description str str

The path to the file or directory.

"}]} \ No newline at end of file diff --git a/docs/sitemap.xml.gz b/docs/sitemap.xml.gz index dc49c3d..1552fa5 100644 Binary files a/docs/sitemap.xml.gz and b/docs/sitemap.xml.gz differ diff --git a/plugins/VKMusic/__init__.py b/plugins/VKMusic/__init__.py index 2af72b5..16fcd8e 100644 --- a/plugins/VKMusic/__init__.py +++ b/plugins/VKMusic/__init__.py @@ -5,12 +5,14 @@ from seaplayer.objects import PopUpWindow, WaitButton from vkpymusic import Service, TokenReceiverAsync # > Typing -from typing import Tuple +from typing import Optional, Tuple, List # > Local Imports from .vkmcodec import VKMCodec from .units import ( - pcheck, - VKM_RANGE_PATTERN + pget, + VKM_RANGE_SUID_PATTERN, + VKM_TEXT_PATTERN, + VKM_TEXT_RANGE_PATTERN, ) # ! Logging Disable @@ -18,11 +20,20 @@ # ! Plugin Class class VKMusic(PluginBase): - def vkm_value_handler(self, value: str): + def vkm_value_handler(self, value: str) -> List[str]: values = [] - if (d:=pcheck(VKM_RANGE_PATTERN, value)) is not None: - for i in range(d['ssid'], d['esid']): - values.append(f"vkm://{d['uid']}/{i}") + if self.service is not None: + # "vkm://users/:-" + if (d:=pget(VKM_RANGE_SUID_PATTERN, value)) is not None: + for sid in range(d['ssid'], d['esid']): + values.append(f"vkm://users/{d['uid']}:{sid}") # > "vkm://users/:" + # "vkm://songs::" + elif (d:=pget(VKM_TEXT_RANGE_PATTERN, value)) is not None: + for offset in range(d['count']): + values.append(f"vkm://songs:{d['text']}:1:{offset}") # > "vkm://songs:::" + # "vkm://songs:" + elif (d:=pget(VKM_TEXT_PATTERN, value)) is not None: + values.append(f"vkm://songs:{d['text']}:1:0") # > "vkm://songs:::" return values def exist_token(self) -> bool: @@ -102,6 +113,7 @@ async def __init_service__(self) -> None: self.add_codecs(VKMCodec) def on_init(self) -> None: + self.service: Optional[Service] = None self.configurated = self.exist_token() async def on_ready(self): diff --git a/plugins/VKMusic/info.json b/plugins/VKMusic/info.json index ac73f37..c1e116c 100644 --- a/plugins/VKMusic/info.json +++ b/plugins/VKMusic/info.json @@ -1,7 +1,7 @@ { "name": "VK Music", "name_id": "seaplayer.plugins.vk.music", - "version": "0.3.1", + "version": "0.4.0", "author": "Romanin", "description": "Music downloader from VK.", "url": "https://github.com/romanin-rf/SeaPlayer" diff --git a/plugins/VKMusic/units.py b/plugins/VKMusic/units.py index 9d50bfc..4802177 100644 --- a/plugins/VKMusic/units.py +++ b/plugins/VKMusic/units.py @@ -5,10 +5,19 @@ # ! VBML Objects PATCHER = Patcher() -VKM_MAIN_PATTERN = Pattern("vkm:///") -VKM_RANGE_PATTERN = Pattern("vkm:///-") +VKM_SUID_PATTERN = Pattern("vkm://users/:") # ! vkmcodec +VKM_RANGE_SUID_PATTERN = Pattern("vkm://users/:-") # > vkm_value_handler +VKM_TEXT_PATTERN = Pattern("vkm://songs:") # > vkm_value_handler +VKM_TEXT_RANGE_PATTERN = Pattern("vkm://songs::") # > vkm_value_handler +VKM_TEXT_RANGE_OFFSET_PATTERN = Pattern("vkm://songs:::") # ! vkmcodec # ! For VBML methods -def pcheck(pattern: Pattern, text: str) -> Optional[Dict[str, Any]]: +def pget(pattern: Pattern, text: str) -> Optional[Dict[str, Any]]: if isinstance(data:=PATCHER.check(pattern, text), dict): - return data \ No newline at end of file + return data + +def pcheck(pattern: Pattern, text: str) -> bool: + return isinstance(PATCHER.check(pattern, text), dict) + +def pchecks(text: str, *patterns: Pattern) -> bool: + return max([pcheck(pattern, text) for pattern in patterns]) \ No newline at end of file diff --git a/plugins/VKMusic/vkmcodec.py b/plugins/VKMusic/vkmcodec.py index aee3ee6..e63e4ce 100644 --- a/plugins/VKMusic/vkmcodec.py +++ b/plugins/VKMusic/vkmcodec.py @@ -1,18 +1,25 @@ import asyncio -from vkpymusic import Service +from vkpymusic import Service, Song from seaplayer.codecs.URLS import URLSoundCodec from seaplayer.codecs.AnySound import AnySound # > Typing -from typing import Optional, Tuple +from typing import Optional, List # > Local Imports -from .units import PATCHER, VKM_MAIN_PATTERN +from .units import ( + pget, + pchecks, + VKM_SUID_PATTERN, + VKM_TEXT_RANGE_OFFSET_PATTERN +) # ! Methods -def parse_vkm(url: str) -> Tuple[int, int]: - d = PATCHER.check(VKM_MAIN_PATTERN, url) - if not isinstance(d, dict): - raise RuntimeError("The values from the 'url' could not be parsed.") - return d.get("uid"), d.get("sid") +def get_song(service: Service, value: str) -> Optional[Song]: + songs: List[Song] = [] + if (d:=pget(VKM_SUID_PATTERN, value)) is not None: # "vkm://users/:" + songs += service.get_songs_by_userid(d['uid'], 1, d['sid']) + elif (d:=pget(VKM_TEXT_RANGE_OFFSET_PATTERN, value)) is not None: # "vkm://songs:::" + songs += service.search_songs_by_text(d['text'], d['count'], d['offset']) + return songs[0] if len(songs) > 0 else None # ! Main Class class VKMCodec(URLSoundCodec): @@ -21,30 +28,31 @@ class VKMCodec(URLSoundCodec): # ! Check Methods @staticmethod - def is_this_codec(url: str) -> bool: - return isinstance(PATCHER.check(VKM_MAIN_PATTERN, url), dict) + def is_this_codec(value: str) -> bool: + return pchecks(value, VKM_SUID_PATTERN, VKM_TEXT_RANGE_OFFSET_PATTERN) @staticmethod - async def aio_is_this_codec(url: str) -> bool: - return isinstance(PATCHER.check(VKM_MAIN_PATTERN, url), dict) + async def aio_is_this_codec(value: str) -> bool: + return pchecks(value, VKM_SUID_PATTERN, VKM_TEXT_RANGE_OFFSET_PATTERN) # ! Main Functions def __init__( self, url: str, - sound_device_id: Optional[int]=None, vkm_service: Optional[Service]=None, + sound_device_id: Optional[int]=None, aio_init: bool=False, **kwargs ) -> None: if vkm_service is None: - raise RuntimeError("The 'service' argument is None.") - uid, sid = parse_vkm(url) - self.song = vkm_service.get_songs_by_userid(uid, 1, sid)[0] + raise RuntimeError("The VKM service has not been initialized.") + self.song = get_song(vkm_service, url) + if self.song is None: + raise RuntimeError("The sound could not be retrieved.") self._title = (self.song.title if (len(self.song.title) > 0) else None) if isinstance(self.song.title, str) else None self._artist = (self.song.artist if (len(self.song.artist) > 0) else None) if isinstance(self.song.artist, str) else None super().__init__(self.song.url, sound_device_id, aio_init, **kwargs) - self.name = url + self.name = "" @staticmethod async def __aio_init__( @@ -53,8 +61,8 @@ async def __aio_init__( vkm_service: Optional[Service]=None, **kwargs ): - self = VKMCodec(url, sound_device_id, vkm_service, aio_init=True) - self._sound = await asyncio.to_thread(AnySound.from_url, self.song.url, device_id=sound_device_id) + self = VKMCodec(url, vkm_service=vkm_service, sound_device_id=sound_device_id, aio_init=True) + self._sound = await asyncio.to_thread(AnySound.from_url, self.song.url, device_id=sound_device_id, **kwargs) return self # ! Properys diff --git a/pyproject.toml b/pyproject.toml index 4381417..426c515 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "SeaPlayer" -version = "0.8.8" +version = "0.8.9" description = "SeaPlayer is a player that works in the terminal." homepage = "https://romanin-rf.github.io/SeaPlayer" repository = "https://github.com/romanin-rf/SeaPlayer" diff --git a/seaplayer/codecs/AnySound.py b/seaplayer/codecs/AnySound.py index 7995678..7415d4d 100644 --- a/seaplayer/codecs/AnySound.py +++ b/seaplayer/codecs/AnySound.py @@ -4,7 +4,7 @@ import subprocess from tempfile import mkstemp # > IO's -from urlopen2 import URLFile +from urlopen2 import URLFile, AsyncURLFile # > Sound Works from playsoundsimple import Sound from playsoundsimple.sound import FPType, getfp @@ -70,31 +70,17 @@ def from_midi( return AnySound(npath, **{"is_temp": True, **kwargs}) @staticmethod - def from_url( - url: str, - download_buffer_size: int=65536, - **kwargs - ): + def from_url(url: str, **kwargs): path = mkstemp(suffix=".bin")[1] - - with URLFile(url) as urlfile: - with open(path, "wb") as tempfile: - while len(data:=urlfile.read(download_buffer_size)) != 0: - tempfile.write(data) - + with open(path, "wb") as tempfile: + with URLFile(url, tempfile) as urlfile: + urlfile.fulling() return AnySound(path, is_temp=True, **kwargs) @staticmethod - async def aio_from_url( - url: str, - download_buffer_size: int=65536, - **kwargs - ): + async def aio_from_url(url: str, **kwargs): path = mkstemp(suffix=".bin")[1] - - with URLFile(url) as urlfile: - async with aiofiles.open(path, "wb") as tempfile: - while len(data:=urlfile.read(download_buffer_size)) != 0: - await tempfile.write(data) - + async with aiofiles.open(path, "wb") as tempfile: + async with AsyncURLFile(url, tempfile) as urlfile: + await urlfile.fulling() return AnySound(path, is_temp=True, **kwargs) diff --git a/seaplayer/seaplayer.py b/seaplayer/seaplayer.py index f43ce9b..b5e777f 100644 --- a/seaplayer/seaplayer.py +++ b/seaplayer/seaplayer.py @@ -520,14 +520,14 @@ async def add_sounds_to_list(self) -> None: try: sound: CodecBase = await codec.__aio_init__(value, **self.CODECS_KWARGS) except Exception as e: - self.exception(e) sound = None + raise e else: try: sound: CodecBase = codec(value, **self.CODECS_KWARGS) except Exception as e: - self.exception(e) sound = None + raise e if sound is not None: if not await self.music_list_view.music_list.aio_exists_sha1(sound): await self.music_list_view.aio_add_sound(sound) diff --git a/seaplayer/units.py b/seaplayer/units.py index c393ca0..d796509 100644 --- a/seaplayer/units.py +++ b/seaplayer/units.py @@ -6,7 +6,7 @@ # ! Metadata __title__ = "SeaPlayer" -__version__ = "0.8.8" +__version__ = "0.8.9" __author__ = "Romanin" __email__ = "semina054@gmail.com" __url__ = "https://github.com/romanin-rf/SeaPlayer"