Skip to content
Permalink
Browse files

Track list improvements.

  • Loading branch information
odahoda committed Dec 15, 2019
1 parent 51053cf commit bae6940b3649995e59ce4c0a0670a321f49b5682
Showing with 2,041 additions and 596 deletions.
  1. +6 −5 3rdparty/typeshed/PyQt5/QtCore.pyi
  2. +7 −4 3rdparty/typeshed/PyQt5/QtWidgets.pyi
  3. +2 −0 3rdparty/typeshed/fastjsonschema.pyi
  4. +4 −2 build_utils/waf/virtenv.py
  5. +2 −2 noisicaa/audioproc/engine/fluidsynth_util.cpp
  6. +5 −1 noisicaa/audioproc/engine/realm.pyx
  7. +6 −6 noisicaa/audioproc/public/musical_time.pyx
  8. +5 −1 noisicaa/builtin_nodes/beat_track/track_ui.py
  9. +2 −18 noisicaa/builtin_nodes/control_track/track_ui.py
  10. +43 −50 noisicaa/builtin_nodes/pianoroll_track/track_ui.py
  11. +1 −1 noisicaa/builtin_nodes/sample_track/track_ui.py
  12. +5 −1 noisicaa/builtin_nodes/score_track/track_ui.py
  13. +6 −6 noisicaa/builtin_nodes/step_sequencer/node_ui.py
  14. +18 −212 noisicaa/core/process_manager.py
  15. +133 −0 noisicaa/core/process_manager_entry.py
  16. +127 −0 noisicaa/core/process_manager_io.py
  17. +2 −0 noisicaa/core/wscript
  18. +1 −1 noisicaa/music/__init__.py
  19. +5 −3 noisicaa/music/base_track.py
  20. +6 −2 noisicaa/music/graph.py
  21. +303 −0 noisicaa/music/loadtest_generator.py
  22. +59 −0 noisicaa/music/loadtest_generator_test.py
  23. +33 −0 noisicaa/music/model_base.py
  24. +17 −0 noisicaa/music/model_base_test.py
  25. +8 −0 noisicaa/music/mutations.proto
  26. +18 −0 noisicaa/music/mutations.py
  27. +4 −0 noisicaa/music/player.py
  28. +6 −7 noisicaa/music/project.py
  29. +17 −0 noisicaa/music/project_client.py
  30. +2 −0 noisicaa/music/wscript
  31. +14 −11 noisicaa/ui/base_dial.py
  32. +10 −14 noisicaa/ui/clipboard.py
  33. +127 −0 noisicaa/ui/code_editor.py
  34. +1 −1 noisicaa/ui/control_value_dial.py
  35. +13 −0 noisicaa/ui/editor_app.py
  36. +23 −9 noisicaa/ui/editor_window.py
  37. +10 −5 noisicaa/ui/graph/canvas.py
  38. +1 −1 noisicaa/ui/graph/view.py
  39. +1 −1 noisicaa/ui/instrument_list.py
  40. +2 −2 noisicaa/ui/int_dial.py
  41. +4 −3 noisicaa/ui/object_list_editor.py
  42. +157 −0 noisicaa/ui/object_list_manager.py
  43. +115 −29 noisicaa/ui/open_project_dialog.py
  44. +1 −0 noisicaa/ui/pianoroll.py
  45. +17 −2 noisicaa/ui/project_registry.py
  46. +36 −0 noisicaa/ui/qtyping.py
  47. +19 −11 noisicaa/ui/settings_dialog.py
  48. +22 −10 noisicaa/ui/slots.py
  49. +20 −15 noisicaa/ui/track_list/base_track_editor.py
  50. +499 −108 noisicaa/ui/track_list/editor.py
  51. +5 −10 noisicaa/ui/track_list/measured_track_editor.py
  52. +2 −20 noisicaa/ui/track_list/time_line.py
  53. +79 −20 noisicaa/ui/track_list/time_view_mixin.py
  54. +4 −1 noisicaa/ui/track_list/view.py
  55. +3 −1 noisicaa/ui/ui_base.py
  56. +3 −0 noisicaa/ui/wscript
