Browse Source

Major refactoring of the project model.

- Move basic model code into noisicaa.model.
- Change internal property storage to protobufs.
- Commands also use protobufs.
- All serializations uses protobufs.
- Object are managed by a Pool object.
- Object references are stored as object IDs and dereferenced lazily.

Also:
- Everything is pylint clean.
- noisicaa.music and most of noisicaa.ui are now mypy strict.
- Generate mypy stubs for generated protobuf code.
- Cleaned up some obsolete cruft.
- Some improvements to runtests.
looper
Ben Niemann 4 years ago
parent
commit
e60d6a11d0
  1. 14
      3rdparty/typeshed/PyQt5/QtCore.pyi
  2. 40
      3rdparty/typeshed/PyQt5/QtWidgets.pyi
  3. 0
      3rdparty/typeshed/google/__init__.pyi
  4. 1
      3rdparty/typeshed/google/protobuf/__init__.pyi
  5. 161
      3rdparty/typeshed/google/protobuf/descriptor.pyi
  6. 2
      3rdparty/typeshed/google/protobuf/descriptor_pb2.pyi
  7. 18
      3rdparty/typeshed/google/protobuf/descriptor_pool.pyi
  8. 0
      3rdparty/typeshed/google/protobuf/internal/__init__.pyi
  9. 35
      3rdparty/typeshed/google/protobuf/internal/containers.pyi
  10. 30
      3rdparty/typeshed/google/protobuf/internal/decoder.pyi
  11. 34
      3rdparty/typeshed/google/protobuf/internal/encoder.pyi
  12. 11
      3rdparty/typeshed/google/protobuf/internal/enum_type_wrapper.pyi
  13. 5
      3rdparty/typeshed/google/protobuf/internal/message_listener.pyi
  14. 50
      3rdparty/typeshed/google/protobuf/internal/wire_format.pyi
  15. 34
      3rdparty/typeshed/google/protobuf/message.pyi
  16. 13
      3rdparty/typeshed/google/protobuf/message_factory.pyi
  17. 6
      3rdparty/typeshed/google/protobuf/reflection.pyi
  18. 14
      3rdparty/typeshed/google/protobuf/symbol_database.pyi
  19. 2
      CMakeLists.txt
  20. 57
      NOTES.org
  21. 2
      bin/pylintrc
  22. 2
      listdeps
  23. 2
      noisicaa/CMakeLists.txt
  24. 1
      noisicaa/audioproc/CMakeLists.txt
  25. 4
      noisicaa/audioproc/__init__.py
  26. 87
      noisicaa/audioproc/audioproc_client.py
  27. 2
      noisicaa/audioproc/audioproc_client_test.py
  28. 5
      noisicaa/audioproc/audioproc_process.py
  29. 13
      noisicaa/audioproc/engine/graph.py
  30. 3
      noisicaa/audioproc/engine/plugin_host_process_test.py
  31. 6
      noisicaa/audioproc/engine/processor_plugin_test.py
  32. 27
      noisicaa/audioproc/exceptions.py
  33. 17
      noisicaa/audioproc/mutations.py
  34. 2
      noisicaa/audioproc/public/__init__.py
  35. 3
      noisicaa/core/CMakeLists.txt
  36. 12
      noisicaa/core/__init__.py
  37. 16
      noisicaa/core/ipc.py
  38. 2
      noisicaa/core/message.capnp
  39. 4
      noisicaa/core/message.py
  40. 4
      noisicaa/core/message_test.py
  41. 554
      noisicaa/core/model_base.py
  42. 10
      noisicaa/core/process_manager.py
  43. 40
      noisicaa/core/storage.proto
  44. 58
      noisicaa/core/storage.py
  45. 6
      noisicaa/editor_main.py
  46. 21
      noisicaa/importers/__init__.py
  47. 539
      noisicaa/importers/abc.py
  48. 69
      noisicaa/importers/abc_filetest.py
  49. 119
      noisicaa/importers/abc_test.py
  50. 19
      noisicaa/model/CMakeLists.txt
  51. 82
      noisicaa/model/__init__.py
  52. 101
      noisicaa/model/clef.py
  53. 16
      noisicaa/model/key_signature.py
  54. 0
      noisicaa/model/key_signature_test.py
  55. 37
      noisicaa/model/model_base.proto
  56. 983
      noisicaa/model/model_base.py
  57. 62
      noisicaa/model/model_base_test.proto
  58. 1247
      noisicaa/model/model_base_test.py
  59. 15
      noisicaa/model/pitch.py
  60. 0
      noisicaa/model/pitch_test.py
  61. 16
      noisicaa/model/pos2f.py
  62. 269
      noisicaa/model/project.proto
  63. 607
      noisicaa/model/project.py
  64. 16
      noisicaa/model/time_signature.py
  65. 0
      noisicaa/model/time_signature_test.py
  66. 22
      noisicaa/music/CMakeLists.txt
  67. 103
      noisicaa/music/__init__.py
  68. 290
      noisicaa/music/base_track.py
  69. 162
      noisicaa/music/base_track_test.py
  70. 257
      noisicaa/music/beat_track.py
  71. 176
      noisicaa/music/beat_track_test.py
  72. 68
      noisicaa/music/clef.py
  73. 305
      noisicaa/music/commands.proto
  74. 317
      noisicaa/music/commands.py
  75. 183
      noisicaa/music/commands_test.py
  76. 178
      noisicaa/music/control_track.py
  77. 113
      noisicaa/music/control_track_test.py
  78. 24
      noisicaa/music/exceptions.py
  79. 455
      noisicaa/music/model.py
  80. 96
      noisicaa/music/mutations.proto
  81. 329
      noisicaa/music/mutations.py
  82. 436
      noisicaa/music/pipeline_graph.py
  83. 158
      noisicaa/music/pipeline_graph_test.py
  84. 80
      noisicaa/music/player.py
  85. 2
      noisicaa/music/player_integration_test.py
  86. 6
      noisicaa/music/player_test.py
  87. 754
      noisicaa/music/pmodel.py
  88. 603
      noisicaa/music/pmodel_test.py
  89. 778
      noisicaa/music/project.py
  90. 674
      noisicaa/music/project_client.py
  91. 119
      noisicaa/music/project_client_test.py
  92. 73
      noisicaa/music/project_iface.py
  93. 175
      noisicaa/music/project_integration_test.py
  94. 397
      noisicaa/music/project_process.py
  95. 178
      noisicaa/music/project_test.py
  96. 63
      noisicaa/music/property_track.py
  97. 38
      noisicaa/music/property_track_test.py
  98. 195
      noisicaa/music/render.py
  99. 218
      noisicaa/music/sample_track.py
  100. 140
      noisicaa/music/sample_track_test.py
  101. Some files were not shown because too many files have changed in this diff Show More

