Changeset 1257

Show
Ignore:
Timestamp:
06/09/08 12:20:15 (3 months ago)
Author:
drobilla
Message:

Fix creation of new ports on split modules (fixes ticket #144).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • patchage/src/JackDriver.cpp

    r1191 r1257  
    149149        if (ref.type == PatchageEvent::PortRef::JACK_ID) 
    150150                jack_port = jack_port_by_id(_client, ref.id.jack_id); 
    151  
     151         
    152152        string module_name, port_name; 
    153153        port_names(ref, module_name, port_name); 
     154 
     155        ModuleType type = InputOutput; 
     156        if (_app->state_manager()->get_module_split(module_name, 
     157                        (jack_port_flags(jack_port) & JackPortIsTerminal))) { 
     158                if (jack_port_flags(jack_port) & JackPortIsInput) { 
     159                        type = Input; 
     160                } else { 
     161                        type = Output; 
     162                } 
     163        } 
     164 
    154165        boost::shared_ptr<PatchageModule> parent 
    155                 = _app->canvas()->find_module(module_name, InputOutput); 
     166                = _app->canvas()->find_module(module_name, type); 
    156167         
    157168        if (!parent) { 
    158169                parent = boost::shared_ptr<PatchageModule>( 
    159                                 new PatchageModule(patchage, module_name, InputOutput)); 
     170                                new PatchageModule(patchage, module_name, type)); 
    160171                parent->load_location(); 
    161172                patchage->canvas()->add_item(parent); 
     
    234245        ports = jack_get_ports(_client, NULL, NULL, 0); // get all existing ports 
    235246 
     247        if (!ports) { 
     248                _shutdown_mutex.unlock(); 
     249                return; 
     250        } 
     251 
    236252        string client1_name; 
    237253        string port1_name; 
     
    240256         
    241257        // Add all ports 
    242         if (ports) 
    243258        for (int i=0; ports[i]; ++i) { 
    244259                port = jack_port_by_name(_client, ports[i]); 
     
    286301         
    287302        // Add all connections 
    288         if (ports) { 
    289          
    290303        for (int i=0; ports[i]; ++i) { 
    291304 
     
    332345        } 
    333346         
    334         } 
    335          
    336347        _shutdown_mutex.unlock(); 
    337348 
     
    570581        } 
    571582} 
     583 
    572584 
    573585float 
     
    593605} 
    594606 
     607 
    595608void 
    596609JackDriver::reset_max_dsp_load() 
    597610{ 
    598                 jack_reset_max_delayed_usecs(_client); 
    599 
     611        jack_reset_max_delayed_usecs(_client); 
     612
     613