Provides MainWindow of the kitstarter application.
Project description
qt_liquid_pool
Manages port connections for instances of LiquidSFZ using JackConnectionManager.
Purpose
This library:
-
Instantiates any number of instances of LiquidSFZ from the "liquiphy" package.
-
Creates a connection to the JACK audio connection kit and monitors changes in clients and ports for the purpose of managing the ports created by the above-mentioned LiquidSFZ instances.
-
Optionally fills and updates two instances of QComboBox, which may be used in your project for allowing a user to select input and output devices to connect to the LiquidSFZ instance(s).
I found myself using the same blocks of code in several projects, and decided to break these out into a new project which could be generally reused.
Installation
Install from the pypi repository:
$ pip install qt_liquid_pool
Usage:
Import
from qt_liquid_pool import LiquidPool
Extending for custom features
You can write your own class which inherits from LiquidPool in order to provide additional features.
Additional devices
The following class connects and disconnects a soundfile player alongside the built-in instances of LiquidSFZ:
class Audio(LiquidPool):
def __init__(self):
super().__init__()
self.audio_player = None
def slot_jack_ready(self, state):
if state:
self.audio_player = JackAudioPlayer(AUDIO_PLAYER_CLIENT)
def disconnect_audio_sinks(self, ports):
super().disconnect_audio_sinks(ports)
for src, tgt in zip(self.audio_player.output_ports, ports):
self.conn_man.disconnect(src, tgt)
def connect_audio_sinks(self, ports):
super().connect_audio_sinks(ports)
for src, tgt in zip(self.audio_player.output_ports, ports):
self.conn_man.connect(src, tgt)
def play_soundfile(self, soundfile):
soundfile.seek(0)
self.audio_player.play_python_soundfile(soundfile)
def stop_playing(self):
self.audio_player.stop()
Saved preferred connections
There is no persistent storage mechanism built in which can save and restore your preferred midi input and audio output devices. The following example shows you you can save and restore these values to a QSettings settings object:
class Audio(LiquidPool):
def __init__(self):
super().__init__()
self.settings = QSettings('developer', 'app')
def get_preferred_midi_source(self):
return settings.value('MIDISource')
def set_preferred_midi_source(self, value):
settings.setValue('MIDISource', value)
super().set_preferred_midi_source(value)
def get_preferred_audio_sink(self):
return settings.value('AudioSink')
def set_preferred_audio_sink(self, value):
settings.setValue('AudioSink', value)
super().set_preferred_audio_sink(value)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qt_liquid_pool-1.0.0.tar.gz.
File metadata
- Download URL: qt_liquid_pool-1.0.0.tar.gz
- Upload date:
- Size: 17.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82c83a1c85bd5480b83f0ae4c2c1797bf9731eb87bea1f1aeee367fb43334f46
|
|
| MD5 |
bbeb2b155b1306e4616226fe259883d7
|
|
| BLAKE2b-256 |
8228b8ddc4f48b296658297c780d9d2154c75471aadc959ac187e60018f57de7
|
File details
Details for the file qt_liquid_pool-1.0.0-py2.py3-none-any.whl.
File metadata
- Download URL: qt_liquid_pool-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d41bddd6c00fb2f94640c477a9f22166ef35358a3d9072c8f24af7a1ce9712f
|
|
| MD5 |
110c162c675fa2872c2835e09d6f71f5
|
|
| BLAKE2b-256 |
b9f7773f404c7348ba4e64d7b220a2c9769221d811da39048d91888d87140580
|