simple-carla 2.1.1__tar.gz → 2.1.3__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-2.1.1 → simple_carla-2.1.3}/PKG-INFO +1 -1
- {simple_carla-2.1.1 → simple_carla-2.1.3}/pyproject.toml +1 -1
- {simple_carla-2.1.1 → simple_carla-2.1.3}/simple_carla/__init__.py +35 -15
- {simple_carla-2.1.1 → simple_carla-2.1.3}/tests/qt_carla.py +24 -27
- {simple_carla-2.1.1 → simple_carla-2.1.3}/.gitignore +0 -0
- {simple_carla-2.1.1 → simple_carla-2.1.3}/LICENSE +0 -0
- {simple_carla-2.1.1 → simple_carla-2.1.3}/README.md +0 -0
- {simple_carla-2.1.1 → simple_carla-2.1.3}/simple_carla/plugin_dialog.py +0 -0
- {simple_carla-2.1.1 → simple_carla-2.1.3}/simple_carla/qt.py +0 -0
- {simple_carla-2.1.1 → simple_carla-2.1.3}/simple_carla/scripts/__init__.py +0 -0
- {simple_carla-2.1.1 → simple_carla-2.1.3}/simple_carla/scripts/sc_plugin_def.py +0 -0
- {simple_carla-2.1.1 → simple_carla-2.1.3}/tests/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 = "2.1.
|
21
|
+
current_version = "2.1.3"
|
22
22
|
version_pattern = "MAJOR.MINOR.PATCH"
|
23
23
|
commit_message = "Bump version {old_version} -> {new_version}"
|
24
24
|
commit = true
|
@@ -240,7 +240,7 @@ from carla_backend import (
|
|
240
240
|
)
|
241
241
|
|
242
242
|
|
243
|
-
__version__ = "2.1.
|
243
|
+
__version__ = "2.1.3"
|
244
244
|
|
245
245
|
|
246
246
|
# -------------------------------------------------------------------
|
@@ -2913,7 +2913,7 @@ class Plugin(PatchbayClient):
|
|
2913
2913
|
self.parameters[int(key)].value = value
|
2914
2914
|
|
2915
2915
|
# -------------------------------------------------------------------
|
2916
|
-
# Port
|
2916
|
+
# Port counts
|
2917
2917
|
|
2918
2918
|
@property
|
2919
2919
|
def audio_in_count(self):
|
@@ -2943,19 +2943,8 @@ class Plugin(PatchbayClient):
|
|
2943
2943
|
"""
|
2944
2944
|
return self._midi_out_count
|
2945
2945
|
|
2946
|
-
|
2947
|
-
|
2948
|
-
"""
|
2949
|
-
Returns (int)
|
2950
|
-
"""
|
2951
|
-
return len(self.input_parameters())
|
2952
|
-
|
2953
|
-
@property
|
2954
|
-
def output_parameter_count(self):
|
2955
|
-
"""
|
2956
|
-
Returns (int)
|
2957
|
-
"""
|
2958
|
-
return len(self.output_parameters())
|
2946
|
+
# -------------------------------------------------------------------
|
2947
|
+
# Peaks
|
2959
2948
|
|
2960
2949
|
@property
|
2961
2950
|
def peak_mono(self):
|
@@ -2978,6 +2967,23 @@ class Plugin(PatchbayClient):
|
|
2978
2967
|
"""
|
2979
2968
|
return Carla.instance.get_input_peak_value(self.plugin_id, False)
|
2980
2969
|
|
2970
|
+
# -------------------------------------------------------------------
|
2971
|
+
# Parameters
|
2972
|
+
|
2973
|
+
@property
|
2974
|
+
def input_parameter_count(self):
|
2975
|
+
"""
|
2976
|
+
Returns (int)
|
2977
|
+
"""
|
2978
|
+
return len(self.input_parameters())
|
2979
|
+
|
2980
|
+
@property
|
2981
|
+
def output_parameter_count(self):
|
2982
|
+
"""
|
2983
|
+
Returns (int)
|
2984
|
+
"""
|
2985
|
+
return len(self.output_parameters())
|
2986
|
+
|
2981
2987
|
def input_parameters(self):
|
2982
2988
|
"""
|
2983
2989
|
Returns a list of Parameter objects.
|
@@ -2990,6 +2996,20 @@ class Plugin(PatchbayClient):
|
|
2990
2996
|
"""
|
2991
2997
|
return [ param for param in self.parameters.values() if param.is_used and param.is_output ]
|
2992
2998
|
|
2999
|
+
def parameter(self, name):
|
3000
|
+
"""
|
3001
|
+
Returns the parameter with the given (str) "name"
|
3002
|
+
|
3003
|
+
Raises IndexError
|
3004
|
+
"""
|
3005
|
+
for param in self.parameters.values():
|
3006
|
+
if param.name == name:
|
3007
|
+
return param
|
3008
|
+
raise IndexError
|
3009
|
+
|
3010
|
+
# -------------------------------------------------------------------
|
3011
|
+
# Str
|
3012
|
+
|
2993
3013
|
def __str__(self):
|
2994
3014
|
return '<{0} "{1}" (uuid {2}, client_id {3})>'.format(
|
2995
3015
|
type(self).__name__, self.moniker, self.uuid, self.client_id)
|
@@ -3,10 +3,7 @@
|
|
3
3
|
# Copyright 2024 liyang <liyang@veronica>
|
4
4
|
#
|
5
5
|
import logging
|
6
|
-
from
|
7
|
-
from PyQt5.QtCore import pyqtSlot
|
8
|
-
from PyQt5.QtWidgets import QApplication
|
9
|
-
from PyQt5.QtWidgets import QMainWindow
|
6
|
+
from PyQt5.QtCore import Qt, QCoreApplication, QObject, pyqtSignal, pyqtSlot, QTimer
|
10
7
|
from simple_carla import Plugin, PatchbayPort
|
11
8
|
from simple_carla.qt import CarlaQt, QtPlugin
|
12
9
|
|
@@ -14,22 +11,24 @@ from simple_carla.qt import CarlaQt, QtPlugin
|
|
14
11
|
APPLICATION_NAME = 'qt_carla'
|
15
12
|
|
16
13
|
|
17
|
-
class TestApp(
|
14
|
+
class TestApp(QObject):
|
18
15
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
carla = CarlaQt(
|
23
|
-
|
24
|
-
|
16
|
+
sig_finished = pyqtSignal()
|
17
|
+
|
18
|
+
def run(self):
|
19
|
+
carla = CarlaQt('carla')
|
20
|
+
for src, tgt in [
|
21
|
+
(carla.sig_engine_started, self.slot_engine_started),
|
22
|
+
(carla.sig_engine_stopped, self.slot_engine_stopped)
|
23
|
+
]: src.connect(tgt, type = Qt.QueuedConnection)
|
25
24
|
if not carla.engine_init():
|
26
|
-
|
27
|
-
if
|
28
|
-
raise
|
29
|
-
raise
|
25
|
+
audio_error = carla.get_last_error()
|
26
|
+
if audio_error:
|
27
|
+
raise RuntimeError(f'Could not start carla; possible reasons:\n{audio_error}')
|
28
|
+
raise RuntimeError('Could not start carla')
|
30
29
|
|
31
30
|
@pyqtSlot(int, int, int, int, float, str)
|
32
|
-
def
|
31
|
+
def slot_engine_started(self, *_):
|
33
32
|
logging.debug('======= Engine started ======== ')
|
34
33
|
self.meter = EBUMeter()
|
35
34
|
self.meter.sig_ready.connect(self.meter_ready)
|
@@ -37,7 +36,7 @@ class TestApp(QMainWindow):
|
|
37
36
|
self.meter.add_to_carla()
|
38
37
|
|
39
38
|
@pyqtSlot()
|
40
|
-
def
|
39
|
+
def slot_engine_stopped(self):
|
41
40
|
logging.debug('======= Engine stopped ========')
|
42
41
|
|
43
42
|
@pyqtSlot(Plugin)
|
@@ -49,13 +48,11 @@ class TestApp(QMainWindow):
|
|
49
48
|
@pyqtSlot(PatchbayPort, PatchbayPort, bool)
|
50
49
|
def meter_connect(self, self_port, other_port, state):
|
51
50
|
logging.debug('Received sig_connection_change: %s to %s: %s', self_port, other_port, state)
|
52
|
-
self.
|
51
|
+
self.finish()
|
53
52
|
|
54
|
-
def
|
55
|
-
logging.debug('Closing');
|
53
|
+
def finish(self):
|
56
54
|
CarlaQt.instance.delete()
|
57
|
-
|
58
|
-
|
55
|
+
self.sig_finished.emit()
|
59
56
|
|
60
57
|
|
61
58
|
class EBUMeter(QtPlugin):
|
@@ -86,12 +83,12 @@ if __name__ == "__main__":
|
|
86
83
|
level = logging.DEBUG,
|
87
84
|
format = "[%(filename)24s:%(lineno)-4d] %(message)s"
|
88
85
|
)
|
89
|
-
app =
|
90
|
-
|
91
|
-
|
92
|
-
|
86
|
+
app = QCoreApplication([])
|
87
|
+
tester = TestApp(app)
|
88
|
+
tester.sig_finished.connect(app.quit)
|
89
|
+
QTimer.singleShot(0, tester.run)
|
93
90
|
app.exec()
|
94
|
-
|
91
|
+
logging.debug('Done')
|
95
92
|
|
96
93
|
|
97
94
|
# end simple_carla/tests/qt_carla.py
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|