Beispiel #1
0
    def _handle_node_info_response(self, message):
        from supriya.commands import Response
        from supriya.realtime import Group, Synth

        response = Response.from_osc_message(message)
        with self._lock:
            node_id = response.node_id
            node = self._nodes.get(node_id)
            if node is not None:
                node._handle_response(response)
            elif response.action == NodeAction.NODE_CREATED:
                if response.is_group:
                    node = Group()
                else:
                    node = self._pending_synths.pop(node_id, Synth())
                node._register_with_local_server(server=self,
                                                 node_id=response.node_id)
                parent = self._nodes[response.parent_id]
                node._set_parent(parent)
                if response.previous_node_id:
                    previous_child = self._nodes[response.previous_node_id]
                    index = parent.index(previous_child)
                    parent._children.insert(index + 1, node)
                else:
                    parent._children.append(node)
Beispiel #2
0
    def _handle_control_bus_set_response(self, message):
        from supriya.commands import Response

        response = Response.from_osc_message(message)
        for item in response:
            bus_id = item.bus_id
            bus_proxy = self._get_control_bus_proxy(bus_id)
            bus_proxy._value = item.bus_value
Beispiel #3
0
    def _handle_buffer_info_response(self, message):
        from supriya.commands import Response

        response = Response.from_osc_message(message)
        for item in response.items:
            buffer_proxy = self._get_buffer_proxy(item.buffer_id)
            if buffer_proxy:
                buffer_proxy._handle_response(item)
Beispiel #4
0
    def _handle_control_bus_setn_response(self, message):
        from supriya.commands import Response

        response = Response.from_osc_message(message)
        for item in response:
            starting_bus_id = item.starting_bus_id
            for i, value in enumerate(item.bus_values):
                bus_id = starting_bus_id + i
                bus_proxy = self._get_control_bus_proxy(bus_id)
                bus_proxy._value = value
Beispiel #5
0
    def _handle_synthdef_removed_response(self, message):
        from supriya.commands import Response

        response = Response.from_osc_message(message)
        synthdef_name = response.synthdef_name
        self._synthdefs.pop(synthdef_name, None)
Beispiel #6
0
    def _handle_status_reply_response(self, message):
        from supriya.commands import Response

        response = Response.from_osc_message(message)
        self._status = response
Beispiel #7
0
    def _set_response_async(self, message):
        from supriya.commands import Response

        self._response = Response.from_osc_message(message)
        self._response_future.set_result(True)
Beispiel #8
0
    def _set_response(self, message):
        from supriya.commands import Response

        with self.condition:
            self._response = Response.from_osc_message(message)
            self.condition.notify()