Example #1
0
        public RecordingPageViewModel(
            IAudioService audioService,
            IOptionsService optionsService,
            ICommandLineService commandLineService,
            IRecordingDestinationService destinationService,
            ICopyRecordingsService copyRecordingsService,
            ISnackbarService snackbarService)
        {
            Messenger.Default.Register <BeforeShutDownMessage>(this, OnShutDown);

            _commandLineService    = commandLineService;
            _copyRecordingsService = copyRecordingsService;
            _snackbarService       = snackbarService;

            _stopwatch = new Stopwatch();

            _audioService = audioService;
            _audioService.StartedEvent           += AudioStartedHandler;
            _audioService.StoppedEvent           += AudioStoppedHandler;
            _audioService.StopRequested          += AudioStopRequestedHandler;
            _audioService.RecordingProgressEvent += AudioProgressHandler;

            _optionsService     = optionsService;
            _destinationService = destinationService;
            _recordingStatus    = RecordingStatus.NotRecording;

            _statusStr = Properties.Resources.NOT_RECORDING;

            // bind commands...
            StartRecordingCommand       = new RelayCommand(StartRecording);
            StopRecordingCommand        = new RelayCommand(StopRecording);
            NavigateSettingsCommand     = new RelayCommand(NavigateSettings);
            ShowRecordingsCommand       = new RelayCommand(ShowRecordings);
            SaveToRemovableDriveCommand = new RelayCommand(SaveToRemovableDrives);

            Messenger.Default.Register <RemovableDriveMessage>(this, OnRemovableDriveMessage);
        }