Beispiel #1
0
        /// <summary>
        /// intialize the necessary components to start the async looping task
        /// </summary>
        private void prepareForLoop()
        {
            //update UI
            disableLoopButton();
            enableStopLoopButton();

            //convert timestamp strings to seconds
            int start = PlayerUtils.ConvertTimestampToSeconds(beginTextBox.Text);
            int end   = PlayerUtils.ConvertTimestampToSeconds(endTextBox.Text);

            //bail if timestamps are invalid
            if (start == -1 || end == -1 || start > end)
            {
                return;
            }

            //start loop in async task
            loop(start, end);
        }
Beispiel #2
0
        /// <summary>
        /// event handler to map keyboard shortcuts
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void PlayerForm_KeyPress(object sender, KeyPressEventArgs e)
        {
            switch (e.KeyChar)
            {
            //jump to position on textbox
            case 'j':
                jumpTo(PlayerUtils.ConvertTimestampToSeconds(jumpTextBox.Text));
                break;

            //set begin text box
            case 'b':
                setBeginTextBoxToCurrent();
                break;

            //set end text box
            case 'e':
                setEndTextBoxToCurrent();
                break;

            default:
                break;
            }
        }