@@ -1696,26 +1696,27 @@ class QObject(sip.wrapper):
def isWidgetType(self) -> bool: ...
def setObjectName(self, name: str) -> None: ...
def objectName(self) -> str: ...
O = typing.TypeVar('O', bound='QObject')
@typing.overload
def findChildren(self, type: type, name: str = ..., options: typing.Union[Qt.FindChildOptions, Qt.FindChildOption] = ...) -> typing.List['QObject']: ...
def findChildren(self, type: typing.Type[O], name: str = ..., options: typing.Union[Qt.FindChildOptions, Qt.FindChildOption] = ...) -> typing.List[O]: ...
@typing.overload
def findChildren(self, types: typing.Tuple, name: str = ..., options: typing.Union[Qt.FindChildOptions, Qt.FindChildOption] = ...) -> typing.List['QObject']: ...
@typing.overload
def findChildren(self, type: type, regExp: 'QRegExp', options: typing.Union[Qt.FindChildOptions, Qt.FindChildOption] = ...) -> typing.List['QObject']: ...
def findChildren(self, type: typing.Type[O], regExp: 'QRegExp', options: typing.Union[Qt.FindChildOptions, Qt.FindChildOption] = ...) -> typing.List[O]: ...
@typing.overload
def findChildren(self, types: typing.Tuple, regExp: 'QRegExp', options: typing.Union[Qt.FindChildOptions, Qt.FindChildOption] = ...) -> typing.List['QObject']: ...
@typing.overload
def findChildren(self, type: type, re: 'QRegularExpression', options: typing.Union[Qt.FindChildOptions, Qt.FindChildOption] = ...) -> typing.List['QObject']: ...
def findChildren(self, type: typing.Type[O], re: 'QRegularExpression', options: typing.Union[Qt.FindChildOptions, Qt.FindChildOption] = ...) -> typing.List[O]: ...
@typing.overload
def findChildren(self, types: typing.Tuple, re: 'QRegularExpression', options: typing.Union[Qt.FindChildOptions, Qt.FindChildOption] = ...) -> typing.List['QObject']: ...
@typing.overload
def findChild(self, type: type, name: str = ..., options: typing.Union[Qt.FindChildOptions, Qt.FindChildOption] = ...) -> 'QObject': ...
def findChild(self, type: typing.Type[O], name: str = ..., options: typing.Union[Qt.FindChildOptions, Qt.FindChildOption] = ...) -> O: ...
@typing.overload
def findChild(self, types: typing.Tuple, name: str = ..., options: typing.Union[Qt.FindChildOptions, Qt.FindChildOption] = ...) -> 'QObject': ...
def tr(self, sourceText: str, disambiguation: typing.Optional[str] = ..., n: int = ...) -> str: ...
def eventFilter(self, a0: 'QObject', a1: 'QEvent') -> bool: ...
def event(self, a0: 'QEvent') -> bool: ...
def __getattr__(self, name: str) -> typing.Any: ...
#def __getattr__(self, name: str) -> typing.Any: ...
def pyqtConfigure(self, a0: typing.Any) -> None: ...
def metaObject(self) -> 'QMetaObject': ...

@@ -1006,6 +1006,8 @@ class QAction(QtCore.QObject):
def setFont(self, font: QtGui.QFont) -> None: ...
def shortcutContext(self) -> QtCore.Qt.ShortcutContext: ...
def setShortcutContext(self, context: QtCore.Qt.ShortcutContext) -> None: ...
def shortcutVisibleInContextMenu(self) -> bool: ...
def setShortcutVisibleInContextMenu(self, visible: bool) -> None: ...
def shortcut(self) -> QtGui.QKeySequence: ...
def setShortcut(self, shortcut: typing.Union[QtGui.QKeySequence, QtGui.QKeySequence.StandardKey, str, int]) -> None: ...
def isSeparator(self) -> bool: ...
@@ -6568,6 +6570,10 @@ class QOpenGLWidget(QWidget):


