예제 #1
0
        private void mnuFileNewMML_Click(object sender, EventArgs e)
        {
            bneverplayed = true;
            string path = songtext1.FileName;

            songtext1 = new SongText();

            if (File.Exists(path))
            {
                songtext1.FileName = GetUniqueFileName(path = Path.Combine(Path.GetDirectoryName(path), "New.mml"));
            }
            else
            {
                songtext1.FileName = "New.mml";
            }

            songtext1.LoadProgressChanged += HandleLoadProgressChanged;
            songtext1.LoadCompleted       += HandleLoadCompleted;
            songtext1.SaveProgressChanged += HandleSaveProgressChanged;
            songtext1.SaveCompleted       += HandleSaveCompleted;

            string tx = @"MML@o2l4t120 cdefg2g2 aaaag2 aaaag2 ffffe2e2 ddddc1;";

            this.txtEditText.Text = tx;

            SetTitle("New.mml");
            SetIcon();
        }
예제 #2
0
        public FrmTextPlayer(OutputDevice outdeviceText, string path, bool bplay)
        {
            InitializeComponent();
            outDevice = outdeviceText;

            // If true, launch player
            bPlayNow = bplay;

            if (path != null && path != string.Empty)
            {
                songtext1                      = new SongText();
                songtext1.FileName             = path;
                songtext1.LoadProgressChanged += HandleLoadProgressChanged;
                songtext1.LoadCompleted       += HandleLoadCompleted;
                songtext1.SaveProgressChanged += HandleSaveProgressChanged;
                songtext1.SaveCompleted       += HandleSaveCompleted;
            }


            // if Edit, force show Text Editor
            if (bPlayNow == false)
            {
                bForceShowTextEditor = true;
            }

            txtEditText.Multiline  = true;
            txtEditText.WordWrap   = false;
            txtEditText.ScrollBars = System.Windows.Forms.ScrollBars.Both;
        }
예제 #3
0
        private void mnuFileNewABC_Click(object sender, EventArgs e)
        {
            bneverplayed = true;
            string path = songtext1.FileName;

            songtext1 = new SongText();

            if (File.Exists(path))
            {
                songtext1.FileName = GetUniqueFileName(path = Path.Combine(Path.GetDirectoryName(path), "New.abc"));
            }
            else
            {
                songtext1.FileName = "New.abc";
            }


            songtext1.LoadProgressChanged += HandleLoadProgressChanged;
            songtext1.LoadCompleted       += HandleLoadCompleted;
            songtext1.SaveProgressChanged += HandleSaveProgressChanged;
            songtext1.SaveCompleted       += HandleSaveCompleted;

            string tx = @"X:1
T: <your title>
M: 4/4     <Meter>
L: 1/4     <Length of undecorated note>
K: Amin    <Key signature>
Q: 1/4=120 <Tempo>
% Headers below are optional
A: <Author - Carborunda Riverside of the Stoors>
O: <Region of origin - Stock, The Shire, Eriador> 
N: <Any notes you want>
N: <And any more lines of note.>
%
% And now your lovely music...
|ABCD|EFG>^G|[A4a4C4E4]||";

            this.txtEditText.Text = tx;

            /*
             * X:1
             * T: <your title>
             * M: 4/4     <Meter>
             * L: 1/4     <Length of undecorated note>
             * K: Amin    <Key signature>
             * Q: 1/4=120 <Tempo>
             * % Headers below are optional
             * A: <Author - Carborunda Riverside of the Stoors>
             * O: <Region of origin - Stock, The Shire, Eriador>
             * N: <Any notes you want>
             * N: <And any more lines of note.>
             * %
             * % And now your lovely music...
             |ABCD|EFG>^G|[A4a4C4E4]||
             */

            SetTitle("New.abc");
            SetIcon();
        }