Audacity  2.2.2
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
ScreenshotCommand Class Reference

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>

Inheritance diagram for ScreenshotCommand:
AudacityCommand CommandDefinitionInterface IdentInterface ParamsInterface

Public Types

enum  kBackgrounds { kBlue, kWhite, kNone, nBackgrounds }
 
enum  kCaptureTypes {
  kwindow, kfullwindow, kwindowplus, kfullscreen,
  ktoolbars, keffects, kscriptables, kpreferences,
  kselectionbar, kspectralselection, ktools, ktransport,
  kmixer, kmeter, kplaymeter, krecordmeter,
  kedit, kdevice, kscrub, ktranscription,
  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

 ScreenshotCommand ()
 
IdentInterfaceSymbol GetSymbol () override
 
wxString GetDescription () override
 
bool DefineParams (ShuttleParams &S) override
 
void PopulateOrExchange (ShuttleGui &S) override
 
wxString 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 ()
 
wxString GetPath () override
 
IdentInterfaceSymbol GetVendor () override
 
wxString GetVersion () override
 
virtual bool IsBatchProcessing ()
 
virtual void SetBatchProcessing (bool start)
 
virtual bool Apply (const CommandContext &WXUNUSED(context))
 
virtual bool Apply ()
 
bool ShowInterface (wxWindow *parent, bool forceModal=false)
 
virtual void SetHostUI (EffectUIHostInterface *WXUNUSED(host))
 
bool PopulateUI (wxWindow *parent)
 
wxDialog * CreateUI (wxWindow *parent, AudacityCommand *client)
 
virtual bool GetAutomationParameters (wxString &parms)
 
virtual bool SetAutomationParameters (const wxString &parms)
 
bool DoAudacityCommand (wxWindow *parent, const CommandContext &context, bool shouldPrompt=true)
 
int MessageBox (const wxString &message, long style=DefaultMessageBoxStyle, const wxString &titleStr=wxString{})
 
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 ()
 
- Public Member Functions inherited from CommandDefinitionInterface
virtual ~CommandDefinitionInterface ()
 
- Public Member Functions inherited from IdentInterface
virtual ~IdentInterface ()
 
const wxString & GetTranslatedName ()
 
- Public Member Functions inherited from ParamsInterface
virtual ~ParamsInterface ()
 
virtual bool DefineParams (ShuttleParams &WXUNUSED(S))
 

Static Public Member Functions

static void SetIdleHandler (void(*pHandler)(wxIdleEvent &event))
 
static bool MayCapture (wxDialog *pDlg)
 

Static Public Attributes

static ScreenshotCommandmpShooter =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, int type, const wxString &name)
 
bool CaptureDock (const CommandContext &Context, wxWindow *win, const wxString &fileName)
 
