Skip to content

Commit

Permalink
cleanup: minor midi.py changes for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
EmoonX committed Jan 18, 2025
1 parent 6189003 commit 256b6fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ repos:
hooks:
- id: mypy
args: ["--pretty"]
additional_dependencies: ["pygobject-stubs", "types-PyYAML", "types-Markdown", "types-requests", "types-pycurl", "types-chardet", "pytest-stub", "types-orjson", "pathvalidate", "requirements-parser", "icoextract", "fvs", "patool", "git+https://gitlab.com/TheEvilSkeleton/vkbasalt-cli.git@main"]
additional_dependencies: ["pygobject-stubs", "types-PyYAML", "types-Markdown", "types-requests", "types-pycurl", "types-chardet", "pytest-stub", "types-orjson", "pathvalidate", "requirements-parser", "icoextract", "fvs", "patool", "pyfluidsynth", "git+https://gitlab.com/TheEvilSkeleton/vkbasalt-cli.git@main"]
8 changes: 5 additions & 3 deletions bottles/backend/utils/midi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from typing import Self

from ctypes import c_void_p
from fluidsynth import cfunc, Synth # type: ignore[import-not-found]
from fluidsynth import cfunc, Synth # type: ignore [import-untyped]

from bottles.backend.logger import Logger
from bottles.backend.models.config import BottleConfig
Expand All @@ -11,11 +13,11 @@
class FluidSynth:
"""Manages a FluidSynth instance bounded to an unique SoundFont (.sf2, .sf3) file."""

__active_instances: dict[int, "FluidSynth"] = {}
__active_instances: dict[int, Self] = {}
"""Active FluidSynth instances (i.e currently in use by one or more programs)."""

@classmethod
def find_or_create(cls, soundfont_path: str) -> "FluidSynth":
def find_or_create(cls, soundfont_path: str) -> Self:
"""
Search for running FluidSynth instance and return it.
If nonexistent, create and add it to active ones beforehand.
Expand Down

0 comments on commit 256b6fb

Please sign in to comment.