Ejemplo n.º 1
0
        private void UpdateViewText()
        {
            var start    = TimeFormatHelper.GetFormattedSeconds(BassTrack.SamplesToSeconds(ZoomStart));
            var end      = TimeFormatHelper.GetFormattedSeconds(BassTrack.SamplesToSeconds(ZoomEnd));
            var length   = TimeFormatHelper.GetFormattedSeconds(BassTrack.SamplesToSeconds(ZoomLength));
            var position = TimeFormatHelper.GetFormattedSeconds(BassTrack.SamplesToSeconds(CurrentPosition));

            lblViewDetails.Text = $"View: {start} to {end} ({length}) Cursor: {position}";
        }
        private string GetSampleFolder(Sample sample)
        {
            var sampleFolder = Path.Combine(SampleLibraryFolder,
                                            FileSystemHelper.StripInvalidFileNameChars(sample.TrackArtist));

            var titleFolder = $"{sample.TrackTitle} ({TimeFormatHelper.GetFormattedSeconds(sample.TrackLength)})";

            titleFolder = FileSystemHelper.StripInvalidFileNameChars(titleFolder);

            sampleFolder = Path.Combine(sampleFolder, titleFolder);

            return(sampleFolder);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Gets the selected track FX.
        /// </summary>
        /// <returns>The selected track FX.</returns>
        private TrackFXTrigger GetSelectedTrackFx()
        {
            if (cmbTrackFX.Items.Count == 0 || cmbTrackFX.SelectedIndex < 0)
            {
                return(null);
            }

            var selectedText = cmbTrackFX.SelectedItem.ToString();

            return(AutomationAttributes
                   .TrackFXTriggers
                   .OrderBy(t => t.Start)
                   .FirstOrDefault(trackFx => selectedText == TimeFormatHelper.GetFormattedSeconds(trackFx.Start)));
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     Populates the track FX combo box.
        /// </summary>
        private void PopulateTrackFxComboBox()
        {
            cmbTrackFX.Items.Clear();

            foreach (var trigger in AutomationAttributes.TrackFXTriggers.OrderBy(t => t.Start).ToList())
            {
                cmbTrackFX.Items.Add(TimeFormatHelper.GetFormattedSeconds(trigger.Start));
            }

            if (cmbTrackFX.Items.Count > 0)
            {
                cmbTrackFX.SelectedIndex = 0;
            }
        }