void CaptureCommands (const CommandContext &Context, wxArrayString &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
 
wxWindow * mIgnore
 
bool mBackground
 
wxColour mBackColor
 
wxString mDirToWriteTo
 
wxString mFilePath
 
wxString mFileName
 
int mCaptureMode
 

Friends

class ScreenFrame
 

Additional Inherited Members

- Protected Attributes inherited from AudacityCommand
ProgressDialogmProgress
 
wxDialog * mUIDialog
 
wxWindow * mUIParent
 
int mUIResultID
 

Detailed Description

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 33 of file ScreenshotCommand.h.

Member Enumeration Documentation

Enumerator
kBlue 
kWhite 
kNone 
nBackgrounds 

Definition at line 36 of file ScreenshotCommand.h.

Enumerator
kwindow 
kfullwindow 
kwindowplus 
kfullscreen 
ktoolbars 
keffects 
kscriptables 
kpreferences 
kselectionbar 
kspectralselection 
ktools 
ktransport 
kmixer 
kmeter 
kplaymeter 
krecordmeter 
kedit 
kdevice 
kscrub 
ktranscription 
ktrackpanel 
kruler 
ktracks 
kfirsttrack 
kfirsttwotracks 
kfirstthreetracks 
kfirstfourtracks 
ksecondtrack 
ktracksplus 
kfirsttrackplus 
kalltracks 
kalltracksplus 
nCaptureWhats 

Definition at line 44 of file ScreenshotCommand.h.

45  {
46  kwindow,
50  ktoolbars,
51  keffects,
56  ktools,
57  ktransport,
58  kmixer,
59  kmeter,
60  kplaymeter,
62  kedit,
63  kdevice,
64  kscrub,
67  kruler,
68  ktracks,
76  kalltracks,
79  };

Constructor & Destructor Documentation

ScreenshotCommand::ScreenshotCommand ( )
inline

Definition at line 81 of file ScreenshotCommand.h.

References mbBringToTop.

81 { mbBringToTop=true;};

Member Function Documentation

bool ScreenshotCommand::Apply ( const CommandContext context)
override

Definition at line 796 of file ScreenshotCommand.cpp.

References Capture(), CaptureDock(), CaptureEffects(), CapturePreferences(), CaptureScriptables(), CaptureToolbar(), DeviceBarID, EditBarID, GetDerivedParams(), GetFrontWindow(), GetFullWindowRect(), GetPanelRect(), CommandContext::GetProject(), AdornedRulerPanel::GetRulerHeight(), GetRulerRect(), GetScreenRect(), AudacityProject::GetToolManager(), ToolManager::GetTopDock(), AudacityProject::GetTrackPanel(), GetTrackRect(), AudacityProject::GetTracks(), GetTracksRect(), GetWindowRect(), kalltracks, kalltracksplus, kdevice, kedit, keffects, kfirstfourtracks, kfirstthreetracks, kfirsttrack, kfirsttrackplus, kfirsttwotracks, kfullscreen, kfullwindow, kmeter, kmixer, kplaymeter, kpreferences, krecordmeter, kruler, kscriptables, kscrub, ksecondtrack, kselectionbar, kspectralselection, ktoolbars, ktools, ktrackpanel, ktracks, ktracksplus, ktranscription, ktransport, kwindow, kwindowplus, mCaptureMode, MeterBarID, mFileName, MixerBarID, TrackPanel::mRuler, PlayMeterBarID, RecordMeterBarID, ScrubbingBarID, SelectionBarID, TrackList::size(), SpectralSelectionBarID, ToolsBarID, TranscriptionBarID, TransportBarID, and WindowFileName().

797 {
799  //Don't reset the toolbars to a known state.
800  //We will be capturing variations of them.
801  //context.GetProject()->GetToolManager()->Reset();
802 
803  wxTopLevelWindow *w = GetFrontWindow(context.GetProject());
804  if (!w)
805  return false;
806 
807  TrackPanel *panel = context.GetProject()->GetTrackPanel();
808  AdornedRulerPanel *ruler = panel->mRuler;
809 
810  int nTracks = context.GetProject()->GetTracks()->size();
811 
812  int x1,y1,x2,y2;
813  w->ClientToScreen(&x1, &y1);
814  panel->ClientToScreen(&x2, &y2);
815 
816  wxPoint p( x2-x1, y2-y1);
817 
818  switch (mCaptureMode) {
819  case kwindow:
820  return Capture(context, WindowFileName( context.GetProject(), w ) , w, GetWindowRect(w));
821  case kfullwindow:
822  case kwindowplus:
823  return Capture(context, WindowFileName( context.GetProject(), w ) , w, GetFullWindowRect(w));
824  case kfullscreen:
825  return Capture(context, mFileName, w,GetScreenRect());
826  case ktoolbars:
827  return CaptureDock(context, context.GetProject()->GetToolManager()->GetTopDock(), mFileName);
828  case kscriptables:
829  CaptureScriptables(context, context.GetProject(), mFileName);
830  break;
831  case keffects:
832  CaptureEffects(context, context.GetProject(), mFileName);
833  break;
834  case kpreferences:
835  CapturePreferences(context, context.GetProject(), mFileName);
836  break;
837  case kselectionbar:
838  return CaptureToolbar(context, context.GetProject()->GetToolManager(), SelectionBarID, mFileName);
839  case kspectralselection:
841  case ktools:
842  return CaptureToolbar(context, context.GetProject()->GetToolManager(), ToolsBarID, mFileName);
843  case ktransport:
844  return CaptureToolbar(context, context.GetProject()->GetToolManager(), TransportBarID, mFileName);
845  case kmixer:
846  return CaptureToolbar(context, context.GetProject()->GetToolManager(), MixerBarID, mFileName);
847  case kmeter:
848  return CaptureToolbar(context, context.GetProject()->GetToolManager(), MeterBarID, mFileName);
849  case krecordmeter:
850  return CaptureToolbar(context, context.GetProject()->GetToolManager(), RecordMeterBarID, mFileName);
851  case kplaymeter:
852  return CaptureToolbar(context, context.GetProject()->GetToolManager(), PlayMeterBarID, mFileName);
853  case kedit:
854  return CaptureToolbar(context, context.GetProject()->GetToolManager(), EditBarID, mFileName);
855  case kdevice:
856  return CaptureToolbar(context, context.GetProject()->GetToolManager(), DeviceBarID, mFileName);
857  case ktranscription:
858  return CaptureToolbar(context, context.GetProject()->GetToolManager(), TranscriptionBarID, mFileName);
859  case kscrub:
860  return CaptureToolbar(context, context.GetProject()->GetToolManager(), ScrubbingBarID, mFileName);
861  case ktrackpanel:
862  return Capture(context, mFileName, panel, GetPanelRect(panel));
863  case kruler:
864  return Capture(context, mFileName, ruler, GetRulerRect(ruler) );
865  case ktracks:
866  return Capture(context, mFileName, panel, GetTracksRect(panel));
867  case kfirsttrack:
868  return Capture(context, mFileName, panel, GetTrackRect( context.GetProject(), panel, 0 ) );
869  case ksecondtrack:
870  return Capture(context, mFileName, panel, GetTrackRect( context.GetProject(), panel, 1 ) );
871  case ktracksplus:
872  { wxRect r = GetTracksRect(panel);
873  r.SetTop( r.GetTop() - ruler->GetRulerHeight() );
874  r.SetHeight( r.GetHeight() + ruler->GetRulerHeight() );
875  return Capture(context, mFileName, panel, r);
876  }
877  case kfirsttrackplus:
878  { wxRect r = GetTrackRect(context.GetProject(), panel, 0 );
879  r.SetTop( r.GetTop() - ruler->GetRulerHeight() );
880  r.SetHeight( r.GetHeight() + ruler->GetRulerHeight() );
881  return Capture(context, mFileName, panel, r );
882  }
883  case kfirsttwotracks:
884  { wxRect r = GetTrackRect( context.GetProject(), panel, 0 );
885  r = r.Union( GetTrackRect( context.GetProject(), panel, 1 ));
886  return Capture(context, mFileName, panel, r );
887  }
888  case kfirstthreetracks:
889  { wxRect r = GetTrackRect( context.GetProject(), panel, 0 );
890  r = r.Union( GetTrackRect( context.GetProject(), panel, 2 ));
891  return Capture(context, mFileName, panel, r );
892  }
893  case kfirstfourtracks:
894  { wxRect r = GetTrackRect( context.GetProject(), panel, 0 );
895  r = r.Union( GetTrackRect( context.GetProject(), panel, 3 ));
896  return Capture(context, mFileName, panel, r );
897  }
898  case kalltracks:
899  { wxRect r = GetTrackRect( context.GetProject(), panel, 0 );
900  r = r.Union( GetTrackRect( context.GetProject(), panel, nTracks-1 ));
901  return Capture(context, mFileName, panel, r );
902  }
903  case kalltracksplus:
904  { wxRect r = GetTrackRect( context.GetProject(), panel, 0 );
905  r.SetTop( r.GetTop() - ruler->GetRulerHeight() );
906  r.SetHeight( r.GetHeight() + ruler->GetRulerHeight() );
907  r = r.Union( GetTrackRect( context.GetProject(), panel, nTracks-1 ));
908  return Capture(context, mFileName, panel, r );
909  }
910  default:
911  return false;
912  }
913 
914  return true;
915 }
ToolDock * GetTopDock()
AudacityProject * GetProject() const
bool CaptureDock(const CommandContext &Context, wxWindow *win, const wxString &fileName)
bool CaptureToolbar(const CommandContext &Context, ToolManager *man, int type, const wxString &name)
void CaptureScriptables(const CommandContext &Context, AudacityProject *pProject, const wxString &fileName)
wxRect GetWindowRect(wxTopLevelWindow *w)
int GetRulerHeight()
Definition: Ruler.h:333
wxRect GetTrackRect(AudacityProject *pProj, TrackPanel *panel, int n)
size_t size() const
Definition: Track.cpp:1234
The TrackPanel class coordinates updates and operations on the main part of the screen which contains...
Definition: TrackPanel.h:245
void CaptureEffects(const CommandContext &Context, AudacityProject *pProject, const wxString &fileName)
ToolManager * GetToolManager()
Definition: Project.h:704
wxString WindowFileName(AudacityProject *proj, wxTopLevelWindow *w)
wxRect GetTracksRect(TrackPanel *panel)
bool Capture(const CommandContext &Context, const wxString &basename, wxWindow *window, wxRect rect, bool bg=false)
void CapturePreferences(const CommandContext &Context, AudacityProject *pProject, const wxString &fileName)
TrackPanel * GetTrackPanel()
Definition: Project.h:307
This is an Audacity Specific ruler panel which additionally has border, selection markers...
Definition: Ruler.h:316
wxRect GetRulerRect(AdornedRulerPanel *ruler)
TrackList * GetTracks()
Definition: Project.h:192
AdornedRulerPanel * mRuler
Definition: TrackPanel.h:453
wxRect GetFullWindowRect(wxTopLevelWindow *w)
wxTopLevelWindow * GetFrontWindow(AudacityProject *project)
wxRect GetPanelRect(TrackPanel *panel)
bool ScreenshotCommand::Capture ( const CommandContext Context,
const wxString &  basename,
wxWindow *  window,
wxRect  rect,
bool  bg = false 
)
private

Definition at line 198 of file ScreenshotCommand.cpp.

References _(), bHasBringToTop, CommandContext::Error(), GetBackgroundRect(), mBackColor, mBackground, mbBringToTop, CommandContext::Status(), and Yield().

Referenced by Apply(), CaptureDock(), CaptureToolbar(), and CaptureWindowOnIdle().

203 {
204  int width = r.width;
205  int height = r.height;
206  if( r.width == 0 )
207  return false;
208  if (window ) {
209  wxWindow * win = window;
210  wxTopLevelWindow * top_win= nullptr;
211  if( !window->IsTopLevel())
212  win = wxGetTopLevelParent(window);
213  top_win = dynamic_cast<wxTopLevelWindow*>( win );
214  if( (!bHasBringToTop || mbBringToTop) && (!top_win || !top_win->IsActive()) ){
215  win->Raise();
216  Yield();
217  }
218  }
219 
220 
221  int screenW, screenH;
222  wxDisplaySize(&screenW, &screenH);
223  // Bug 1378 workaround.
224  // wx 3.0.2 has a bug in Blit from ScreenDC where in default mode
225  // much is drawn transparent - including for example black text!
226  // Forcing 24 bit here is a workaround.
227  wxBitmap full(screenW, screenH, 24);
228 
229  wxScreenDC screenDC;
230  wxMemoryDC fullDC;
231 
232 #if defined(__WXMAC__) && !wxCHECK_VERSION(3, 0, 0)
233  full = DoGetAsBitmap(NULL);
234 #else
235  // We grab the whole screen image since there seems to be a problem with
236  // using non-zero source coordinates on OSX. (as of wx2.8.9)
237  fullDC.SelectObject(full);
238  fullDC.Blit(0, 0, screenW, screenH, &screenDC, 0, 0);
239  fullDC.SelectObject(wxNullBitmap);
240 #endif
241 
242  //wxRect r(x, y, width, height);
243 
244 
245  // Convert to screen coordinates if needed
246  if (window && window->GetParent() && !window->IsTopLevel()) {
247  r.SetPosition(window->GetParent()->ClientToScreen(r.GetPosition()));
248  }
249 
250  // Ensure within bounds (x/y are negative on Windows when maximized)
251  r.Intersect(wxRect(0, 0, screenW, screenH));
252 
253  // Extract the actual image
254  wxBitmap part = full.GetSubBitmap(r);
255 
256  // Add a background
257  if (bg && mBackground) {
258  wxRect b = GetBackgroundRect();
259 
260  wxBitmap back(width + b.width, height + b.height);
261  fullDC.SelectObject(back);
262 
263  fullDC.SetBackground(wxBrush(mBackColor, wxSOLID));
264  fullDC.Clear();
265 
266  fullDC.DrawBitmap(part, b.x, b.y);
267  fullDC.SelectObject(wxNullBitmap);
268 
269  part = back;
270  }
271 
272  // Save the final image
273  wxImage image = part.ConvertToImage();
274  ::wxBell();
275 
276  if (image.SaveFile(filename)) {
277  // flush
278  context.Status( wxString::Format( _("Saved %s"), filename ), true );
279  }
280  else {
281  context.Error(
282  wxString::Format( _("Error trying to save file: %s"), filename ) );
283  return false;
284  }
285  return true;
286 }
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
static void Yield()
void ScreenshotCommand::CaptureCommands ( const CommandContext Context,
wxArrayString &  Commands 
)
private

Definition at line 580 of file ScreenshotCommand.cpp.

References AlwaysEnabledFlag, AudacityProject::GetCommandManager(), CommandContext::GetProject(), CommandManager::HandleTextualCommand(), IdleHandler(), mDirToWriteTo, mFileName, mpShooter, and SetIdleHandler().

Referenced by CaptureEffects(), and CaptureScriptables().

581  {
582  AudacityProject * pProject = context.GetProject();
583  CommandManager * pMan = pProject->GetCommandManager();
584  wxString Str;
585  // Yucky static variables. Is there a better way? The problem is that we need the
586  // idle callback to know more about what to do.
587 #ifdef __WXMSW__
588  mDirToWriteTo = mFileName.BeforeLast('\\') + "\\";
589 #else
590  mDirToWriteTo = mFileName.BeforeLast('/') + "/";
591 #endif
592  mpShooter = this;
593 
594  for( size_t i=0;i<Commands.GetCount();i++){
595  // The handler is cleared each time it is used.
597  Str = Commands[i];
598  const CommandContext projectContext( *pProject );
599  if( !pMan->HandleTextualCommand( Str, projectContext, AlwaysEnabledFlag, AlwaysEnabledFlag ) )
600  {
601  wxLogDebug("Command %s not found", Str);
602  }
603  // This particular sleep is not needed, but gives user a chance to see the
604  // dialogs as they whizz by.
605  wxMilliSleep( 200 );
606  }
607 }
bool HandleTextualCommand(const wxString &Str, const CommandContext &context, CommandFlag flags, CommandMask mask)
CommandContext provides addiitonal information to an 'Apply()' command. It provides the project...
CommandManager * GetCommandManager()
Definition: Project.h:346
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:176
static ScreenshotCommand * mpShooter
CommandManager implements a system for organizing all user-callable commands.
void IdleHandler(wxIdleEvent &event)
static void SetIdleHandler(void(*pHandler)(wxIdleEvent &event))
bool ScreenshotCommand::CaptureDock ( const CommandContext Context,
wxWindow *  win,
const wxString &  fileName 
)
private

Definition at line 316 of file ScreenshotCommand.cpp.

References Capture().

Referenced by Apply().

319 {
320  int x = 0, y = 0;
321  int width, height;
322 
323  win->ClientToScreen(&x, &y);
324  win->GetParent()->ScreenToClient(&x, &y);
325  win->GetClientSize(&width, &height);
326 
327  return Capture(context, FileName, win, wxRect(x, y, width, height));
328 }
bool Capture(const CommandContext &Context, const wxString &basename, wxWindow *window, wxRect rect, bool bg=false)
void ScreenshotCommand::CaptureEffects ( const CommandContext Context,
AudacityProject pProject,
const wxString &  fileName 
)
private

Definition at line 445 of file ScreenshotCommand.cpp.

References CaptureCommands().

Referenced by Apply().

448 {
449  (void)pProject;
450  (void)&FileName;//compiler food.
451  (void)&context;
452 #define TRICKY_CAPTURE
453 #define CAPTURE_NYQUIST_TOO
454  // Commented out the effects that don't have dialogs.
455  // Also any problematic ones,
456  const wxString EffectNames[] = {
457 #ifdef TRICKY_CAPTURE
458  //"Contrast...", // renamed
459  "ContrastAnalyser",
460  //"Plot Spectrum...", // renamed
461  "PlotSpectrum",
462 
463  "Auto Duck...", // needs a track below.
464  //"Spectral edit multi tool",
465  "Spectral edit parametric EQ...", // Needs a spectral selection.
466  "Spectral edit shelves...",
467 
468  //"Noise Reduction...", // Exits twice...
469  //"SC4...", //Has 'Close' rather than 'Cancel'.
470 #endif
471  "Amplify...",
472  "Bass and Treble...",
473  "Change Pitch...",
474  "Change Speed...",
475  "Change Tempo...",
476  "Click Removal...",
477  "Compressor...",
478  "Distortion...",
479  "Echo...",
480  "Equalization...",
481  //"Fade In",
482  //"Fade Out",
483  //"Invert",
484  "Normalize...",
485  "Paulstretch...",
486  "Phaser...",
487  //"Repair",
488  "Repeat...",
489  "Reverb...",
490  //"Reverse",
491  "Sliding Stretch...",
492  "Truncate Silence...",
493  "Wahwah...",
494  // Sole LADSPA effect...
495 #ifdef CAPTURE_NYQUIST_TOO
496  "Adjustable Fade...",
497  "Clip Fix...",
498  //"Crossfade Clips",
499  "Crossfade Tracks...",
500  "Delay...",
501  "High Pass Filter...",
502  "Limiter...",
503  "Low Pass Filter...",
504  "Notch Filter...",
505  "Nyquist Effects Prompt...",
506  //"Studio Fade Out",
507  "Tremolo...",
508  "Vocal Reduction and Isolation...",
509  "Vocal Remover...",
510  "Vocoder...",
511 #endif
512  // Generators.....
513  "Chirp...",
514  "DTMF Tones...",
515  "Noise...",
516  "Silence...",
517  "Tone...",
518 #ifdef CAPTURE_NYQUIST_TOO
519  "Pluck...",
520  "Rhythm Track...",
521  "Risset Drum...",
522  "Sample Data Import...",
523 #endif
524  // Analyzers...
525  "Find Clipping...",
526 #ifdef CAPTURE_NYQUIST_TOO
527  "Beat Finder...",
528  "Regular Interval Labels...",
529  "Sample Data Export...",
530  "Silence Finder...",
531  "Sound Finder...",
532 #endif
533  };
534  wxArrayString Commands( sizeof(EffectNames)/sizeof(EffectNames[0]), EffectNames );
535  CaptureCommands( context, Commands );
536 }
void CaptureCommands(const CommandContext &Context, wxArrayString &Commands)
void ScreenshotCommand::CapturePreferences ( const CommandContext Context,
AudacityProject pProject,
const wxString &  fileName 
)
private

Definition at line 411 of file ScreenshotCommand.cpp.

References AlwaysEnabledFlag, AudacityProject::GetCommandManager(), gPrefs, CommandManager::HandleTextualCommand(), IdleHandler(), mDirToWriteTo, mpShooter, and SetIdleHandler().

Referenced by Apply().

413  {
414  (void)&FileName;//compiler food.
415  (void)&context;
416  CommandManager * pMan = pProject->GetCommandManager();
417 
418  // Yucky static variables. Is there a better way? The problem is that we need the
419  // idle callback to know more about what to do.
420 #ifdef __WXMSW__
421  mDirToWriteTo = FileName.BeforeLast('\\') + "\\";
422 #else
423  mDirToWriteTo = FileName.BeforeLast('/') + "/";
424 #endif
425  mpShooter = this;
426  const int nPrefsPages = 19;
427 
428  for( int i=0;i<nPrefsPages;i++){
429  // The handler is cleared each time it is used.
431  gPrefs->Write(wxT("/Prefs/PrefsCategory"), (long)i);
432  gPrefs->Flush();
433  wxString Command = "Preferences";
434  const CommandContext projectContext( *pProject );
435  if( !pMan->HandleTextualCommand( Command, projectContext, AlwaysEnabledFlag, AlwaysEnabledFlag ) )
436  {
437  wxLogDebug("Command %s not found", Command );
438  }
439  // This sleep is not needed, but gives user a chance to see the
440  // dialogs as they whizz by.
441  wxMilliSleep( 200 );
442  }
443 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
bool HandleTextualCommand(const wxString &Str, const CommandContext &context, CommandFlag flags, CommandMask mask)
CommandContext provides addiitonal information to an 'Apply()' command. It provides the project...
CommandManager * GetCommandManager()
Definition: Project.h:346
static ScreenshotCommand * mpShooter
CommandManager implements a system for organizing all user-callable commands.
void IdleHandler(wxIdleEvent &event)
static void SetIdleHandler(void(*pHandler)(wxIdleEvent &event))
void ScreenshotCommand::CaptureScriptables ( const CommandContext Context,
AudacityProject pProject,
const wxString &  fileName 
)
private

Definition at line 538 of file ScreenshotCommand.cpp.

References CaptureCommands().

Referenced by Apply().

541 {
542  (void)pProject;
543  (void)&FileName;//compiler food.
544  (void)&context;
545 
546  const wxString ScriptablesNames[] = {
547  "SelectTime",
548  "SelectFrequencies",
549  "SelectTracks",
550  "SetTrackStatus",
551  "SetTrackAudio",
552  "SetTrackVisuals",
553  "GetPreference",
554  "SetPreference",
555  "SetClip",
556  "SetEnvelope",
557  "SetLabel",
558  "SetProject",
559 
560  "Select",
561  "SetTrack",
562  "GetInfo",
563  "Message",
564  "Help", // Help on individual commands
565  "Import2",
566  "Export2",
567  "OpenProject2",
568  "SaveProject2",
569  "Drag",
570  "CompareAudio",
571  "Screenshot",
572  };
573 
574  wxArrayString Commands( sizeof(ScriptablesNames)/sizeof(ScriptablesNames[0]), ScriptablesNames );
575  CaptureCommands( context, Commands );
576 
577 }
void CaptureCommands(const CommandContext &Context, wxArrayString &Commands)
bool ScreenshotCommand::CaptureToolbar ( const CommandContext Context,
ToolManager man,
int  type,
const wxString &  name 
)
private

Definition at line 288 of file ScreenshotCommand.cpp.

References Capture(), ToolManager::GetToolBar(), ToolManager::IsVisible(), mIgnore, ToolManager::ShowHide(), and Yield().

Referenced by Apply().

291 {
292  bool visible = man->IsVisible(type);
293  if (!visible) {
294  man->ShowHide(type);
295  Yield();
296  }
297 
298  wxWindow *w = man->GetToolBar(type);
299  int x = 0, y = 0;
300  int width, height;
301 
302  w->ClientToScreen(&x, &y);
303  w->GetParent()->ScreenToClient(&x, &y);
304  w->GetClientSize(&width, &height);
305 
306  bool result = Capture(context, name, w, wxRect(x, y, width, height));
307 
308  if (!visible) {
309  man->ShowHide(type);
310  if (mIgnore)
311  mIgnore->Raise();
312  }
313  return result;
314 }
void ShowHide(int type)
bool Capture(const CommandContext &Context, const wxString &basename, wxWindow *window, wxRect rect, bool bg=false)
bool IsVisible(int type)
const wxChar * name
Definition: Distortion.cpp:94
static void Yield()
ToolBar * GetToolBar(int type) const
void ScreenshotCommand::CaptureWindowOnIdle ( const CommandContext context,
wxWindow *  pWin 
)

Definition at line 378 of file ScreenshotCommand.cpp.

References Capture(), and mDirToWriteTo.

Referenced by IdleHandler().

381 {
382  wxDialog * pDlg = dynamic_cast<wxDialog*>(pWin);
383  if( !pDlg ){
384  wxLogDebug("Event from bogus dlg" );
385  return;
386  }
387 
388  wxPoint Pos = pDlg->GetScreenPosition();
389  wxSize Siz = pDlg->GetSize();
390  wxString Title = pDlg->GetTitle();
391 
392  // Remove '/' from "Sliding Time Scale/Pitch Shift..."
393  // and any other effects that have illegal filename chanracters.
394  Title.Replace( "/", "" );
395  Title.Replace( ":", "" );
396  wxString Name = mDirToWriteTo + Title + ".png";
397 
398  wxLogDebug("Taking screenshot of window %s (%i,%i,%i,%i)", Name,
399  Pos.x, Pos.y, Siz.x, Siz.y );
400  // This delay is needed, as dialogs take a moment or two to fade in.
401  wxMilliSleep( 400 );
402  // JKC: The border of 7 pixels was determined from a trial capture and then measuring
403  // in the GIMP. I'm unsure where the border comes from.
404  Capture( context, Name, pDlg, wxRect((int)Pos.x+7, (int)Pos.y, (int)Siz.x-14, (int)Siz.y-7) );
405 
406  // We've captured the dialog, so now dismiss the dialog.
407  wxCommandEvent Evt( wxEVT_BUTTON, wxID_CANCEL );
408  pDlg->GetEventHandler()->AddPendingEvent( Evt );
409 }
bool Capture(const CommandContext &Context, const wxString &basename, wxWindow *window, wxRect rect, bool bg=false)
bool ScreenshotCommand::DefineParams ( ShuttleParams S)
override

Definition at line 97 of file ScreenshotCommand.cpp.

References bHasBackground, bHasBringToTop, ShuttleParams::Define(), ShuttleParams::DefineEnum(), kBackgroundStrings, kCaptureWhatStrings, kNone, kwindow, mBack, mbBringToTop, mPath, mWhat, nBackgrounds, nCaptureWhats, and ShuttleParams::OptionalN().

97  {
98  S.Define( mPath, wxT("Path"), wxT(""));
99  S.DefineEnum( mWhat, wxT("CaptureWhat"), kwindow,kCaptureWhatStrings, nCaptureWhats );
101  S.OptionalN(bHasBringToTop).Define( mbBringToTop, wxT("ToTop"), true );
102  return true;
103 };
virtual ShuttleParams & OptionalN(bool &var)
Definition: Shuttle.h:72
virtual void DefineEnum(int &var, const wxChar *key, const int vdefault, const IdentInterfaceSymbol strings[], size_t nStrings)
Definition: Shuttle.cpp:346
static const IdentInterfaceSymbol kBackgroundStrings[ScreenshotCommand::nBackgrounds]
virtual void Define(bool &var, const wxChar *key, const bool vdefault, const bool vmin=false, const bool vmax=false, const bool vscl=false)
Definition: Shuttle.cpp:339
static const IdentInterfaceSymbol kCaptureWhatStrings[ScreenshotCommand::nCaptureWhats]
wxRect ScreenshotCommand::GetBackgroundRect ( )
private

Definition at line 174 of file ScreenshotCommand.cpp.

Referenced by Capture(), and GetFullWindowRect().

175 {
176  wxRect r;
177 
178  r.x = 16;
179  r.y = 16;
180  r.width = r.x * 2;
181  r.height = r.y * 2;
182 
183  return r;
184 }
void ScreenshotCommand::GetDerivedParams ( )

Definition at line 632 of file ScreenshotCommand.cpp.

References kBlue, kCaptureWhatStrings, kWhite, MakeFileName(), mBack, mBackColor, mBackground, mCaptureMode, mFileName, mFilePath, mPath, and mWhat.

Referenced by Apply().

633 {
634  // Read the parameters that were passed in
635  mFilePath = mPath;
637 
638  // Build a suitable filename
640  kCaptureWhatStrings[ mCaptureMode ].Translation() );
641 
642  if (mBack == kBlue)
643  {
644  mBackground = true;
645  mBackColor = wxColour(51, 102, 153);
646  }
647  else if (mBack == kWhite)
648  {
649  mBackground = true;
650  mBackColor = wxColour(255, 255, 255);
651  }
652  else
653  {
654  mBackground = false;
655  }
656 
657 }
static const IdentInterfaceSymbol kCaptureWhatStrings[ScreenshotCommand::nCaptureWhats]
wxString MakeFileName(const wxString &path, const wxString &basename)
wxString ScreenshotCommand::GetDescription ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 84 of file ScreenshotCommand.h.

References _().

84 {return _("Takes screenshots.");};
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
wxTopLevelWindow * ScreenshotCommand::GetFrontWindow ( AudacityProject project)

Definition at line 141 of file ScreenshotCommand.cpp.

References mIgnore.

Referenced by Apply().

142 {
143  wxWindow *front = NULL;
144  wxWindow *proj = wxGetTopLevelParent(project);
145 
146  // This is kind of an odd hack. There's no method to enumerate all
147  // possible windows, so we search the whole screen for any windows
148  // that are not this one and not the given Audacity project and
149  // if we find anything, we assume that's the dialog the user wants
150  // to capture.
151 
152  int width, height, x, y;
153  wxDisplaySize(&width, &height);
154  for (x = 0; x < width; x += 50) {
155  for (y = 0; y < height; y += 50) {
156  wxWindow *win = wxFindWindowAtPoint(wxPoint(x, y));
157  if (win) {
158  win = wxGetTopLevelParent(win);
159  if (win != mIgnore && win != proj) {
160  front = win;
161  break;
162  }
163  }
164  }
165  }
166 
167  if (!front || !front->IsTopLevel()) {
168  return (wxTopLevelWindow *)proj;
169  }
170 
171  return (wxTopLevelWindow *)front;
172 }
wxRect ScreenshotCommand::GetFullWindowRect ( wxTopLevelWindow *  w)
private

Definition at line 668 of file ScreenshotCommand.cpp.

References GetBackgroundRect(), kwindowplus, mBackground, and mCaptureMode.

Referenced by Apply().

668  {
669 
670  wxRect r = w->GetRect();
671  r.SetPosition(w->GetScreenPosition());
672  r = w->GetScreenRect();
673 
674 #if defined(__WXGTK__)
675  // In wxGTK, we need to include decoration sizes
676  r.width += (wxSystemSettings::GetMetric(wxSYS_BORDER_X, w) * 2);
677  r.height += wxSystemSettings::GetMetric(wxSYS_CAPTION_Y, w) +
678  wxSystemSettings::GetMetric(wxSYS_BORDER_Y, w);
679 #endif
681  {
682  // background colour not selected but we want a background
683  wxRect b = GetBackgroundRect();
684  r.x = (r.x - b.x) >= 0 ? (r.x - b.x): 0;
685  r.y = (r.y - b.y) >= 0 ? (r.y - b.y): 0;
686  r.width += b.width;
687  r.height += b.height;
688  }
689 
690  return r;
691 }
wxRect ScreenshotCommand::GetPanelRect ( TrackPanel panel)
private

Definition at line 700 of file ScreenshotCommand.cpp.

References AdornedRulerPanel::GetRulerHeight(), and TrackPanel::mRuler.

Referenced by Apply().

700  {
701  //AdornedRulerPanel *ruler = panel->mRuler;
702 
703  int h = panel->mRuler->GetRulerHeight();
704  int x = 0, y = -h;
705  int width, height;
706 
707  panel->ClientToScreen(&x, &y);
708  panel->GetParent()->ScreenToClient(&x, &y);
709  panel->GetClientSize(&width, &height);
710  return wxRect(x, y, width, height + h);
711 }
int GetRulerHeight()
Definition: Ruler.h:333
AdornedRulerPanel * mRuler
Definition: TrackPanel.h:453
wxRect ScreenshotCommand::GetRulerRect ( AdornedRulerPanel ruler)
private

Definition at line 713 of file ScreenshotCommand.cpp.

References AdornedRulerPanel::GetRulerHeight().

Referenced by Apply().

713  {
714  int x = 0, y = 0;
715  int width, height;
716 
717  ruler->ClientToScreen(&x, &y);
718  ruler->GetParent()->ScreenToClient(&x, &y);
719  ruler->GetClientSize(&width, &height);
720  height = ruler->GetRulerHeight();
721  return wxRect( x, y, width, height);
722 }
int GetRulerHeight()
Definition: Ruler.h:333
wxRect ScreenshotCommand::GetScreenRect ( )
private

Definition at line 693 of file ScreenshotCommand.cpp.

Referenced by Apply().

693  {
694  int width, height;
695  wxDisplaySize(&width, &height);
696 
697  return wxRect( 0,0,width,height);
698 }
IdentInterfaceSymbol ScreenshotCommand::GetSymbol ( )
inlineoverridevirtual

Implements AudacityCommand.

Definition at line 83 of file ScreenshotCommand.h.

References SCREENSHOT_PLUGIN_SYMBOL.

83 {return SCREENSHOT_PLUGIN_SYMBOL;};
#define SCREENSHOT_PLUGIN_SYMBOL
wxRect ScreenshotCommand::GetTrackRect ( AudacityProject pProj,
TrackPanel panel,
int  n 
)
private

Definition at line 735 of file ScreenshotCommand.cpp.

References TrackPanel::FindTrackRect(), AudacityProject::GetTracks(), kBottomMargin, and kTopMargin.

Referenced by Apply().

735  {
736  auto FindRectangle = []( TrackPanel &panel, Track &t )
737  {
738  // This rectangle omits the focus ring about the track, and
739  // also within that, a narrow black border with a "shadow" below and
740  // to the right
741  wxRect rect = panel.FindTrackRect( &t, false );
742 
743  // Enlarge horizontally.
744  // PRL: perhaps it's one pixel too much each side, including some gray
745  // beyond the yellow?
746  rect.x = 0;
747  panel.GetClientSize(&rect.width, nullptr);
748 
749  // Enlarge vertically, enough to enclose the yellow focus border pixels
750  // Omit the outermost ring of gray pixels
751 
752  // (Note that TrackPanel paints its focus over the "top margin" of the
753  // rectangle allotted to the track, according to Track::GetY() and
754  // Track::GetHeight(), but also over the margin of the next track.)
755 
756  rect.height += kBottomMargin;
757  int dy = kTopMargin - 1;
758  rect.Inflate( 0, dy );
759 
760  // Reposition it relative to parent of panel
761  rect.SetPosition(
762  panel.GetParent()->ScreenToClient(
763  panel.ClientToScreen(
764  rect.GetPosition())));
765 
766  return rect;
767  };
768 
769  TrackListIterator iter(pProj->GetTracks());
770  int count = 0;
771  for (auto t = iter.First(); t; t = iter.Next()) {
772  count += 1;
773  if( count > n )
774  {
775  wxRect r = FindRectangle( *panel, *t );
776  return r;
777  }
778  if( t->GetLinked() ){
779  t = iter.Next();
780  if( !t )
781  break;
782  }
783  }
784  return wxRect( 0,0,0,0);
785 }
wxRect FindTrackRect(const Track *target, bool label)
The TrackPanel class coordinates updates and operations on the main part of the screen which contains...
Definition: TrackPanel.h:245
Fundamental data object of Audacity, placed in the TrackPanel. Classes derived form it include the Wa...
Definition: Track.h:102
An iterator for a TrackList.
Definition: Track.h:402
TrackList * GetTracks()
Definition: Project.h:192
wxRect ScreenshotCommand::GetTracksRect ( TrackPanel panel)
private

Definition at line 724 of file ScreenshotCommand.cpp.

Referenced by Apply().

724  {
725  int x = 0, y = 0;
726  int width, height;
727 
728  panel->ClientToScreen(&x, &y);
729  panel->GetParent()->ScreenToClient(&x, &y);
730  panel->GetClientSize(&width, &height);
731 
732  return wxRect( x, y, width, height);
733 }
wxRect ScreenshotCommand::GetWindowRect ( wxTopLevelWindow *  w)
private

Definition at line 659 of file ScreenshotCommand.cpp.

Referenced by Apply().

659  {
660  int x = 0, y = 0;
661  int width, height;
662 
663  w->ClientToScreen(&x, &y);
664  w->GetClientSize(&width, &height);
665  return wxRect( x,y,width,height);
666 }
wxString ScreenshotCommand::MakeFileName ( const wxString &  path,
const wxString &  basename 
)
private

Definition at line 609 of file ScreenshotCommand.cpp.

Referenced by GetDerivedParams(), and WindowFileName().

610 {
611  // If the path is a full file name, then use it.
612  if( path.EndsWith( ".png" ) )
613  return path;
614 
615  // Otherwise make up a file name that has not been used already.
616  wxFileName prefixPath;
617  prefixPath.AssignDir(path);
618  wxString prefix = prefixPath.GetPath
619  (wxPATH_GET_VOLUME|wxPATH_GET_SEPARATOR);
620 
621  wxString filename;
622  int i = 0;
623  do {
624  filename.Printf(wxT("%s%s%03d.png"),
625  prefix, basename, i);
626  i++;
627  } while (::wxFileExists(filename));
628 
629  return filename;
630 }
wxString ScreenshotCommand::ManualPage ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 89 of file ScreenshotCommand.h.

89 {return wxT("Help_Menu:_Tools#screenshot_tools");};
bool ScreenshotCommand::MayCapture ( wxDialog *  pDlg)
static

Definition at line 368 of file ScreenshotCommand.cpp.

References mIdleHandler.

Referenced by AudacityProject::OnContrast(), AudacityProject::OnPlotSpectrum(), AudacityProject::OnPreferences(), AudacityCommand::ShowInterface(), and Effect::ShowInterface().

369 {
370  if( mIdleHandler == NULL )
371  return false;
372  pDlg->Bind( wxEVT_IDLE, mIdleHandler );
373  mIdleHandler = NULL;
374  pDlg->ShowModal();
375  return true;
376 }
static void(* mIdleHandler)(wxIdleEvent &event)
void ScreenshotCommand::PopulateOrExchange ( ShuttleGui S)
override

Definition at line 105 of file ScreenshotCommand.cpp.

References _(), ShuttleGui::AddSpace(), ShuttleGuiBase::EndMultiColumn(), kBackgroundStrings, kCaptureWhatStrings, LocalizedStrings(), mBack, mbBringToTop, mPath, mWhat, nBackgrounds, nCaptureWhats, ShuttleGuiBase::StartMultiColumn(), ShuttleGuiBase::TieCheckBox(), ShuttleGuiBase::TieChoice(), and ShuttleGuiBase::TieTextBox().

106 {
109  S.AddSpace(0, 5);
110 
111  S.StartMultiColumn(2, wxALIGN_CENTER);
112  {
113  S.TieTextBox( _("Path:"), mPath);
114  S.TieChoice( _("Capture What:"), mWhat, &whats);
115  S.TieChoice( _("Background:"), mBack, &backs);
116  S.TieCheckBox( _("Bring To Top:"), mbBringToTop);
117  }
118  S.EndMultiColumn();
119 }
wxChoice * TieChoice(const wxString &Prompt, WrappedType &WrappedRef, const wxArrayString *pChoices)
wxArrayString LocalizedStrings(const IdentInterfaceSymbol strings[], size_t nStrings)
Definition: Internat.cpp:303
void EndMultiColumn()
static const IdentInterfaceSymbol kBackgroundStrings[ScreenshotCommand::nBackgrounds]
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
static const IdentInterfaceSymbol kCaptureWhatStrings[ScreenshotCommand::nCaptureWhats]
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
wxCheckBox * TieCheckBox(const wxString &Prompt, WrappedType &WrappedRef)
wxSizerItem * AddSpace(int width, int height)
wxTextCtrl * TieTextBox(const wxString &Prompt, WrappedType &WrappedRef, const int nChars)
static void ScreenshotCommand::SetIdleHandler ( void(*)(wxIdleEvent &event)  pHandler)
inlinestatic

Definition at line 143 of file ScreenshotCommand.h.

References mIdleHandler.

Referenced by CaptureCommands(), and CapturePreferences().

143 {mIdleHandler=pHandler;};
static void(* mIdleHandler)(wxIdleEvent &event)
wxString ScreenshotCommand::WindowFileName ( AudacityProject proj,
wxTopLevelWindow *  w 
)
private

Definition at line 787 of file ScreenshotCommand.cpp.

References kCaptureWhatStrings, MakeFileName(), mCaptureMode, mFileName, and mFilePath.

Referenced by Apply().

787  {
788  if (w != proj && w->GetTitle() != wxT("")) {
790  kCaptureWhatStrings[ mCaptureMode ].Translation() +
791  (wxT("-") + w->GetTitle() + wxT("-")));
792  }
793  return mFileName;
794 }
static const IdentInterfaceSymbol kCaptureWhatStrings[ScreenshotCommand::nCaptureWhats]
wxString MakeFileName(const wxString &path, const wxString &basename)

