Exemple #1
0
        void OnEditTimeSignature(object sender, PointerPressedEventArgs args)
        {
            var project = DocManager.Inst.Project;
            var dialog  = new TypeInDialog();

            dialog.Title = "Time Signature";
            dialog.SetText($"{project.beatPerBar}/{project.beatUnit}");
            dialog.onFinish = s => {
                var parts      = s.Split('/');
                int beatPerBar = parts.Length > 0 && int.TryParse(parts[0], out beatPerBar) ? beatPerBar : project.beatPerBar;
                int beatUnit   = parts.Length > 1 && int.TryParse(parts[1], out beatUnit) ? beatUnit : project.beatUnit;
                viewModel.PlaybackViewModel.SetTimeSignature(beatPerBar, beatUnit);
            };
            dialog.ShowDialog(this);
        }
Exemple #2
0
        void OnEditBpm(object sender, PointerPressedEventArgs args)
        {
            var project = DocManager.Inst.Project;
            var dialog  = new TypeInDialog();

            dialog.Title = "BPM";
            dialog.SetText(project.bpm.ToString());
            dialog.onFinish = s => {
                if (double.TryParse(s, out double bpm))
                {
                    viewModel.PlaybackViewModel.SetBpm(bpm);
                }
            };
            dialog.ShowDialog(this);
        }
        void OnMenuRenamePart(object?sender, RoutedEventArgs e)
        {
            var part = ViewModel.NotesViewModel.Part;

            if (part == null)
            {
                return;
            }
            var dialog = new TypeInDialog();

            dialog.Title = "Rename";
            dialog.SetText(part.name);
            dialog.onFinish = name => {
                if (!string.IsNullOrWhiteSpace(name) && name != part.name)
                {
                    ViewModel.RenamePart(part, name);
                }
            };
            dialog.Show(this);
        }