simple-carla 1.4.0__tar.gz → 1.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {simple_carla-1.4.0 → simple_carla-1.5.0}/PKG-INFO +1 -1
- {simple_carla-1.4.0 → simple_carla-1.5.0}/pyproject.toml +1 -1
- {simple_carla-1.4.0 → simple_carla-1.5.0}/simple_carla/__init__.py +78 -45
- {simple_carla-1.4.0 → simple_carla-1.5.0}/simple_carla/plugin_dialog.py +1 -0
- {simple_carla-1.4.0 → simple_carla-1.5.0}/.gitignore +0 -0
- {simple_carla-1.4.0 → simple_carla-1.5.0}/LICENSE +0 -0
- {simple_carla-1.4.0 → simple_carla-1.5.0}/README.md +0 -0
- {simple_carla-1.4.0 → simple_carla-1.5.0}/simple_carla/qt.py +0 -0
- {simple_carla-1.4.0 → simple_carla-1.5.0}/simple_carla/scripts/__init__.py +0 -0
- {simple_carla-1.4.0 → simple_carla-1.5.0}/simple_carla/scripts/sc_plugin_def.py +0 -0
- {simple_carla-1.4.0 → simple_carla-1.5.0}/tests/carla.py +0 -0
- {simple_carla-1.4.0 → simple_carla-1.5.0}/tests/qt_carla.py +0 -0
@@ -18,7 +18,7 @@ build-backend = "flit_core.buildapi"
|
|
18
18
|
sc-plugin-def = "simple_carla.scripts.sc_plugin_def:main"
|
19
19
|
|
20
20
|
[bumpver]
|
21
|
-
current_version = "1.
|
21
|
+
current_version = "1.5.0"
|
22
22
|
version_pattern = "MAJOR.MINOR.PATCH"
|
23
23
|
commit_message = "Bump version {old_version} -> {new_version}"
|
24
24
|
commit = true
|
@@ -233,10 +233,8 @@ from carla_backend import (
|
|
233
233
|
FILE_CALLBACK_SAVE
|
234
234
|
)
|
235
235
|
|
236
|
-
from resources_rc import qCleanupResources
|
237
236
|
|
238
|
-
|
239
|
-
__version__ = "1.4.0"
|
237
|
+
__version__ = "1.5.0"
|
240
238
|
|
241
239
|
|
242
240
|
# -------------------------------------------------------------------
|
@@ -285,8 +283,9 @@ class _SimpleCarla(CarlaHostDLL):
|
|
285
283
|
idle_interval = 1 / 50
|
286
284
|
instance = None
|
287
285
|
client_name = None
|
288
|
-
|
289
|
-
|
286
|
+
_autoload_plugin = None
|
287
|
+
_autoload_filename = None
|
288
|
+
_cptr_filename = None # Pointer which is held onto so as not to get segfaults
|
290
289
|
|
291
290
|
# -------------------------------------------------------------------
|
292
291
|
# Singleton instantiation
|
@@ -296,14 +295,6 @@ class _SimpleCarla(CarlaHostDLL):
|
|
296
295
|
cls.instance = Carla.instance = super().__new__(cls)
|
297
296
|
return cls.instance
|
298
297
|
|
299
|
-
@classmethod
|
300
|
-
def delete(cls):
|
301
|
-
"""
|
302
|
-
Close the engine and delete the current instance to avoid hanging when exiting.
|
303
|
-
"""
|
304
|
-
cls.instance.engine_close()
|
305
|
-
cls.instance = Carla.instance = None
|
306
|
-
|
307
298
|
def __init__(self, client_name):
|
308
299
|
"""
|
309
300
|
client_name is the name which appears in JACK audio connection kit.
|
@@ -324,6 +315,8 @@ class _SimpleCarla(CarlaHostDLL):
|
|
324
315
|
self.lib.carla_set_engine_callback(self.handle, self._engine_callback, None)
|
325
316
|
self._file_callback = FileCallbackFunc(self.file_callback)
|
326
317
|
self.lib.carla_set_file_callback(self.handle, self._file_callback, None)
|
318
|
+
self._open_file_callback = None
|
319
|
+
self._save_file_callback = None
|
327
320
|
|
328
321
|
self.audioDriverForced = "JACK"
|
329
322
|
self.forceStereo = False
|
@@ -356,6 +349,14 @@ class _SimpleCarla(CarlaHostDLL):
|
|
356
349
|
self.set_engine_option(ENGINE_OPTION_DEBUG_CONSOLE_OUTPUT, self.showLogs, "")
|
357
350
|
self.set_engine_option(ENGINE_OPTION_CLIENT_NAME_PREFIX, 0, self.client_name)
|
358
351
|
|
352
|
+
@classmethod
|
353
|
+
def delete(cls):
|
354
|
+
"""
|
355
|
+
Close the engine and delete the current instance to avoid hanging when exiting.
|
356
|
+
"""
|
357
|
+
cls.instance.engine_close()
|
358
|
+
cls.instance = Carla.instance = None
|
359
|
+
|
359
360
|
# -------------------------------------------------------------------
|
360
361
|
# Engine control / idle loop
|
361
362
|
|
@@ -372,13 +373,6 @@ class _SimpleCarla(CarlaHostDLL):
|
|
372
373
|
return True
|
373
374
|
return False
|
374
375
|
|
375
|
-
def set_ui_parent(self, window):
|
376
|
-
"""
|
377
|
-
Set the parent window of dialogs opened by the Carla engine.
|
378
|
-
Not needed if the file open dialog will not be needed.
|
379
|
-
"""
|
380
|
-
self._file_callback_parent = window
|
381
|
-
|
382
376
|
def engine_idle(self):
|
383
377
|
"""
|
384
378
|
Overrides CarlaHostDLL engine_idle() function, as this is handled internally.
|
@@ -1720,34 +1714,74 @@ class _SimpleCarla(CarlaHostDLL):
|
|
1720
1714
|
liquidsfz does not have an input file parameter, but instead, requests the host to display an open file dialog from which the user may select an SFZ file to load. This function triggers the plugin's host gui display which will call __file_callback(). When there is a plugin to autoload on deck, __file_callback() will return the "autoload_filename" property of the plugin, instead of showing the file open dialog and returning the result.
|
1721
1715
|
|
1722
1716
|
"""
|
1723
|
-
if self.
|
1724
|
-
raise Exception("Cannot set autoload plugin as it is already used by " + self.
|
1725
|
-
self.
|
1726
|
-
self.
|
1717
|
+
if self._autoload_plugin is not None:
|
1718
|
+
raise Exception("Cannot set autoload plugin as it is already used by " + self._autoload_plugin)
|
1719
|
+
self._autoload_plugin = plugin
|
1720
|
+
self._autoload_filename = filename
|
1727
1721
|
#logging.debug('Autoloading "%s"', filename)
|
1728
1722
|
self.show_custom_ui(plugin.plugin_id, True)
|
1729
|
-
self.
|
1730
|
-
self.
|
1723
|
+
self._autoload_plugin = None
|
1724
|
+
self._autoload_filename = None
|
1731
1725
|
if callable(callback):
|
1732
1726
|
callback()
|
1733
1727
|
|
1734
|
-
def
|
1735
|
-
|
1736
|
-
|
1737
|
-
|
1738
|
-
|
1728
|
+
def set_open_file_callback(self, callback):
|
1729
|
+
"""
|
1730
|
+
Set the callback function that Carla will call when it needs a file name.
|
1731
|
+
|
1732
|
+
The callback must have this signature:
|
1733
|
+
|
1734
|
+
def funct(self, caption: str, filter: str)
|
1735
|
+
|
1736
|
+
A typical implementation in Qt might be:
|
1737
|
+
|
1738
|
+
carla.set_open_file_callback(self.open_file_dialog)
|
1739
|
+
|
1740
|
+
def open_file_dialog(self, caption, filter):
|
1741
|
+
filename, ok = QFileDialog.getOpenFileName(self, caption, "", filter)
|
1742
|
+
return filename if ok else None
|
1743
|
+
|
1744
|
+
"""
|
1745
|
+
self._open_file_callback = callback
|
1746
|
+
|
1747
|
+
def set_save_file_callback(self, callback):
|
1748
|
+
"""
|
1749
|
+
Set the callback function that Carla will call when it needs a file name.
|
1750
|
+
|
1751
|
+
The callback must have this signature:
|
1752
|
+
|
1753
|
+
def funct(self, caption: str, filter: str, dirs_only: bool)
|
1754
|
+
|
1755
|
+
A typical implementation in Qt might be:
|
1756
|
+
|
1757
|
+
carla.set_save_file_callback(self.save_file_dialog)
|
1758
|
+
|
1759
|
+
def save_file_dialog(self, caption, filter):
|
1760
|
+
filename, ok = QFileDialog.getOpenFileName(self, caption, "", filter)
|
1761
|
+
return filename if ok else None
|
1762
|
+
|
1763
|
+
"""
|
1764
|
+
self._save_file_callback = callback
|
1765
|
+
|
1766
|
+
def file_callback(self, ptr, action, dirs_only, caption, filter):
|
1767
|
+
if self._autoload_plugin is None:
|
1768
|
+
caption = charPtrToString(caption)
|
1739
1769
|
filter = charPtrToString(filter)
|
1740
1770
|
if action == FILE_CALLBACK_OPEN:
|
1741
|
-
|
1771
|
+
if self._open_file_callback is None:
|
1772
|
+
raise RuntimeError('Carla wants to open a file, but no callback function is defined')
|
1773
|
+
str_filename = self._open_file_callback(caption, filter)
|
1742
1774
|
elif action == FILE_CALLBACK_SAVE:
|
1743
|
-
|
1775
|
+
if self._save_file_callback is None:
|
1776
|
+
raise RuntimeError('Carla wants to open a file, but no callback function is defined')
|
1777
|
+
str_filename = self._save_file_callback(caption, filter)
|
1744
1778
|
else:
|
1745
1779
|
return None
|
1746
1780
|
else:
|
1747
|
-
|
1748
|
-
if
|
1749
|
-
|
1750
|
-
retval = cast(byref(
|
1781
|
+
str_filename = self._autoload_filename
|
1782
|
+
if str_filename:
|
1783
|
+
self._cptr_filename = c_char_p(str_filename.encode("utf-8"))
|
1784
|
+
retval = cast(byref(self._cptr_filename), POINTER(c_uintptr))
|
1751
1785
|
return retval.contents.value
|
1752
1786
|
return None
|
1753
1787
|
|
@@ -2663,7 +2697,6 @@ class Plugin(PatchbayClient):
|
|
2663
2697
|
"""
|
2664
2698
|
|
2665
2699
|
plugin_def = None
|
2666
|
-
has_user_interface = False
|
2667
2700
|
|
2668
2701
|
_cb_ready = None
|
2669
2702
|
_cb_removed = None
|
@@ -2737,6 +2770,13 @@ class Plugin(PatchbayClient):
|
|
2737
2770
|
|
2738
2771
|
carla = Carla.instance
|
2739
2772
|
|
2773
|
+
counts = carla.get_audio_port_count_info(self.plugin_id)
|
2774
|
+
self._audio_in_count = counts['ins']
|
2775
|
+
self._audio_out_count = counts['outs']
|
2776
|
+
counts = carla.get_midi_port_count_info(self.plugin_id)
|
2777
|
+
self._midi_in_count = counts['ins']
|
2778
|
+
self._midi_out_count = counts['outs']
|
2779
|
+
|
2740
2780
|
# basic info
|
2741
2781
|
# 'type', 'category', 'hints', 'optionsAvailable', 'optionsEnabled', 'filename', 'name', 'label', 'maker', 'copyright', 'iconName', 'uniqueId'
|
2742
2782
|
info = carla.get_plugin_info(self.plugin_id)
|
@@ -2785,13 +2825,6 @@ class Plugin(PatchbayClient):
|
|
2785
2825
|
with StreamToLogger() as slog:
|
2786
2826
|
print(carla.get_chunk_data(self.plugin_id), file = slog)
|
2787
2827
|
|
2788
|
-
counts = carla.get_audio_port_count_info(self.plugin_id)
|
2789
|
-
self._audio_in_count = counts['ins']
|
2790
|
-
self._audio_out_count = counts['outs']
|
2791
|
-
counts = carla.get_midi_port_count_info(self.plugin_id)
|
2792
|
-
self._midi_in_count = counts['ins']
|
2793
|
-
self._midi_out_count = counts['outs']
|
2794
|
-
|
2795
2828
|
# Parameters
|
2796
2829
|
for parameter_id in range(carla.get_parameter_count(self.plugin_id)):
|
2797
2830
|
param = Parameter(self.plugin_id, parameter_id)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|