Friends And Related Function Documentation

friend class ScreenFrame
friend

Definition at line 98 of file ScreenshotCommand.h.

Member Data Documentation

bool ScreenshotCommand::bHasBackground
private

Definition at line 96 of file ScreenshotCommand.h.

Referenced by DefineParams().

bool ScreenshotCommand::bHasBringToTop
private

Definition at line 97 of file ScreenshotCommand.h.

Referenced by Capture(), and DefineParams().

int ScreenshotCommand::mBack
private

Definition at line 93 of file ScreenshotCommand.h.

Referenced by DefineParams(), GetDerivedParams(), and PopulateOrExchange().

wxColour ScreenshotCommand::mBackColor
private

Definition at line 109 of file ScreenshotCommand.h.

Referenced by Capture(), and GetDerivedParams().

bool ScreenshotCommand::mBackground
private

Definition at line 108 of file ScreenshotCommand.h.

Referenced by Capture(), GetDerivedParams(), and GetFullWindowRect().

bool ScreenshotCommand::mbBringToTop
private

Definition at line 95 of file ScreenshotCommand.h.

Referenced by Capture(), DefineParams(), PopulateOrExchange(), and ScreenshotCommand().

int ScreenshotCommand::mCaptureMode
private

Definition at line 114 of file ScreenshotCommand.h.

