TypeError
in AnySound.from_url
VKMusic
plugin to v0.4.0SeaPlayer 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
.
seaplayer
via 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 OSC:\\Program Files\\FluidSynth
Settings
> System
> About the system
> Additional system parameters
> Environment variables
> [Double click on Path]
> Create
> [Enter the full path to the folder with FluidSynth]
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":"viaseaplug
via 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.
ConsoleOutputseaplug load [--overwrite/-o] ./plugins/ExamplePlugin\n
Plugin loaded!\n
"},{"location":"plugin-cli-home/#unload","title":"Unload","text":"The command to unload plugins.
ConsoleOutputseaplug unload seaplayer.plugins.example \n
Plugin unloaded!\n
"},{"location":"plugin-cli-home/#list","title":"List","text":"List of all loaded plugins.
ConsoleOutputseaplug 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.
ConsoleOutputseaplug 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.
ConsoleOutputseaplug 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.
ConsoleOutputseaplug 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.
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.
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.
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.
__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.
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.
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.
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
.
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
.
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
.
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 Descriptionpath
str
required File path (optional file path).
"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.album","title":"albuminstance-attribute
","text":"album\n
The album title
is taken from the metadata.
instance-attribute
","text":"artist\n
The artist
is taken from the metadata.
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":"channelsinstance-attribute
","text":"channels\n
The number of channels in the file.
"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.codec_name","title":"codec_nameclass-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_priorityclass-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":"durationinstance-attribute
","text":"duration\n
The duration of the sound in seconds.
"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.icon_data","title":"icon_datainstance-attribute
","text":"icon_data\n
A poster
in bytes format is obtained from metadata.
instance-attribute
","text":"name\n
File path (optional file path).
"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.paused","title":"pausedinstance-attribute
","text":"paused\n
The playback status (True if paused
).
instance-attribute
","text":"playing\n
The playback status (True if playing
).
instance-attribute
","text":"samplerate\n
The sampling rate in hertz (Hz).
"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.title","title":"titleinstance-attribute
","text":"title\n
The title
of the sound is taken from the metadata.
async
","text":"__aio_sha1__(buffer_size)\n
Calculating the hash of the file.
Parameters Parameter Default Descriptionbuffer_size
int
required The size of the temporary buffer.
Returns Name Type Descriptionstr
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 Descriptionbuffer_size
int
required The size of the temporary buffer.
Returns Name Type Descriptionstr
str
SHA256 in string format.
"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.aio_is_this_codec","title":"aio_is_this_codecasync
staticmethod
","text":"aio_is_this_codec(path)\n
Compatibility check.
Parameters Parameter Default Descriptionpath
str
required File path (optional file path).
Returns Name Type Descriptionbool
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 Descriptionfloat
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 Descriptionfloat
float
Volume percentage (0.01 == 1%).
"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.is_this_codec","title":"is_this_codecstaticmethod
","text":"is_this_codec(path)\n
Compatibility check.
Parameters Parameter Default Descriptionpath
str
required File path (optional file path).
Returns Name Type Descriptionbool
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 Descriptionvalue
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 Descriptionvalue
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_DATAmodule-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 Descriptionfilepath
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_methodproperty
writable
","text":"image_resample_method\n
The image resampling method.
Returns Type DescriptionLiteral['nearest', 'bilinear', 'bicubic', 'lanczos', 'hamming', 'box']
The image resampling method.
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_quit","title":"key_quitproperty
writable
","text":"key_quit\n
The key to exit the SeaPlayer.
Returns Type Descriptionstr
The key char(s).
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_rewind_back","title":"key_rewind_backproperty
writable
","text":"key_rewind_back\n
The rewind back key.
Returns Type Descriptionstr
The key char(s).
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_rewind_forward","title":"key_rewind_forwardproperty
writable
","text":"key_rewind_forward\n
The rewind forward key.
Returns Type Descriptionstr
The key char(s).
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_volume_down","title":"key_volume_downproperty
writable
","text":"key_volume_down\n
The volume down key.
Returns Type Descriptionstr
The key char(s).
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_volume_up","title":"key_volume_upproperty
writable
","text":"key_volume_up\n
The volume up key.
Returns Type Descriptionstr
The key char(s).
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.lang","title":"langproperty
writable
","text":"lang\n
The current language.
Returns Type DescriptionUnion[Literal['en-eng'], str]
The file name without an extension.
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.log_menu_enable","title":"log_menu_enableproperty
writable
","text":"log_menu_enable\n
Enabling and disabling logging.
Returns Type Descriptionbool
On or off.
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.max_volume_percent","title":"max_volume_percentproperty
writable
","text":"max_volume_percent\n
Maximum volume value.
Returns Type Descriptionfloat
Value 0.01 == 1%.
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.output_sound_device_id","title":"output_sound_device_idproperty
writable
","text":"output_sound_device_id\n
ID of the audio output device.
Returns Type DescriptionOptional[int]
The device ID.
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.recursive_search","title":"recursive_searchproperty
writable
","text":"recursive_search\n
Recursive file search.
Returns Type Descriptionbool
On or off.
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.rewind_count_seconds","title":"rewind_count_secondsproperty
writable
","text":"rewind_count_seconds\n
The value of the seconds by which the current sound will be rewound.
Returns Type Descriptionint
Rewind in seconds.
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.sound_font_path","title":"sound_font_pathproperty
writable
","text":"sound_font_path\n
The path to the file with the audio font.
Returns Type DescriptionOptional[str]
The full path to the file.
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.volume_change_percent","title":"volume_change_percentproperty
writable
","text":"volume_change_percent\n
Percentage by which the volume changes when the special keys are pressed.
Returns Type Descriptionfloat
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 DescriptionOptional[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
.
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 Descriptionlanguage_filepath
str
required The path to the file with the translation.
Raises Type DescriptionFileNotFoundError
It is called if the file with the translation does not exist.
"},{"location":"api/languages/#seaplayer.languages.Language.author","title":"authorproperty
","text":"author\n
The author of the translation taken from the translation file.
Returns Type Descriptionstr
The author's nickname.
"},{"location":"api/languages/#seaplayer.languages.Language.author_url","title":"author_urlproperty
","text":"author_url\n
The link to the author of the translation is taken from the translation file.
Returns Type DescriptionOptional[str]
Link to the author.
"},{"location":"api/languages/#seaplayer.languages.Language.loaded","title":"loadedproperty
","text":"loaded\n
If True
, then the file with the translation is fully loaded in memory.
bool
If loaded, then True
.
property
","text":"mark\n
The name of the file without an extension.
Returns Type Descriptionstr
The name of the file without the extension.
"},{"location":"api/languages/#seaplayer.languages.Language.name","title":"nameproperty
","text":"name\n
The path to the file with the translation.
Returns Type Descriptionstr
The full path to the file.
"},{"location":"api/languages/#seaplayer.languages.Language.title","title":"titleproperty
","text":"title\n
The name of the translation language taken from the file.
Returns Type Descriptionstr
The purpose of the language.
"},{"location":"api/languages/#seaplayer.languages.Language.words","title":"wordsproperty
","text":"words\n
Special values that you need to have even if the language is not loaded.
Returns Type DescriptionDict[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 Descriptionkey
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 DescriptionLanguageNotLoadedError
It is called if the translation file is not fully loaded into memory.
Returns Type DescriptionOptional[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 Descriptionlangs_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 DescriptionFileNotFoundError
Called if the file with the default translation without the extension could not be found.
"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.alangs","title":"alangsproperty
","text":"alangs\n
Additional languages, for example, translation of plugins.
Returns Type DescriptionA list with an additional translation.
"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.default_lang","title":"default_langproperty
","text":"default_lang\n
An image of the Language
class reflecting the uploaded file with the default translation.
Language
The translation.
"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.default_lang_mark","title":"default_lang_markproperty
","text":"default_lang_mark\n
The name of the file with the default translation without an extension.
Returns Type Descriptionstr
The file name without an extension.
"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.langs","title":"langsproperty
","text":"langs\n
A list with images of the Language
class, reflecting the files found in the folder with the translation files.
List[Language]
A list with translations.
"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.main_lang","title":"main_langproperty
","text":"main_lang\n
An image of the Language
class reflecting the uploaded file with the main translation.
Optional[Language]
The translation or None
.
property
","text":"main_lang_mark\n
The name of the file with the main translation without the extension.
Returns Type Descriptionstr
The file name without an extension.
"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.name","title":"nameproperty
","text":"name\n
The path to the folder with the translation files.
Returns Type Descriptionstr
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
.
key
str
required The key to the variable with the translation, which is registered in the file with the translation.
Returns Name Type Descriptionstr
str
The translated string.
"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.merge","title":"merge","text":"merge(ll)\n
Adding additional languages (self.alangs
).
ll
LanguageLoader
required The image of the LanguageLoader
class.
PluginBase(app, pl, info)\n
The base class of the plugin.
Parameters Parameter Default Descriptionapp
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
.
instance-attribute
","text":"app = app\n
A link to the image of the SeaPlayer
class.
instance-attribute
","text":"info = info\n
Contains all variables from info.json
.
instance-attribute
","text":"pl = pl\n
A link to the image of the PluginLoader
class.
__init_repr__()\n
The string that is output to the logs after initialization of the class.
Returns Name Type Descriptionstr
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
.
name
str
required The name by which it will be accessed by SeaPlayer.
screen
Screen
required The image of the Screen
class.
on_bindings()\n
A generator for binding information classes about keys.
Yields:
Type DescriptionBinding
Generator[Binding, Any, None]: A class with information about key bindings.
"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.on_compose","title":"on_composeasync
","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_quitasync
","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_readyasync
","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.
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_pluginsinstance-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_pluginsinstance-attribute
","text":"on_plugins = []\n
A list with initialized plugin classes.
"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoader.plugins_config_path","title":"plugins_config_pathinstance-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_dirpathinstance-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":"filepathinstance-attribute
","text":"filepath = Path(path)\n
The path to the plugin configuration file.
"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoaderConfigManager.dump","title":"dumpstaticmethod
","text":"dump(path, data)\n
Overwriting configurations.
Parameters Parameter Default Descriptionpath
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":"loadstaticmethod
","text":"load(path, default_data)\n
Loading configurations.
Parameters Parameter Default Descriptionpath
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 DescriptionPluginLoaderConfigModel
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
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_KWARGSclass-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)
).
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":"configclass-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_volumeclass-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":"llclass-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.
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_quitasync
","text":"action_quit()\n
The function called by our when the SeaPlayer stops working.
"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.aio_callnofy","title":"aio_callnofyasync
","text":"aio_callnofy(text, dosk='top')\n
Creating a notification.
Parameters Parameter Default Descriptiontext
str
required The text of the notification.
dosk
Literal[bottom, left, right, top]
'top'
Regarding the screen. Defaults to \"top\".
Returns Name Type DescriptionCallNofy
CallNofy
To delete the notification image, use the CallNofy.remove()
method.
async
","text":"aio_gcs()\n
Getting the currently selected sound.
Returns Type DescriptionOptional[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_textasync
","text":"aio_get_sound_selected_label_text(sound=None)\n
Generating a string for self.music_selected_label
.
sound
Optional[CodecBase]
None
The image of the code\u0441 in which the sound is wrapped. Defaults to None.
Returns Name Type Descriptionstr
str
String for self.music_selected_label
.
async
","text":"aio_nofy(text, life_time=3, dosk='top')\n
Creating a temporary notification.
Parameters Parameter Default Descriptiontext
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_labelasync
","text":"aio_update_select_label(sound=None)\n
Updating the string in self.music_selected_label
.
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 Descriptiontext
str
required The text of the notification.
dosk
Literal[bottom, left, right, top]
'top'
Regarding the screen. Defaults to \"top\".
Returns Name Type DescriptionCallNofy
CallNofy
To delete the notification image, use the CallNofy.remove()
method.
async
","text":"currect_sound_pause(sound=None)\n
Pauses the currently selected sound.
Parameters Parameter Default Descriptionsound
Optional[CodecBase]
None
\u0421urrently selected sound. Defaults to None.
"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.currect_sound_play","title":"currect_sound_playasync
","text":"currect_sound_play(sound=None)\n
Plays playback of the currently selected sound.
Parameters Parameter Default Descriptionsound
Optional[CodecBase]
None
\u0421urrently selected sound. Defaults to None.
"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.currect_sound_stop","title":"currect_sound_stopasync
","text":"currect_sound_stop(sound=None)\n
Stops playback of the currently selected sound.
Parameters Parameter Default Descriptionsound
Optional[CodecBase]
None
\u0421urrently selected sound. Defaults to None.
"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.currect_sound_unpause","title":"currect_sound_unpauseasync
","text":"currect_sound_unpause(sound=None)\n
Unpauses the currently selected sound.
Parameters Parameter Default Descriptionsound
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 DescriptionOptional[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
.
sound
Optional[CodecBase]
None
The image of the code\u0441 in which the sound is wrapped. Defaults to None.
Returns Name Type Descriptionstr
str
String for self.music_selected_label
.
get_sound_tstatus(sound)\n
Getting the audio status in text format in the language selected by the user.
Parameters Parameter Default Descriptionsound
CodecBase
required The image of the code\u0441 in which the sound is wrapped.
Returns Name Type Descriptionstr
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 Descriptiontext
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
.
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 Descriptioncache_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.
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 DescriptionD
D
Returns property
, but as part of convenience, typing has been done that says that the same type that was set is returned.
Converter(*args, **kwargs)\n
A class for converting values entered by the user.
"},{"location":"api/types/#seaplayer.types.Convert.Converter.boolean","title":"booleanstaticmethod
","text":"boolean(value)\n
Converting to bool
.
staticmethod
","text":"filepath(value)\n
Check if there is a file on the path.
Parameters Parameter Default Descriptionvalue
str
required The value entered by the user.
Raises Type DescriptionPathNotExistsError
Called if the path does not point to a non-existent file.
Returns Name Type Descriptionstr
str
The path to the file.
"},{"location":"api/types/#seaplayer.types.Convert.Converter.optional","title":"optionalstaticmethod
","text":"optional(tp)\n
This is a type or function decorator for converting a value.
"},{"location":"api/types/#seaplayer.types.Convert.Converter.path","title":"pathstaticmethod
","text":"path(value)\n
Checking the existence of a path
.
value
str
required The value entered by the user.
Raises Type DescriptionPathNotExistsError
Called if the path does not point to a non-existent file or directory.
Returns Name Type Descriptionstr
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
.
seaplayer
via 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 OSC:\\Program Files\\FluidSynth
Settings
> System
> About the system
> Additional system parameters
> Environment variables
> [Double click on Path]
> Create
> [Enter the full path to the folder with FluidSynth]
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":"viaseaplug
via 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.
ConsoleOutputseaplug load [--overwrite/-o] ./plugins/ExamplePlugin\n
Plugin loaded!\n
"},{"location":"plugin-cli-home/#unload","title":"Unload","text":"The command to unload plugins.
ConsoleOutputseaplug unload seaplayer.plugins.example \n
Plugin unloaded!\n
"},{"location":"plugin-cli-home/#list","title":"List","text":"List of all loaded plugins.
ConsoleOutputseaplug 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.
ConsoleOutputseaplug 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.
ConsoleOutputseaplug 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.
ConsoleOutputseaplug 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.
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.
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.
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.
__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.
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.
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.
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
.
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
.
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
.
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 Descriptionpath
str
required File path (optional file path).
"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.album","title":"albuminstance-attribute
","text":"album\n
The album title
is taken from the metadata.
instance-attribute
","text":"artist\n
The artist
is taken from the metadata.
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":"channelsinstance-attribute
","text":"channels\n
The number of channels in the file.
"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.codec_name","title":"codec_nameclass-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_priorityclass-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":"durationinstance-attribute
","text":"duration\n
The duration of the sound in seconds.
"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.icon_data","title":"icon_datainstance-attribute
","text":"icon_data\n
A poster
in bytes format is obtained from metadata.
instance-attribute
","text":"name\n
File path (optional file path).
"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.paused","title":"pausedinstance-attribute
","text":"paused\n
The playback status (True if paused
).
instance-attribute
","text":"playing\n
The playback status (True if playing
).
instance-attribute
","text":"samplerate\n
The sampling rate in hertz (Hz).
"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.title","title":"titleinstance-attribute
","text":"title\n
The title
of the sound is taken from the metadata.
async
","text":"__aio_sha1__(buffer_size)\n
Calculating the hash of the file.
Parameters Parameter Default Descriptionbuffer_size
int
required The size of the temporary buffer.
Returns Name Type Descriptionstr
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 Descriptionbuffer_size
int
required The size of the temporary buffer.
Returns Name Type Descriptionstr
str
SHA256 in string format.
"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.aio_is_this_codec","title":"aio_is_this_codecasync
staticmethod
","text":"aio_is_this_codec(path)\n
Compatibility check.
Parameters Parameter Default Descriptionpath
str
required File path (optional file path).
Returns Name Type Descriptionbool
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 Descriptionfloat
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 Descriptionfloat
float
Volume percentage (0.01 == 1%).
"},{"location":"api/codecbase/#seaplayer.code\u0441base.CodecBase.is_this_codec","title":"is_this_codecstaticmethod
","text":"is_this_codec(path)\n
Compatibility check.
Parameters Parameter Default Descriptionpath
str
required File path (optional file path).
Returns Name Type Descriptionbool
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 Descriptionvalue
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 Descriptionvalue
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_DATAmodule-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 Descriptionfilepath
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_methodproperty
writable
","text":"image_resample_method\n
The image resampling method.
Returns Type DescriptionLiteral['nearest', 'bilinear', 'bicubic', 'lanczos', 'hamming', 'box']
The image resampling method.
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_quit","title":"key_quitproperty
writable
","text":"key_quit\n
The key to exit the SeaPlayer.
Returns Type Descriptionstr
The key char(s).
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_rewind_back","title":"key_rewind_backproperty
writable
","text":"key_rewind_back\n
The rewind back key.
Returns Type Descriptionstr
The key char(s).
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_rewind_forward","title":"key_rewind_forwardproperty
writable
","text":"key_rewind_forward\n
The rewind forward key.
Returns Type Descriptionstr
The key char(s).
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_volume_down","title":"key_volume_downproperty
writable
","text":"key_volume_down\n
The volume down key.
Returns Type Descriptionstr
The key char(s).
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.key_volume_up","title":"key_volume_upproperty
writable
","text":"key_volume_up\n
The volume up key.
Returns Type Descriptionstr
The key char(s).
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.lang","title":"langproperty
writable
","text":"lang\n
The current language.
Returns Type DescriptionUnion[Literal['en-eng'], str]
The file name without an extension.
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.log_menu_enable","title":"log_menu_enableproperty
writable
","text":"log_menu_enable\n
Enabling and disabling logging.
Returns Type Descriptionbool
On or off.
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.max_volume_percent","title":"max_volume_percentproperty
writable
","text":"max_volume_percent\n
Maximum volume value.
Returns Type Descriptionfloat
Value 0.01 == 1%.
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.output_sound_device_id","title":"output_sound_device_idproperty
writable
","text":"output_sound_device_id\n
ID of the audio output device.
Returns Type DescriptionOptional[int]
The device ID.
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.recursive_search","title":"recursive_searchproperty
writable
","text":"recursive_search\n
Recursive file search.
Returns Type Descriptionbool
On or off.
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.rewind_count_seconds","title":"rewind_count_secondsproperty
writable
","text":"rewind_count_seconds\n
The value of the seconds by which the current sound will be rewound.
Returns Type Descriptionint
Rewind in seconds.
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.sound_font_path","title":"sound_font_pathproperty
writable
","text":"sound_font_path\n
The path to the file with the audio font.
Returns Type DescriptionOptional[str]
The full path to the file.
"},{"location":"api/config/#seaplayer.config.SeaPlayerConfig.volume_change_percent","title":"volume_change_percentproperty
writable
","text":"volume_change_percent\n
Percentage by which the volume changes when the special keys are pressed.
Returns Type Descriptionfloat
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 DescriptionOptional[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
.
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 Descriptionlanguage_filepath
str
required The path to the file with the translation.
Raises Type DescriptionFileNotFoundError
It is called if the file with the translation does not exist.
"},{"location":"api/languages/#seaplayer.languages.Language.author","title":"authorproperty
","text":"author\n
The author of the translation taken from the translation file.
Returns Type Descriptionstr
The author's nickname.
"},{"location":"api/languages/#seaplayer.languages.Language.author_url","title":"author_urlproperty
","text":"author_url\n
The link to the author of the translation is taken from the translation file.
Returns Type DescriptionOptional[str]
Link to the author.
"},{"location":"api/languages/#seaplayer.languages.Language.loaded","title":"loadedproperty
","text":"loaded\n
If True
, then the file with the translation is fully loaded in memory.
bool
If loaded, then True
.
property
","text":"mark\n
The name of the file without an extension.
Returns Type Descriptionstr
The name of the file without the extension.
"},{"location":"api/languages/#seaplayer.languages.Language.name","title":"nameproperty
","text":"name\n
The path to the file with the translation.
Returns Type Descriptionstr
The full path to the file.
"},{"location":"api/languages/#seaplayer.languages.Language.title","title":"titleproperty
","text":"title\n
The name of the translation language taken from the file.
Returns Type Descriptionstr
The purpose of the language.
"},{"location":"api/languages/#seaplayer.languages.Language.words","title":"wordsproperty
","text":"words\n
Special values that you need to have even if the language is not loaded.
Returns Type DescriptionDict[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 Descriptionkey
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 DescriptionLanguageNotLoadedError
It is called if the translation file is not fully loaded into memory.
Returns Type DescriptionOptional[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 Descriptionlangs_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 DescriptionFileNotFoundError
Called if the file with the default translation without the extension could not be found.
"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.alangs","title":"alangsproperty
","text":"alangs\n
Additional languages, for example, translation of plugins.
Returns Type DescriptionA list with an additional translation.
"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.default_lang","title":"default_langproperty
","text":"default_lang\n
An image of the Language
class reflecting the uploaded file with the default translation.
Language
The translation.
"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.default_lang_mark","title":"default_lang_markproperty
","text":"default_lang_mark\n
The name of the file with the default translation without an extension.
Returns Type Descriptionstr
The file name without an extension.
"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.langs","title":"langsproperty
","text":"langs\n
A list with images of the Language
class, reflecting the files found in the folder with the translation files.
List[Language]
A list with translations.
"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.main_lang","title":"main_langproperty
","text":"main_lang\n
An image of the Language
class reflecting the uploaded file with the main translation.
Optional[Language]
The translation or None
.
property
","text":"main_lang_mark\n
The name of the file with the main translation without the extension.
Returns Type Descriptionstr
The file name without an extension.
"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.name","title":"nameproperty
","text":"name\n
The path to the folder with the translation files.
Returns Type Descriptionstr
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
.
key
str
required The key to the variable with the translation, which is registered in the file with the translation.
Returns Name Type Descriptionstr
str
The translated string.
"},{"location":"api/languages/#seaplayer.languages.LanguageLoader.merge","title":"merge","text":"merge(ll)\n
Adding additional languages (self.alangs
).
ll
LanguageLoader
required The image of the LanguageLoader
class.
PluginBase(app, pl, info)\n
The base class of the plugin.
Parameters Parameter Default Descriptionapp
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
.
instance-attribute
","text":"app = app\n
A link to the image of the SeaPlayer
class.
instance-attribute
","text":"info = info\n
Contains all variables from info.json
.
instance-attribute
","text":"pl = pl\n
A link to the image of the PluginLoader
class.
__init_repr__()\n
The string that is output to the logs after initialization of the class.
Returns Name Type Descriptionstr
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
.
name
str
required The name by which it will be accessed by SeaPlayer.
screen
Screen
required The image of the Screen
class.
on_bindings()\n
A generator for binding information classes about keys.
Yields:
Type DescriptionBinding
Generator[Binding, Any, None]: A class with information about key bindings.
"},{"location":"api/pluginbase/#seaplayer.plug.pluginbase.PluginBase.on_compose","title":"on_composeasync
","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_quitasync
","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_readyasync
","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.
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_pluginsinstance-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_pluginsinstance-attribute
","text":"on_plugins = []\n
A list with initialized plugin classes.
"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoader.plugins_config_path","title":"plugins_config_pathinstance-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_dirpathinstance-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":"filepathinstance-attribute
","text":"filepath = Path(path)\n
The path to the plugin configuration file.
"},{"location":"api/pluginloader/#seaplayer.plug.pluginloader.PluginLoaderConfigManager.dump","title":"dumpstaticmethod
","text":"dump(path, data)\n
Overwriting configurations.
Parameters Parameter Default Descriptionpath
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":"loadstaticmethod
","text":"load(path, default_data)\n
Loading configurations.
Parameters Parameter Default Descriptionpath
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 DescriptionPluginLoaderConfigModel
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
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_KWARGSclass-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)
).
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":"configclass-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_volumeclass-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":"llclass-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.
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_quitasync
","text":"action_quit()\n
The function called by our when the SeaPlayer stops working.
"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.aio_callnofy","title":"aio_callnofyasync
","text":"aio_callnofy(text, dosk='top')\n
Creating a notification.
Parameters Parameter Default Descriptiontext
str
required The text of the notification.
dosk
Literal[bottom, left, right, top]
'top'
Regarding the screen. Defaults to \"top\".
Returns Name Type DescriptionCallNofy
CallNofy
To delete the notification image, use the CallNofy.remove()
method.
async
","text":"aio_gcs()\n
Getting the currently selected sound.
Returns Type DescriptionOptional[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_textasync
","text":"aio_get_sound_selected_label_text(sound=None)\n
Generating a string for self.music_selected_label
.
sound
Optional[CodecBase]
None
The image of the code\u0441 in which the sound is wrapped. Defaults to None.
Returns Name Type Descriptionstr
str
String for self.music_selected_label
.
async
","text":"aio_nofy(text, life_time=3, dosk='top')\n
Creating a temporary notification.
Parameters Parameter Default Descriptiontext
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_labelasync
","text":"aio_update_select_label(sound=None)\n
Updating the string in self.music_selected_label
.
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 Descriptiontext
str
required The text of the notification.
dosk
Literal[bottom, left, right, top]
'top'
Regarding the screen. Defaults to \"top\".
Returns Name Type DescriptionCallNofy
CallNofy
To delete the notification image, use the CallNofy.remove()
method.
async
","text":"currect_sound_pause(sound=None)\n
Pauses the currently selected sound.
Parameters Parameter Default Descriptionsound
Optional[CodecBase]
None
\u0421urrently selected sound. Defaults to None.
"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.currect_sound_play","title":"currect_sound_playasync
","text":"currect_sound_play(sound=None)\n
Plays playback of the currently selected sound.
Parameters Parameter Default Descriptionsound
Optional[CodecBase]
None
\u0421urrently selected sound. Defaults to None.
"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.currect_sound_stop","title":"currect_sound_stopasync
","text":"currect_sound_stop(sound=None)\n
Stops playback of the currently selected sound.
Parameters Parameter Default Descriptionsound
Optional[CodecBase]
None
\u0421urrently selected sound. Defaults to None.
"},{"location":"api/seaplayer/#seaplayer.seaplayer.SeaPlayer.currect_sound_unpause","title":"currect_sound_unpauseasync
","text":"currect_sound_unpause(sound=None)\n
Unpauses the currently selected sound.
Parameters Parameter Default Descriptionsound
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 DescriptionOptional[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
.
sound
Optional[CodecBase]
None
The image of the code\u0441 in which the sound is wrapped. Defaults to None.
Returns Name Type Descriptionstr
str
String for self.music_selected_label
.
get_sound_tstatus(sound)\n
Getting the audio status in text format in the language selected by the user.
Parameters Parameter Default Descriptionsound
CodecBase
required The image of the code\u0441 in which the sound is wrapped.
Returns Name Type Descriptionstr
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 Descriptiontext
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
.
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 Descriptioncache_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.
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 DescriptionD
D
Returns property
, but as part of convenience, typing has been done that says that the same type that was set is returned.
Converter(*args, **kwargs)\n
A class for converting values entered by the user.
"},{"location":"api/types/#seaplayer.types.Convert.Converter.boolean","title":"booleanstaticmethod
","text":"boolean(value)\n
Converting to bool
.
staticmethod
","text":"filepath(value)\n
Check if there is a file on the path.
Parameters Parameter Default Descriptionvalue
str
required The value entered by the user.
Raises Type DescriptionPathNotExistsError
Called if the path does not point to a non-existent file.
Returns Name Type Descriptionstr
str
The path to the file.
"},{"location":"api/types/#seaplayer.types.Convert.Converter.optional","title":"optionalstaticmethod
","text":"optional(tp)\n
This is a type or function decorator for converting a value.
"},{"location":"api/types/#seaplayer.types.Convert.Converter.path","title":"pathstaticmethod
","text":"path(value)\n
Checking the existence of a path
.
value
str
required The value entered by the user.
Raises Type DescriptionPathNotExistsError
Called if the path does not point to a non-existent file or directory.
Returns Name Type Descriptionstr
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/