Skip to content
Permalink
Browse files

Use proto messages for IPCs.

- Mostly internal refactoring without user visible changes.
- Optimize the IPC code a bit, which makes it a bit faster.
- Shutting down is a bit more reliable.
  • Loading branch information...
odahoda committed Mar 3, 2019
1 parent 028c738 commit da16c0626ab6a5b327a4927528c95718d3c1b3bb
Showing with 4,103 additions and 2,535 deletions.
  1. +2 −0 noisicaa/CMakeLists.txt
  2. +2 −1 noisicaa/audioproc/CMakeLists.txt
  3. +11 −5 noisicaa/audioproc/__init__.py
  4. +159 −0 noisicaa/audioproc/audioproc.proto
  5. +163 −95 noisicaa/audioproc/audioproc_client.py
  6. +5 −20 noisicaa/audioproc/audioproc_client_test.py
  7. +222 −131 noisicaa/audioproc/audioproc_process.py
  8. +1 −0 noisicaa/audioproc/engine/alsa_device_manager.cpp
  9. +5 −2 noisicaa/audioproc/engine/backend.cpp
  10. +4 −8 noisicaa/audioproc/engine/backend.h
  11. +1 −11 noisicaa/audioproc/engine/backend.pxd
  12. +2 −10 noisicaa/audioproc/engine/backend.pyi
  13. +2 −31 noisicaa/audioproc/engine/backend.pyx
  14. +2 −2 noisicaa/audioproc/engine/backend_null.cpp
  15. +1 −1 noisicaa/audioproc/engine/backend_null.h
  16. +1 −1 noisicaa/audioproc/engine/backend_portaudio.cpp
  17. +1 −1 noisicaa/audioproc/engine/backend_portaudio.h
  18. +6 −5 noisicaa/audioproc/engine/backend_renderer.cpp
  19. +1 −1 noisicaa/audioproc/engine/backend_renderer.h
  20. +3 −2 noisicaa/audioproc/engine/backend_test.py
  21. +57 −33 noisicaa/audioproc/engine/engine.pyx
  22. +3 −1 noisicaa/audioproc/engine/engine_test.py
  23. +18 −7 noisicaa/audioproc/engine/graph.py
  24. +36 −0 noisicaa/audioproc/engine/plugin_host.proto
  25. +75 −27 noisicaa/audioproc/engine/plugin_host_process.py
  26. +74 −36 noisicaa/audioproc/engine/plugin_host_process_test.py
  27. +2 −0 noisicaa/audioproc/engine/processor_csound_test.py
  28. +11 −5 noisicaa/audioproc/engine/processor_plugin_test.py
  29. +1 −0 noisicaa/audioproc/engine/processor_test.py
  30. +1 −3 noisicaa/audioproc/engine/realm.pyi
  31. +16 −10 noisicaa/audioproc/engine/realm.pyx
  32. +4 −2 noisicaa/audioproc/engine/realm_test.py
  33. +0 −101 noisicaa/audioproc/mutations.py
  34. +12 −0 noisicaa/audioproc/public/CMakeLists.txt
  35. +12 −0 noisicaa/audioproc/public/__init__.py
  36. +30 −0 noisicaa/audioproc/public/backend_settings.proto
  37. +31 −0 noisicaa/audioproc/public/control_value.proto
  38. +30 −0 noisicaa/audioproc/public/host_parameters.proto
  39. +32 −0 noisicaa/audioproc/public/project_properties.proto
  40. +1 −0 noisicaa/builtin_nodes/beat_track/node_description.py
  41. +0 −1 noisicaa/builtin_nodes/commands_registry.proto
  42. +8 −8 noisicaa/builtin_nodes/control_track/client_impl_test.py
  43. +1 −0 noisicaa/builtin_nodes/control_track/node_description.py
  44. +1 −2 noisicaa/builtin_nodes/control_track/server_impl.py
  45. +4 −2 noisicaa/builtin_nodes/custom_csound/client_impl_test.py
  46. +1 −0 noisicaa/builtin_nodes/custom_csound/node_description.py
  47. +1 −4 noisicaa/builtin_nodes/custom_csound/node_ui.py
  48. +4 −2 noisicaa/builtin_nodes/instrument/client_impl_test.py
  49. +1 −0 noisicaa/builtin_nodes/instrument/node_description.py
  50. +4 −2 noisicaa/builtin_nodes/midi_source/client_impl_test.py
  51. +1 −0 noisicaa/builtin_nodes/midi_source/node_description.py
  52. +1 −0 noisicaa/builtin_nodes/mixer/node_description.py
  53. +10 −10 noisicaa/builtin_nodes/node_description_registry.py
  54. +1 −0 noisicaa/builtin_nodes/sample_track/CMakeLists.txt
  55. +9 −5 noisicaa/builtin_nodes/sample_track/client_impl_test.py
  56. +0 −6 noisicaa/builtin_nodes/sample_track/commands.proto
  57. +0 −12 noisicaa/builtin_nodes/sample_track/commands.py
  58. +37 −0 noisicaa/builtin_nodes/sample_track/ipc.proto
  59. +1 −0 noisicaa/builtin_nodes/sample_track/node_description.py
  60. +58 −48 noisicaa/builtin_nodes/sample_track/server_impl.py
  61. +25 −41 noisicaa/builtin_nodes/sample_track/track_ui.py
  62. +1 −0 noisicaa/builtin_nodes/score_track/node_description.py
  63. +1 −3 noisicaa/builtin_nodes/score_track/server_impl.py
  64. +9 −1 noisicaa/builtin_nodes/server_registry.py
  65. +5 −1 noisicaa/core/CMakeLists.txt
  66. +2 −4 noisicaa/core/__init__.py
  67. +28 −0 noisicaa/core/empty_message.proto
  68. +31 −0 noisicaa/core/ipc.proto
  69. +596 −313 noisicaa/core/ipc.py
  70. +134 −19 noisicaa/core/ipc_test.py
  71. +38 −0 noisicaa/core/process_manager.proto
  72. +95 −25 noisicaa/core/process_manager.py
  73. +47 −0 noisicaa/core/proto_types.proto
  74. +47 −0 noisicaa/core/session_data.proto
  75. +0 −208 noisicaa/core/sessions.py
  76. +3 −2 noisicaa/core/threads.py
  77. +44 −0 noisicaa/editor_main.proto
  78. +110 −40 noisicaa/editor_main.py
  79. +1 −3 noisicaa/instrument_db/CMakeLists.txt
  80. +3 −8 noisicaa/instrument_db/__init__.py
  81. +34 −36 noisicaa/instrument_db/client.py
  82. +5 −12 noisicaa/instrument_db/client_test.py
  83. +14 −1 noisicaa/instrument_db/instrument_db.proto
  84. +43 −0 noisicaa/instrument_db/instrument_description.proto
  85. +0 −62 noisicaa/instrument_db/instrument_description.py
  86. +0 −43 noisicaa/instrument_db/mutations.py
  87. +13 −10 noisicaa/instrument_db/private/db.py
  88. +12 −12 noisicaa/instrument_db/private/sample_scanner.py
  89. +2 −2 noisicaa/instrument_db/private/soundfont_scanner.py
  90. +54 −39 noisicaa/instrument_db/process.py
  91. +2 −0 noisicaa/lv2/CMakeLists.txt
  92. +42 −0 noisicaa/lv2/urid_mapper.proto
  93. +0 −1 noisicaa/lv2/urid_mapper.pxd
  94. +20 −18 noisicaa/lv2/urid_mapper.pyx
  95. +37 −24 noisicaa/lv2/urid_mapper_process.py
  96. +25 −21 noisicaa/lv2/urid_mapper_process_test.py
  97. +1 −6 noisicaa/lv2/urid_mapper_test.py
  98. +4 −4 noisicaa/model/color.py
  99. +4 −4 noisicaa/model/control_value.py
  100. +4 −4 noisicaa/model/pos2f.py
  101. +2 −28 noisicaa/model/project.proto
  102. +4 −4 noisicaa/model/sizef.py
  103. +2 −0 noisicaa/music/CMakeLists.txt
  104. +7 −0 noisicaa/music/__init__.py
  105. +1 −3 noisicaa/music/base_track.py
  106. +5 −5 noisicaa/music/base_track_test.py
  107. +4 −0 noisicaa/music/commands.proto
  108. +3 −6 noisicaa/music/commands.py
  109. +21 −6 noisicaa/music/commands_test.py
  110. +37 −22 noisicaa/music/graph.py
  111. +31 −29 noisicaa/music/graph_test.py
  112. +2 −0 noisicaa/music/mutations.proto
  113. +9 −7 noisicaa/music/player.py
  114. +17 −23 noisicaa/music/player_integration_test.py
  115. +11 −34 noisicaa/music/player_test.py
  116. +12 −5 noisicaa/music/project.py
  117. +182 −81 noisicaa/music/project_client.py
  118. +67 −41 noisicaa/music/project_client_test.py
  119. +20 −5 noisicaa/music/project_integration_test.py
  120. +111 −0 noisicaa/music/project_process.proto
  121. +330 −220 noisicaa/music/project_process.py
  122. +10 −11 noisicaa/{instrument_db/process_base.py → music/project_process_context.py}
  123. +62 −39 noisicaa/music/render.py
  124. +1 −2 noisicaa/node_db/CMakeLists.txt
  125. +1 −4 noisicaa/node_db/__init__.py
  126. +33 −33 noisicaa/node_db/client.py
  127. +7 −16 noisicaa/node_db/client_test.py
  128. +0 −44 noisicaa/node_db/mutations.py
  129. +34 −0 noisicaa/node_db/node_db.proto
  130. +10 −8 noisicaa/node_db/node_description.proto
  131. +1 −0 noisicaa/node_db/private/CMakeLists.txt
  132. +9 −5 noisicaa/node_db/private/builtin_scanner.py
  133. +10 −8 noisicaa/node_db/{process_base.py → private/builtin_scanner_test.py}
  134. +4 −3 noisicaa/node_db/private/csound_scanner.py
  135. +4 −3 noisicaa/node_db/private/csound_scanner_test.py
  136. +6 −6 noisicaa/node_db/private/db.py
  137. +4 −3 noisicaa/node_db/private/ladspa_scanner.py
  138. +3 −2 noisicaa/node_db/private/ladspa_scanner_test.py
  139. +4 −3 noisicaa/node_db/private/lv2_scanner.py
  140. +3 −2 noisicaa/node_db/private/lv2_scanner_test.py
  141. +2 −2 noisicaa/node_db/private/scanner.py
  142. +31 −25 noisicaa/node_db/process.py
  143. +36 −27 noisicaa/ui/editor_app.py
  144. +2 −2 noisicaa/ui/graph/base_node_test.py
  145. +4 −11 noisicaa/ui/instrument_library.py
  146. +1 −2 noisicaa/ui/instrument_library_test.py
  147. +28 −13 noisicaa/ui/project_registry.py
  148. +46 −26 noisicaa/ui/render_dialog.py
  149. +9 −3 noisicaa/ui/stat_monitor.py
  150. +12 −17 noisicaa/ui/ui_base.py
  151. +42 −18 noisidev/uitest.py
  152. +87 −57 noisidev/unittest_mixins.py