Referenced by Apply(), GetDerivedParams(), GetFullWindowRect(), and WindowFileName().

wxString ScreenshotCommand::mDirToWriteTo
private

Definition at line 110 of file ScreenshotCommand.h.

Referenced by CaptureCommands(), CapturePreferences(), and CaptureWindowOnIdle().

wxString ScreenshotCommand::mFileName
private

Definition at line 113 of file ScreenshotCommand.h.

Referenced by Apply(), CaptureCommands(), GetDerivedParams(), and WindowFileName().

wxString ScreenshotCommand::mFilePath
private

Definition at line 112 of file ScreenshotCommand.h.

Referenced by GetDerivedParams(), and WindowFileName().

void(* ScreenshotCommand::mIdleHandler)(wxIdleEvent &event) = NULL
static

Definition at line 142 of file ScreenshotCommand.h.

Referenced by MayCapture(), and SetIdleHandler().

wxWindow* ScreenshotCommand::mIgnore
private

Definition at line 106 of file ScreenshotCommand.h.

Referenced by CaptureToolbar(), and GetFrontWindow().

wxString ScreenshotCommand::mPath
private

Definition at line 94 of file ScreenshotCommand.h.

Referenced by DefineParams(), GetDerivedParams(), and PopulateOrExchange().

ScreenshotCommand * ScreenshotCommand::mpShooter =NULL
static

Definition at line 141 of file ScreenshotCommand.h.

Referenced by CaptureCommands(), and CapturePreferences().

int ScreenshotCommand::mWhat
private

Definition at line 89 of file ScreenshotCommand.h.

Referenced by DefineParams(), GetDerivedParams(), and PopulateOrExchange().


The documentation for this class was generated from the following files: