Logo Search packages:      
Sourcecode: patchage version File versions  Download package

void PatchBay::PatchBayArea::ports_joined ( Port port1,
Port port2 
) [protected]

Called when two ports are 'toggled' (connected or disconnected)

Definition at line 327 of file PatchBayArea.cpp.

References connect(), disconnect(), PatchBay::Port::hilite(), and PatchBay::Port::is_input().

Referenced by port_event().

{
      port1->hilite(false);
      port2->hilite(false);

      string src_mod_name, dst_mod_name, src_port_name, dst_port_name;

      Port* src_port = NULL;
      Port* dst_port = NULL;
      
      if (port2->is_input() && ! port1->is_input()) {
            src_port = port1;
            dst_port = port2;
      } else if ( ! port2->is_input() && port1->is_input()) {
            src_port = port2;
            dst_port = port1;
      } else {
            return;
      }
      
      if (are_connected(src_port, dst_port))
            disconnect(src_port, dst_port);
      else
            connect(src_port, dst_port);
}


Generated by  Doxygen 1.6.0   Back to index