simple-carla 2.1.0__tar.gz → 2.1.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: simple_carla
3
- Version: 2.1.0
3
+ Version: 2.1.2
4
4
  Summary: An easy-to-use, object-oriented interface to the carla plugin host.
5
5
  Author-email: Leon Dionne <ldionne@dridesign.sh.cn>
6
6
  Description-Content-Type: text/markdown
@@ -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.0"
21
+ current_version = "2.1.2"
22
22
  version_pattern = "MAJOR.MINOR.PATCH"
23
23
  commit_message = "Bump version {old_version} -> {new_version}"
24
24
  commit = true
@@ -154,15 +154,21 @@ from carla_backend import (
154
154
  ENGINE_PROCESS_MODE_PATCHBAY,
155
155
 
156
156
  # Plugin types:
157
- PLUGIN_DSSI,
158
- PLUGIN_JACK,
157
+ PLUGIN_NONE,
158
+ PLUGIN_INTERNAL,
159
159
  PLUGIN_LADSPA,
160
+ PLUGIN_DSSI,
160
161
  PLUGIN_LV2,
161
- PLUGIN_NONE,
162
- PLUGIN_SF2,
163
- PLUGIN_SFZ,
164
162
  PLUGIN_VST2,
165
163
  PLUGIN_VST3,
164
+ PLUGIN_AU,
165
+ PLUGIN_DLS,
166
+ PLUGIN_GIG,
167
+ PLUGIN_SF2,
168
+ PLUGIN_SFZ,
169
+ PLUGIN_JACK,
170
+ PLUGIN_JSFX,
171
+ PLUGIN_CLAP,
166
172
 
167
173
  # Plugin options:
168
174
  PLUGIN_OPTION_FIXED_BUFFERS,
@@ -234,7 +240,7 @@ from carla_backend import (
234
240
  )
235
241
 
236
242
 
237
- __version__ = "2.1.0"
243
+ __version__ = "2.1.2"
238
244
 
239
245
 
240
246
  # -------------------------------------------------------------------
@@ -3,10 +3,7 @@
3
3
  # Copyright 2024 liyang <liyang@veronica>
4
4
  #
5
5
  import logging
6
- from time import sleep
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(QMainWindow):
14
+ class TestApp(QObject):
18
15
 
19
- def __init__(self):
20
- super().__init__()
21
- self.ready = False
22
- carla = CarlaQt(APPLICATION_NAME)
23
- carla.sig_engine_started.connect(self.carla_started)
24
- carla.sig_engine_stopped.connect(self.carla_stopped)
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
- audioError = carla.get_last_error()
27
- if audioError:
28
- raise Exception("Could not connect to JACK; possible reasons:\n%s" % audioError)
29
- raise Exception('Could not connect to JACK')
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 carla_started(self, plugin_count, process_mode, transport_mode, buffer_size, sample_rate, driver_name):
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 carla_stopped(self):
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.close()
51
+ self.finish()
53
52
 
54
- def closeEvent(self, event):
55
- logging.debug('Closing');
53
+ def finish(self):
56
54
  CarlaQt.instance.delete()
57
- event.accept()
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 = QApplication([])
90
- main_window = TestApp()
91
- main_window.show()
92
- logging.debug('Done')
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