14
3rdparty/typeshed/PyQt5/QtCore.pyi vendored

@ -32,11 +32,13 @@ class pyqtSignal:
def connect(self, slot: typing.Callable) -> None: ...
def disconnect(self, slot: typing.Optional[typing.Callable] = None) -> None: ...
def emit(self, *args: typing.Any) -> None: ...
def __call__(self, *args: typing.Any) -> None: ...
class pyqtBoundSignal:
def connect(self, slot: typing.Callable) -> None: ...
def disconnect(self, slot: typing.Optional[typing.Callable] = None) -> None: ...
def emit(self, *args: typing.Any) -> None: ...
def __call__(self, *args: typing.Any) -> None: ...
# Convenient type aliases.
PYQT_SIGNAL = typing.Union[pyqtSignal, pyqtBoundSignal]
@ -1348,8 +1350,10 @@ class Qt(sip.simplewrapper):
def __bool__(self) -> int: ...
def __invert__(self) -> 'Qt.KeyboardModifiers': ...
def __int__(self) -> int: ...
def __or__(self, o: Qt.KeyboardModifier) -> 'Qt.KeyboardModifiers': ...
def __ior__(self, o: Qt.KeyboardModifier) -> 'Qt.KeyboardModifiers': ...
def __or__(self, o: typing.Union[int, Qt.KeyboardModifier, Qt.KeyboardModifiers]) -> 'Qt.KeyboardModifiers': ...
def __ior__(self, o: typing.Union[int, Qt.KeyboardModifier, Qt.KeyboardModifiers]) -> 'Qt.KeyboardModifiers': ...
def __and__(self, o: typing.Union[int, Qt.KeyboardModifier, Qt.KeyboardModifiers]) -> 'Qt.KeyboardModifiers': ...
def __iand__(self, o: typing.Union[int, Qt.KeyboardModifier, Qt.KeyboardModifiers]) -> 'Qt.KeyboardModifiers': ...
class MouseButtons(sip.simplewrapper):
@ -5982,6 +5986,8 @@ class QPoint(sip.simplewrapper):
def manhattanLength(self) -> int: ...
def __add__(self, a0: 'QPoint') -> 'QPoint': ...
def __iadd__(self, a0: 'QPoint') -> 'QPoint': ...
def __sub__(self, a0: 'QPoint') -> 'QPoint': ...
def __isub__(self, a0: 'QPoint') -> 'QPoint': ...
class QPointF(sip.simplewrapper):
@ -6007,6 +6013,10 @@ class QPointF(sip.simplewrapper):
def __bool__(self) -> int: ...
def isNull(self) -> bool: ...
def __repr__(self) -> str: ...
def __add__(self, a0: typing.Union['QPointF', 'QPoint']) -> 'QPointF': ...
def __iadd__(self, a0: typing.Union['QPointF', 'QPoint']) -> 'QPointF': ...
def __sub__(self, a0: typing.Union['QPointF', 'QPoint']) -> 'QPointF': ...
def __isub__(self, a0: typing.Union['QPointF', 'QPoint']) -> 'QPointF': ...
class QProcess(QIODevice):

40
3rdparty/typeshed/PyQt5/QtWidgets.pyi vendored

@ -1340,25 +1340,13 @@ class QVBoxLayout(QBoxLayout):
class QButtonGroup(QtCore.QObject):
buttonClicked = ... # type: PYQT_SIGNAL
buttonToggled = ... # type: PYQT_SIGNAL
buttonReleased = ... # type: PYQT_SIGNAL
buttonPressed = ... # type: PYQT_SIGNAL
def __init__(self, parent: typing.Optional[QtCore.QObject] = ...) -> None: ...
@typing.overload
def buttonToggled(self, a0: QAbstractButton, a1: bool) -> None: ...
@typing.overload
def buttonToggled(self, a0: int, a1: bool) -> None: ...
@typing.overload
def buttonReleased(self, a0: QAbstractButton) -> None: ...
@typing.overload
def buttonReleased(self, a0: int) -> None: ...
@typing.overload
def buttonPressed(self, a0: QAbstractButton) -> None: ...
@typing.overload
def buttonPressed(self, a0: int) -> None: ...
@typing.overload
def buttonClicked(self, a0: QAbstractButton) -> None: ...
@typing.overload
def buttonClicked(self, a0: int) -> None: ...
def checkedId(self) -> int: ...
def id(self, button: QAbstractButton) -> int: ...
def setId(self, button: QAbstractButton, id: int) -> None: ...
@ -2862,6 +2850,8 @@ class QDirModel(QtCore.QAbstractItemModel):
class QDockWidget(QWidget):
topLevelChanged = ... # type: PYQT_SIGNAL
featuresChanged = ... # type: PYQT_SIGNAL
class DockWidgetFeature(int): ...
DockWidgetClosable = ... # type: 'QDockWidget.DockWidgetFeature'
@ -2884,6 +2874,8 @@ class QDockWidget(QWidget):
def __bool__(self) -> int: ...
def __invert__(self) -> 'QDockWidget.DockWidgetFeatures': ...
def __int__(self) -> int: ...
def __and__(self, o: typing.Union['QDockWidget.DockWidgetFeatures', 'QDockWidget.DockWidgetFeature']) -> 'QDockWidget.DockWidgetFeatures': ...
def __or__(self, o: typing.Union['QDockWidget.DockWidgetFeatures', 'QDockWidget.DockWidgetFeature']) -> 'QDockWidget.DockWidgetFeatures': ...
@typing.overload
def __init__(self, title: str, parent: typing.Optional[QWidget] = ..., flags: typing.Union[QtCore.Qt.WindowFlags, QtCore.Qt.WindowType] = ...) -> None: ...
@ -2898,8 +2890,6 @@ class QDockWidget(QWidget):
def visibilityChanged(self, visible: bool) -> None: ...
def dockLocationChanged(self, area: QtCore.Qt.DockWidgetArea) -> None: ...
def allowedAreasChanged(self, allowedAreas: typing.Union[QtCore.Qt.DockWidgetAreas, QtCore.Qt.DockWidgetArea]) -> None: ...
def topLevelChanged(self, topLevel: bool) -> None: ...
def featuresChanged(self, features: typing.Union['QDockWidget.DockWidgetFeatures', 'QDockWidget.DockWidgetFeature']) -> None: ...
def titleBarWidget(self) -> QWidget: ...
def setTitleBarWidget(self, widget: QWidget) -> None: ...
def toggleViewAction(self) -> QAction: ...
@ -5124,7 +5114,7 @@ class QGraphicsView(QAbstractScrollArea):
def resizeAnchor(self) -> 'QGraphicsView.ViewportAnchor': ...
def setTransformationAnchor(self, anchor: 'QGraphicsView.ViewportAnchor') -> None: ...
def transformationAnchor(self) -> 'QGraphicsView.ViewportAnchor': ...
def setAlignment(self, alignment: typing.Union[QtCore.Qt.Alignment, QtCore.Qt.AlignmentFlag]) -> None: ...
def setAlignment(self, alignment: typing.Union[int, QtCore.Qt.Alignment, QtCore.Qt.AlignmentFlag]) -> None: ...
def alignment(self) -> QtCore.Qt.Alignment: ...
def setRenderHints(self, hints: typing.Union[QtGui.QPainter.RenderHints, QtGui.QPainter.RenderHint]) -> None: ...
def setRenderHint(self, hint: QtGui.QPainter.RenderHint, on: bool = ...) -> None: ...
@ -5671,6 +5661,9 @@ class QLCDNumber(QFrame):
class QLineEdit(QWidget):
textChanged = ... # type: PYQT_SIGNAL
textEdited = ... # type: PYQT_SIGNAL
editingFinished = ... # type: PYQT_SIGNAL
class ActionPosition(int): ...
LeadingPosition = ... # type: 'QLineEdit.ActionPosition'
@ -5730,11 +5723,8 @@ class QLineEdit(QWidget):
def mousePressEvent(self, a0: QtGui.QMouseEvent) -> None: ...
def initStyleOption(self, option: 'QStyleOptionFrame') -> None: ...
def selectionChanged(self) -> None: ...
def editingFinished(self) -> None: ...
def returnPressed(self) -> None: ...
def cursorPositionChanged(self, a0: int, a1: int) -> None: ...
def textEdited(self, a0: str) -> None: ...
def textChanged(self, a0: str) -> None: ...
def createStandardContextMenu(self) -> 'QMenu': ...
def insert(self, a0: str) -> None: ...
def deselect(self) -> None: ...
@ -7209,10 +7199,6 @@ class QDoubleSpinBox(QAbstractSpinBox):
def __init__(self, parent: typing.Optional[QWidget] = ...) -> None: ...
@typing.overload
def valueChanged(self, a0: float) -> None: ...
@typing.overload
def valueChanged(self, a0: str) -> None: ...
def setValue(self, val: float) -> None: ...
def fixup(self, str: str) -> str: ...
def textFromValue(self, v: float) -> str: ...
@ -8648,6 +8634,7 @@ class QTableWidget(QTableView):
class QTabWidget(QWidget):
currentChanged = ... # type: PYQT_SIGNAL
tabCloseRequested = ... # type: PYQT_SIGNAL
class TabShape(int): ...
Rounded = ... # type: 'QTabWidget.TabShape'
@ -8667,7 +8654,6 @@ class QTabWidget(QWidget):
def tabBarClicked(self, index: int) -> None: ...
def hasHeightForWidth(self) -> bool: ...
def heightForWidth(self, width: int) -> int: ...
def tabCloseRequested(self, index: int) -> None: ...
def setDocumentMode(self, set: bool) -> None: ...
def documentMode(self) -> bool: ...
def setMovable(self, movable: bool) -> None: ...

