Ejemplo n.º 1
0
        private void AddSample(string sampleName, double start, double length)
        {
            var sample = new Sample
            {
                Description = sampleName
            };

            if (LibraryTrack != null)
            {
                TrackSampleLibrary.UpdateSampleFromTrack(sample, LibraryTrack);
            }

            Samples.Add(sample);
            CurrentSample           = sample;
            trackWave.CurrentSample = sample;
            trackWave.Samples       = Samples;

            sample.Start  = start;
            sample.Length = length;
            sample.Bpm    = BpmHelper.GetBpmFromLoopLength(sample.Length);

            RefreshTrackWavePositions();

            BindData();
        }
Ejemplo n.º 2
0
        private void Initialise()
        {
            trackWave.Mode       = TrackWave.TrackWaveMode.Sampler;
            trackWave.BassPlayer = BassPlayer;
            Track        = trackWave.LoadTrack(Filename);
            LibraryTrack = Library.GetTrackByFilename(Filename) ?? Library.LoadNonLibraryTrack(Filename);

            cmbOutput.SelectedIndex = 0;

            if ((Samples == null || (Samples != null && Samples.Count == 0)) && LibraryTrack != null)
            {
                _updateSampleLibrary = true;
                Samples = TrackSampleLibrary
                          .GetSamples(LibraryTrack)
                          .Select(sample => sample.Clone())
                          .ToList();
            }
            else
            {
                if (LibraryTrack != null && Samples != null)
                {
                    foreach (var sample in Samples)
                    {
                        TrackSampleLibrary.UpdateSampleFromTrack(sample, LibraryTrack);
                    }
                }
            }


            trackWave.Samples = Samples;

            btnImportSamplesFromMix.Visible = LibraryTrack != null && LibraryTrack.IsShufflerTrack;

            BindData();

            for (var i = 0; i < lstSamples.Items.Count; i++)
            {
                lstSamples.Items[i].Selected = lstSamples.Items[i].Text == InitialSample;
            }
        }