Audacity 3.2.0
|
Implements a command for capturing various areas of the screen or project window. It's one big if-elseif switch statement with lots of small calculations of rectangles. More...
#include <ScreenshotCommand.h>
Public Types | |
enum | kBackgrounds { kBlue , kWhite , kNone , nBackgrounds } |
enum | kCaptureTypes { kwindow , kfullwindow , kwindowplus , kfullscreen , ktoolbars , keffects , kscriptables , kpreferences , ktrackpanel , kruler , ktracks , kfirsttrack , kfirsttwotracks , kfirstthreetracks , kfirstfourtracks , ksecondtrack , ktracksplus , kfirsttrackplus , kalltracks , kalltracksplus , nCaptureWhats } |
Public Types inherited from AudacityCommand | |
enum | : long { DefaultMessageBoxStyle = wxOK | wxCENTRE } |
Public Member Functions | |
EnumValueSymbols | kCaptureWhatStrings () |
ScreenshotCommand () | |
ComponentInterfaceSymbol | GetSymbol () const override |
TranslatableString | GetDescription () const override |
template<bool Const> | |
bool | VisitSettings (SettingsVisitorBase< Const > &S) |
bool | VisitSettings (SettingsVisitor &S) override |
bool | VisitSettings (ConstSettingsVisitor &S) override |
void | PopulateOrExchange (ShuttleGui &S) override |
ManualPageID | ManualPage () override |
bool | Apply (const CommandContext &context) override |
void | GetDerivedParams () |
void | CaptureWindowOnIdle (const CommandContext &context, wxWindow *pWin) |
wxTopLevelWindow * | GetFrontWindow (AudacityProject *project) |
Public Member Functions inherited from AudacityCommand | |
AudacityCommand () | |
virtual | ~AudacityCommand () |
PluginPath | GetPath () const override |
VendorSymbol | GetVendor () const override |
wxString | GetVersion () const override |
ComponentInterfaceSymbol | GetSymbol () const override=0 |
virtual TranslatableString | GetDescription () const override |
virtual ManualPageID | ManualPage () |
virtual bool | IsBatchProcessing () const |
virtual void | SetBatchProcessing (bool start) |
virtual bool | Apply (const CommandContext &WXUNUSED(context)) |
bool | ShowInterface (wxWindow *parent, bool forceModal=false) |
wxDialog * | CreateUI (wxWindow *parent, AudacityCommand *client) |
bool | SaveSettingsAsString (wxString &parms) |
bool | LoadSettingsFromString (const wxString &parms) |
bool | DoAudacityCommand (wxWindow *parent, const CommandContext &context, bool shouldPrompt=true) |
int | MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={}) |
virtual bool | Init () |
virtual bool | PromptUser (wxWindow *parent) |
virtual bool | CheckWhetherSkipAudacityCommand () |
virtual void | End () |
virtual void | PopulateOrExchange (ShuttleGui &WXUNUSED(S)) |
virtual bool | TransferDataToWindow () |
virtual bool | TransferDataFromWindow () |
virtual bool | VisitSettings (SettingsVisitor &) |
virtual bool | VisitSettings (ConstSettingsVisitor &) |
Public Member Functions inherited from ComponentInterface | |
virtual | ~ComponentInterface () |
virtual PluginPath | GetPath () const =0 |
virtual ComponentInterfaceSymbol | GetSymbol () const =0 |
virtual VendorSymbol | GetVendor () const =0 |
virtual wxString | GetVersion () const =0 |
virtual TranslatableString | GetDescription () const =0 |
TranslatableString | GetName () const |
Static Public Member Functions | |
static void | SetIdleHandler (AudacityProject &project) |
static bool | MayCapture (wxDialog *pDlg) |
Static Public Attributes | |
static const ComponentInterfaceSymbol | Symbol { XO("Screenshot") } |
static ScreenshotCommand * | mpShooter =NULL |
static void(* | mIdleHandler )(wxIdleEvent &event) = NULL |
Private Member Functions | |
wxString | MakeFileName (const wxString &path, const wxString &basename) |
wxRect | GetBackgroundRect () |
bool | CaptureToolbar (const CommandContext &Context, ToolManager *man, Identifier type, const wxString &name) |
bool | CaptureDock (const CommandContext &Context, wxWindow *win, const wxString &fileName) |
void | CaptureCommands (const CommandContext &Context, const wxArrayStringEx &Commands) |
void | CaptureEffects (const CommandContext &Context, AudacityProject *pProject, const wxString &fileName) |
void | CaptureScriptables (const CommandContext &Context, AudacityProject *pProject, const wxString &fileName) |
void | CapturePreferences (const CommandContext &Context, AudacityProject *pProject, const wxString &fileName) |
bool | Capture (const CommandContext &Context, const wxString &basename, wxWindow *window, wxRect rect, bool bg=false) |
wxRect | GetWindowRect (wxTopLevelWindow *w) |
wxRect | GetFullWindowRect (wxTopLevelWindow *w) |
wxRect | GetScreenRect () |
wxRect | GetPanelRect (TrackPanel *panel) |
wxRect | GetRulerRect (AdornedRulerPanel *ruler) |
wxRect | GetTracksRect (TrackPanel *panel) |
wxRect | GetTrackRect (AudacityProject *pProj, TrackPanel *panel, int n) |
wxString | WindowFileName (AudacityProject *proj, wxTopLevelWindow *w) |
Private Attributes | |
int | mWhat |
int | mBack |
wxString | mPath |
bool | mbBringToTop |
bool | bHasBackground |
bool | bHasBringToTop |
EnumValueSymbols | mSymbols |
wxWindow * | mIgnore |
bool | mBackground |
wxColour | mBackColor |
wxString | mDirToWriteTo |
wxString | mFilePath |
wxString | mFileName |
int | mCaptureMode |
Friends | |
class | ScreenshotBigDialog |
Additional Inherited Members | |
Protected Attributes inherited from AudacityCommand | |
ProgressDialog * | mProgress |
wxDialog * | mUIDialog |
wxWindow * | mUIParent |
Implements a command for capturing various areas of the screen or project window. It's one big if-elseif switch statement with lots of small calculations of rectangles.
Definition at line 31 of file ScreenshotCommand.h.
Enumerator | |
---|---|
kBlue | |
kWhite | |
kNone | |
nBackgrounds |
Definition at line 34 of file ScreenshotCommand.h.
Definition at line 42 of file ScreenshotCommand.h.
ScreenshotCommand::ScreenshotCommand | ( | ) |
Definition at line 121 of file ScreenshotCommand.cpp.
References MayCapture(), mbBringToTop, mIgnore, and anonymous_namespace{wxCommandTargets.cpp}::scope.
|
override |
Definition at line 773 of file ScreenshotCommand.cpp.
References Capture(), CaptureDock(), CaptureEffects(), CapturePreferences(), CaptureScriptables(), CaptureToolbar(), TrackList::Get(), ToolManager::Get(), TrackPanel::Get(), GetDerivedParams(), GetFrontWindow(), GetFullWindowRect(), GetPanelRect(), TrackPanel::GetRuler(), GetRulerRect(), GetScreenRect(), GetTrackRect(), GetTracksRect(), GetWindowRect(), kalltracks, kalltracksplus, kCaptureWhatStrings(), keffects, kfirstfourtracks, kfirstthreetracks, kfirsttrack, kfirsttrackplus, kfirsttwotracks, kfullscreen, kfullwindow, kpreferences, kruler, kscriptables, ksecondtrack, ktoolbars, ktrackpanel, ktracks, ktracksplus, kwindow, kwindowplus, mCaptureMode, mFileName, nCaptureWhats, CommandContext::project, anonymous_namespace{TimeTrackVRulerControls.cpp}::ruler(), TrackList::Size(), and WindowFileName().
|
private |
Definition at line 233 of file ScreenshotCommand.cpp.
References _, bHasBringToTop, CommandContext::Error(), GetBackgroundRect(), mBackColor, mBackground, mbBringToTop, CommandContext::Status(), wxImage(), and Yield().
Referenced by Apply(), CaptureDock(), CaptureToolbar(), and CaptureWindowOnIdle().
|
private |
Definition at line 581 of file ScreenshotCommand.cpp.
References AlwaysEnabledFlag, CommandManager::Get(), manager, mDirToWriteTo, mFileName, mpShooter, CommandContext::project, and SetIdleHandler().
Referenced by CaptureEffects(), and CaptureScriptables().
|
private |
Definition at line 354 of file ScreenshotCommand.cpp.
References Capture().
Referenced by Apply().
|
private |
Definition at line 450 of file ScreenshotCommand.cpp.
References CaptureCommands().
Referenced by Apply().
|
private |
Definition at line 413 of file ScreenshotCommand.cpp.
References AlwaysEnabledFlag, MenuRegistry::Command, audacity::BasicSettings::Flush(), gPrefs, CommandDispatch::HandleTextualCommand(), mDirToWriteTo, mpShooter, CommandContext::project, SetIdleHandler(), audacity::BasicSettings::Write(), and wxT().
Referenced by Apply().
|
private |
Definition at line 542 of file ScreenshotCommand.cpp.
References CaptureCommands().
Referenced by Apply().
|
private |
Definition at line 323 of file ScreenshotCommand.cpp.
References Capture(), ToolManager::GetToolBar(), ToolManager::IsVisible(), mIgnore, name, ToolManager::ShowHide(), and Yield().
Referenced by Apply().
void ScreenshotCommand::CaptureWindowOnIdle | ( | const CommandContext & | context, |
wxWindow * | pWin | ||
) |
Definition at line 379 of file ScreenshotCommand.cpp.
References Capture(), and mDirToWriteTo.
Referenced by IdleHandler().
|
private |
Definition at line 210 of file ScreenshotCommand.cpp.
Referenced by Capture(), and GetFullWindowRect().
void ScreenshotCommand::GetDerivedParams | ( | ) |
Definition at line 635 of file ScreenshotCommand.cpp.
References kBlue, kCaptureWhatStrings(), kWhite, MakeFileName(), mBack, mBackColor, mBackground, mCaptureMode, mFileName, mFilePath, mPath, and mWhat.
Referenced by Apply().
|
inlineoverridevirtual |
Reimplemented from AudacityCommand.
Definition at line 74 of file ScreenshotCommand.h.
References XO().
wxTopLevelWindow * ScreenshotCommand::GetFrontWindow | ( | AudacityProject * | project | ) |
Definition at line 189 of file ScreenshotCommand.cpp.
References FindProjectFrame(), mIgnore, and project.
Referenced by Apply().
|
private |
Definition at line 671 of file ScreenshotCommand.cpp.
References GetBackgroundRect(), kwindowplus, mBackground, and mCaptureMode.
Referenced by Apply().
|
private |
Definition at line 703 of file ScreenshotCommand.cpp.
References TrackPanel::GetRuler(), and AdornedRulerPanel::GetRulerHeight().
Referenced by Apply().
|
private |
Definition at line 716 of file ScreenshotCommand.cpp.
References anonymous_namespace{TimeTrackVRulerControls.cpp}::ruler().
Referenced by Apply().
|
private |
Definition at line 696 of file ScreenshotCommand.cpp.
Referenced by Apply().
|
inlineoverridevirtual |
Implements AudacityCommand.
Definition at line 73 of file ScreenshotCommand.h.
|
private |
Definition at line 738 of file ScreenshotCommand.cpp.
References TrackPanel::FindFocusedTrackRect(), and TrackList::Get().
Referenced by Apply().
|
private |
Definition at line 727 of file ScreenshotCommand.cpp.
Referenced by Apply().
|
private |
Definition at line 662 of file ScreenshotCommand.cpp.
Referenced by Apply().
EnumValueSymbols ScreenshotCommand::kCaptureWhatStrings | ( | ) |
Definition at line 57 of file ScreenshotCommand.cpp.
References PackedArray::begin(), staffpad::vo::copy(), PackedArray::end(), ToolManager::ForEach(), ToolManager::Get(), GetActiveProject(), mSymbols, wxT(), and XO().
Referenced by Apply(), GetDerivedParams(), PopulateOrExchange(), VisitSettings(), and WindowFileName().
|
private |
Definition at line 612 of file ScreenshotCommand.cpp.
References wxT().
Referenced by GetDerivedParams(), and WindowFileName().
|
inlineoverridevirtual |
Reimplemented from AudacityCommand.
Definition at line 81 of file ScreenshotCommand.h.
|
static |
Definition at line 369 of file ScreenshotCommand.cpp.
References mIdleHandler.
Referenced by ScreenshotCommand().
|
override |
Definition at line 145 of file ScreenshotCommand.cpp.
References kBackgroundStrings, kCaptureWhatStrings(), mBack, mbBringToTop, mPath, Msgids(), mWhat, nBackgrounds, S, and XXO().
|
static |
Definition at line 183 of file ScreenshotCommand.cpp.
References IdleHandler(), mIdleHandler, pIdleHandlerProject, and project.
Referenced by CaptureCommands(), and CapturePreferences().
|
overridevirtual |
Visit settings, if defined. false means no defined settings. Default implementation returns false
Reimplemented from AudacityCommand.
Definition at line 142 of file ScreenshotCommand.cpp.
References S.
|
overridevirtual |
Visit settings, if defined. false means no defined settings. Default implementation returns false
Reimplemented from AudacityCommand.
Definition at line 139 of file ScreenshotCommand.cpp.
References S.
bool ScreenshotCommand::VisitSettings | ( | SettingsVisitorBase< Const > & | S | ) |
Definition at line 130 of file ScreenshotCommand.cpp.
References kBackgroundStrings, kCaptureWhatStrings(), kNone, kwindow, mBack, mbBringToTop, mPath, mWhat, nBackgrounds, S, and wxT().
|
private |
Definition at line 764 of file ScreenshotCommand.cpp.
References FindProjectFrame(), kCaptureWhatStrings(), MakeFileName(), mCaptureMode, mFileName, mFilePath, and wxT().
Referenced by Apply().
|
friend |
Definition at line 90 of file ScreenshotCommand.h.
|
private |
Definition at line 88 of file ScreenshotCommand.h.
|
private |
Definition at line 89 of file ScreenshotCommand.h.
Referenced by Capture().
|
private |
Definition at line 85 of file ScreenshotCommand.h.
Referenced by GetDerivedParams(), PopulateOrExchange(), and VisitSettings().
|
private |
Definition at line 104 of file ScreenshotCommand.h.
Referenced by Capture(), and GetDerivedParams().
|
private |
Definition at line 103 of file ScreenshotCommand.h.
Referenced by Capture(), GetDerivedParams(), and GetFullWindowRect().
|
private |
Definition at line 87 of file ScreenshotCommand.h.
Referenced by Capture(), PopulateOrExchange(), ScreenshotCommand(), and VisitSettings().
|
private |
Definition at line 109 of file ScreenshotCommand.h.
Referenced by Apply(), GetDerivedParams(), GetFullWindowRect(), and WindowFileName().
|
private |
Definition at line 105 of file ScreenshotCommand.h.
Referenced by CaptureCommands(), CapturePreferences(), and CaptureWindowOnIdle().
|
private |
Definition at line 108 of file ScreenshotCommand.h.
Referenced by Apply(), CaptureCommands(), GetDerivedParams(), and WindowFileName().
|
private |
Definition at line 107 of file ScreenshotCommand.h.
Referenced by GetDerivedParams(), and WindowFileName().
|
static |
Definition at line 137 of file ScreenshotCommand.h.
Referenced by MayCapture(), and SetIdleHandler().
|
private |
Definition at line 101 of file ScreenshotCommand.h.
Referenced by CaptureToolbar(), GetFrontWindow(), and ScreenshotCommand().
|
private |
Definition at line 86 of file ScreenshotCommand.h.
Referenced by GetDerivedParams(), PopulateOrExchange(), and VisitSettings().
|
static |
Definition at line 136 of file ScreenshotCommand.h.
Referenced by CaptureCommands(), CapturePreferences(), and IdleHandler().
|
private |
Definition at line 97 of file ScreenshotCommand.h.
Referenced by kCaptureWhatStrings().
|
private |
Definition at line 84 of file ScreenshotCommand.h.
Referenced by GetDerivedParams(), PopulateOrExchange(), and VisitSettings().
|
static |
Definition at line 69 of file ScreenshotCommand.h.