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

void QEFileView::mark_area_relative ( int  from,
int  to 
) [private]

Set the marked area using relative screen coordinates

Definition at line 241 of file qefile.cpp.

References marked_area_changed().

{
  int pos1,pos2;
  if (from > to) {
    pos1 = to;
    pos2 = from;
  }
  else {
    pos1 = from;
    pos2 = to;
  }
  if (pos1 < 0) pos1 = 0;

  int rpos1 = pos1;
  int rpos2 = pos2;
  if (last_mousemove_xpos < rpos1) rpos1 = last_mousemove_xpos;
  else if (last_mousemove_xpos > rpos2) rpos2 = last_mousemove_xpos;
  
  for(int n = 0; n < static_cast<int>(waveforms.size()); n++) {
    waveforms[n]->mark_area_relative(pos1,pos2);
    //      cerr << "Mouse area blocks: " << to << " to " << from << ".\n";
    waveforms[n]->toggle_marking(true);
    waveforms[n]->repaint(rpos1, 0, rpos2 - rpos1, waveforms[n]->height(), false);
  }

  emit marked_area_changed(ECA_AUDIO_TIME(coord_to_samples(pos1), sample_rate_rep), 
                     ECA_AUDIO_TIME(coord_to_samples(pos2), sample_rate_rep));
}


Generated by  Doxygen 1.6.0   Back to index