0
3rdparty/typeshed/google/__init__.pyi vendored

1
3rdparty/typeshed/google/protobuf/__init__.pyi vendored

@ -0,0 +1 @@
__version__ = ... # type: str

161
3rdparty/typeshed/google/protobuf/descriptor.pyi vendored

@ -0,0 +1,161 @@
from typing import Any
from .message import Message
class Error(Exception): ...
class TypeTransformationError(Error): ...
class DescriptorMetaclass(type):
def __instancecheck__(cls, obj): ...
class DescriptorBase:
__metaclass__ = DescriptorMetaclass
has_options = ... # type: Any
def __init__(self, options, options_class_name) -> None: ...
def GetOptions(self): ...
class _NestedDescriptorBase(DescriptorBase):
name = ... # type: Any
full_name = ... # type: Any
file = ... # type: Any
containing_type = ... # type: Any
def __init__(self, options, options_class_name, name, full_name, file, containing_type, serialized_start=..., serialized_end=...) -> None: ...
def GetTopLevelContainingType(self): ...
def CopyToProto(self, proto): ...
class Descriptor(_NestedDescriptorBase):
def __new__(cls, name, full_name, filename, containing_type, fields, nested_types, enum_types, extensions, options=..., is_extendable=..., extension_ranges=..., oneofs=..., file=..., serialized_start=..., serialized_end=..., syntax=...): ...
fields = ... # type: Any
fields_by_number = ... # type: Any
fields_by_name = ... # type: Any
nested_types = ... # type: Any
nested_types_by_name = ... # type: Any
enum_types = ... # type: Any
enum_types_by_name = ... # type: Any
enum_values_by_name = ... # type: Any
extensions = ... # type: Any
extensions_by_name = ... # type: Any
is_extendable = ... # type: Any
extension_ranges = ... # type: Any
oneofs = ... # type: Any
oneofs_by_name = ... # type: Any
syntax = ... # type: Any
def __init__(self, name, full_name, filename, containing_type, fields, nested_types, enum_types, extensions, options=..., is_extendable=..., extension_ranges=..., oneofs=..., file=..., serialized_start=..., serialized_end=..., syntax=...) -> None: ...
def EnumValueName(self, enum, value): ...
def CopyToProto(self, proto): ...
class FieldDescriptor(DescriptorBase):
TYPE_DOUBLE = ... # type: Any
TYPE_FLOAT = ... # type: Any
TYPE_INT64 = ... # type: Any
TYPE_UINT64 = ... # type: Any
TYPE_INT32 = ... # type: Any
TYPE_FIXED64 = ... # type: Any
TYPE_FIXED32 = ... # type: Any
TYPE_BOOL = ... # type: Any
TYPE_STRING = ... # type: Any
TYPE_GROUP = ... # type: Any
TYPE_MESSAGE = ... # type: Any
TYPE_BYTES = ... # type: Any
TYPE_UINT32 = ... # type: Any
TYPE_ENUM = ... # type: Any
TYPE_SFIXED32 = ... # type: Any
TYPE_SFIXED64 = ... # type: Any
TYPE_SINT32 = ... # type: Any
TYPE_SINT64 = ... # type: Any
MAX_TYPE = ... # type: Any
CPPTYPE_INT32 = ... # type: Any
CPPTYPE_INT64 = ... # type: Any
CPPTYPE_UINT32 = ... # type: Any
CPPTYPE_UINT64 = ... # type: Any
CPPTYPE_DOUBLE = ... # type: Any
CPPTYPE_FLOAT = ... # type: Any
CPPTYPE_BOOL = ... # type: Any
CPPTYPE_ENUM = ... # type: Any
CPPTYPE_STRING = ... # type: Any
CPPTYPE_MESSAGE = ... # type: Any
MAX_CPPTYPE = ... # type: Any
LABEL_OPTIONAL = ... # type: Any
LABEL_REQUIRED = ... # type: Any
LABEL_REPEATED = ... # type: Any
MAX_LABEL = ... # type: Any
MAX_FIELD_NUMBER = ... # type: Any
FIRST_RESERVED_FIELD_NUMBER = ... # type: Any
LAST_RESERVED_FIELD_NUMBER = ... # type: Any
def __new__(cls, name, full_name, index, number, type, cpp_type, label, default_value, message_type, enum_type, containing_type, is_extension, extension_scope, options=..., file=..., has_default_value=..., containing_oneof=...): ...
name = ... # type: Any
full_name = ... # type: Any
index = ... # type: Any
number = ... # type: Any
type = ... # type: Any
cpp_type = ... # type: Any
label = ... # type: Any
has_default_value = ... # type: Any
default_value = ... # type: Any
containing_type = ... # type: Any
message_type = ... # type: Any
enum_type = ... # type: Any
is_extension = ... # type: Any
extension_scope = ... # type: Any
containing_oneof = ... # type: Any
def __init__(self, name, full_name, index, number, type, cpp_type, label, default_value, message_type, enum_type, containing_type, is_extension, extension_scope, options=..., file=..., has_default_value=..., containing_oneof=...) -> None: ...
@staticmethod
def ProtoTypeToCppProtoType(proto_type): ...
class EnumDescriptor(_NestedDescriptorBase):
def __new__(cls, name, full_name, filename, values, containing_type=..., options=..., file=..., serialized_start=..., serialized_end=...): ...
values = ... # type: Any
values_by_name = ... # type: Any
values_by_number = ... # type: Any
def __init__(self, name, full_name, filename, values, containing_type=..., options=..., file=..., serialized_start=..., serialized_end=...) -> None: ...
def CopyToProto(self, proto): ...
class EnumValueDescriptor(DescriptorBase):
def __new__(cls, name, index, number, type=..., options=...): ...
name = ... # type: Any
index = ... # type: Any
number = ... # type: Any
type = ... # type: Any
def __init__(self, name, index, number, type=..., options=...) -> None: ...
class OneofDescriptor:
def __new__(cls, name, full_name, index, containing_type, fields): ...
name = ... # type: Any
full_name = ... # type: Any
index = ... # type: Any
containing_type = ... # type: Any
fields = ... # type: Any
def __init__(self, name, full_name, index, containing_type, fields) -> None: ...
class ServiceDescriptor(_NestedDescriptorBase):
index = ... # type: Any
methods = ... # type: Any
def __init__(self, name, full_name, index, methods, options=..., file=..., serialized_start=..., serialized_end=...) -> None: ...
def FindMethodByName(self, name): ...
def CopyToProto(self, proto): ...
class MethodDescriptor(DescriptorBase):
name = ... # type: Any
full_name = ... # type: Any
index = ... # type: Any
containing_service = ... # type: Any
input_type = ... # type: Any
output_type = ... # type: Any
def __init__(self, name, full_name, index, containing_service, input_type, output_type, options=...) -> None: ...
class FileDescriptor(DescriptorBase):
def __new__(cls, name, package, options=..., serialized_pb=..., dependencies=..., syntax=...): ...
_options = ... # type: Any
message_types_by_name = ... # type: Any
name = ... # type: Any
package = ... # type: Any
syntax = ... # type: Any
serialized_pb = ... # type: Any
enum_types_by_name = ... # type: Any
extensions_by_name = ... # type: Any
dependencies = ... # type: Any
def __init__(self, name, package, options=..., serialized_pb=..., dependencies=..., syntax=...) -> None: ...
def CopyToProto(self, proto): ...
def MakeDescriptor(desc_proto, package=..., build_file_if_cpp=..., syntax=...): ...
def _ParseOptions(message: Message, string: str) -> Message: ...

