private void pictureBox1_MouseDown(object sender, MouseEventArgs e) { if (WF2 == null) { return; } long pos = WF2.GetBytePositionFromX(e.X, pictureBox1.Width, -1, -1); Bass.BASS_ChannelSetPosition(stream, pos); }
public void SetPosition(int x) { if (WF2 == null) return; long pos = WF2.GetBytePositionFromX(x, 100, _zoomStart, _zoomEnd); Bass.BASS_ChannelSetPosition(_stream, pos); }
private void pictureBoxWaveForm_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { if (_WF == null) { return; } bool doubleClick = e.Clicks > 1; bool lowerHalf = (e.Y > pictureBoxWaveForm.Height / 2); if (lowerHalf && doubleClick) { ToggleZoom(); } else if (!lowerHalf && e.Button == MouseButtons.Left) { // left button will set the position long pos = _WF.GetBytePositionFromX(e.X, pictureBoxWaveForm.Width, _zoomStart, _zoomEnd); SetEnvelopePos(_currentTrack.Channel, pos); } else if (!lowerHalf) { _currentTrack.NextTrackPos = _WF.GetBytePositionFromX(e.X, pictureBoxWaveForm.Width, _zoomStart, _zoomEnd); // if there is already a sync set, remove it first if (_currentTrack.NextTrackSync != 0) { BassMix.BASS_Mixer_ChannelRemoveSync(_currentTrack.Channel, _currentTrack.NextTrackSync); } // right button will set a next track position sync _currentTrack.NextTrackSync = BassMix.BASS_Mixer_ChannelSetSync(_currentTrack.Channel, BASSSync.BASS_SYNC_POS | BASSSync.BASS_SYNC_MIXTIME, _currentTrack.NextTrackPos, _currentTrack.TrackSync, new IntPtr(1)); _WF.AddMarker("Next", _currentTrack.NextTrackPos); DrawWave(); } }