class QPlainTextEdit(QAbstractScrollArea):
blockCountChanged = ... # type: PYQT_SIGNAL
updateRequest = ... # type: PYQT_SIGNAL
cursorPositionChanged = ... # type: PYQT_SIGNAL
textChanged = ... # type: PYQT_SIGNAL

class LineWrapMode(int): ...
NoWrap = ... # type: 'QPlainTextEdit.LineWrapMode'
@@ -6619,14 +6625,10 @@ class QPlainTextEdit(QAbstractScrollArea):
def timerEvent(self, e: QtCore.QTimerEvent) -> None: ...
def event(self, e: QtCore.QEvent) -> bool: ...
def modificationChanged(self, a0: bool) -> None: ...
def blockCountChanged(self, newBlockCount: int) -> None: ...
def updateRequest(self, rect: QtCore.QRect, dy: int) -> None: ...
def cursorPositionChanged(self) -> None: ...
def selectionChanged(self) -> None: ...
def copyAvailable(self, b: bool) -> None: ...
def redoAvailable(self, b: bool) -> None: ...
def undoAvailable(self, b: bool) -> None: ...
def textChanged(self) -> None: ...
def centerCursor(self) -> None: ...
def appendHtml(self, html: str) -> None: ...
def appendPlainText(self, text: str) -> None: ...
@@ -7208,6 +7210,7 @@ class QSpinBox(QAbstractSpinBox):


class QDoubleSpinBox(QAbstractSpinBox):
valueChanged = ... # type: PYQT_SIGNAL

def __init__(self, parent: typing.Optional[QWidget] = ...) -> None: ...

@@ -0,0 +1,2 @@
from typing import Any
def __getattr__(arrr: str) -> Any: ...
@@ -165,6 +165,7 @@ def configure(ctx):
pip_mgr.check_package(RUNTIME, 'sortedcontainers')
pip_mgr.check_package(RUNTIME, 'toposort')
pip_mgr.check_package(RUNTIME, 'urwid')
pip_mgr.check_package(RUNTIME, 'fastjsonschema')
pip_mgr.check_package(BUILD, 'cssutils')
pip_mgr.check_package(BUILD, 'Cython', version='0.29.6')
pip_mgr.check_package(BUILD, 'Jinja2')
@@ -328,9 +329,9 @@ def check_virtual_env(ctx):
system_site_packages=False,
with_pip=True)
env_builder.create(venvdir)
except Exception as exc: # pylint: disable=broad-except
except BaseException as exc: # pylint: disable=broad-except
shutil.rmtree(venvdir)
ctx.fatal("Failed to create virtual env: %s" % exc)
ctx.fatal("Failed to create virtual env: %s: %s" % (type(exc).__name__, exc))