2
3rdparty/typeshed/google/protobuf/descriptor_pb2.pyi vendored

@ -0,0 +1,2 @@
class FileOptions(object): ...
class FieldOptions(object): ...

18
3rdparty/typeshed/google/protobuf/descriptor_pool.pyi vendored

@ -0,0 +1,18 @@
from typing import Any, Optional
class DescriptorPool:
def __new__(cls, descriptor_db: Optional[Any] = ...): ...
def __init__(self, descriptor_db: Optional[Any] = ...) -> None: ...
def Add(self, file_desc_proto): ...
def AddSerializedFile(self, serialized_file_desc_proto): ...
def AddDescriptor(self, desc): ...
def AddEnumDescriptor(self, enum_desc): ...
def AddFileDescriptor(self, file_desc): ...
def FindFileByName(self, file_name): ...
def FindFileContainingSymbol(self, symbol): ...
def FindMessageTypeByName(self, full_name): ...
def FindEnumTypeByName(self, full_name): ...
def FindFieldByName(self, full_name): ...
def FindExtensionByName(self, full_name): ...
def Default(): ...

0
3rdparty/typeshed/google/protobuf/internal/__init__.pyi vendored

35
3rdparty/typeshed/google/protobuf/internal/containers.pyi vendored

@ -0,0 +1,35 @@
from google.protobuf.descriptor import Descriptor
from google.protobuf.internal.message_listener import MessageListener
from google.protobuf.message import Message
from typing import (
MutableSequence, Sequence, TypeVar, Generic, Any, Iterator, Iterable,
Union, Optional, Callable
)
_T = TypeVar('_T')
class BaseContainer(Generic[_T], MutableSequence[_T]):
def __init__(self, message_listener: MessageListener) -> None: ...
def __len__(self) -> int: ...
def __ne__(self, other: object) -> bool: ...
def __hash__(self) -> int: ...
def __repr__(self) -> str: ...
def sort(self, *, key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ...) -> None: ...
class RepeatedScalarFieldContainer(Generic[_T], BaseContainer[_T]):
def __init__(self, message_listener: MessageListener, message_descriptor: Descriptor) -> None: ...
def MergeFrom(self, other: RepeatedScalarFieldContainer[_T]) -> None: ...
class RepeatedCompositeFieldContainer(Generic[_T], BaseContainer[_T]):
def __init__(self, message_listener: MessageListener, type_checker: Any) -> None: ...
def add(self, **kwargs: Any) -> _T: ...
def MergeFrom(self, other: RepeatedCompositeFieldContainer[_T]) -> None: ...
# Classes not yet typed
class Mapping(Any):
pass
class MutableMapping(Mapping):
pass
class ScalarMap(MutableMapping):
pass
class MessageMap(MutableMapping):
pass

30
3rdparty/typeshed/google/protobuf/internal/decoder.pyi vendored

