Exemplo n.º 1
0
 // Update the selection position on mouse down...
 private void mWaveform_MouseDown(object sender, MouseEventArgs e)
 {
     FlagMouseDown = true; //@zoomwaveform
     if (e.Button == MouseButtons.Left && CanSelectInWaveform)
     {
         if (mShiftKeyPressed && mWaveform.Selection != null)
         {
             int begin = mWaveform.SelectionPointPosition;
             if (begin < e.X)
             {
                 mWaveform.FinalSelectionPosition = e.X;
             }
             else
             {
                 if (mWaveform.Selection.HasCursor)
                 {
                     mWaveform.SelectionPointPosition = e.X;
                     mWaveform.FinalSelectionPosition = begin;
                 }
                 else
                 {
                     int end = mWaveform.FinalSelectionPosition;
                     mWaveform.SelectionPointPosition = e.X;
                     mWaveform.FinalSelectionPosition = end;
                 }
             }
         }
         else
         {
             mWaveform.SelectionPointPosition = e.X;
         }
         Strip.ContentView.DisableScrolling();
         Strip.SetSelectedAudioInBlockFromBlock(this, mWaveform.Selection);
     }
 }
Exemplo n.º 2
0
 // Double clicking on the waveform selects all.
 private void mWaveform_DoubleClick(object sender, EventArgs e)
 {
     if (CanSelectInWaveform)
     {
         mWaveform.Selection = new AudioRange(0.0, ((PhraseNode)mNode).Audio.Duration.AsMilliseconds);
         Strip.SetSelectedAudioInBlockFromBlock(this, mWaveform.Selection);
     }
 }
Exemplo n.º 3
0
 // Clicking selects at that point (see mouse up/down)
 private void mWaveform_Click(object sender, EventArgs e)
 {
     if (CanSelectInWaveform && mWaveform.Selection != null)
     {
         Strip.ContentView.DisableScrolling();
         Strip.SetSelectedAudioInBlockFromBlock(this, mWaveform.Selection);
     }
 }
Exemplo n.º 4
0
 // ... and commit it (select) on mouse up outside of the waveform (otherwise the click event is not registered ?!)
 private void mWaveform_MouseUp(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left && CanSelectInWaveform)
     {
         if (e.X < 0 || e.X > mWaveform.Width)
         {
             Strip.SetSelectedAudioInBlockFromBlock(this, mWaveform.Selection);
         }
     }
 }
Exemplo n.º 5
0
 public void SelectAtCurrentTime()
 {
     Strip.SetSelectedAudioInBlockFromBlock(this, mWaveform.Selection);
 }