# Always update PIP to something more recent than what ensurepip has installed. We need at
# least 9.0 for 'pip list --format=json' to work.
@@ -701,6 +702,7 @@ def build(self, src_path):
['cmake',
'-DBUILD_PYTHON_INTERFACE=0',
'-DBUILD_LINEAR_ALGEBRA_OPCODES=0',
'-DBUILD_STK_OPCODES=0',
'-DCMAKE_INSTALL_PREFIX=' + self._ctx.env.VIRTUAL_ENV,
os.path.abspath(src_path)
],
@@ -162,12 +162,12 @@ Status FluidSynthUtil::process_block(
if ((midi[0] & 0xf0) == 0x90) {
int rc = fluid_synth_noteon(_synth, 0, midi[1], midi[2]);
if (rc == FLUID_FAILED) {
_logger->warning("noteon failed.");
_logger->info("noteon failed.");
}
} else if ((midi[0] & 0xf0) == 0x80) {
int rc = fluid_synth_noteoff(_synth, 0, midi[1]);
if (rc == FLUID_FAILED) {
_logger->warning("noteoff failed.");
_logger->info("noteoff failed.");
}
} else {
_logger->warning("Ignoring unsupported midi event %d.", midi[0] & 0xf0);
@@ -233,7 +233,11 @@ cdef class PyRealm(object):
node.set_session_value(node_key, session_value)

def send_node_message(self, msg):
node = self.__graph.find_node(msg.node_id)
try:
node = self.__graph.find_node(msg.node_id)
except KeyError:
logger.warning("Node message to unknown node:\n%s", msg)
return
assert isinstance(node, graph.ProcessorNode), type(node).__name__
proc = node.processor

@@ -46,14 +46,14 @@ cdef class PyMusicalDuration(object):
if len(args) == 0:
self._duration = MusicalDuration()
elif len(args) == 2:
self._duration = MusicalDuration(<int>args[0], <int>args[1])
self._duration = MusicalDuration(<int64_t>args[0], <int64_t>args[1])
elif len(args) == 1:
if isinstance(args[0], PyMusicalDuration):
self._duration = (<PyMusicalDuration>args[0])._duration
elif isinstance(args[0], fractions.Fraction):
self._duration = MusicalDuration(<int>args[0].numerator, <int>args[0].denominator)
self._duration = MusicalDuration(<int64_t>args[0].numerator, <int64_t>args[0].denominator)
elif isinstance(args[0], int):
self._duration = MusicalDuration(<int>args[0])
self._duration = MusicalDuration(<int64_t>args[0])
else:
raise TypeError(repr(args[0]))
else:
@@ -161,14 +161,14 @@ cdef class PyMusicalTime(object):
if len(args) == 0:
self._time = MusicalTime()
elif len(args) == 2:
self._time = MusicalTime(<int>args[0], <int>args[1])
self._time = MusicalTime(<int64_t>args[0], <int64_t>args[1])
elif len(args) == 1:
if isinstance(args[0], PyMusicalTime):
self._time = (<PyMusicalTime>args[0])._time
elif isinstance(args[0], fractions.Fraction):
self._time = MusicalTime(<int>args[0].numerator, <int>args[0].denominator)
self._time = MusicalTime(<int64_t>args[0].numerator, <int64_t>args[0].denominator)
elif isinstance(args[0], int):
self._time = MusicalTime(<int>args[0])
self._time = MusicalTime(<int64_t>args[0])
else:
raise TypeError(repr(args[0]))
else:
@@ -124,6 +124,10 @@ def __init__(self, **kwargs: Any) -> None:

self.__ghost_time = None # type: audioproc.MusicalDuration

@property
def track_editor(self) -> 'BeatTrackEditor':
return down_cast(BeatTrackEditor, super().track_editor)

@property
def track(self) -> model.BeatTrack:
return down_cast(model.BeatTrack, super().track)
@@ -238,7 +242,7 @@ def __init__(self, **kwargs: Any) -> None:

self.__play_last_pitch = None # type: value_types.Pitch

self.setFixedHeight(60)
self.setDefaultHeight(60)

@property
def track(self) -> model.BeatTrack:
@@ -278,7 +278,7 @@ def __init__(self, **kwargs: Any) -> None:

self.__listeners.add(self.track.points_changed.add(self.onPointsChanged))

self.setFixedHeight(120)
self.setDefaultHeight(120)

self.scaleXChanged.connect(self.__onScaleXChanged)
self.playbackPositionChanged.connect(self.__playbackPositionChanged)
@@ -390,23 +390,7 @@ def mouseDoubleClickEvent(self, evt: QtGui.QMouseEvent) -> None:
super().mouseDoubleClickEvent(evt)

def _paint(self, painter: QtGui.QPainter, paint_rect: QtCore.QRect) -> None:
painter.setPen(Qt.black)

beat_time = audioproc.MusicalTime()
beat_num = 0
while beat_time < self.projectEndTime():
x = self.timeToX(beat_time)

if beat_num == 0:
painter.fillRect(x, 0, 2, self.height(), Qt.black)
else:
painter.fillRect(x, 0, 1, self.height(), QtGui.QColor(160, 160, 160))

beat_time += audioproc.MusicalDuration(1, 4)
beat_num += 1

x = self.timeToX(self.projectEndTime())
painter.fillRect(x, 0, 2, self.height(), Qt.black)
self.renderTimeGrid(painter, paint_rect)

points = self.points[:]

0 comments on commit bae6940

Please sign in to comment.
You can’t perform that action at this time.