// Select on tabbing protected void Block_Enter(object sender, EventArgs e) { if (!Strip.ContentView.Focusing) { Strip.SetSelectedBlockFromBlock(this); } }
// 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); } }
// 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); } }
// 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); } }
// ... 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); } } }
//@singleSection: height and width is increased by 20%, height is increased from properties of designer from 128 to 154 /// <summary> /// Create a new audio block for a phrase node in a strip. /// </summary> public AudioBlock(PhraseNode node, Strip strip, bool showWaveform) : base(node, strip) { InitializeComponent(); m_IsAudioBlockDisposing = false; m_ShowWaveform = showWaveform; SetWaveform(Node as PhraseNode); node.NodeAudioChanged += new NodeEventHandler <PhraseNode>(node_NodeAudioChanged); mShiftKeyPressed = false; if (ContentView.Settings.ObiFont != this.Font.Name) //@fontconfig { SetFont(); //@fontconfig } }
public Toolbar_EditAudio(ContentView contentView, Strip strip, EmptyNode node, ProjectView mProjectView) : this() { m_ContentView = contentView; m_Strip = strip; m_Node = node; m_ProjectView = mProjectView; m_ProjectView.SelectionChanged += new EventHandler(ProjectViewSelectionChanged); this.toolStrip1.MouseDown += new MouseEventHandler(Toolbar_EditAudio_MouseDown); this.toolStrip1.MouseUp += new MouseEventHandler(Toolbar_EditAudio_MouseUp); this.toolStrip1.MouseMove += new MouseEventHandler(Toolbar_EditAudio_MouseMove); this.toolStrip1.MinimumSize = this.Size; this.toolStrip1.MaximumSize = this.Size; this.toolStrip1.Size = this.Size; EditAudioPanelToolTipInit(); if (m_ProjectView.ObiForm.Settings.ObiFont != this.Font.Name) //@fontconfig { SetFont(); //@fontconfig } }
// Select/deselect on click private void Block_Click(object sender, EventArgs e) { Strip.SetSelectedBlockFromBlock(this); }
//@zoomwaveform public AudioBlock(PhraseNode node, Strip strip, bool isAudioScaleIndependentOfStrip, bool showWaveform) : this(node, strip, showWaveform) { m_IsAudioScaleIndependentOfStrip = isAudioScaleIndependentOfStrip; m_AudioScaleIndependentOfStrip = m_IsAudioScaleIndependentOfStrip ? 0.04f : -1.0f; }
public void SelectAtCurrentTime() { Strip.SetSelectedAudioInBlockFromBlock(this, mWaveform.Selection); }