@ -0,0 +1,30 @@
from typing import Any
def ReadTag(buffer, pos): ...
def EnumDecoder(field_number, is_repeated, is_packed, key, new_default): ...
Int32Decoder = ... # type: Any
Int64Decoder = ... # type: Any
UInt32Decoder = ... # type: Any
UInt64Decoder = ... # type: Any
SInt32Decoder = ... # type: Any
SInt64Decoder = ... # type: Any
Fixed32Decoder = ... # type: Any
Fixed64Decoder = ... # type: Any
SFixed32Decoder = ... # type: Any
SFixed64Decoder = ... # type: Any
FloatDecoder = ... # type: Any
DoubleDecoder = ... # type: Any
BoolDecoder = ... # type: Any
def StringDecoder(field_number, is_repeated, is_packed, key, new_default): ...
def BytesDecoder(field_number, is_repeated, is_packed, key, new_default): ...
def GroupDecoder(field_number, is_repeated, is_packed, key, new_default): ...
def MessageDecoder(field_number, is_repeated, is_packed, key, new_default): ...
MESSAGE_SET_ITEM_TAG = ... # type: Any
def MessageSetItemDecoder(extensions_by_number): ...
def MapDecoder(field_descriptor, new_default, is_message_map): ...
SkipField = ... # type: Any

34
3rdparty/typeshed/google/protobuf/internal/encoder.pyi vendored

@ -0,0 +1,34 @@
from typing import Any
Int32Sizer = ... # type: Any
UInt32Sizer = ... # type: Any
SInt32Sizer = ... # type: Any
Fixed32Sizer = ... # type: Any
Fixed64Sizer = ... # type: Any
BoolSizer = ... # type: Any
def StringSizer(field_number, is_repeated, is_packed): ...
def BytesSizer(field_number, is_repeated, is_packed): ...
def GroupSizer(field_number, is_repeated, is_packed): ...
def MessageSizer(field_number, is_repeated, is_packed): ...
def MessageSetItemSizer(field_number): ...
def MapSizer(field_descriptor): ...
def TagBytes(field_number, wire_type): ...
Int32Encoder = ... # type: Any
UInt32Encoder = ... # type: Any
SInt32Encoder = ... # type: Any
Fixed32Encoder = ... # type: Any
Fixed64Encoder = ... # type: Any
SFixed32Encoder = ... # type: Any
SFixed64Encoder = ... # type: Any
FloatEncoder = ... # type: Any
DoubleEncoder = ... # type: Any
def BoolEncoder(field_number, is_repeated, is_packed): ...
def StringEncoder(field_number, is_repeated, is_packed): ...
def BytesEncoder(field_number, is_repeated, is_packed): ...
def GroupEncoder(field_number, is_repeated, is_packed): ...
def MessageEncoder(field_number, is_repeated, is_packed): ...
def MessageSetItemEncoder(field_number): ...
def MapEncoder(field_descriptor): ...

11
3rdparty/typeshed/google/protobuf/internal/enum_type_wrapper.pyi vendored

@ -0,0 +1,11 @@
from typing import Any, List, Tuple
class EnumTypeWrapper(object):
def __init__(self, enum_type: Any) -> None: ...
def Name(self, number: int) -> str: ...
def Value(self, name: str) -> int: ...
def keys(self) -> List[str]: ...
def values(self) -> List[int]: ...
@classmethod
def items(cls) -> List[Tuple[str, int]]: ...

5
3rdparty/typeshed/google/protobuf/internal/message_listener.pyi vendored

@ -0,0 +1,5 @@
class MessageListener(object):
def Modified(self) -> None: ...
class NullMessageListener(MessageListener):
def Modified(self) -> None: ...

50
3rdparty/typeshed/google/protobuf/internal/wire_format.pyi vendored

@ -0,0 +1,50 @@
from typing import Any
TAG_TYPE_BITS = ... # type: Any
TAG_TYPE_MASK = ... # type: Any
WIRETYPE_VARINT = ... # type: Any
WIRETYPE_FIXED64 = ... # type: Any
WIRETYPE_LENGTH_DELIMITED = ... # type: Any
WIRETYPE_START_GROUP = ... # type: Any
WIRETYPE_END_GROUP = ... # type: Any
WIRETYPE_FIXED32 = ... # type: Any
INT32_MAX = ... # type: Any
INT32_MIN = ... # type: Any
UINT32_MAX = ... # type: Any
INT64_MAX = ... # type: Any
INT64_MIN = ... # type: Any
UINT64_MAX = ... # type: Any
FORMAT_UINT32_LITTLE_ENDIAN = ... # type: Any
FORMAT_UINT64_LITTLE_ENDIAN = ... # type: Any
FORMAT_FLOAT_LITTLE_ENDIAN = ... # type: Any
FORMAT_DOUBLE_LITTLE_ENDIAN = ... # type: Any
def PackTag(field_number, wire_type): ...
def UnpackTag(tag): ...
def ZigZagEncode(value): ...
def ZigZagDecode(value): ...
def Int32ByteSize(field_number, int32): ...
def Int32ByteSizeNoTag(int32): ...
def Int64ByteSize(field_number, int64): ...
def UInt32ByteSize(field_number, uint32): ...
def UInt64ByteSize(field_number, uint64): ...
def SInt32ByteSize(field_number, int32): ...
def SInt64ByteSize(field_number, int64): ...
def Fixed32ByteSize(field_number, fixed32): ...
def Fixed64ByteSize(field_number, fixed64): ...
def SFixed32ByteSize(field_number, sfixed32): ...
def SFixed64ByteSize(field_number, sfixed64): ...
def FloatByteSize(field_number, flt): ...
def DoubleByteSize(field_number, double): ...
def BoolByteSize(field_number, b): ...
def EnumByteSize(field_number, enum): ...
def StringByteSize(field_number, string): ...
def BytesByteSize(field_number, b): ...
def GroupByteSize(field_number, message): ...
def MessageByteSize(field_number, message): ...
def MessageSetItemByteSize(field_number, msg): ...
def TagByteSize(field_number): ...
NON_PACKABLE_TYPES = ... # type: Any
def IsTypePackable(field_type): ...

34
3rdparty/typeshed/google/protobuf/message.pyi vendored

