示例#1
0
        private void CmdScoreNoteModifySpecial_Executed(object sender, ExecutedEventArgs e)
        {
            var hit = (ScoreEditorHitTestResult)e.Parameter;

            if (hit == null || !hit.HitAnyNote)
            {
                return;
            }

            var note = hit.Note;

            Debug.Assert(note.Params != null, "note.Params != null");

            var originalBpm = note.Params.NewBpm;

            var(r, newBpm) = FSpecialNote.VariantBpmRequestInput(this, hit.Bar.Basic.Index, hit.Row, originalBpm);

            if (r == DialogResult.Cancel)
            {
                return;
            }
            note.Params.NewBpm = newBpm;
            InformProjectModified();
            visualizer.Editor.UpdateBarStartTimeText();

            ctxScoreNoteInsertSpecial.DeleteCommandParameter();
            ctxScoreNoteModifySpecial.DeleteCommandParameter();
            ctxScoreNoteDeleteSpecial.DeleteCommandParameter();
        }
示例#2
0
        private void CmdScoreNoteInsertSpecial_Executed(object sender, ExecutedEventArgs e)
        {
            var    hit = (ScoreEditorHitTestResult)e.Parameter;
            double newBpm;
            Bar    bar;
            int    newRowIndex;

            if (hit == null)
            {
                var r = FSpecialNote.VariantBpmRequestInput(this, visualizer.Editor.CurrentScore);
                if (r.DialogResult == DialogResult.Cancel)
                {
                    return;
                }
                newBpm = r.NewBpm;
                bar    = visualizer.Editor.CurrentScore?.Bars.Find(b => b.Basic.Index == r.BarIndex);
                if (bar == null)
                {
                    return;
                }
                newRowIndex = r.RowIndex;
            }
            else
            {
                if (!hit.HitAnyBar)
                {
                    return;
                }
                var r = FSpecialNote.VariantBpmRequestInput(this, hit.Bar.Basic.Index, hit.Row);
                if (r.DialogResult == DialogResult.Cancel)
                {
                    return;
                }
                newBpm      = r.NewBpm;
                bar         = hit.Bar;
                newRowIndex = hit.Row;
            }

            var note = bar.AddSpecialNote(NoteType.VariantBpm);

            Debug.Assert(note.Params != null, "note.Params != null");

            note.Params.NewBpm     = newBpm;
            note.Basic.IndexInGrid = newRowIndex;

            InformProjectModified();
            visualizer.Editor.UpdateBarStartTimeText();

            ctxScoreNoteInsertSpecial.DeleteCommandParameter();
            ctxScoreNoteModifySpecial.DeleteCommandParameter();
            ctxScoreNoteDeleteSpecial.DeleteCommandParameter();
        }