/// <summary> /// Initializes a new instance of the <see cref="AudioBattleRecorder"/> class. /// </summary> public AudioBattleRecorder() { InitializeComponent(); RecorderState = PlayerState.Stop; this.PlayButton.IsEnabled = false; this.StopButton.IsEnabled = false; this.SaveButton.IsEnabled = false; _audioUpload = new RapUploadClient(this.StatusText); }
/// <summary> /// Handles the Click event of the SaveButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param> private void SaveButton_Click([NotNull] object sender, [NotNull] RoutedEventArgs e) { if (this.UserId != null) { var filename = Guid.NewGuid() + ".wav"; this.RecorderState = PlayerState.Save; UpdateRecordingState(this.RecorderState); this._audioUpload = new RapUploadClient(this.StatusText, (int) this.UserId, RapAudioContext.Current.Service.BattleId, this.BeatsList.SelectedBeat, (bool) this.ProcessAudio.IsChecked); this._audioUpload.UploadFile(this._theMemStream, filename); } }