Пример #1
0
        public MainController(TextBox fileTextBox, TextBox LilyTextBox)
        {
            this.fileTextBox = fileTextBox;
            FileHandler      = new FileHandler();
            DrawableStaff    = new ObservableCollection <MusicalSymbol>();
            player           = new MidiPlayer();
            lilypondEditor   = new LilypondEditor(LilyTextBox, this);

            ViewCOR = new LilypondHandler(LilyTextBox, lilypondEditor);
            ViewCOR.addHandler(new MidiHandler(player));
            ViewCOR.addHandler(new WPFHandler(DrawableStaff));

            commands = new Dictionary <string, Command>
            {
                [CKey.InsertClef]  = new InsertClefCommand(LilyTextBox),
                [CKey.InsertTempo] = new InsertTempoCommand(LilyTextBox),

                [CKey.InsertTime]   = new InsertTimeCommand(LilyTextBox),
                [CKey.InsertTime44] = new InsertTimeCommand(LilyTextBox, "4/4"),
                [CKey.InsertTime34] = new InsertTimeCommand(LilyTextBox, "3/4"),
                [CKey.InsertTime68] = new InsertTimeCommand(LilyTextBox, "6/8"),

                [CKey.Open]    = new OpenCommand(this),
                [CKey.Save]    = new SaveCommand(lilypondEditor),
                [CKey.SavePdf] = new SaveToPDFCommand(lilypondEditor)
            };
        }
Пример #2
0
        public LilypondHandler(TextBox text, LilypondEditor lilypondEditor)
        {
            handleType = ContentType.LILYPOND;
            textBox    = text;

            this.lilypondEditor = lilypondEditor;
        }
 public SaveToPDFCommand(LilypondEditor lilypondEditor, string fileName = "")
 {
     _lilypondEditor = lilypondEditor;
     _fileName       = fileName;
 }
Пример #4
0
 public SaveCommand(LilypondEditor lilypondEditor)
 {
     _lilypondEditor = lilypondEditor;
 }