Ejemplo n.º 1
0
    def connect(self, connection):
        """
        Connect two effect audio ports

        :param pluginsmanager.model.connection.Connection connection: Connection with the two effect audio ports (output and input)
        """
        self.connection.send(ProtocolParser.connect(connection))
    def test_connect_system_effect(self):
        system_effect = SystemEffect('system', ('capture_1', 'capture_2'), ('playback_1', 'playback_2'))

        output = system_effect.outputs[1]
        input = system_effect.inputs[0]
        connection = Connection(output, input)

        correct_message = 'connect system:{} system:{}'.format(
            output.symbol,
            input.symbol
        )

        self.assertEqual(correct_message, ProtocolParser.connect(connection))
    def test_connect(self):
        effect1_instance = 3
        effect2_instance = 4

        reverb1 = self.builder.build('http://calf.sourceforge.net/plugins/Reverb')
        reverb2 = self.builder.build('http://calf.sourceforge.net/plugins/Reverb')
        reverb1.instance = effect1_instance
        reverb2.instance = effect2_instance

        output = reverb1.outputs[0]
        input = reverb2.inputs[0]
        connection = Connection(output, input)

        correct_message = 'connect effect_{}:{} effect_{}:{}'.format(
            reverb1.instance,
            output.symbol,
            reverb2.instance,
            input.symbol
        )

        self.assertEqual(correct_message, ProtocolParser.connect(connection))