@ -0,0 +1,34 @@
from typing import Any, Dict, Sequence, Optional, Text, Tuple
from .descriptor import FieldDescriptor
class Error(Exception): ...
class DecodeError(Error): ...
class EncodeError(Error): ...
class Message:
DESCRIPTOR = ... # type: Any
Extensions = ... # type: Dict[Any, Any]
def __deepcopy__(self, memo=...): ...
def __eq__(self, other_msg): ...
def __ne__(self, other_msg): ...
def MergeFrom(self, other_msg: Message) -> None: ...
def CopyFrom(self, other_msg: Message) -> None: ...
def Clear(self) -> None: ...
def SetInParent(self) -> None: ...
def IsInitialized(self) -> bool: ...
def MergeFromString(self, serialized: bytes) -> int: ... # TODO: we need to be able to call buffer() on serialized
def ParseFromString(self, serialized: bytes) -> None: ...
def SerializeToString(self) -> bytes: ...
def SerializePartialToString(self) -> bytes: ...
def ListFields(self) -> Sequence[Tuple[FieldDescriptor, Any]]: ...
def HasField(self, field_name: Text) -> bool: ...
def ClearField(self, field_name: Text) -> None: ...
def WhichOneof(self, oneof_group) -> Optional[str]: ...
def HasExtension(self, extension_handle): ...
def ClearExtension(self, extension_handle): ...
def ByteSize(self) -> int: ...
# TODO: check kwargs
def __init__(self, **kwargs) -> None: ...

13
3rdparty/typeshed/google/protobuf/message_factory.pyi vendored

@ -0,0 +1,13 @@
from typing import Any, Dict, Iterable, Optional, Type
from .message import Message
from .descriptor import Descriptor
from .descriptor_pool import DescriptorPool
class MessageFactory:
pool = ... # type: Any
def __init__(self, pool: Optional[DescriptorPool] = ...) -> None: ...
def GetPrototype(self, descriptor: Descriptor) -> Type[Message]: ...
def GetMessages(self, files: Iterable[str]) -> Dict[str, Type[Message]]: ...
def GetMessages(file_protos: Iterable[str]) -> Dict[str, Type[Message]]: ...

6
3rdparty/typeshed/google/protobuf/reflection.pyi vendored

@ -0,0 +1,6 @@
class GeneratedProtocolMessageType(type):
def __new__(cls, name, bases, dictionary): ...
def __init__(cls, name, bases, dictionary) -> None: ...
def ParseMessage(descriptor, byte_str): ...
def MakeClass(descriptor): ...

14
3rdparty/typeshed/google/protobuf/symbol_database.pyi vendored

@ -0,0 +1,14 @@
from typing import Dict, Iterable, Type
from .descriptor import EnumDescriptor, FileDescriptor
from .message import Message
from .message_factory import MessageFactory
class SymbolDatabase(MessageFactory):
def RegisterMessage(self, message: Type[Message]) -> Type[Message]: ...
def RegisterEnumDescriptor(self, enum_descriptor: Type[EnumDescriptor]) -> EnumDescriptor: ...
def RegisterFileDescriptor(self, file_descriptor: Type[FileDescriptor]) -> FileDescriptor: ...
def GetSymbol(self, symbol: str) -> Type[Message]: ...
def GetMessages(self, files: Iterable[str]) -> Dict[str, Type[Message]]: ...
def Default(): ...

2
CMakeLists.txt

@ -124,7 +124,7 @@ macro(py_proto src)
string(REGEX REPLACE "\\.proto$" "" base ${src})
add_custom_command(
OUTPUT ${base}_pb2.py
COMMAND LD_LIBRARY_PATH=$ENV{VIRTUAL_ENV}/lib protoc --python_out=${CMAKE_BINARY_DIR} --proto_path=${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_LIST_DIR}/${src}
COMMAND LD_LIBRARY_PATH=$ENV{VIRTUAL_ENV}/lib protoc --python_out=${CMAKE_BINARY_DIR} --mypy_out=${CMAKE_BINARY_DIR} --proto_path=${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_LIST_DIR}/${src}
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/${src}
)
file(RELATIVE_PATH pkg_path ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_LIST_DIR})

57
NOTES.org

@ -1,5 +1,51 @@
# -*- org-tags-column: -98 -*-
* runtests: warn if selector did not match any tests :TESTING:
* what is the proper type for target in noisicaa.ui.tools? :CLEANUP:
* typesafe callbacks :CLEANUP:
- remove core.CallbackRegistry
- instead declare all callbacks as explicit class members in __init__
self.foo_changed = core.Callback[T]()
* solve cyclic import dependencies from ui_base :CLEANUP:
- ui_base needs EditorApp, EditorWindow, ProjectView - which need ui_base
- ui_base defines interfaces for those classes (and possibly more)
- use those for type annotations everywhere else
- modules defining the implementations of those classes shouldn't be imported elsewhere
- might also make testing easier
- tests can implement mocks for those interfaces
* refactor noisicaa.ui.editor_app :CLEANUP:
- some better way to make it testable than this BaseEditorApp/EditorApp split.
- perhaps don't subclass QApplication, just be a QObject with a reference to the QApplication?
* refactor noisicaa.ui.editor_window :CLEANUP:
- just an empty shell that hosts project views
- menubar, toolbar, etc are owned by ProjectView
- when switching current project view, set the current menubar, toolbar, ...
- dito for dock widgets?
- dock widgets are hosted in window
- when switching between projects, dock widgets and their states are stored/restored.
- ProjectView does not have to be a QMainWindow anymore (which feels hacky anyway).
- can have any number of windows, with some set of projects hosted within each.
- eacg ProjectView is hosted in exactly one window.
* Use 'object' instead of Any for 'some value' :CLEANUP:TESTING:
- enforces using cast() whenever such a value is used.
- enable mypy to complain about any untyped/Any-types variable.
* use specific versions for venv packages :FR:
- so venv setup is deterministic
- listdeps --check-updates
- check for latest versions, list packages with updates
* reanimate pdb :TESTING:
* Make target object explicit member of command proto :CLEANUP:
- Remove the Command.target field
- Add an appropriate field the each command proto (or not).
* asyncio.wait() does not raise exception in failed tasks :BUG:
- causes 'task never retrieved' messages, and uncaught exceptions
- always collect results from the done tasks
* Use command CreateX, UpdateX, DeleteX pattern for commands. :CLEANUP:
* Add stubs for PyQt5.QtSvg :FR:TESTING:
* Make control value generations work with undo :BUG:
- generation must also increment, when value change is caused by undo
@ -54,9 +100,6 @@
* PyQt5 stubs declare signals incorrectly :TESTING:BUG:
- declared as methods, should be some object with connect/disconnect methods.
* Try protostub to generate .pyi stubs for *_pb2 modules :TESTING:FR:
https://github.com/arachnys/protostub
* Debug console :FR:
- make switching between toplevel windows work properly
- highlight active window
@ -271,11 +314,6 @@ Probably related to unittest.UITestCase
* Make the audio thread real-time safe :FR:
- no more python code in the main loop
- lock-free queue for log messages
* clean up pylint issues in pylint-unclean files :CLEANUP:TESTING:
- grep -r pylint-unclean noisicaa/
- pick some file and clean it up.
- until grep finds no more files.
* clean up mypy issues in mypy: loose files :CLEANUP:TESTING:
- wc -l $(grep -l -r 'mypy: loose' noisicaa/ | grep -Ev '~$') | sort -nr
- slower: bin/runtests --tags=mypy --pedantic=true 2>&1 | sed -ne '0,/= mypy report =/!p' | grep -vE '^\s*$' | sed -e 's/:.*$//' | sort | uniq -c | sort -nr
@ -375,9 +413,6 @@ ERROR : 8298:7fbd9ef37700:ui.editor_app: Exception in callback: Traceback for
return stat
AssertionError
* Move various test helpers to noisidev.unittest :CLEANUP:TESTING:
- noisicaa.ui.uitest_utils
* Explore https://github.com/census-instrumentation for stats tracking :RESEARCH:
* Make playing notes on insert when editing work again :BUG:
Reimplement Player.send_message() again, now without the proxy, forwarding the message directly

