Пример #1
0
 private static void recorder_OnStatusChanged(RecorderState newState)
 {
     Console.WriteLine("   => New Recorder Status : " + newState.ToString());
     recordingState = newState;
 }
Пример #2
0
        private void ChangeApplicationState(RecorderState newState)
        {
            ChangeGui(newState);
            addToLog("Now " + newState.ToString());

            switch (_currentApplicationState)
            {
            case RecorderState.NotRecording:
                switch (newState)
                {
                case RecorderState.NotRecording:
                    break;

                case RecorderState.WaitingForRecording:
                    break;

                case RecorderState.Recording:
                    StartRecording((MMDevice)deviceListBox.SelectedItem);
                    break;

                case RecorderState.Closing:
                    break;
                }

                break;

            case RecorderState.WaitingForRecording:
                switch (newState)
                {
                case RecorderState.NotRecording:
                    break;

                case RecorderState.WaitingForRecording:
                    throw new Exception(string.Format("NY {0} - {1}", _currentApplicationState, newState));

                case RecorderState.Recording:
                    StartRecording((MMDevice)deviceListBox.SelectedItem);
                    break;

                case RecorderState.Closing:
                    //Close();
                    break;
                }
                break;

            case RecorderState.Recording:
                switch (newState)
                {
                case RecorderState.NotRecording:
                    StopRecording();
                    break;

                case RecorderState.Recording:         //file changed
                    StopRecording();
                    StartRecording((MMDevice)deviceListBox.SelectedItem);
                    break;

                case RecorderState.WaitingForRecording:         //file changed
                    StopRecording();
                    break;
                }
                break;
            }
            _currentApplicationState = newState;
        }