Ejemplo n.º 1
0
        private void cmdOffsetBeats_Click(object sender, EventArgs e)
        {
            dlgNud frm = new dlgNud();

            frm.lblPrompt.Text = "Enter number of beats to offset the Play and Record Tracks by";
            frm.lblMsg.Text    = "Any events that are moved before the start or after the end of the song will be deleted.";
            frm.lblMsg.Text   += "\r\n(Removed events can be recovered with the Undo button.)";
            frm.lblMsg.Text   += "\r\nThe range of valid values is -100 to 100";
            frm.nud1.Minimum   = -100;
            frm.nud1.Maximum   = 100;
            frm.nud1.Value     = 0;
            DialogResult res = frm.ShowDialog();

            if (res == DialogResult.Cancel)
            {
                return;
            }
            if (frm.nud1.Value == 0)
            {
                return;
            }

            Action(delegate(eCmd xcmd) {
                AudioSync.Elapsed.OffsetBeats((int)frm.nud1.Value);
            }, eCmd.Offset);
        }
Ejemplo n.º 2
0
        private void cmdOffsetTimes_Click(object sender, EventArgs e)
        {
            dlgNud frm = new dlgNud();

            frm.lblPrompt.Text = "Enter offset in milliseconds to apply to the Play and Record Tracks";
            frm.lblMsg.Text    = "A positive offset will display beat positions later.";
            frm.lblMsg.Text    = "Any events that are moved before the start or after the end of the song will be deleted.";
            frm.lblMsg.Text   += "\r\n(Removed events can be recovered with the Undo button.)";
            frm.lblMsg.Text   += "\r\nThe range of valid values is -2000 to 2000";
            frm.nud1.Minimum   = -2000;
            frm.nud1.Maximum   = 2000;
            frm.nud1.Increment = 10;
            frm.nud1.Value     = 0;
            DialogResult res = frm.ShowDialog();

            if (res == DialogResult.Cancel)
            {
                return;
            }
            if (frm.nud1.Value == 0)
            {
                return;
            }

            Action(delegate(eCmd xcmd) {
                AudioSync.Elapsed.OffsetTimes((int)frm.nud1.Value);
            }, eCmd.Offset);
        }