/// <summary> /// Binds the data. /// </summary> private void BindData() { _bindingData = true; var loopLengths = BpmHelper.GetLoopLengths(Track.StartBpm); cmbCustomFadeInLength.PopulateItemsFromSecondsList(loopLengths); loopLengths = BpmHelper.GetLoopLengths(Track.EndBpm); cmbCustomFadeOutLength.PopulateItemsFromSecondsList(loopLengths); lblStartBPM.Text = Track.StartBpm.ToString("0.00"); lblEndBPM.Text = Track.EndBpm.ToString("0.00"); Text = @"Halloumi : Shuffler : Shuffler Details : " + Track.Description; chkUsePreFadeIn.Checked = Track.UsePreFadeIn; chkUseSkipSection.Checked = Track.HasSkipSection; txtSkipStart.Seconds = Track.SamplesToSeconds(Track.SkipStart); cmbSkipLength.Seconds = Track.SkipLengthSeconds; cmbSkipLength.PopulateItemsFromSecondsList(loopLengths); txtFadeInPosition.Seconds = Track.SamplesToSeconds(Track.FadeInStart); txtFadeOutStartPosition.Seconds = Track.SamplesToSeconds(Track.FadeOutStart); txtPreFadeInStartPosition.Seconds = Track.SamplesToSeconds(Track.PreFadeInStart); if (Track.FadeInEnd != 0) { cmbCustomFadeInLength.Seconds = Track.SamplesToSeconds(Track.FadeInEnd - Track.FadeInStart); } if (Track.FadeOutEnd != 0) { cmbCustomFadeOutLength.Seconds = Track.SamplesToSeconds(Track.FadeOutEnd - Track.FadeOutStart); } cmbPreFadeInStartVolume.Text = (Track.PreFadeInStartVolume * 100).ToString(CultureInfo.InvariantCulture); cmbFadeInLoopCount.Text = !Track.IsLoopedAtStart ? "0" : Track.StartLoopCount.ToString(); cmbFadeOutLoopCount.Text = !Track.IsLoopedAtEnd ? "0" : Track.EndLoopCount.ToString(); chkPowerDown.Checked = Track.PowerDownOnEnd; BindSamples(); BindSample(); _bindingData = false; }
private void BindSample() { List <double> loopLengths; if (CurrentSample == null) { txtSampleStartPosition.Seconds = 0; loopLengths = BpmHelper.GetLoopLengths(Track.Bpm); cmbSampleLength.Seconds = 0; chkLoopSample.Checked = false; } else { txtSampleStartPosition.Seconds = CurrentSample.Start; loopLengths = BpmHelper.GetLoopLengths(CurrentSample.CalculateBpm(Track)); cmbSampleLength.Seconds = CurrentSample.Length; chkLoopSample.Checked = CurrentSample.IsLooped; } cmbSampleLength.PopulateItemsFromSecondsList(loopLengths); }
private void BindSample() { List <double> loopLengths; if (CurrentSample == null) { txtSampleStartPosition.Seconds = 0; txtSampleOffsetPosition.Seconds = 0; loopLengths = BpmHelper.GetLoopLengths(Track.Bpm); cmbSampleLength.Seconds = 0; SetLoopModeOnDropdown(LoopMode.FullLoop); chkAtonal.Checked = false; chkPrimaryLoop.Checked = false; lblSampleBPM.Text = @"100.00"; txtTags.Text = ""; } else { loopLengths = BpmHelper.GetLoopLengths(CurrentSample.Bpm); txtSampleStartPosition.Seconds = CurrentSample.Start; txtSampleOffsetPosition.Seconds = CurrentSample.Offset; lblSampleBPM.Text = CurrentSample.Bpm.ToString("0.00"); cmbSampleLength.Seconds = CurrentSample.Length; SetLoopModeOnDropdown(CurrentSample.LoopMode); chkAtonal.Checked = CurrentSample.IsAtonal; chkPrimaryLoop.Checked = CurrentSample.IsPrimaryLoop; txtTags.Text = string.Join(", ", CurrentSample.Tags.ToArray()); } // SetSampleCheckBoxes(); SetSampleBpmLabel(); cmbSampleLength.PopulateItemsFromSecondsList(loopLengths); }