예제 #1
0
        private void AddTrackPlot(Track track)
        {
            MelodySequence seq = track.GetMainSequence() as MelodySequence;

            ListBoxItem listBoxItem = new ListBoxItem();
            OxyPlot.Wpf.PlotView plotView = new OxyPlot.Wpf.PlotView();
            plotView.Margin = new Thickness(0, 0, 82, 10);
            setupTrackPlot(plotView);
            generateSongPlotFull(plotView.Model, seq.GeneratePlaybackInfo(0));

            Grid grid = new Grid();
            grid.Height = 128;
            grid.Children.Add(plotView);
            listBoxItem.Content = grid;
            listBoxItem.Tag = track;
            listBoxItem.MouseDoubleClick += listBoxItem_MouseDoubleClick;

            itemsBox.Items.Add(listBoxItem);
        }
        private bool IsValidTrack(Track track)
        {
            if (track.Channel == 10)
                return false;
            var mel = track.GetMainSequence() as MelodySequence;
            if (mel.Length > MaxLength)
                return false;

            return true;
        }