@@ -29,6 +29,8 @@ add_python_package(
utils.py
)

py_proto(editor_main.proto)

add_subdirectory(audioproc)
add_subdirectory(bindings)
add_subdirectory(core)
@@ -22,8 +22,9 @@ add_python_package(
audioproc_client.py
audioproc_client_test.py
audioproc_process.py
mutations.py
)

py_proto(audioproc.proto)

add_subdirectory(engine)
add_subdirectory(public)
@@ -18,11 +18,9 @@
#
# @end:license

from .audioproc_client import (
AudioProcClientBase,
AudioProcClientMixin,
)
from .mutations import (
from .audioproc_pb2 import (
ControlValueChange,
PluginStateChange,
Mutation,
AddNode,
RemoveNode,
@@ -31,6 +29,10 @@
SetControlValue,
SetPluginState,
)
from .audioproc_client import (
AbstractAudioProcClient,
AudioProcClient,
)
from .public import (
NodeStateChange,
EngineStateChange,
@@ -49,4 +51,8 @@
TimeMapper,
DeviceDescription,
DevicePortDescription,
ControlValue,
ProjectProperties,
BackendSettings,
HostParameters,
)
@@ -0,0 +1,159 @@
/*
* @begin:license
*
* Copyright (c) 2015-2019, 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
*/

syntax = "proto2";

import "noisicaa/core/session_data.proto";
import "noisicaa/node_db/node_description.proto";
import "noisicaa/audioproc/public/backend_settings.proto";
import "noisicaa/audioproc/public/control_value.proto";
import "noisicaa/audioproc/public/host_parameters.proto";
import "noisicaa/audioproc/public/player_state.proto";
import "noisicaa/audioproc/public/plugin_state.proto";
import "noisicaa/audioproc/public/processor_message.proto";
import "noisicaa/audioproc/public/project_properties.proto";

package noisicaa.audioproc.pb;

message AddNode {
required string id = 1;
optional string name = 2;
required noisicaa.pb.NodeDescription description = 3;
optional noisicaa.pb.PluginState initial_state = 4;
optional string child_realm = 5;
}

message RemoveNode {
required string id = 1;
}

message ConnectPorts {
required string src_node_id = 1;
required string src_port = 2;
required string dest_node_id = 3;
required string dest_port = 4;
}

message DisconnectPorts {
required string src_node_id = 1;
required string src_port = 2;
required string dest_node_id = 3;
required string dest_port = 4;
}

message SetControlValue {
required string name = 1;
required float value = 2;
required uint32 generation = 3;
}

message SetPluginState {
required string node_id = 1;
required noisicaa.pb.PluginState state = 2;
}

message Mutation {
oneof type {
AddNode add_node = 1;
RemoveNode remove_node = 2;
ConnectPorts connect_ports = 3;
DisconnectPorts disconnect_ports = 4;
SetControlValue set_control_value = 5;
SetPluginState set_plugin_state = 6;
}
}

message PluginStateChange {
required string realm = 1;
required string node_id = 2;
required noisicaa.pb.PluginState state = 3;
}

message ControlValueChange {
required string realm = 1;
required string node_id = 2;
required noisicaa.pb.ControlValue value = 3;
}

message CreateRealmRequest {
required string name = 1;
optional string parent = 2;
optional bool enable_player = 3;
optional string callback_address = 4;
}

message DeleteRealmRequest {
required string name = 1;
}

message SendNodeMessagesRequest {
required string realm = 1;
repeated noisicaa.pb.ProcessorMessage messages = 2;
}

message CreatePluginUIRequest {
required string realm = 1;
required string node_id = 2;
}

message CreatePluginUIResponse {
required uint32 wid = 1;
required uint32 width = 2;
required uint32 height = 3;
}

message DeletePluginUIRequest {
required string realm = 1;
required string node_id = 2;
}

message PlayFileRequest {
required string path = 1;
}

message ProfileAudioThreadRequest {
required uint32 duration = 1;
}

message ProfileAudioThreadResponse {
required bytes svg = 1;
}

message SetBackendRequest {
required string name = 1;
optional noisicaa.pb.BackendSettings settings = 2;
}

message UpdateProjectPropertiesRequest {
required string realm = 1;
required noisicaa.pb.ProjectProperties properties = 2;
}

message PipelineMutationRequest {
required string realm = 1;
required Mutation mutation = 2;
}

message SetSessionValuesRequest {
required string realm = 1;
repeated noisicaa.pb.SessionValue session_values = 2;
}
Oops, something went wrong.

0 comments on commit da16c06

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