Audacity  3.0.3
Screenshot.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  Screenshot.cpp
6 
7  Dominic Mazzoni
8 
9 *******************************************************************/
19 #include "Screenshot.h"
23 #include <wx/app.h>
24 #include <wx/defs.h>
25 #include <wx/event.h>
26 #include <wx/frame.h>
27 
28 #include "ShuttleGui.h"
29 #include <wx/button.h>
30 #include <wx/checkbox.h>
31 #include <wx/dirdlg.h>
32 #include <wx/image.h>
33 #include <wx/intl.h>
34 #include <wx/panel.h>
35 #include <wx/sizer.h>
36 #include <wx/statusbr.h>
37 #include <wx/textctrl.h>
38 #include <wx/timer.h>
39 #include <wx/tglbtn.h>
40 #include <wx/window.h>
41 
42 #include "prefs/GUISettings.h" // for RTL_WORKAROUND
43 #include "Project.h"
44 #include "ProjectStatus.h"
45 #include "ProjectWindow.h"
46 #include "Prefs.h"
47 #include "tracks/ui/TrackView.h"
48 #include "widgets/HelpSystem.h"
49 
50 #include "ViewInfo.h"
51 #include "WaveTrack.h"
52 
54 class ScreenFrameTimer;
55 
57 #define ScreenCaptureFrameTitle XO("Screen Capture Frame")
58 
59 // ANSWER-ME: Should this derive from wxDialogWrapper instead?
60 class ScreenshotBigDialog final : public wxFrame,
61  public PrefsListener
62 {
63  public:
64 
65  // constructors and destructors
67  wxWindow *parent, wxWindowID id, AudacityProject &project);
68  virtual ~ScreenshotBigDialog();
69 
70  bool ProcessEvent(wxEvent & event) override;
71 
72  private:
73  void Populate();
75 
76  void OnCloseWindow(wxCloseEvent & event);
77  void OnUIUpdate(wxUpdateUIEvent & event);
78  void OnDirChoose(wxCommandEvent & event);
79  void OnGetURL(wxCommandEvent & event);
80  void OnClose(wxCommandEvent & event );
81 
82 
83  void SizeMainWindow(int w, int h);
84  void OnMainWindowSmall(wxCommandEvent & event);
85  void OnMainWindowLarge(wxCommandEvent & event);
86  void OnToggleBackgroundBlue(wxCommandEvent & event);
87  void OnToggleBackgroundWhite(wxCommandEvent & event);
88 
89  void DoCapture(int captureMode);
90  void OnCaptureSomething(wxCommandEvent & event);
91 
92  void TimeZoom(double seconds);
93  void OnOneSec(wxCommandEvent & event);
94  void OnTenSec(wxCommandEvent & event);
95  void OnOneMin(wxCommandEvent & event);
96  void OnFiveMin(wxCommandEvent & event);
97  void OnOneHour(wxCommandEvent & event);
98 
99  void SizeTracks(int h);
100  void OnShortTracks(wxCommandEvent & event);
101  void OnMedTracks(wxCommandEvent & event);
102  void OnTallTracks(wxCommandEvent & event);
103 
104  // PrefsListener implementation
105  void UpdatePrefs() override;
106 
108 
109  std::unique_ptr<ScreenshotCommand> CreateCommand();
110 
111  wxCheckBox *mDelayCheckBox;
112  wxTextCtrl *mDirectoryTextBox;
113  wxToggleButton *mBlue;
114  wxToggleButton *mWhite;
115  wxStatusBar *mStatus;
116 
117  std::unique_ptr<ScreenFrameTimer> mTimer;
118 
119  std::unique_ptr<ScreenshotCommand> mCommand;
121 
122  DECLARE_EVENT_TABLE()
123 };
124 
125 // Static pointer to the unique ScreenshotBigDialog window.
126 // Formerly it was parentless, therefore this was a Destroy_ptr<ScreenshotBigDialog>
127 // But now the window is owned, so just use a bare pointer, and null it when
128 // the unique window is destroyed.
131 
133 
135 {
136  if (!mFrame) {
137  auto parent = wxTheApp->GetTopWindow();
138  if (!parent) {
139  wxASSERT(false);
140  return;
141  }
143  safenew ScreenshotBigDialog(parent, -1, project) };
144  }
145  mFrame->Show();
146  mFrame->Raise();
147 }
148 
150 {
151  mFrame = nullptr;
152 }
153 
155 
156 class ScreenFrameTimer final : public wxTimer
157 {
158  public:
160  wxEvent & event)
161  {
162  screenFrame = frame;
163  evt.reset(event.Clone());
164  }
165 
167  {
168  if (IsRunning())
169  {
170  Stop();
171  }
172  }
173 
174  void Notify() override
175  {
176  // Process timer notification just once, then destroy self
177  evt->SetEventObject(NULL);
179  }
180 
181  private:
183  std::unique_ptr<wxEvent> evt;
184 };
185 
187 
188 enum
189 {
192 
195 
201 
205 
207 
209  // No point delaying the capture of sets of things.
214 
215  // Put all events that need delay between AllDelayed and LastDelayed.
221 
235 
242 
244 
247 
248 };
249 
250 BEGIN_EVENT_TABLE(ScreenshotBigDialog, wxFrame)
254 
256 
262 
268 
272 
275 
276 // Must not be called before CreateStatusBar!
277 std::unique_ptr<ScreenshotCommand> ScreenshotBigDialog::CreateCommand()
278 {
279  wxASSERT(mStatus != NULL);
280  auto output =
281  std::make_unique<CommandOutputTargets>(std::make_unique<NullProgressTarget>(),
282  std::make_shared<StatusBarTarget>(*mStatus),
283  std::make_shared<MessageBoxTarget>());
284  return std::make_unique<ScreenshotCommand>();//*type, std::move(output), this);
285 }
286 
288  wxWindow * parent, wxWindowID id, AudacityProject &project)
289 : wxFrame(parent, id, ScreenCaptureFrameTitle.Translation(),
290  wxDefaultPosition, wxDefaultSize,
291 
292 #if !defined(__WXMSW__)
293 
294  #if !defined(__WXMAC__) // bug1358
295  wxFRAME_TOOL_WINDOW |
296  #endif
297 
298 #else
299 
300  wxSTAY_ON_TOP|
301 
302 #endif
303 
304  wxSYSTEM_MENU|wxCAPTION|wxCLOSE_BOX)
305  , mProject{ project }
306  , mContext( project )
307 {
308  mDelayCheckBox = NULL;
309  mDirectoryTextBox = NULL;
310 
311  mStatus = CreateStatusBar(3);
312  mCommand = CreateCommand();
313 
314  Populate();
315 
316  // Reset the toolbars to a known state.
317  // Note that the audio could be playing.
318  // The monitoring will switch off temporarily
319  // because we've switched monitor mid play.
320  // Bug 383 - Resetting the toolbars is not wanted.
321  // Any that are invisible will be amde visible as/when needed.
322  //ToolManager::Get( mContext.project ).Reset();
323  Center();
324 }
325 
327 {
328  if (this == mFrame)
329  mFrame = nullptr;
330  else
331  // There should only be one!
332  wxASSERT(false);
333 }
334 
336 {
337  ShuttleGui S(this, eIsCreating);
339 }
340 
342 {
343  wxPanel *p = S.StartPanel();
344  RTL_WORKAROUND(p);
345  {
346  S.SetBorder(3);
347 
348  S.StartStatic(XO("Choose location to save files"));
349  {
350  S.StartMultiColumn(3, wxEXPAND);
351  {
352  S.SetStretchyCol(1);
353 
356  XXO("Save images to:"),
357  gPrefs->Read(wxT("/ScreenshotPath"), wxFileName::GetHomeDir()),
358  30
359  );
360  S.Id(IdDirChoose).AddButton(XXO("Choose..."));
361  }
362  S.EndMultiColumn();
363  }
364  S.EndStatic();
365 
366  S.StartStatic(XO("Capture entire window or screen"));
367  {
368  S.StartHorizontalLay();
369  {
370  S.Id(IdMainWindowSmall).AddButton(XXO("Resize Small"));
371  S.Id(IdMainWindowLarge).AddButton(XXO("Resize Large"));
372  mBlue = safenew wxToggleButton(S.GetParent(),
374  /* i18n-hint: Bkgnd is short for background and appears on a small button
375  * It is OK to just translate this item as if it said 'Blue' */
376  _("Blue Bkgnd"));
377  S.AddWindow(mBlue);
378  mWhite = safenew wxToggleButton(S.GetParent(),
380  /* i18n-hint: Bkgnd is short for background and appears on a small button
381  * It is OK to just translate this item as if it said 'White' */
382  _("White Bkgnd"));
383  S.AddWindow(mWhite);
384  }
385  S.EndHorizontalLay();
386 
387  S.StartHorizontalLay();
388  {
389  S.Id(IdCaptureWindowContents).AddButton(XXO("Capture Window Only"));
390  S.Id(IdCaptureFullWindow).AddButton(XXO("Capture Full Window"));
391  S.Id(IdCaptureWindowPlus).AddButton(XXO("Capture Window Plus"));
392  }
393  S.EndHorizontalLay();
394 
395  S.StartHorizontalLay();
396  {
397  S.Id(IdCaptureFullScreen).AddButton(XXO("Capture Full Screen"));
398  }
399  S.EndHorizontalLay();
400 
401  S.StartHorizontalLay();
402  {
404  XXO("Wait 5 seconds and capture frontmost window/dialog"),
405  false);
406  }
407  S.EndHorizontalLay();
408  }
409  S.EndStatic();
410 
411  S.StartStatic(XO("Capture part of a project window"));
412  {
413  S.StartHorizontalLay();
414  {
415  S.Id(IdCaptureToolbars).AddButton(XXO("All Toolbars"));
416  S.Id(IdCaptureEffects).AddButton(XXO("All Effects"));
417  S.Id(IdCaptureScriptables).AddButton(XXO("All Scriptables"));
418  S.Id(IdCapturePreferences).AddButton(XXO("All Preferences"));
419  }
420  S.EndHorizontalLay();
421 
422  S.StartHorizontalLay();
423  {
424  S.Id(IdCaptureSelectionBar).AddButton(XXO("SelectionBar"));
425  S.Id(IdCaptureSpectralSelection).AddButton(XXO("Spectral Selection"));
426  S.Id(IdCaptureTimer).AddButton(XXO("Timer"));
427  S.Id(IdCaptureTools).AddButton(XXO("Tools"));
428  S.Id(IdCaptureTransport).AddButton(XXO("Transport"));
429  }
430  S.EndHorizontalLay();
431 
432  S.StartHorizontalLay();
433  {
434  S.Id(IdCaptureMixer).AddButton(XXO("Mixer"));
435  S.Id(IdCaptureMeter).AddButton(XXO("Meter"));
436  S.Id(IdCapturePlayMeter).AddButton(XXO("Play Meter"));
437  S.Id(IdCaptureRecordMeter).AddButton(XXO("Record Meter"));
438  }
439  S.EndHorizontalLay();
440 
441  S.StartHorizontalLay();
442  {
443  S.Id(IdCaptureEdit).AddButton(XXO("Edit"));
444  S.Id(IdCaptureDevice).AddButton(XXO("Device"));
445  S.Id(IdCaptureTranscription).AddButton(XXO("Play-at-Speed"));
446  S.Id(IdCaptureScrub).AddButton(XXO("Scrub"));
447  }
448  S.EndHorizontalLay();
449 
450  S.StartHorizontalLay();
451  {
452  S.Id(IdCaptureTrackPanel).AddButton(XXO("Track Panel"));
453  S.Id(IdCaptureRuler).AddButton(XXO("Ruler"));
454  S.Id(IdCaptureTracks).AddButton(XXO("Tracks"));
455  S.Id(IdCaptureFirstTrack).AddButton(XXO("First Track"));
456  S.Id(IdCaptureSecondTrack).AddButton(XXO("Second Track"));
457  }
458  S.EndHorizontalLay();
459  }
460  S.EndStatic();
461 
462  S.StartStatic(XO("Scale"));
463  {
464  S.StartHorizontalLay();
465  {
466  S.Id(IdOneSec).AddButton(XXO("One Sec"));
467  S.Id(IdTenSec).AddButton(XXO("Ten Sec"));
468  S.Id(IdOneMin).AddButton(XXO("One Min"));
469  S.Id(IdFiveMin).AddButton(XXO("Five Min"));
470  S.Id(IdOneHour).AddButton(XXO("One Hour"));
471  }
472  S.EndHorizontalLay();
473 
474  S.StartHorizontalLay();
475  {
476  S.Id(IdShortTracks).AddButton(XXO("Short Tracks"));
477  S.Id(IdMedTracks).AddButton(XXO("Medium Tracks"));
478  S.Id(IdTallTracks).AddButton(XXO("Tall Tracks"));
479  }
480  S.EndHorizontalLay();
481  }
482  S.EndStatic();
484  }
485  S.EndPanel();
486 
487  Layout();
488  GetSizer()->Fit(this);
489  SetMinSize(GetSize());
490 
491  int top = 0;
492 #ifdef __WXMAC__
493  // Allow for Mac menu bar
494  top += 20;
495 #endif
496 
497  int width, height;
498  GetSize(&width, &height);
499  int displayWidth, displayHeight;
500  wxDisplaySize(&displayWidth, &displayHeight);
501 
502  if (width > 100) {
503  Move(displayWidth - width - 16, top + 16);
504  }
505  else {
506  CentreOnParent();
507  }
508 
509  SetIcon( GetProjectFrame( mContext.project ).GetIcon() );
510 }
511 
513 {
514  if (!IsFrozen())
515  {
516  int id = e.GetId();
517 
518  // If split into two parts to make for easier breakpoint
519  // when testing timer.
520  if (mDelayCheckBox &&
521  mDelayCheckBox->GetValue() &&
522  e.IsCommandEvent() &&
523  e.GetEventType() == wxEVT_COMMAND_BUTTON_CLICKED)
524  {
525  if( id >= IdAllDelayedEvents && id <= IdLastDelayedEvent &&
526  e.GetEventObject() != NULL) {
527  mTimer = std::make_unique<ScreenFrameTimer>(this, e);
528  mTimer->Start(5000, true);
529  return true;
530  }
531  }
532 
533  if (e.IsCommandEvent() && e.GetEventObject() == NULL) {
534  e.SetEventObject(this);
535  }
536  }
537 
538  return wxFrame::ProcessEvent(e);
539 }
540 
541 void ScreenshotBigDialog::OnCloseWindow(wxCloseEvent & WXUNUSED(event))
542 {
543  if (mDirectoryTextBox->IsModified()) {
544  gPrefs->Write(wxT("/ScreenshotPath"), mDirectoryTextBox->GetValue());
545  gPrefs->Flush();
546  }
547 
548  Destroy();
549 }
550 
551 void ScreenshotBigDialog::OnClose(wxCommandEvent & WXUNUSED(event))
552 {
553  if (mDirectoryTextBox->IsModified()) {
554  gPrefs->Write(wxT("/ScreenshotPath"), mDirectoryTextBox->GetValue());
555  gPrefs->Flush();
556  }
557 
558  Destroy();
559 }
560 
561 void ScreenshotBigDialog::OnGetURL(wxCommandEvent & WXUNUSED(event))
562 {
563  HelpSystem::ShowHelp(this, L"Screenshot");
564 }
565 
566 void ScreenshotBigDialog::OnUIUpdate(wxUpdateUIEvent & WXUNUSED(event))
567 {
568 #ifdef __WXMAC__
569  wxTopLevelWindow *top = mCommand->GetFrontWindow(&mProject);
570  bool needupdate = false;
571  bool enable = false;
572 
573  if ((!top || top->IsIconized()) && mDirectoryTextBox->IsEnabled()) {
574  needupdate = true;
575  enable = false;
576  }
577  else if ((top && !top->IsIconized()) && !mDirectoryTextBox->IsEnabled()) {
578  needupdate = true;
579  enable = true;
580  }
581 
582  if (needupdate) {
583  for (int i = IdMainWindowSmall; i < IdLastDelayedEvent; i++) {
584  wxWindow *w = wxWindow::FindWindowById(i, this);
585  if (w) {
586  w->Enable(enable);
587  }
588  }
589  }
590 #endif
591 }
592 
593 void ScreenshotBigDialog::OnDirChoose(wxCommandEvent & WXUNUSED(event))
594 {
595  wxString current = mDirectoryTextBox->GetValue();
596 
597  wxDirDialogWrapper dlog(this,
598  XO("Choose a location to save screenshot images"),
599  current);
600 
601  dlog.ShowModal();
602  if (!dlog.GetPath().empty()) {
603  wxFileName tmpDirPath;
604  tmpDirPath.AssignDir(dlog.GetPath());
605  wxString path = tmpDirPath.GetPath(wxPATH_GET_VOLUME|wxPATH_GET_SEPARATOR);
606  mDirectoryTextBox->SetValue(path);
607  gPrefs->Write(wxT("/ScreenshotPath"), path);
608  gPrefs->Flush();
609  mCommand->mPath = path;
610  }
611 }
612 
613 void ScreenshotBigDialog::OnToggleBackgroundBlue(wxCommandEvent & WXUNUSED(event))
614 {
615  mWhite->SetValue(false);
616 }
617 
618 void ScreenshotBigDialog::OnToggleBackgroundWhite(wxCommandEvent & WXUNUSED(event))
619 {
620  mBlue->SetValue(false);
621 }
622 
624 {
625  int top = 20;
626 
627  auto &window = GetProjectFrame( mContext.project );
628  window.Maximize(false);
629  window.SetSize(16, 16 + top, w, h);
630  //Bug383 - Toolbar Resets not wanted.
631  //ToolManager::Get( mContext.project ).Reset();
632 }
633 
634 void ScreenshotBigDialog::OnMainWindowSmall(wxCommandEvent & WXUNUSED(event))
635 {
636  SizeMainWindow(680, 450);
637 }
638 
639 void ScreenshotBigDialog::OnMainWindowLarge(wxCommandEvent & WXUNUSED(event))
640 {
641  SizeMainWindow(900, 600);
642 }
643 
644 void ScreenshotBigDialog::DoCapture(int captureMode)
645 {
646  Hide();
647  wxYieldIfNeeded();
648  //mCommand->SetParameter(wxT("FilePath"), mDirectoryTextBox->GetValue());
649  //mCommand->SetParameter(wxT("CaptureMode"), captureMode);
650  mCommand->mBack = mWhite->GetValue()
652  : mBlue->GetValue()
654  mCommand->mPath = mDirectoryTextBox->GetValue();
655  mCommand->mWhat = captureMode;
656  if (!mCommand->Apply(mContext))
657  mStatus->SetStatusText(_("Capture failed!"), mainStatusBarField);
658 
659  // Bug 2323: (100% hackage alert) Since the command target dialog is not
660  // accessible from outside the command, this seems to be the only way we
661  // can get the window on top of this dialog.
662  auto w = static_cast<wxDialogWrapper *>(wxFindWindowByLabel(XO("Long Message").Translation()));
663  if (w) {
664  auto endmodal = [w](wxCommandEvent &evt)
665  {
666  w->EndModal(0);
667  };
668  w->Bind(wxEVT_BUTTON, endmodal);
669  w->ShowModal();
670  }
671 
672  Show();
673 }
674 
675 void ScreenshotBigDialog::OnCaptureSomething(wxCommandEvent & event)
676 {
677  int i = event.GetId() - IdCaptureFirst;
678 
679  /*
680  IdCaptureEffects= IdCaptureFirst,
681  IdCaptureScriptables,
682  IdCapturePreferences,
683  IdCaptureToolbars,
684 
685  // Put all events that need delay between AllDelayed and LastDelayed.
686  IdAllDelayedEvents,
687  IdCaptureWindowContents=IdAllDelayedEvents,
688  IdCaptureFullWindow,
689  IdCaptureWindowPlus,
690  IdCaptureFullScreen,
691 
692  IdCaptureSelectionBar,
693  IdCaptureSpectralSelection,
694  IdCaptureTools,
695  IdCaptureTransport,
696  IdCaptureMixer,
697  IdCaptureMeter,
698  IdCapturePlayMeter,
699  IdCaptureRecordMeter,
700  IdCaptureEdit,
701  IdCaptureDevice,
702  IdCaptureTranscription,
703  IdCaptureScrub,
704 
705  IdCaptureTrackPanel,
706  IdCaptureRuler,
707  IdCaptureTracks,
708  IdCaptureFirstTrack,
709  IdCaptureSecondTrack,
710  IdCaptureLast = IdCaptureSecondTrack,
711  */
712 
713  static const int codes[] = {
718 
741  };
742 
743  DoCapture(codes[i]);
744 }
745 
746 void ScreenshotBigDialog::TimeZoom(double seconds)
747 {
748  auto &viewInfo = ViewInfo::Get( mContext.project );
749  auto &window = ProjectWindow::Get( mContext.project );
750  int width, height;
751  window.GetClientSize(&width, &height);
752  viewInfo.SetZoom((0.75 * width) / seconds);
753  window.RedrawProject();
754 }
755 
756 void ScreenshotBigDialog::OnOneSec(wxCommandEvent & WXUNUSED(event))
757 {
758  TimeZoom(1.0);
759 }
760 
761 void ScreenshotBigDialog::OnTenSec(wxCommandEvent & WXUNUSED(event))
762 {
763  TimeZoom(10.0);
764 }
765 
766 void ScreenshotBigDialog::OnOneMin(wxCommandEvent & WXUNUSED(event))
767 {
768  TimeZoom(60.0);
769 }
770 
771 void ScreenshotBigDialog::OnFiveMin(wxCommandEvent & WXUNUSED(event))
772 {
773  TimeZoom(300.0);
774 }
775 
776 void ScreenshotBigDialog::OnOneHour(wxCommandEvent & WXUNUSED(event))
777 {
778  TimeZoom(3600.0);
779 }
780 
782 {
783  // h is the height for a channel
784  // Set the height of a mono track twice as high
785 
786  // TODO: more-than-two-channels
787  // If there should be more-than-stereo tracks, this makes
788  // each channel as high as for a stereo channel
789 
790  auto &tracks = TrackList::Get( mContext.project );
791  for (auto t : tracks.Leaders<WaveTrack>()) {
792  auto channels = TrackList::Channels(t);
793  auto nChannels = channels.size();
794  auto height = nChannels == 1 ? 2 * h : h;
795  for (auto channel : channels)
796  TrackView::Get( *channel ).SetHeight(height);
797  }
799 }
800 
801 void ScreenshotBigDialog::OnShortTracks(wxCommandEvent & WXUNUSED(event))
802 {
803  for (auto t : TrackList::Get( mContext.project ).Any<WaveTrack>()) {
804  auto &view = TrackView::Get( *t );
805  view.SetHeight( view.GetMinimizedHeight() );
806  }
807 
809 }
810 
811 void ScreenshotBigDialog::OnMedTracks(wxCommandEvent & WXUNUSED(event))
812 {
813  SizeTracks(60);
814 }
815 
816 void ScreenshotBigDialog::OnTallTracks(wxCommandEvent & WXUNUSED(event))
817 {
818  SizeTracks(85);
819 }
820 
822 {
823  Freeze();
824 
825  SetSizer(nullptr);
826  DestroyChildren();
827 
828  SetTitle(ScreenCaptureFrameTitle.Translation());
829  Populate();
830 
831  Thaw();
832 }
IdToggleBackgroundBlue
@ IdToggleBackgroundBlue
Definition: Screenshot.cpp:245
WaveTrack.h
EVT_BUTTON
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
ViewInfo::Get
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:156
ScreenFrameTimer::evt
std::unique_ptr< wxEvent > evt
Definition: Screenshot.cpp:183
eIsCreating
@ eIsCreating
Definition: ShuttleGui.h:38
ScreenshotBigDialog::OnCaptureSomething
void OnCaptureSomething(wxCommandEvent &event)
Definition: Screenshot.cpp:675
ScreenFrameTimer::ScreenFrameTimer
ScreenFrameTimer(ScreenshotBigDialog *frame, wxEvent &event)
Definition: Screenshot.cpp:159
ScreenshotCommand::ktranscription
@ ktranscription
Definition: ScreenshotCommand.h:64
ProjectStatus.h
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:69
IdCaptureLast
@ IdCaptureLast
Definition: Screenshot.cpp:241
ScreenCaptureFrameTitle
#define ScreenCaptureFrameTitle
Definition: Screenshot.cpp:57
ScreenshotBigDialog::DoCapture
void DoCapture(int captureMode)
Definition: Screenshot.cpp:644
ShuttleGuiBase::AddCheckBox
wxCheckBox * AddCheckBox(const TranslatableString &Prompt, bool Selected)
Definition: ShuttleGui.cpp:309
IdCaptureScrub
@ IdCaptureScrub
Definition: Screenshot.cpp:234
ScreenshotBigDialog::CreateCommand
std::unique_ptr< ScreenshotCommand > CreateCommand()
Definition: Screenshot.cpp:277
ScreenshotBigDialog::UpdatePrefs
void UpdatePrefs() override
Definition: Screenshot.cpp:821
ScreenshotCommand::kpreferences
@ kpreferences
Definition: ScreenshotCommand.h:51
IdCaptureTranscription
@ IdCaptureTranscription
Definition: Screenshot.cpp:233
ScreenshotBigDialog::OnGetURL
void OnGetURL(wxCommandEvent &event)
Definition: Screenshot.cpp:561
ScreenshotBigDialog::TimeZoom
void TimeZoom(double seconds)
Definition: Screenshot.cpp:746
OpenScreenshotTools
void OpenScreenshotTools(AudacityProject &project)
Definition: Screenshot.cpp:134
ScreenshotBigDialog::Populate
void Populate()
Definition: Screenshot.cpp:335
HelpSystem.h
ScreenshotBigDialog::OnDirChoose
void OnDirChoose(wxCommandEvent &event)
Definition: Screenshot.cpp:593
IdCaptureScriptables
@ IdCaptureScriptables
Definition: Screenshot.cpp:211
TrackView::Get
static TrackView & Get(Track &)
Definition: TrackView.cpp:63
OldStyleCommandType
Base class for containing data common to all commands of a given type. Also acts as a factory.
Definition: CommandType.h:43
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
ScreenshotBigDialog::OnToggleBackgroundBlue
void OnToggleBackgroundBlue(wxCommandEvent &event)
Definition: Screenshot.cpp:613
mFrame
ScreenshotBigDialogPtr mFrame
Definition: Screenshot.cpp:130
TrackView.h
ScreenshotBigDialog::OnShortTracks
void OnShortTracks(wxCommandEvent &event)
Definition: Screenshot.cpp:801
eHelpButton
@ eHelpButton
Definition: ShuttleGui.h:604
Project.h
ScreenshotCommand::kfullwindow
@ kfullwindow
Definition: ScreenshotCommand.h:45
IdCaptureFullScreen
@ IdCaptureFullScreen
Definition: Screenshot.cpp:220
ScreenshotBigDialog::mCommand
std::unique_ptr< ScreenshotCommand > mCommand
Definition: Screenshot.cpp:119
IdDirectory
@ IdDirectory
Definition: Screenshot.cpp:193
ScreenshotCommand::kfirsttrack
@ kfirsttrack
Definition: ScreenshotCommand.h:68
ScreenshotCommand::kselectionbar
@ kselectionbar
Definition: ScreenshotCommand.h:52
IdDelayCheckBox
@ IdDelayCheckBox
Definition: Screenshot.cpp:206
TrackList::Channels
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1468
ScreenshotCommand::ktimer
@ ktimer
Definition: ScreenshotCommand.h:54
ScreenshotCommand::kedit
@ kedit
Definition: ScreenshotCommand.h:61
ScreenshotBigDialog::OnMainWindowLarge
void OnMainWindowLarge(wxCommandEvent &event)
Definition: Screenshot.cpp:639
ScreenshotCommand::ktracks
@ ktracks
Definition: ScreenshotCommand.h:67
IdCaptureRuler
@ IdCaptureRuler
Definition: Screenshot.cpp:237
IdCaptureMeter
@ IdCaptureMeter
Definition: Screenshot.cpp:228
wxDirDialogWrapper
Definition: wxPanelWrapper.h:126
TrackView::SetHeight
void SetHeight(int height)
Definition: TrackView.cpp:164
ScreenshotBigDialog::mContext
const CommandContext mContext
Definition: Screenshot.cpp:120
XO
#define XO(s)
Definition: Internat.h:31
END_EVENT_TABLE
END_EVENT_TABLE()
IdCaptureTimer
@ IdCaptureTimer
Definition: Screenshot.cpp:224
IdOneMin
@ IdOneMin
Definition: Screenshot.cpp:198
ScreenshotBigDialog::OnTenSec
void OnTenSec(wxCommandEvent &event)
Definition: Screenshot.cpp:761
ScreenshotCommand::kscriptables
@ kscriptables
Definition: ScreenshotCommand.h:50
ScreenshotCommand::kmeter
@ kmeter
Definition: ScreenshotCommand.h:58
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
ScreenshotCommand::ktoolbars
@ ktoolbars
Definition: ScreenshotCommand.h:48
ProjectWindow::Get
static ProjectWindow & Get(AudacityProject &project)
Definition: ProjectWindow.cpp:533
IdCaptureTransport
@ IdCaptureTransport
Definition: Screenshot.cpp:226
IdCaptureEdit
@ IdCaptureEdit
Definition: Screenshot.cpp:231
ScreenFrameTimer
Definition: Screenshot.cpp:157
ScreenshotCommand::ksecondtrack
@ ksecondtrack
Definition: ScreenshotCommand.h:72
ScreenshotBigDialog::mProject
AudacityProject & mProject
Definition: Screenshot.cpp:107
ShuttleGuiBase::StartPanel
wxPanel * StartPanel(int iStyle=0)
Definition: ShuttleGui.cpp:990
HelpSystem::ShowHelp
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:237
ShuttleGuiBase::EndPanel
void EndPanel()
Definition: ShuttleGui.cpp:1018
IdToggleBackgroundWhite
@ IdToggleBackgroundWhite
Definition: Screenshot.cpp:246
ShuttleGui::Id
ShuttleGui & Id(int id)
Definition: ShuttleGui.cpp:2274
IdCaptureDevice
@ IdCaptureDevice
Definition: Screenshot.cpp:232
PrefsListener
A listener notified of changes in preferences.
Definition: Prefs.h:389
IdCaptureSelectionBar
@ IdCaptureSelectionBar
Definition: Screenshot.cpp:222
IdMainWindowSmall
@ IdMainWindowSmall
Definition: Screenshot.cpp:190
IdCaptureToolbars
@ IdCaptureToolbars
Definition: Screenshot.cpp:213
IdLastDelayedEvent
@ IdLastDelayedEvent
Definition: Screenshot.cpp:243
CommandContext.h
IdShortTracks
@ IdShortTracks
Definition: Screenshot.cpp:202
ScreenshotBigDialog::mDelayCheckBox
wxCheckBox * mDelayCheckBox
Definition: Screenshot.cpp:111
XXO
#define XXO(s)
Definition: Internat.h:44
mainStatusBarField
@ mainStatusBarField
Definition: ProjectStatus.h:26
ShuttleGuiBase::EndHorizontalLay
void EndHorizontalLay()
Definition: ShuttleGui.cpp:1177
ScreenshotCommand::kBlue
@ kBlue
Definition: ScreenshotCommand.h:36
ScreenshotBigDialog::OnFiveMin
void OnFiveMin(wxCommandEvent &event)
Definition: Screenshot.cpp:771
CommandContext
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
Definition: CommandContext.h:22
ShuttleGuiBase::StartHorizontalLay
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
Definition: ShuttleGui.cpp:1167
ScreenshotBigDialog::SizeMainWindow
void SizeMainWindow(int w, int h)
Definition: Screenshot.cpp:623
ScreenshotCommand::kplaymeter
@ kplaymeter
Definition: ScreenshotCommand.h:59
ShuttleGuiBase::AddTextBox
wxTextCtrl * AddTextBox(const TranslatableString &Caption, const wxString &Value, const int nChars)
Definition: ShuttleGui.cpp:638
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
IdMainWindowLarge
@ IdMainWindowLarge
Definition: Screenshot.cpp:191
GetProjectFrame
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
Definition: Project.cpp:188
ScreenshotCommand::kruler
@ kruler
Definition: ScreenshotCommand.h:66
ScreenshotBigDialog::OnClose
void OnClose(wxCommandEvent &event)
Definition: Screenshot.cpp:551
ScreenshotCommand.h
ShuttleGuiBase::GetParent
wxWindow * GetParent()
Definition: ShuttleGui.h:496
ScreenshotBigDialog::OnUIUpdate
void OnUIUpdate(wxUpdateUIEvent &event)
Definition: Screenshot.cpp:566
CommandTargets.h
IdCaptureTools
@ IdCaptureTools
Definition: Screenshot.cpp:225
ShuttleGuiBase::AddWindow
wxWindow * AddWindow(wxWindow *pWindow, int PositionFlags=wxALIGN_CENTRE)
Definition: ShuttleGui.cpp:299
IdCaptureTracks
@ IdCaptureTracks
Definition: Screenshot.cpp:238
IdDirChoose
@ IdDirChoose
Definition: Screenshot.cpp:194
IdCaptureFirst
@ IdCaptureFirst
Definition: Screenshot.cpp:208
ScreenshotBigDialog::OnTallTracks
void OnTallTracks(wxCommandEvent &event)
Definition: Screenshot.cpp:816
ScreenFrameTimer::Notify
void Notify() override
Definition: Screenshot.cpp:174
ScreenshotBigDialog::mTimer
std::unique_ptr< ScreenFrameTimer > mTimer
Definition: Screenshot.cpp:117
ShuttleGui.h
ViewInfo.h
ScreenshotBigDialog::mStatus
wxStatusBar * mStatus
Definition: Screenshot.cpp:115
ScreenFrameTimer::screenFrame
ScreenshotBigDialog * screenFrame
Definition: Screenshot.cpp:182
ScreenshotBigDialog::SizeTracks
void SizeTracks(int h)
Definition: Screenshot.cpp:781
ShuttleGuiBase::AddButton
wxButton * AddButton(const TranslatableString &Text, int PositionFlags=wxALIGN_CENTRE, bool setDefault=false)
Definition: ShuttleGui.cpp:360
ScreenshotCommand::ktrackpanel
@ ktrackpanel
Definition: ScreenshotCommand.h:65
GUISettings.h
IdMedTracks
@ IdMedTracks
Definition: Screenshot.cpp:203
ScreenshotCommand::ktransport
@ ktransport
Definition: ScreenshotCommand.h:56
ShuttleGuiBase::StartStatic
wxStaticBox * StartStatic(const TranslatableString &Str, int iProp=0)
Definition: ShuttleGui.cpp:893
id
int id
Definition: WaveTrackControls.cpp:590
ScreenshotBigDialog::mBlue
wxToggleButton * mBlue
Definition: Screenshot.cpp:113
IdCaptureRecordMeter
@ IdCaptureRecordMeter
Definition: Screenshot.cpp:230
wxDialogWrapper
Definition: wxPanelWrapper.h:81
ScreenshotBigDialog::ProcessEvent
bool ProcessEvent(wxEvent &event) override
Definition: Screenshot.cpp:512
ScreenFrameTimer::~ScreenFrameTimer
virtual ~ScreenFrameTimer()
Definition: Screenshot.cpp:166
IdCaptureFirstTrack
@ IdCaptureFirstTrack
Definition: Screenshot.cpp:239
IdCaptureFullWindow
@ IdCaptureFullWindow
Definition: Screenshot.cpp:218
ScreenshotBigDialog::OnOneHour
void OnOneHour(wxCommandEvent &event)
Definition: Screenshot.cpp:776
FileConfig::Flush
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143
ScreenshotBigDialog::mDirectoryTextBox
wxTextCtrl * mDirectoryTextBox
Definition: Screenshot.cpp:112
TrackList::Get
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:495
IdCaptureTrackPanel
@ IdCaptureTrackPanel
Definition: Screenshot.cpp:236
ScreenshotCommand::kwindowplus
@ kwindowplus
Definition: ScreenshotCommand.h:46
ScreenshotBigDialog::OnMedTracks
void OnMedTracks(wxCommandEvent &event)
Definition: Screenshot.cpp:811
_
#define _(s)
Definition: Internat.h:75
ScreenshotCommand::kfullscreen
@ kfullscreen
Definition: ScreenshotCommand.h:47
ScreenshotCommand::krecordmeter
@ krecordmeter
Definition: ScreenshotCommand.h:60
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:113
ScreenshotBigDialog::ScreenshotBigDialog
ScreenshotBigDialog(wxWindow *parent, wxWindowID id, AudacityProject &project)
Definition: Screenshot.cpp:287
eCloseButton
@ eCloseButton
Definition: ShuttleGui.h:610
IdOneHour
@ IdOneHour
Definition: Screenshot.cpp:200
ScreenshotCommand::ktools
@ ktools
Definition: ScreenshotCommand.h:55
ScreenshotCommand::kmixer
@ kmixer
Definition: ScreenshotCommand.h:57
IdFiveMin
@ IdFiveMin
Definition: Screenshot.cpp:199
ScreenshotBigDialog::OnOneSec
void OnOneSec(wxCommandEvent &event)
Definition: Screenshot.cpp:756
IdTallTracks
@ IdTallTracks
Definition: Screenshot.cpp:204
IdCapturePreferences
@ IdCapturePreferences
Definition: Screenshot.cpp:212
ScreenshotCommand::kdevice
@ kdevice
Definition: ScreenshotCommand.h:62
ScreenshotCommand::kwindow
@ kwindow
Definition: ScreenshotCommand.h:44
IdOneSec
@ IdOneSec
Definition: Screenshot.cpp:196
CloseScreenshotTools
void CloseScreenshotTools()
Definition: Screenshot.cpp:149
ScreenshotBigDialog::OnToggleBackgroundWhite
void OnToggleBackgroundWhite(wxCommandEvent &event)
Definition: Screenshot.cpp:618
RTL_WORKAROUND
#define RTL_WORKAROUND(pWnd)
Definition: GUISettings.h:21
ShuttleGui::AddStandardButtons
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxWindow *extra=NULL)
Definition: ShuttleGui.cpp:2432
ScreenshotBigDialog::~ScreenshotBigDialog
virtual ~ScreenshotBigDialog()
Definition: Screenshot.cpp:326
ScreenshotBigDialog::OnOneMin
void OnOneMin(wxCommandEvent &event)
Definition: Screenshot.cpp:766
Prefs.h
IdCaptureSecondTrack
@ IdCaptureSecondTrack
Definition: Screenshot.cpp:240
ProjectWindow.h
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:489
ScreenshotBigDialog::OnCloseWindow
void OnCloseWindow(wxCloseEvent &event)
Definition: Screenshot.cpp:541
ProjectWindow::RedrawProject
void RedrawProject(const bool bForceWaveTracks=false)
Definition: ProjectWindow.cpp:708
TrackList::Any
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1355
IdCaptureWindowPlus
@ IdCaptureWindowPlus
Definition: Screenshot.cpp:219
ScreenshotBigDialog::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S)
Definition: Screenshot.cpp:341
IdTenSec
@ IdTenSec
Definition: Screenshot.cpp:197
ScreenshotCommand::keffects
@ keffects
Definition: ScreenshotCommand.h:49
IdCapturePlayMeter
@ IdCapturePlayMeter
Definition: Screenshot.cpp:229
ShuttleGuiBase::EndStatic
void EndStatic()
Definition: ShuttleGui.cpp:922
ScreenshotBigDialog::OnMainWindowSmall
void OnMainWindowSmall(wxCommandEvent &event)
Definition: Screenshot.cpp:634
safenew
#define safenew
Definition: MemoryX.h:10
ScreenshotBigDialog::mWhite
wxToggleButton * mWhite
Definition: Screenshot.cpp:114
ShuttleGuiBase::SetStretchyCol
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:202
IdCaptureWindowContents
@ IdCaptureWindowContents
Definition: Screenshot.cpp:217
CommandContext::project
AudacityProject & project
Definition: CommandContext.h:52
IdCaptureSpectralSelection
@ IdCaptureSpectralSelection
Definition: Screenshot.cpp:223
ScreenshotCommand::kWhite
@ kWhite
Definition: ScreenshotCommand.h:37
IdCaptureEffects
@ IdCaptureEffects
Definition: Screenshot.cpp:210
Screenshot.h
ScreenshotCommand::kscrub
@ kscrub
Definition: ScreenshotCommand.h:63
ScreenshotCommand
Implements a command for capturing various areas of the screen or project window. It's one big if-els...
Definition: ScreenshotCommand.h:32
EVT_COMMAND_RANGE
EVT_COMMAND_RANGE(ID_Slider, ID_Slider+NUMBER_OF_BANDS - 1, wxEVT_COMMAND_SLIDER_UPDATED, EffectEqualization::OnSlider) EffectEqualization
Definition: Equalization.cpp:218
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631
ScreenshotBigDialog
ScreenshotBigDialog provides an alternative Gui for ScreenshotCommand. It adds a timer that allows a ...
Definition: Screenshot.cpp:62
ScreenshotCommand::kNone
@ kNone
Definition: ScreenshotCommand.h:38
IdCaptureMixer
@ IdCaptureMixer
Definition: Screenshot.cpp:227
IdAllDelayedEvents
@ IdAllDelayedEvents
Definition: Screenshot.cpp:216
ScreenshotCommand::kspectralselection
@ kspectralselection
Definition: ScreenshotCommand.h:53