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