~ubuntu-branches/ubuntu/lucid/ardour/lucid-proposed

« back to all changes in this revision

Viewing changes to libs/ardour/route.cc

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2008-07-29 11:27:04 UTC
  • mfrom: (1.1.15 upstream)
  • Revision ID: james.westby@ubuntu.com-20080729112704-x1rmgb4tjotjyu5u
Tags: 1:2.5-0ubuntu1
* New upstream release.
* debian/patches/s390-FTBFS.patch: Dropped, as it fails to apply, and
  Ubuntu doesn't concern itself with s390.
* debian/control:
  - Fix package description, thanks to the patch in Debian bug #485892.
  - Metadata cleanup and sync control/control.in files.
  - Add libaubio-dev to Build-Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
873
873
                uint32_t potential_max_streams = 0;
874
874
 
875
875
                if ((pi = boost::dynamic_pointer_cast<PluginInsert>(redirect)) != 0) {
876
 
                        pi->set_count (1);
877
876
 
878
877
                        if (pi->input_streams() == 0) {
879
878
                                /* instrument plugin */
1093
1092
                        return -1;
1094
1093
                }
1095
1094
 
1096
 
                bool foo = false;
 
1095
                _have_internal_generator = false;
1097
1096
 
1098
1097
                for (i = _redirects.begin(); i != _redirects.end(); ++i) {
1099
1098
                        boost::shared_ptr<PluginInsert> pi;
1100
1099
                        
1101
1100
                        if ((pi = boost::dynamic_pointer_cast<PluginInsert>(*i)) != 0) {
1102
1101
                                if (pi->is_generator()) {
1103
 
                                        foo = true;
 
1102
                                        _have_internal_generator = true;
 
1103
                                        break;
1104
1104
                                }
1105
1105
                        }
1106
1106
                }
1107
 
 
1108
 
                _have_internal_generator = foo;
1109
1107
        }
1110
1108
 
1111
1109
        if (old_rmo != redirect_max_outs) {
1134
1132
        uint32_t send_cnt = 0;
1135
1133
        map<Placement,list<InsertCount> > insert_map;
1136
1134
        RedirectList::iterator prev;
1137
 
        nframes_t initial_streams;
 
1135
        int32_t initial_streams = n_inputs ();;
 
1136
        int32_t previous_initial_streams = n_inputs ();
1138
1137
        int ret = -1;
1139
1138
 
1140
1139
        redirect_max_outs = 0;
1141
1140
 
1142
 
        /* divide inserts up by placement so we get the signal flow
 
1141
        /* Step 1: build a map that links each insert to an in/out channel count 
 
1142
 
 
1143
           Divide inserts up by placement so we get the signal flow
1143
1144
           properly modelled. we need to do this because the _redirects
1144
1145
           list is not sorted by placement, and because other reasons may 
1145
1146
           exist now or in the future for this separate treatment.
1191
1192
        /* figure out the streams that will feed into PreFader */
1192
1193
 
1193
1194
        if (!insert_map[PreFader].empty()) {
1194
 
                InsertCount& ic (insert_map[PreFader].back());
1195
 
                initial_streams = ic.insert->compute_output_streams (ic.cnt);
1196
 
        } else {
1197
 
                initial_streams = n_inputs ();
 
1195
                previous_initial_streams = n_inputs ();
 
1196
                for (list<InsertCount>::iterator i = insert_map[PreFader].begin(); i != insert_map[PreFader].end(); i++) {
 
1197
                        if (i->insert->can_do (previous_initial_streams, initial_streams) < 0) {
 
1198
                                goto streamcount;
 
1199
                        }
 
1200
                        previous_initial_streams = initial_streams;
 
1201
                }
1198
1202
        }
1199
1203
 
1200
1204
        /* B: PostFader */
1203
1207
                goto streamcount;
1204
1208
        }
1205
1209
 
 
1210
        if (!insert_map[PostFader].empty()) {
 
1211
                for (list<InsertCount>::iterator i = insert_map[PostFader].begin(); i != insert_map[PostFader].end(); i++) {
 
1212
                        if (i->insert->can_do (previous_initial_streams, initial_streams) < 0) {
 
1213
                                goto streamcount;
 
1214
                        }
 
1215
                        previous_initial_streams = initial_streams;
 
1216
                }
 
1217
        }
 
1218
 
1206
1219
        /* OK, everything can be set up correctly, so lets do it */
1207
1220
 
1208
1221
        apply_some_plugin_counts (insert_map[PreFader]);
1269
1282
        list<InsertCount>::iterator i;
1270
1283
        
1271
1284
        for (i = iclist.begin(); i != iclist.end(); ++i) {
1272
 
 
1273
 
                if (((*i).cnt = (*i).insert->can_support_input_configuration (required_inputs)) < 0) {
 
1285
                
 
1286
                if (((*i).cnt = (*i).insert->can_do (required_inputs, (*i).out)) < 0) {
1274
1287
                        if (err_streams) {
1275
1288
                                *err_streams = required_inputs;
1276
1289
                        }
1278
1291
                }
1279
1292
                
1280
1293
                (*i).in = required_inputs;
1281
 
 
1282
 
                if (((*i).out = (*i).insert->compute_output_streams ((*i).cnt)) < 0) {
1283
 
                        if (err_streams) {
1284
 
                                *err_streams = required_inputs;
1285
 
                        }
1286
 
                        return -1;
1287
 
                }
1288
 
 
1289
1294
                required_inputs = (*i).out;
1290
1295
        }
1291
1296
 
2419
2424
                }
2420
2425
        }
2421
2426
 
 
2427
#undef DEBUG_LATENCY
 
2428
#ifdef DEBUG_LATENCY
 
2429
        cerr << _name << ": internal redirect latency = " << _own_latency << endl;
 
2430
#endif
 
2431
 
2422
2432
        set_port_latency (_own_latency);
2423
2433
 
2424
2434
        /* this (virtual) function is used for pure Routes,
2430
2440
 
2431
2441
        _own_latency += input_latency ();
2432
2442
 
 
2443
#ifdef DEBUG_LATENCY
 
2444
        cerr << _name << ": input latency = " << input_latency() << " total = "
 
2445
             << _own_latency << endl;
 
2446
#endif
 
2447
 
2433
2448
        return _own_latency;
2434
2449
}
2435
2450