Ejemplo n.º 1
0
        public MusicChooseView(StaveView sv, NoteView nv, ButtonView bv)
        {
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            InitializeComponent();
            connection = new DatabaseConnection();
            this.sv    = sv;
            this.nv    = nv;
            this.bv    = bv;
            musicView  = connection.getSheetMusic(1).Tables["Music"].DefaultView;

            scoreView           = connection.getSheetScore().Tables["Score"].DefaultView;
            scoreView.RowFilter = "Id = 0";

            //add sheet records to tab
            populateTab(SheetMusic, musicView);

            //Add Score records to tab
            populateTab(ScoreGrid, scoreView);
        }
Ejemplo n.º 2
0
        public ButtonView(Grid myGrid, StaveView sv, NoteView nv)
        {
            this.myGrid = myGrid;
            this.nv     = nv;
            this.sv     = sv;
            this.mPc    = sv.MusicPieceController;

            //menuGrid.ShowGridLines = true;
            // Define all columns for menuGrid
            DefineGridRowsMenuGrid();

            // Draw menu items
            DrawBpmMenu();

            // Metronome enable/disable button
            metronomeText                       = new TextBlock();
            metronomeText.Text                  = "🔇";
            metronomeButton                     = new Button();
            metronomeButton.Content             = metronomeText;
            metronomeButton.Width               = 40;
            metronomeButton.Height              = 40;
            metronomeButton.FontSize            = 25;
            metronomeButton.Click              += onMetronomeButtonClick;
            metronomeButton.HorizontalAlignment = HorizontalAlignment.Center;


            // Piano enable/disable button
            TextDecoration strikeTroughDecoration = new TextDecoration();

            strikeTroughDecoration.Location = TextDecorationLocation.Strikethrough;
            strikeTroughDecoration.Pen      = new Pen(Brushes.Red, 3);
            strikeTrough.Add(strikeTroughDecoration);
            pianoText                       = new TextBlock();
            pianoText.Text                  = "🎹";
            pianoText.TextDecorations       = strikeTrough;
            pianoButton                     = new Button();
            pianoButton.Content             = pianoText;
            pianoButton.Width               = 40;
            pianoButton.Height              = 40;
            pianoButton.FontSize            = 20;
            pianoButton.Click              += onPianoButtonClick;
            pianoButton.HorizontalAlignment = HorizontalAlignment.Center;
            pianoButton.VerticalAlignment   = VerticalAlignment.Bottom;

            // Start button
            startBtn.FontSize            = 25;
            startBtn.Name                = "startBtn";
            startBtn.Content             = "▶";
            startBtn.Width               = 40;
            startBtn.Height              = 40;
            startBtn.HorizontalAlignment = HorizontalAlignment.Center;
            startBtn.Click              += StartBtn_Click;
            Grid.SetColumn(startBtn, 5);

            // Stop Button
            StopBtn.FontSize            = 25;
            StopBtn.Name                = "stopBtn";
            StopBtn.Content             = "◼";
            StopBtn.Width               = 40;
            StopBtn.Height              = 40;
            StopBtn.HorizontalAlignment = HorizontalAlignment.Center;
            StopBtn.Click              += StopBtn_Click;
            StopBtn.IsEnabled           = false;
            Grid.SetColumn(StopBtn, 6);


            // Add the button to the Grid
            SelectSheetMusic                     = new Button();
            SelectSheetMusic.Name                = "SelectSheetMusic";
            SelectSheetMusic.Content             = "Selecteer \n muziekstuk";
            SelectSheetMusic.Width               = menuGrid.ColumnDefinitions[0].Width.Value - 15;
            SelectSheetMusic.Height              = 40;
            SelectSheetMusic.HorizontalAlignment = HorizontalAlignment.Left;
            SelectSheetMusic.VerticalAlignment   = VerticalAlignment.Bottom;
            SelectSheetMusic.Click              += SelectSheetMusic_Click;

            Grid.SetRow(menuGrid, 0);

            Grid.SetColumn(SelectSheetMusic, 0);
            Grid.SetColumn(pianoButton, 8);
            Grid.SetColumn(metronomeButton, 7);

            menuGrid.Children.Add(metronomeButton);
            menuGrid.Children.Add(pianoButton);
            menuGrid.Children.Add(startBtn);
            menuGrid.Children.Add(StopBtn);
            menuGrid.Children.Add(SelectSheetMusic);

            myGrid.Children.Add(menuGrid);
        }
Ejemplo n.º 3
0
 public NoteView(StaveView sv)
 {
     this.mPc = sv.MusicPieceController;
     mPc.SheetController.NoteView = this;
     DrawNotes();
 }