Audacity 3.2.0
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/frame.h>
26
27#include "ShuttleGui.h"
28#include <wx/checkbox.h>
29#include <wx/dirdlg.h>
30#include <wx/panel.h>
31#include <wx/sizer.h>
32#include <wx/statusbr.h>
33#include <wx/textctrl.h>
34#include <wx/timer.h>
35#include <wx/tglbtn.h>
36#include <wx/window.h>
37
38#include "prefs/GUISettings.h" // for RTL_WORKAROUND
39#include "Project.h"
40#include "ProjectStatus.h"
41#include "ProjectWindow.h"
42#include "ProjectWindows.h"
43#include "Prefs.h"
45#include "tracks/ui/TrackView.h"
46#include "HelpSystem.h"
47
48#include "ViewInfo.h"
49#include "WaveTrack.h"
50
53
55#define ScreenCaptureFrameTitle XO("Screen Capture Frame")
56
57// ANSWER-ME: Should this derive from wxDialogWrapper instead?
58class ScreenshotBigDialog final : public wxFrame,
59 public PrefsListener
60{
61 public:
62
63 // constructors and destructors
65 wxWindow *parent, wxWindowID id, AudacityProject &project);
66 virtual ~ScreenshotBigDialog();
67
68 bool ProcessEvent(wxEvent & event) override;
69
70 private:
71 void Populate();
73
74 void OnCloseWindow(wxCloseEvent & event);
75 void OnUIUpdate(wxUpdateUIEvent & event);
76 void OnDirChoose(wxCommandEvent & event);
77 void OnGetURL(wxCommandEvent & event);
78 void OnClose(wxCommandEvent & event );
79
80
81 void SizeMainWindow(int w, int h);
82 void OnMainWindowSmall(wxCommandEvent & event);
83 void OnMainWindowLarge(wxCommandEvent & event);
84 void OnToggleBackgroundBlue(wxCommandEvent & event);
85 void OnToggleBackgroundWhite(wxCommandEvent & event);
86
87 void DoCapture(int captureMode);
88 void OnCaptureSomething(wxCommandEvent & event);
89
90 void TimeZoom(double seconds);
91 void OnOneSec(wxCommandEvent & event);
92 void OnTenSec(wxCommandEvent & event);
93 void OnOneMin(wxCommandEvent & event);
94 void OnFiveMin(wxCommandEvent & event);
95 void OnOneHour(wxCommandEvent & event);
96
97 void SizeTracks(int h);
98 void OnShortTracks(wxCommandEvent & event);
99 void OnMedTracks(wxCommandEvent & event);
100 void OnTallTracks(wxCommandEvent & event);
101
102 // PrefsListener implementation
103 void UpdatePrefs() override;
104
106
107 std::unique_ptr<ScreenshotCommand> CreateCommand();
108
109 wxCheckBox *mDelayCheckBox;
110 wxTextCtrl *mDirectoryTextBox;
111 wxToggleButton *mBlue;
112 wxToggleButton *mWhite;
113 wxStatusBar *mStatus;
114
115 std::unique_ptr<ScreenFrameTimer> mTimer;
116
117 std::unique_ptr<ScreenshotCommand> mCommand;
119
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
151class ScreenFrameTimer final : public wxTimer
152{
153 public:
155 wxEvent & event)
156 {
157 screenFrame = frame;
158 evt.reset(event.Clone());
159 }
160
162 {
163 if (IsRunning())
164 {
165 Stop();
166 }
167 }
168
169 void Notify() override
170 {
171 // Process timer notification just once, then destroy self
172 evt->SetEventObject(NULL);
174 }
175
176 private:
178 std::unique_ptr<wxEvent> evt;
179};
180
182
183enum
184{
187
190
196
200
202
205
207
208 // No point delaying the capture of sets of things.
212
214
215 // Put all events that need delay between AllDelayed and LastDelayed.
221
228
229 // Reserved values for an unspecified number of toolbars
231};
232
233BEGIN_EVENT_TABLE(ScreenshotBigDialog, wxFrame)
237
239
245
251
255
258
259// Must not be called before CreateStatusBar!
260std::unique_ptr<ScreenshotCommand> ScreenshotBigDialog::CreateCommand()
261{
262 wxASSERT(mStatus != NULL);
263 auto output =
264 std::make_unique<CommandOutputTargets>(std::make_unique<NullProgressTarget>(),
265 std::make_shared<StatusBarTarget>(*mStatus),
266 std::make_shared<MessageBoxTarget>());
267 return std::make_unique<ScreenshotCommand>();//*type, std::move(output), this);
268}
269
271 wxWindow * parent, wxWindowID id, AudacityProject &project)
272: wxFrame(parent, id, ScreenCaptureFrameTitle.Translation(),
273 wxDefaultPosition, wxDefaultSize,
274
275#if !defined(__WXMSW__)
276
277 #if !defined(__WXMAC__) // bug1358
278 wxFRAME_TOOL_WINDOW |
279 #endif
280
281#else
282
283 wxSTAY_ON_TOP|
284
285#endif
286
287 wxSYSTEM_MENU|wxCAPTION|wxCLOSE_BOX)
288 , mProject{ project }
289 , mContext( project )
290{
291 mDelayCheckBox = NULL;
292 mDirectoryTextBox = NULL;
293
294 mStatus = CreateStatusBar(3);
296
297 Populate();
298
299 // Reset the toolbars to a known state.
300 // Note that the audio could be playing.
301 // The monitoring will switch off temporarily
302 // because we've switched monitor mid play.
303 // Bug 383 - Resetting the toolbars is not wanted.
304 // Any that are invisible will be amde visible as/when needed.
305 //ToolManager::Get( mContext.project ).Reset();
306 Center();
307}
308
310{
311 if (this == mFrame)
312 mFrame = nullptr;
313 else
314 // There should only be one!
315 wxASSERT(false);
316}
317
319{
320 ShuttleGui S(this, eIsCreating);
322}
323
325{
326 wxPanel *p = S.StartPanel();
328 {
329 S.SetBorder(3);
330
331 S.StartStatic(XO("Choose location to save files"));
332 {
333 S.StartMultiColumn(3, wxEXPAND);
334 {
335 S.SetStretchyCol(1);
336
338 S.Id(IdDirectory).AddTextBox(
339 XXO("Save images to:"),
340 gPrefs->Read(wxT("/ScreenshotPath"), wxFileName::GetHomeDir()),
341 30
342 );
343 S.Id(IdDirChoose).AddButton(XXO("Choose..."));
344 }
345 S.EndMultiColumn();
346 }
347 S.EndStatic();
348
349 S.StartStatic(XO("Capture entire window or screen"));
350 {
351 S.StartHorizontalLay();
352 {
353 S.Id(IdMainWindowSmall).AddButton(XXO("Resize Small"));
354 S.Id(IdMainWindowLarge).AddButton(XXO("Resize Large"));
355 mBlue = safenew wxToggleButton(S.GetParent(),
357 /* i18n-hint: Bkgnd is short for background and appears on a small button
358 * It is OK to just translate this item as if it said 'Blue' */
359 _("Blue Bkgnd"));
360 S.AddWindow(mBlue);
361 mWhite = safenew wxToggleButton(S.GetParent(),
363 /* i18n-hint: Bkgnd is short for background and appears on a small button
364 * It is OK to just translate this item as if it said 'White' */
365 _("White Bkgnd"));
366 S.AddWindow(mWhite);
367 }
368 S.EndHorizontalLay();
369
370 S.StartHorizontalLay();
371 {
372 S.Id(IdCaptureWindowContents).AddButton(XXO("Capture Window Only"));
373 S.Id(IdCaptureFullWindow).AddButton(XXO("Capture Full Window"));
374 S.Id(IdCaptureWindowPlus).AddButton(XXO("Capture Window Plus"));
375 }
376 S.EndHorizontalLay();
377
378 S.StartHorizontalLay();
379 {
380 S.Id(IdCaptureFullScreen).AddButton(XXO("Capture Full Screen"));
381 }
382 S.EndHorizontalLay();
383
384 S.StartHorizontalLay();
385 {
386 mDelayCheckBox = S.Id(IdDelayCheckBox).AddCheckBox(
387 XXO("Wait 5 seconds and capture frontmost window/dialog"),
388 false);
389 }
390 S.EndHorizontalLay();
391 }
392 S.EndStatic();
393
394 S.StartStatic(XO("Capture part of a project window"));
395 {
396 S.StartHorizontalLay();
397 {
398 S.Id(IdCaptureToolbars).AddButton(XXO("All Toolbars"));
399 S.Id(IdCaptureEffects).AddButton(XXO("All Effects"));
400 S.Id(IdCaptureScriptables).AddButton(XXO("All Scriptables"));
401 S.Id(IdCapturePreferences).AddButton(XXO("All Preferences"));
402 }
403 S.EndHorizontalLay();
404
405 {
406 // Discover the available toolbars and make rows of buttons
407 int id = IdFirstToolbar;
408 size_t ii = 0;
409 S.StartHorizontalLay();
410 std::vector<ToolBar *> bars;
412 bars.emplace_back(pBar);
413 });
414 // Sort by translation, for determinacy (per language) of the
415 // sequence
416 static const auto comp = [](ToolBar *a, ToolBar *b){
417 return a->GetLabel().Translation() < b->GetLabel().Translation();
418 };
419 sort(bars.begin(), bars.end(), comp);
420 for_each(bars.begin(), bars.end(), [&](ToolBar *pBar){
421 S.Id(id).AddButton(pBar->GetLabel());
422 Bind(wxEVT_BUTTON,
423 &ScreenshotBigDialog::OnCaptureSomething, this, id);
424 ++id;
425 // Start a new row at every fourth one
426 if (++ii == 4) {
427 ii = 0;
428 S.EndHorizontalLay();
429 S.StartHorizontalLay();
430 }
431 });
433 S.EndHorizontalLay();
434 }
435
436 S.StartHorizontalLay();
437 {
438 S.Id(IdCaptureTrackPanel).AddButton(XXO("Track Panel"));
439 S.Id(IdCaptureRuler).AddButton(XXO("Ruler"));
440 S.Id(IdCaptureTracks).AddButton(XXO("Tracks"));
441 S.Id(IdCaptureFirstTrack).AddButton(XXO("First Track"));
442 S.Id(IdCaptureSecondTrack).AddButton(XXO("Second Track"));
443 }
444 S.EndHorizontalLay();
445 }
446 S.EndStatic();
447
448 S.StartStatic(XO("Scale"));
449 {
450 S.StartHorizontalLay();
451 {
452 S.Id(IdOneSec).AddButton(XXO("One Sec"));
453 S.Id(IdTenSec).AddButton(XXO("Ten Sec"));
454 S.Id(IdOneMin).AddButton(XXO("One Min"));
455 S.Id(IdFiveMin).AddButton(XXO("Five Min"));
456 S.Id(IdOneHour).AddButton(XXO("One Hour"));
457 }
458 S.EndHorizontalLay();
459
460 S.StartHorizontalLay();
461 {
462 S.Id(IdShortTracks).AddButton(XXO("Short Tracks"));
463 S.Id(IdMedTracks).AddButton(XXO("Medium Tracks"));
464 S.Id(IdTallTracks).AddButton(XXO("Tall Tracks"));
465 }
466 S.EndHorizontalLay();
467 }
468 S.EndStatic();
469 S.AddStandardButtons(eCloseButton |eHelpButton);
470 }
471 S.EndPanel();
472
473 Layout();
474 GetSizer()->Fit(this);
475 SetMinSize(GetSize());
476
477 int top = 0;
478#ifdef __WXMAC__
479 // Allow for Mac menu bar
480 top += 20;
481#endif
482
483 int width, height;
484 GetSize(&width, &height);
485 int displayWidth, displayHeight;
486 wxDisplaySize(&displayWidth, &displayHeight);
487
488 if (width > 100) {
489 Move(displayWidth - width - 16, top + 16);
490 }
491 else {
492 CentreOnParent();
493 }
494
495 SetIcon( GetProjectFrame( mContext.project ).GetIcon() );
496}
497
499{
500 if (!IsFrozen())
501 {
502 int id = e.GetId();
503
504 // If split into two parts to make for easier breakpoint
505 // when testing timer.
506 if (mDelayCheckBox &&
507 mDelayCheckBox->GetValue() &&
508 e.IsCommandEvent() &&
509 e.GetEventType() == wxEVT_COMMAND_BUTTON_CLICKED)
510 {
511 if( id >= IdAllDelayedEvents &&
512 e.GetEventObject() != NULL) {
513 mTimer = std::make_unique<ScreenFrameTimer>(this, e);
514 mTimer->Start(5000, true);
515 return true;
516 }
517 }
518
519 if (e.IsCommandEvent() && e.GetEventObject() == NULL) {
520 e.SetEventObject(this);
521 }
522 }
523
524 return wxFrame::ProcessEvent(e);
525}
526
527void ScreenshotBigDialog::OnCloseWindow(wxCloseEvent & WXUNUSED(event))
528{
529 if (mDirectoryTextBox->IsModified()) {
530 gPrefs->Write(wxT("/ScreenshotPath"), mDirectoryTextBox->GetValue());
531 gPrefs->Flush();
532 }
533
534 Destroy();
535}
536
537void ScreenshotBigDialog::OnClose(wxCommandEvent & WXUNUSED(event))
538{
539 if (mDirectoryTextBox->IsModified()) {
540 gPrefs->Write(wxT("/ScreenshotPath"), mDirectoryTextBox->GetValue());
541 gPrefs->Flush();
542 }
543
544 Destroy();
545}
546
547void ScreenshotBigDialog::OnGetURL(wxCommandEvent & WXUNUSED(event))
548{
549 HelpSystem::ShowHelp(this, L"Screenshot");
550}
551
552void ScreenshotBigDialog::OnUIUpdate(wxUpdateUIEvent & WXUNUSED(event))
553{
554#ifdef __WXMAC__
555 wxTopLevelWindow *top = mCommand->GetFrontWindow(&mProject);
556 bool needupdate = false;
557 bool enable = false;
558
559 if ((!top || top->IsIconized()) && mDirectoryTextBox->IsEnabled()) {
560 needupdate = true;
561 enable = false;
562 }
563 else if ((top && !top->IsIconized()) && !mDirectoryTextBox->IsEnabled()) {
564 needupdate = true;
565 enable = true;
566 }
567
568 if (needupdate) {
569 for (int i = IdMainWindowSmall; i < mFirstUnusedId; i++) {
571 continue;
572 wxWindow *w = wxWindow::FindWindowById(i, this);
573 if (w) {
574 w->Enable(enable);
575 }
576 }
577 }
578#endif
579}
580
581void ScreenshotBigDialog::OnDirChoose(wxCommandEvent & WXUNUSED(event))
582{
583 wxString current = mDirectoryTextBox->GetValue();
584
585 wxDirDialogWrapper dlog(this,
586 XO("Choose a location to save screenshot images"),
587 current);
588
589 dlog.ShowModal();
590 if (!dlog.GetPath().empty()) {
591 wxFileName tmpDirPath;
592 tmpDirPath.AssignDir(dlog.GetPath());
593 wxString path = tmpDirPath.GetPath(wxPATH_GET_VOLUME|wxPATH_GET_SEPARATOR);
594 mDirectoryTextBox->SetValue(path);
595 gPrefs->Write(wxT("/ScreenshotPath"), path);
596 gPrefs->Flush();
597 mCommand->mPath = path;
598 }
599}
600
601void ScreenshotBigDialog::OnToggleBackgroundBlue(wxCommandEvent & WXUNUSED(event))
602{
603 mWhite->SetValue(false);
604}
605
606void ScreenshotBigDialog::OnToggleBackgroundWhite(wxCommandEvent & WXUNUSED(event))
607{
608 mBlue->SetValue(false);
609}
610
612{
613 int top = 20;
614
615 auto &window = GetProjectFrame( mContext.project );
616 window.Maximize(false);
617 window.SetSize(16, 16 + top, w, h);
618 //Bug383 - Toolbar Resets not wanted.
619 //ToolManager::Get( mContext.project ).Reset();
620}
621
622void ScreenshotBigDialog::OnMainWindowSmall(wxCommandEvent & WXUNUSED(event))
623{
624 SizeMainWindow(680, 450);
625}
626
627void ScreenshotBigDialog::OnMainWindowLarge(wxCommandEvent & WXUNUSED(event))
628{
629 SizeMainWindow(900, 600);
630}
631
633{
634 Hide();
635 wxYieldIfNeeded();
636 //mCommand->SetParameter(wxT("FilePath"), mDirectoryTextBox->GetValue());
637 //mCommand->SetParameter(wxT("CaptureMode"), captureMode);
638 mCommand->mBack = mWhite->GetValue()
640 : mBlue->GetValue()
642 mCommand->mPath = mDirectoryTextBox->GetValue();
643 mCommand->mWhat = captureMode;
644 if (!mCommand->Apply(mContext))
645 mStatus->SetStatusText(_("Capture failed!"), mainStatusBarField);
646
647 // Bug 2323: (100% hackage alert) Since the command target dialog is not
648 // accessible from outside the command, this seems to be the only way we
649 // can get the window on top of this dialog.
650 auto w = static_cast<wxDialogWrapper *>(wxFindWindowByLabel(XO("Long Message").Translation()));
651 if (w) {
652 auto endmodal = [w](wxCommandEvent &evt)
653 {
654 w->EndModal(0);
655 };
656 w->Bind(wxEVT_BUTTON, endmodal);
657 w->ShowModal();
658 }
659
660 Show();
661}
662
663void ScreenshotBigDialog::OnCaptureSomething(wxCommandEvent & event)
664{
665 int i = event.GetId();
666
667 /*
668 IdCaptureEffects= IdCaptureFirst,
669 IdCaptureScriptables,
670 IdCapturePreferences,
671 IdCaptureToolbars,
672
673 // Put all events that need delay between AllDelayed and LastDelayed.
674 IdAllDelayedEvents,
675 IdCaptureWindowContents=IdAllDelayedEvents,
676 IdCaptureFullWindow,
677 IdCaptureWindowPlus,
678 IdCaptureFullScreen,
679
680 IdCaptureSelectionBar,
681 IdCaptureSpectralSelection,
682 IdCaptureTools,
683 IdCaptureTransport,
684 IdCaptureMixer,
685 IdCaptureMeter,
686 IdCapturePlayMeter,
687 IdCaptureRecordMeter,
688 IdCaptureEdit,
689 IdCaptureDevice,
690 IdCaptureTranscription,
691 IdCaptureScrub,
692
693 IdCaptureTrackPanel,
694 IdCaptureRuler,
695 IdCaptureTracks,
696 IdCaptureFirstTrack,
697 IdCaptureSecondTrack,
698 IdCaptureLast = IdCaptureSecondTrack,
699 */
700
701 static const int codes[] = {
706
716 };
717
718 int code;
719 if (i >= IdFirstToolbar)
721 else
722 code = codes[i - IdCaptureFirst];
723 DoCapture(code);
724}
725
727{
728 auto &viewInfo = ViewInfo::Get( mContext.project );
729 auto &window = ProjectWindow::Get( mContext.project );
730 int width, height;
731 window.GetClientSize(&width, &height);
732 viewInfo.SetZoom((0.75 * width) / seconds);
733 window.RedrawProject();
734}
735
736void ScreenshotBigDialog::OnOneSec(wxCommandEvent & WXUNUSED(event))
737{
738 TimeZoom(1.0);
739}
740
741void ScreenshotBigDialog::OnTenSec(wxCommandEvent & WXUNUSED(event))
742{
743 TimeZoom(10.0);
744}
745
746void ScreenshotBigDialog::OnOneMin(wxCommandEvent & WXUNUSED(event))
747{
748 TimeZoom(60.0);
749}
750
751void ScreenshotBigDialog::OnFiveMin(wxCommandEvent & WXUNUSED(event))
752{
753 TimeZoom(300.0);
754}
755
756void ScreenshotBigDialog::OnOneHour(wxCommandEvent & WXUNUSED(event))
757{
758 TimeZoom(3600.0);
759}
760
762{
763 // h is the height for a channel
764 // Set the height of a mono track twice as high
765
766 // TODO: more-than-two-channels
767 // If there should be more-than-stereo tracks, this makes
768 // each channel as high as for a stereo channel
769
770 auto &tracks = TrackList::Get( mContext.project );
771 for (auto t : tracks.Leaders<WaveTrack>()) {
772 auto channels = TrackList::Channels(t);
773 auto nChannels = channels.size();
774 auto height = nChannels == 1 ? 2 * h : h;
775 for (auto channel : channels)
776 TrackView::Get( *channel ).SetExpandedHeight(height);
777 }
779}
780
781void ScreenshotBigDialog::OnShortTracks(wxCommandEvent & WXUNUSED(event))
782{
783 for (auto t : TrackList::Get( mContext.project ).Any<WaveTrack>()) {
784 auto &view = TrackView::Get( *t );
785 view.SetExpandedHeight( view.GetMinimizedHeight() );
786 }
787
789}
790
791void ScreenshotBigDialog::OnMedTracks(wxCommandEvent & WXUNUSED(event))
792{
793 SizeTracks(60);
794}
795
796void ScreenshotBigDialog::OnTallTracks(wxCommandEvent & WXUNUSED(event))
797{
798 SizeTracks(85);
799}
800
802{
803 Freeze();
804
805 SetSizer(nullptr);
806 DestroyChildren();
807
808 SetTitle(ScreenCaptureFrameTitle.Translation());
809 Populate();
810
811 Thaw();
812}
813
814#include "CommonCommandFlags.h"
816
817namespace {
818void OnScreenshot(const CommandContext &context )
819{
820 // Register Screenshot as Last Tool
822 OpenScreenshotTools( context.project );
823}
824
825// Menu definitions
826
827using namespace MenuTable;
829 { wxT("Tools/Other"), { OrderingHint::After, wxT("ConfigReset") } },
830 Command( wxT("FancyScreenshot"), XXO("&Screenshot..."),
832};
833
834}
wxEVT_COMMAND_BUTTON_CLICKED
wxT("CloseDown"))
const ReservedCommandFlag & AudioIONotBusyFlag()
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
XO("Cut/Copy/Paste")
XXO("&Cut/Copy/Paste Toolbar")
#define RTL_WORKAROUND(pWnd)
Definition: GUISettings.h:20
#define _(s)
Definition: Internat.h:73
#define safenew
Definition: MemoryX.h:10
EVT_COMMAND_RANGE(ID_Slider, ID_Slider+99, wxEVT_COMMAND_SLIDER_UPDATED, NyquistEffect::OnSlider) EVT_COMMAND_RANGE(ID_Text
FileConfig * gPrefs
Definition: Prefs.cpp:70
@ mainStatusBarField
Definition: ProjectStatus.h:26
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 ...
accessors for certain important windows associated with each project
ScreenshotBigDialogPtr mFrame
Definition: Screenshot.cpp:130
#define ScreenCaptureFrameTitle
Definition: Screenshot.cpp:55
END_EVENT_TABLE()
static void OpenScreenshotTools(AudacityProject &project)
Definition: Screenshot.cpp:134
@ IdToggleBackgroundWhite
Definition: Screenshot.cpp:204
@ IdTallTracks
Definition: Screenshot.cpp:199
@ IdFiveMin
Definition: Screenshot.cpp:194
@ IdCaptureEffects
Definition: Screenshot.cpp:209
@ IdMainWindowLarge
Definition: Screenshot.cpp:186
@ IdFirstToolbar
Definition: Screenshot.cpp:230
@ IdCaptureToolbars
Definition: Screenshot.cpp:213
@ IdTenSec
Definition: Screenshot.cpp:192
@ IdCaptureFirstTrack
Definition: Screenshot.cpp:225
@ IdCaptureWindowContents
Definition: Screenshot.cpp:217
@ IdMainWindowSmall
Definition: Screenshot.cpp:185
@ IdCaptureRuler
Definition: Screenshot.cpp:223
@ IdOneMin
Definition: Screenshot.cpp:193
@ IdDirectory
Definition: Screenshot.cpp:188
@ IdCaptureLast
Definition: Screenshot.cpp:227
@ IdOneHour
Definition: Screenshot.cpp:195
@ IdDirChoose
Definition: Screenshot.cpp:189
@ IdCaptureSecondTrack
Definition: Screenshot.cpp:226
@ IdCaptureTracks
Definition: Screenshot.cpp:224
@ IdCaptureFullScreen
Definition: Screenshot.cpp:220
@ IdOneSec
Definition: Screenshot.cpp:191
@ IdCaptureWindowPlus
Definition: Screenshot.cpp:219
@ IdToggleBackgroundBlue
Definition: Screenshot.cpp:203
@ IdCaptureScriptables
Definition: Screenshot.cpp:210
@ IdAllDelayedEvents
Definition: Screenshot.cpp:216
@ IdDelayCheckBox
Definition: Screenshot.cpp:201
@ IdCaptureTrackPanel
Definition: Screenshot.cpp:222
@ IdCaptureFullWindow
Definition: Screenshot.cpp:218
@ IdShortTracks
Definition: Screenshot.cpp:197
@ IdMedTracks
Definition: Screenshot.cpp:198
@ IdCaptureFirst
Definition: Screenshot.cpp:206
@ IdCapturePreferences
Definition: Screenshot.cpp:211
@ eIsCreating
Definition: ShuttleGui.h:37
@ eCloseButton
Definition: ShuttleGui.h:604
@ eHelpButton
Definition: ShuttleGui.h:598
#define S(N)
Definition: ToChars.cpp:64
int id
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
AudacityProject & project
void RegisterLastTool(const CommandContext &context)
static CommandManager & Get(AudacityProject &project)
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:233
Base class for containing data common to all commands of a given type. Also acts as a factory.
Definition: CommandType.h:45
A listener notified of changes in preferences.
Definition: Prefs.h:556
static ProjectWindow & Get(AudacityProject &project)
void RedrawProject(const bool bForceWaveTracks=false)
ScreenshotBigDialog * screenFrame
Definition: Screenshot.cpp:177
std::unique_ptr< wxEvent > evt
Definition: Screenshot.cpp:178
ScreenFrameTimer(ScreenshotBigDialog *frame, wxEvent &event)
Definition: Screenshot.cpp:154
void Notify() override
Definition: Screenshot.cpp:169
virtual ~ScreenFrameTimer()
Definition: Screenshot.cpp:161
ScreenshotBigDialog provides an alternative Gui for ScreenshotCommand. It adds a timer that allows a ...
Definition: Screenshot.cpp:60
void OnGetURL(wxCommandEvent &event)
Definition: Screenshot.cpp:547
virtual ~ScreenshotBigDialog()
Definition: Screenshot.cpp:309
bool ProcessEvent(wxEvent &event) override
Definition: Screenshot.cpp:498
void OnMainWindowSmall(wxCommandEvent &event)
Definition: Screenshot.cpp:622
void OnOneSec(wxCommandEvent &event)
Definition: Screenshot.cpp:736
void OnMedTracks(wxCommandEvent &event)
Definition: Screenshot.cpp:791
void OnToggleBackgroundWhite(wxCommandEvent &event)
Definition: Screenshot.cpp:606
AudacityProject & mProject
Definition: Screenshot.cpp:105
void OnClose(wxCommandEvent &event)
Definition: Screenshot.cpp:537
void TimeZoom(double seconds)
Definition: Screenshot.cpp:726
const CommandContext mContext
Definition: Screenshot.cpp:118
void OnTallTracks(wxCommandEvent &event)
Definition: Screenshot.cpp:796
wxToggleButton * mWhite
Definition: Screenshot.cpp:112
void UpdatePrefs() override
Definition: Screenshot.cpp:801
void OnUIUpdate(wxUpdateUIEvent &event)
Definition: Screenshot.cpp:552
void OnTenSec(wxCommandEvent &event)
Definition: Screenshot.cpp:741
void OnCaptureSomething(wxCommandEvent &event)
Definition: Screenshot.cpp:663
void OnShortTracks(wxCommandEvent &event)
Definition: Screenshot.cpp:781
void SizeMainWindow(int w, int h)
Definition: Screenshot.cpp:611
ScreenshotBigDialog(wxWindow *parent, wxWindowID id, AudacityProject &project)
Definition: Screenshot.cpp:270
std::unique_ptr< ScreenshotCommand > mCommand
Definition: Screenshot.cpp:117
void OnOneMin(wxCommandEvent &event)
Definition: Screenshot.cpp:746
void SizeTracks(int h)
Definition: Screenshot.cpp:761
void OnToggleBackgroundBlue(wxCommandEvent &event)
Definition: Screenshot.cpp:601
std::unique_ptr< ScreenshotCommand > CreateCommand()
Definition: Screenshot.cpp:260
wxToggleButton * mBlue
Definition: Screenshot.cpp:111
void PopulateOrExchange(ShuttleGui &S)
Definition: Screenshot.cpp:324
void OnMainWindowLarge(wxCommandEvent &event)
Definition: Screenshot.cpp:627
wxTextCtrl * mDirectoryTextBox
Definition: Screenshot.cpp:110
std::unique_ptr< ScreenFrameTimer > mTimer
Definition: Screenshot.cpp:115
void OnFiveMin(wxCommandEvent &event)
Definition: Screenshot.cpp:751
wxStatusBar * mStatus
Definition: Screenshot.cpp:113
void OnCloseWindow(wxCloseEvent &event)
Definition: Screenshot.cpp:527
void DoCapture(int captureMode)
Definition: Screenshot.cpp:632
wxCheckBox * mDelayCheckBox
Definition: Screenshot.cpp:109
void OnOneHour(wxCommandEvent &event)
Definition: Screenshot.cpp:756
void OnDirChoose(wxCommandEvent &event)
Definition: Screenshot.cpp:581
Implements a command for capturing various areas of the screen or project window. It's one big if-els...
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:625
Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed.
Definition: ToolBar.h:74
TranslatableString GetLabel()
Definition: ToolBar.cpp:392
static ToolManager & Get(AudacityProject &project)
void ForEach(F &&fun)
Visit bars, lexicographically by their textual ids.
Definition: ToolManager.h:103
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1313
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:385
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1417
void SetExpandedHeight(int height)
Definition: TrackView.cpp:172
static TrackView & Get(Track &)
Definition: TrackView.cpp:69
wxString Translation() const
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235
A Track that contains audio waveform data.
Definition: WaveTrack.h:51
constexpr auto Command
void OnScreenshot(const CommandContext &context)
Definition: Screenshot.cpp:818
STL namespace.