2
bin/pylintrc

@ -79,7 +79,7 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=fixme,missing-docstring,invalid-name,no-self-use,locally-disabled,star-args,len-as-condition,unused-argument,protected-access,typecheck,bad-reversed-sequence,R
disable=fixme,missing-docstring,invalid-name,no-self-use,locally-disabled,star-args,len-as-condition,unused-argument,protected-access,typecheck,bad-reversed-sequence,arguments-differ,R
#W1604,W1603,W1610,W1614,E1606,W1626,W1609,W0704,W1630,W1601,W1623,W1602,W1631,E1604,W1616,W1611,W1628,W1607,E1602,W1625,W1622,W1612,I0020,E1605,E1608,W1619,W1620,W1617,W1632,W1624,W1613,W1615,E1607,E1601,E1603,W1608,W1629,W1627,W1606,I0021,W1605,W1633,W1618,W1621

2
listdeps

@ -71,6 +71,8 @@ PIP_DEPS = {
PKG('cython'),
PKG('pkgconfig'),
PKG('pyyaml'),
# TODO: get my changes upstream and use regular mypy-protobuf package from pip.
PKG('git+https://github.com/odahoda/mypy-protobuf.git#subdirectory=python'),
],
'dev': [
PKG('asynctest'),

2
noisicaa/CMakeLists.txt

@ -34,10 +34,10 @@ add_subdirectory(bindings)
add_subdirectory(core)
add_subdirectory(devices)
add_subdirectory(host_system)
add_subdirectory(importers)
add_subdirectory(instr)
add_subdirectory(instrument_db)
add_subdirectory(lv2)
add_subdirectory(model)
add_subdirectory(music)
add_subdirectory(node_db)
add_subdirectory(ui)

1
noisicaa/audioproc/CMakeLists.txt

@ -22,7 +22,6 @@ add_python_package(
audioproc_client.py
audioproc_client_test.py
audioproc_process.py
exceptions.py
mutations.py
)

4
noisicaa/audioproc/__init__.py

@ -23,11 +23,11 @@ from .audioproc_client import (
AudioProcClientMixin,
)
from .mutations import (
Mutation,
AddNode,
RemoveNode,
ConnectPorts,
DisconnectPorts,
SetPortProperty,
SetControlValue,
SetPluginState,
)
@ -35,6 +35,8 @@ from .public import (
MusicalDuration,
MusicalTime,
PluginState,
PluginStateLV2,
PluginStateLV2Property,
ProcessorMessage,
ProcessorMessageList,
PlayerState,

87
noisicaa/audioproc/audioproc_client.py

@ -39,12 +39,95 @@ class AudioProcClientBase(object):
self.event_loop = event_loop
self.server = server
self.listeners = None # type: core.CallbackRegistry
@property
def address(self) -> str:
raise NotImplementedError
async def setup(self) -> None:
raise NotImplementedError
async def cleanup(self) -> None:
raise NotImplementedError
async def connect(self, address: str, flags: Optional[Set[str]] = None) -> None:
raise NotImplementedError
async def disconnect(self, shutdown: bool = False) -> None:
raise NotImplementedError
async def shutdown(self) -> None:
raise NotImplementedError
async def ping(self) -> None:
raise NotImplementedError
async def create_realm(
self, *, name: str, parent: Optional[str] = None, enable_player: bool = False,
callback_address: Optional[str] = None) -> None:
raise NotImplementedError
async def delete_realm(self, name: str) -> None:
raise NotImplementedError
async def add_node(
self, realm: str, *, description: node_db.NodeDescription, **args: Any) -> None:
raise NotImplementedError
async def remove_node(self, realm: str, node_id: str) -> None:
raise NotImplementedError
async def connect_ports(
self, realm: str, node1_id: str, port1_name: str, node2_id: str, port2_name: str
) -> None:
raise NotImplementedError
async def disconnect_ports(
self, realm: str, node1_id: str, port1_name: str, node2_id: str, port2_name: str
) -> None:
raise NotImplementedError
async def set_control_value(self, realm: str, name: str, value: float, generation: int) -> None:
raise NotImplementedError
async def pipeline_mutation(self, realm: str, mutation: mutations.Mutation) -> None:
raise NotImplementedError
async def create_plugin_ui(self, realm: str, node_id: str) -> Tuple[int, Tuple[int, int]]:
raise NotImplementedError
async def delete_plugin_ui(self, realm: str, node_id: str) -> None:
raise NotImplementedError
async def send_node_messages(
self, realm: str, messages: processor_message_pb2.ProcessorMessageList) -> None:
raise NotImplementedError
async def set_host_parameters(self, **parameters: Any) -> None:
raise NotImplementedError
async def set_backend(self, name: str, **parameters: Any) -> None:
raise NotImplementedError
async def set_backend_parameters(self, **parameters: Any) -> None:
raise NotImplementedError
async def update_player_state(self, realm: str, state: player_state_pb2.PlayerState) -> None:
raise NotImplementedError
async def send_message(self, msg: Any) -> None:
raise NotImplementedError
async def play_file(self, path: str) -> str:
raise NotImplementedError
async def dump(self) -> None:
raise NotImplementedError
async def update_project_properties(self, realm: str, **kwargs: Any) -> None:
raise NotImplementedError
class AudioProcClientMixin(AudioProcClientBase):
def __init__(self, *args: Any, **kwargs: Any) -> None:
@ -129,10 +212,6 @@ class AudioProcClientMixin(AudioProcClientBase):
await self.pipeline_mutation(
realm, mutations.DisconnectPorts(node1_id, port1_name, node2_id, port2_name))
async def set_port_property(
self, realm: str, node_id: str, port_name: str, **kwargs: Any) -> None:
await self.pipeline_mutation(realm, mutations.SetPortProperty(node_id, port_name, **kwargs))
async def set_control_value(self, realm: str, name: str, value: float, generation: int) -> None:
await self.pipeline_mutation(realm, mutations.SetControlValue(name, value, generation))

2
noisicaa/audioproc/audioproc_client_test.py

@ -36,7 +36,7 @@ from . import audioproc_client
logger = logging.getLogger(__name__)
class TestClientImpl(audioproc_client.AudioProcClientBase):
class TestClientImpl(audioproc_client.AudioProcClientBase): # pylint: disable=abstract-method
def __init__(self, event_loop):
super().__init__(event_loop, ipc.Server(event_loop, 'client', TEST_OPTS.TMP_DIR))

5
noisicaa/audioproc/audioproc_process.py

@ -272,11 +272,6 @@ class AudioProcProcess(core.SessionHandlerMixin, core.ProcessBase):
node2.inputs[mutation.dest_port].disconnect(node1.outputs[mutation.src_port])
realm.update_spec()
elif isinstance(mutation, mutations.SetPortProperty):
node = graph.find_node(mutation.node)
port = node.outputs[mutation.port]
port.set_prop(**mutation.kwargs)
elif isinstance(mutation, mutations.SetControlValue):
realm.set_control_value(mutation.name, mutation.value, mutation.generation)

13
noisicaa/audioproc/engine/graph.py

@ -21,7 +21,6 @@
# @end:license
import logging
import os
from typing import Any, Dict, List, Optional, Set # pylint: disable=unused-import
import toposort
@ -117,9 +116,7 @@ class OutputPortMixin(Port):
assert self._bypass_port is not None
self._bypass = bool(value)
def set_prop( # pylint: disable=arguments-differ
self, *, bypass: Optional[bool] = None, **kwargs: Any
) -> None:
def set_prop(self, *, bypass: Optional[bool] = None, **kwargs: Any) -> None:
super().set_prop(**kwargs)
if bypass is not None:
self.bypass = bypass
@ -174,9 +171,7 @@ class AudioOutputPort(AudioPortMixin, OutputPortMixin, Port):
raise ValueError("Invalid dry/wet value.")
self._drywet = float(value)
def set_prop( # pylint: disable=arguments-differ
self, *, drywet: Optional[float] = None, **kwargs: Any
) -> None:
def set_prop(self, *, drywet: Optional[float] = None, **kwargs: Any) -> None:
super().set_prop(**kwargs)
if drywet is not None:
self.drywet = drywet
@ -437,7 +432,7 @@ class PluginNode(ProcessorNode):
self.processor.set_parameters(
processor_pb2.ProcessorParameters(
plugin_pipe_path=os.fsencode(self.__plugin_pipe_path)))
plugin_pipe_path=self.__plugin_pipe_path))
async def cleanup(self, deref: bool = False) -> None:
await super().cleanup(deref)
@ -488,7 +483,7 @@ class ChildRealmNode(Node):
class EventSourceNode(Node):
def __init__(self, *, track_id: str, **kwargs: Any) -> None:
def __init__(self, *, track_id: int, **kwargs: Any) -> None:
super().__init__(**kwargs)
self.__track_id = track_id

