public RecordingControls() { InitializeComponent(); state = IRecorderState.Idle; recMan = new AudioRecManager(); focusDiverter.GotFocus += new EventHandler(focusDiverterChanged); focusDiverter.LostFocus += new EventHandler(focusDiverterChanged); recMan.DeviceNumber = Devices.SelectedIndex; // call from frame level //PopulateDevices(); }
private void btnRec_Click_1(object sender, EventArgs e) { if (state == IRecorderState.Idle) { if (Devices.SelectedItem == null) { MessageBox.Show("Please select a device", "Device not selected", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } state = IRecorderState.Recording; ForceFocusDiversion(); btnRec.Text = "Stop"; btnRec.BackColor = Color.LightBlue; if (logicShit != null) logicShit.startRecording(); } else if (state == IRecorderState.Recording) { if (logicShit != null) logicShit.stopRecording(); btnRec.Text = "Rec"; btnRec.BackColor = Color.Red; state = IRecorderState.Idle; } }
////============================================================================= //// Constructor //// ////============================================================================= public ResumingState(IRecorderState nextState, TimeRecorderData data) { _nextState = nextState; _data = data; }
////============================================================================= //// Constructor //// ////============================================================================= public DestroyingState(IRecorderState nextState) { _nextState = nextState; }
////============================================================================= //// Constructor //// ////============================================================================= public StartingState(IRecorderState nextState) { _nextState = nextState; }