protected override void ExecuteAction(string ribbonId) { //TODO: This needs to improved to stop using global variables (Change RemoveAudioEnabledHandler too) this.StartNewUndoEntry(); NotesToAudio.RemoveAudioFromSelectedSlides(); CustomTaskPane recorderPane = this.GetAddIn().GetActivePane(typeof(RecorderTaskPane)); if (recorderPane != null) { RecorderTaskPane recorder = recorderPane.Control as RecorderTaskPane; recorder.ClearRecordDataListForSelectedSlides(); // if current list is visible, update the pane immediately if (recorderPane.Visible) { foreach (PowerPointSlide slide in this.GetCurrentPresentation().SelectedSlides) { recorder.UpdateLists(slide.ID); } } } NotesToAudio.IsRemoveAudioEnabled = false; this.GetRibbonUi().RefreshRibbonControl("RemoveNarrationsButton"); }
protected override void ExecuteAction(string ribbonId) { //TODO: This needs to improved to stop using global variables this.StartNewUndoEntry(); PowerPointSlide currentSlide = this.GetCurrentSlide(); // If there are text in notes page for any of the selected slides if (this.GetCurrentPresentation().SelectedSlides.Any(slide => slide.NotesPageText.Trim() != "")) { NotesToAudio.IsRemoveAudioEnabled = true; this.GetRibbonUi().RefreshRibbonControl("RemoveNarrationsButton"); } List <string[]> allAudioFiles = NotesToAudio.EmbedSelectedSlideNotes(); CustomTaskPane recorderPane = this.GetAddIn().GetActivePane(typeof(RecorderTaskPane)); if (recorderPane == null) { return; } RecorderTaskPane recorder = recorderPane.Control as RecorderTaskPane; if (recorder == null) { return; } // initialize selected slides' audio recorder.InitializeAudioAndScript(this.GetCurrentPresentation().SelectedSlides.ToList(), allAudioFiles, true); // if current list is visible, update the pane immediately if (recorderPane.Visible) { recorder.UpdateLists(currentSlide.ID); } if (NarrationsLabSettings.IsPreviewEnabled) { NotesToAudio.PreviewAnimations(); } }
protected override void ExecuteAction(string ribbonId) { NotesToAudio.SpeakSelectedText(); }