3
noisicaa/audioproc/engine/plugin_host_process_test.py

@ -34,6 +34,7 @@ import posix_ipc
from noisidev import unittest
from noisidev import unittest_mixins
from noisidev import unittest_engine_mixins
from noisidev import qttest
from noisicaa.constants import TEST_OPTS
from noisicaa.core import ipc
from noisicaa import node_db
@ -56,7 +57,7 @@ class PluginHostProcessTest(
unittest_mixins.NodeDBMixin,
unittest_mixins.ProcessManagerMixin,
unittest_engine_mixins.HostSystemMixin,
unittest.QtTestCase):
qttest.QtTestCase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

6
noisicaa/audioproc/engine/processor_plugin_test.py

@ -88,7 +88,7 @@ class ProcessorPluginTest(
proc.setup()
proc.set_parameters(
processor_pb2.ProcessorParameters(
plugin_pipe_path=os.fsencode(pipe_address)))
plugin_pipe_path=pipe_address))
arena = buffer_arena.PyBufferArena(2**20)
buffer_mgr = unittest_engine_utils.BufferManager(self.host_system, arena)
@ -157,7 +157,7 @@ class ProcessorPluginTest(
proc.setup()
proc.set_parameters(
processor_pb2.ProcessorParameters(
plugin_pipe_path=os.fsencode(pipe_address)))
plugin_pipe_path=pipe_address))
ctxt = block_context.PyBlockContext(buffer_arena=arena)
ctxt.sample_pos = 1024
@ -221,7 +221,7 @@ class ProcessorPluginTest(
proc.setup()
proc.set_parameters(
processor_pb2.ProcessorParameters(
plugin_pipe_path=os.fsencode(pipe_address)))
plugin_pipe_path=pipe_address))
ctxt = block_context.PyBlockContext(buffer_arena=arena)
ctxt.sample_pos = 1024

27
noisicaa/audioproc/exceptions.py

@ -1,27 +0,0 @@
#!/usr/bin/python3
# @begin:license
#
# Copyright (c) 2015-2018, Benjamin Niemann <pink@odahoda.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# @end:license
class Error(Exception):
pass
class SetupError(Error):
pass

17
noisicaa/audioproc/mutations.py

@ -23,6 +23,7 @@
from typing import Any
from noisicaa import node_db
from .public import plugin_state_pb2
class Mutation(object):
@ -78,20 +79,6 @@ class DisconnectPorts(Mutation):
self.src_node, self.src_port, self.dest_node, self.dest_port)
class SetPortProperty(Mutation):
def __init__(self, node: str, port: str, **kwargs: Any) -> None:
super().__init__()
self.node = node
self.port = port
self.kwargs = kwargs
def __str__(self) -> str:
return '<SetPortProperty port=%s:%s%s>' % (
self.node, self.port,
''.join(' %s=%r' % (k, v)
for k, v in sorted(self.kwargs.items())))
class SetControlValue(Mutation):
def __init__(self, name: str, value: float, generation: int) -> None:
super().__init__()
@ -105,7 +92,7 @@ class SetControlValue(Mutation):
class SetPluginState(Mutation):
def __init__(self, node: str, state: str) -> None:
def __init__(self, node: str, state: plugin_state_pb2.PluginState) -> None:
super().__init__()
self.node = node
self.state = state

2
noisicaa/audioproc/public/__init__.py

@ -30,6 +30,8 @@ from .player_state_pb2 import (
)
from .plugin_state_pb2 import (
PluginState,
PluginStateLV2,
PluginStateLV2Property,
)
from .processor_message_pb2 import (
ProcessorMessage,

3
noisicaa/core/CMakeLists.txt

@ -30,7 +30,6 @@ add_python_package(
logging.pyi
message.py
message_test.py
model_base.py
perf_stats_test.py
process_manager.py
process_manager_test.py
@ -49,6 +48,8 @@ add_python_package(
add_cython_module(logging_test CXX)