- {
- int current_time = 0;
- for(Edit *current = edits->first;
- current && current_time < times->size(); )
- {
- if(current->startproject >= start_units &&
- current->startproject + current->length <= end_units)
- {
- int64_t desired_startunits = to_units(times->get(current_time), 0);
- int64_t current_startunits = current->startproject;
+ Edit *master = master_track->edits->first;
+ for(Edit *current = edits->first; current && master; ) {
+ if( current->startproject >= start_units &&
+ current->startproject + current->length <= end_units ) {
+// edit is in highlighted region
+ int64_t master_length_units = to_units(master_track->from_units(master->length), 0);
+// starting time of master edit
+ int64_t master_start_units = to_units(master_track->from_units(master->startproject), 0);
+// starting time of current edit
+ int64_t current_startunits = current->startproject;
+
+// the following occur if multiple aligns are performed
+// master edit is not silence but current edit is silence
+ if( !master->silence() && current->silence() ) {
+// try again with next edit