コード例 #1
0
        private void Schedule_Recording_timer_Tick(object sender, EventArgs e)
        {
            if (DateTime.Now > scheduled_time && has_recorded == false)
            {
                #region
                #region
                if (Recording_Length_Hour_textBox.Text == "Hour")
                {
                    hour_recording = 0;
                }
                else
                {
                    hour_recording = Int32.Parse(Recording_Length_Hour_textBox.Text);
                }

                if (Recording_Length_Minute_textBox.Text == "Min")
                {
                    minute_recording = 0;
                }
                else
                {
                    minute_recording = Int32.Parse(Recording_Length_Minute_textBox.Text);
                }

                if (Recording_Length_Second_textbox.Text == "Sec")
                {
                    second_recording = 10;
                }
                else
                {
                    second_recording = Int32.Parse(Recording_Length_Second_textbox.Text);
                }
                #endregion

                my_player.Start_Recording_GroupBox.Controls["Recording_Hour_TextBox"].Text   = hour_recording.ToString();
                my_player.Start_Recording_GroupBox.Controls["Recording_Minute_TextBox"].Text = minute_recording.ToString();
                my_player.Start_Recording_GroupBox.Controls["Recording_Second_TextBox"].Text = second_recording.ToString();
                #endregion

                if (!(my_player.recorder.State == DeviceState.InProgress || my_player.recorder.State == DeviceState.Opened)) //Check if recorder is already in use
                {
                    my_player.Record_with_Timer_Button.PerformClick();
                }

                Is_Recording_Checkbox.Checked = true;

                if (sched_name_choosen == false)
                {
                    Select_Name_button_Click(null, null);
                }

                has_recorded = true;

                Schedule_Recording_timer.Stop();
                Schedule_Is_Recording_timer.Start();
            }
        }
コード例 #2
0
        private void Stop_Scheduling_Button_Click(object sender, EventArgs e)
        {
            Schedule_Recording_timer.Stop();

            Is_Scheduling_CheckBox.Checked = false;

            #region Enable Unneccesary Controls
            Scheduling_Hour_TextBox.Enabled   = true;
            Scheduling_Minute_TextBox.Enabled = true;
            Time_of_Day_comboBox.Enabled      = true;
            Start_Scheduling_Button.Enabled   = true;
            Stop_Scheduling_Button.Enabled    = true;
            #endregion

            Scheduling_Hour_TextBox.Text   = "Hour";
            Scheduling_Minute_TextBox.Text = "Min";
        }
コード例 #3
0
        private void Schedule_Recording_timer_Tick(object sender, EventArgs e)
        {
            if (DateTime.Now >= scheduled_time && has_recorded == false)
            {
                Stop_Scheduling_Button.PerformClick();
                my_player.Record_with_Timer_Button_Click(null, null);

                has_recorded = true;
            }

            if (DateTime.Now >= scheduled_time && has_recorded == true)
            {
                if (my_player.recorder.State == DeviceState.Closed)
                {
                    my_player.Save_Recording_Button_Click(null, null);
                    Schedule_Recording_timer.Stop();
                }
            }
        }
コード例 #4
0
        private void Stop_Scheduling_Button_Click(object sender, EventArgs e)
        {
            Schedule_Recording_timer.Stop();
            Schedule_Is_Recording_timer.Stop();

            Is_Scheduling_CheckBox.Checked = false;

            #region Enable Unneccesary Controls
            Set_When_groupBox.Enabled       = true;
            Set_How_Long_groupBox1.Enabled  = true;
            Set_Name_groupBox1.Enabled      = true;
            Start_Scheduling_Button.Enabled = true;
            Stop_Scheduling_Button.Enabled  = true;
            Select_Name_button.Enabled      = true; Select_Name_button.Text = "Select";
            Name_textBox.Enabled            = true;
            #endregion

            Scheduling_Hour_textbox1.Text        = "Hour";
            Scheduling_Minute_textBox1.Text      = "Min";
            Recording_Length_Hour_textBox.Text   = "Hour";
            Recording_Length_Minute_textBox.Text = "Min";
            Recording_Length_Second_textbox.Text = "Sec";
        }