Audacity  2.2.2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ScreenFrame Class Referencefinal

ScreenFrame provides an alternative Gui for ScreenshotCommand. It adds a timer that allows a delay before taking a screenshot, provides lots of one-click buttons, options to resize the screen. It forwards the actual work of doing the commands to the ScreenshotCommand. More...

Inheritance diagram for ScreenFrame:

Public Member Functions

 ScreenFrame (wxWindow *parent, wxWindowID id)
 
virtual ~ScreenFrame ()
 
bool ProcessEvent (wxEvent &event) override
 

Private Member Functions

void Populate ()
 
void PopulateOrExchange (ShuttleGui &S)
 
void OnCloseWindow (wxCloseEvent &event)
 
void OnUIUpdate (wxUpdateUIEvent &event)
 
void OnDirChoose (wxCommandEvent &event)
 
void SizeMainWindow (int w, int h)
 
void OnMainWindowSmall (wxCommandEvent &event)
 
void OnMainWindowLarge (wxCommandEvent &event)
 
void OnToggleBackgroundBlue (wxCommandEvent &event)
 
void OnToggleBackgroundWhite (wxCommandEvent &event)
 
void DoCapture (int captureMode)
 
void OnCaptureSomething (wxCommandEvent &event)
 
void TimeZoom (double seconds)
 
void OnOneSec (wxCommandEvent &event)
 
void OnTenSec (wxCommandEvent &event)
 
void OnOneMin (wxCommandEvent &event)
 
void OnFiveMin (wxCommandEvent &event)
 
void OnOneHour (wxCommandEvent &event)
 
void SizeTracks (int h)
 
void OnShortTracks (wxCommandEvent &event)
 
void OnMedTracks (wxCommandEvent &event)
 
void OnTallTracks (wxCommandEvent &event)
 
std::unique_ptr
< ScreenshotCommand
CreateCommand ()
 

Private Attributes

wxCheckBox * mDelayCheckBox
 
wxTextCtrl * mDirectoryTextBox
 
wxToggleButton * mBlue
 
wxToggleButton * mWhite
 
wxStatusBar * mStatus
 
std::unique_ptr
< ScreenshotCommand
mCommand
 
CommandContext mContext
 

Detailed Description

ScreenFrame provides an alternative Gui for ScreenshotCommand. It adds a timer that allows a delay before taking a screenshot, provides lots of one-click buttons, options to resize the screen. It forwards the actual work of doing the commands to the ScreenshotCommand.

Definition at line 53 of file Screenshot.cpp.

Constructor & Destructor Documentation

ScreenFrame::ScreenFrame ( wxWindow *  parent,
wxWindowID  id 
)

Definition at line 256 of file Screenshot.cpp.

References CreateCommand(), mCommand, mDelayCheckBox, mDirectoryTextBox, mStatus, and Populate().

257 : wxFrame(parent, id, _("Screen Capture Frame"),
258  wxDefaultPosition, wxDefaultSize,
259 
260 #if !defined(__WXMSW__)
261 
262  #if !defined(__WXMAC__) // bug1358
263  wxFRAME_TOOL_WINDOW |
264  #endif
265 
266 #else
267 
268  wxSTAY_ON_TOP|
269 
270 #endif
271 
272  wxSYSTEM_MENU|wxCAPTION|wxCLOSE_BOX),
274 {
275  mDelayCheckBox = NULL;
276  mDirectoryTextBox = NULL;
277 
278  mStatus = CreateStatusBar(3);
280 
281  Populate();
282 
283  // Reset the toolbars to a known state.
284  // Note that the audio could be playing.
285  // The monitoring will switch off temporarily
286  // because we've switched monitor mid play.
287  // Bug 383 - Resetting the toolbars is not wanted.
288  // Any that are invisible will be amde visible as/when needed.
289  //mContext.GetProject()->GetToolManager()->Reset();
290  Center();
291 }
CommandContext mContext
Definition: Screenshot.cpp:100
std::unique_ptr< ScreenshotCommand > CreateCommand()
Definition: Screenshot.cpp:246
wxStatusBar * mStatus
Definition: Screenshot.cpp:97
wxTextCtrl * mDirectoryTextBox
Definition: Screenshot.cpp:94
std::unique_ptr< ScreenshotCommand > mCommand
Definition: Screenshot.cpp:99
wxCheckBox * mDelayCheckBox
Definition: Screenshot.cpp:93
_("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
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
void Populate()
Definition: Screenshot.cpp:302
ScreenFrame::~ScreenFrame ( )
virtual

Definition at line 293 of file Screenshot.cpp.

294 {
295  if (this == mFrame)
296  mFrame = nullptr;
297  else
298  // There should only be one!
299  wxASSERT(false);
300 }
ScreenFramePtr mFrame
Definition: Screenshot.cpp:110

Member Function Documentation

std::unique_ptr< ScreenshotCommand > ScreenFrame::CreateCommand ( )
private

Definition at line 246 of file Screenshot.cpp.

Referenced by ScreenFrame().

247 {
248  wxASSERT(mStatus != NULL);
249  auto output =
250  std::make_unique<CommandOutputTargets>(std::make_unique<NullProgressTarget>(),
251  std::make_shared<StatusBarTarget>(*mStatus),
252  std::make_shared<MessageBoxTarget>());
253  return std::make_unique<ScreenshotCommand>();//*type, std::move(output), this);
254 }
wxStatusBar * mStatus
Definition: Screenshot.cpp:97
void ScreenFrame::DoCapture ( int  captureMode)
private

Definition at line 585 of file Screenshot.cpp.

References _(), ScreenshotCommand::kBlue, ScreenshotCommand::kNone, ScreenshotCommand::kWhite, mainStatusBarField, mBlue, mCommand, mContext, mDirectoryTextBox, mStatus, and mWhite.

Referenced by OnCaptureSomething().

586 {
587  Hide();
588  //mCommand->SetParameter(wxT("FilePath"), mDirectoryTextBox->GetValue());
589  //mCommand->SetParameter(wxT("CaptureMode"), captureMode);
590  mCommand->mBack = mWhite->GetValue()
592  : mBlue->GetValue()
594  mCommand->mPath = mDirectoryTextBox->GetValue();
595  mCommand->mWhat = captureMode;
596  if (!mCommand->Apply(mContext))
597  mStatus->SetStatusText(_("Capture failed!"), mainStatusBarField);
598  Show();
599 }
CommandContext mContext
Definition: Screenshot.cpp:100
wxToggleButton * mWhite
Definition: Screenshot.cpp:96
wxStatusBar * mStatus
Definition: Screenshot.cpp:97
wxTextCtrl * mDirectoryTextBox
Definition: Screenshot.cpp:94
std::unique_ptr< ScreenshotCommand > mCommand
Definition: Screenshot.cpp:99
wxToggleButton * mBlue
Definition: Screenshot.cpp:95
_("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
void ScreenFrame::OnCaptureSomething ( wxCommandEvent &  event)
private

Definition at line 601 of file Screenshot.cpp.

References DoCapture(), IdCaptureFirst, ScreenshotCommand::kdevice, ScreenshotCommand::kedit, ScreenshotCommand::keffects, ScreenshotCommand::kfirsttrack, ScreenshotCommand::kfullscreen, ScreenshotCommand::kfullwindow, ScreenshotCommand::kmeter, ScreenshotCommand::kmixer, ScreenshotCommand::kplaymeter, ScreenshotCommand::kpreferences, ScreenshotCommand::krecordmeter, ScreenshotCommand::kruler, ScreenshotCommand::kscriptables, ScreenshotCommand::kscrub, ScreenshotCommand::ksecondtrack, ScreenshotCommand::kselectionbar, ScreenshotCommand::kspectralselection, ScreenshotCommand::ktoolbars, ScreenshotCommand::ktools, ScreenshotCommand::ktrackpanel, ScreenshotCommand::ktracks, ScreenshotCommand::ktranscription, ScreenshotCommand::ktransport, ScreenshotCommand::kwindow, and ScreenshotCommand::kwindowplus.

602 {
603  int i = event.GetId() - IdCaptureFirst;
604 
605  /*
606  IdCaptureEffects= IdCaptureFirst,
607  IdCaptureScriptables,
608  IdCapturePreferences,
609  IdCaptureToolbars,
610 
611  // Put all events that need delay between AllDelayed and LastDelayed.
612  IdAllDelayedEvents,
613  IdCaptureWindowContents=IdAllDelayedEvents,
614  IdCaptureFullWindow,
615  IdCaptureWindowPlus,
616  IdCaptureFullScreen,
617 
618  IdCaptureSelectionBar,
619  IdCaptureSpectralSelection,
620  IdCaptureTools,
621  IdCaptureTransport,
622  IdCaptureMixer,
623  IdCaptureMeter,
624  IdCapturePlayMeter,
625  IdCaptureRecordMeter,
626  IdCaptureEdit,
627  IdCaptureDevice,
628  IdCaptureTranscription,
629  IdCaptureScrub,
630 
631  IdCaptureTrackPanel,
632  IdCaptureRuler,
633  IdCaptureTracks,
634  IdCaptureFirstTrack,
635  IdCaptureSecondTrack,
636  IdCaptureLast = IdCaptureSecondTrack,
637  */
638 
639  static const int codes[] = {
644 
666  };
667 
668  DoCapture(codes[i]);
669 }
void DoCapture(int captureMode)
Definition: Screenshot.cpp:585
void ScreenFrame::OnCloseWindow ( wxCloseEvent &  event)
private

Definition at line 503 of file Screenshot.cpp.

504 {
505  Destroy();
506 }
void ScreenFrame::OnDirChoose ( wxCommandEvent &  event)
private

Definition at line 535 of file Screenshot.cpp.

References _(), gPrefs, mCommand, and mDirectoryTextBox.

536 {
537  wxString current = mDirectoryTextBox->GetValue();
538 
539  wxDirDialogWrapper dlog(this,
540  _("Choose a location to save screenshot images"),
541  current);
542 
543  dlog.ShowModal();
544  if (dlog.GetPath() != wxT("")) {
545  wxFileName tmpDirPath;
546  tmpDirPath.AssignDir(dlog.GetPath());
547  wxString path = tmpDirPath.GetPath(wxPATH_GET_VOLUME|wxPATH_GET_SEPARATOR);
548  mDirectoryTextBox->SetValue(path);
549  gPrefs->Write(wxT("/ScreenshotPath"), path);
550  gPrefs->Flush();
551  mCommand->mPath = path;
552  }
553 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
wxTextCtrl * mDirectoryTextBox
Definition: Screenshot.cpp:94
std::unique_ptr< ScreenshotCommand > mCommand
Definition: Screenshot.cpp:99
_("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
void ScreenFrame::OnFiveMin ( wxCommandEvent &  event)
private

Definition at line 694 of file Screenshot.cpp.

References TimeZoom().

695 {
696  TimeZoom(300.0);
697 }
void TimeZoom(double seconds)
Definition: Screenshot.cpp:671
void ScreenFrame::OnMainWindowLarge ( wxCommandEvent &  event)
private

Definition at line 580 of file Screenshot.cpp.

References SizeMainWindow().

581 {
582  SizeMainWindow(900, 600);
583 }
void SizeMainWindow(int w, int h)
Definition: Screenshot.cpp:565
void ScreenFrame::OnMainWindowSmall ( wxCommandEvent &  event)
private

Definition at line 575 of file Screenshot.cpp.

References SizeMainWindow().

576 {
577  SizeMainWindow(680, 450);
578 }
void SizeMainWindow(int w, int h)
Definition: Screenshot.cpp:565
void ScreenFrame::OnMedTracks ( wxCommandEvent &  event)
private

Definition at line 731 of file Screenshot.cpp.

References SizeTracks().

732 {
733  SizeTracks(60);
734 }
void SizeTracks(int h)
Definition: Screenshot.cpp:704
void ScreenFrame::OnOneHour ( wxCommandEvent &  event)
private

Definition at line 699 of file Screenshot.cpp.

References TimeZoom().

700 {
701  TimeZoom(3600.0);
702 }
void TimeZoom(double seconds)
Definition: Screenshot.cpp:671
void ScreenFrame::OnOneMin ( wxCommandEvent &  event)
private

Definition at line 689 of file Screenshot.cpp.

References TimeZoom().

690 {
691  TimeZoom(60.0);
692 }
void TimeZoom(double seconds)
Definition: Screenshot.cpp:671
void ScreenFrame::OnOneSec ( wxCommandEvent &  event)
private

Definition at line 679 of file Screenshot.cpp.

References TimeZoom().

680 {
681  TimeZoom(1.0);
682 }
void TimeZoom(double seconds)
Definition: Screenshot.cpp:671
void ScreenFrame::OnShortTracks ( wxCommandEvent &  event)
private

Definition at line 720 of file Screenshot.cpp.

References CommandContext::GetProject(), AudacityProject::GetTracks(), mContext, AudacityProject::RedrawProject(), and Track::Wave.

721 {
723  for (Track * t = iter.First(); t; t = iter.Next()) {
724  if (t->GetKind() == Track::Wave) {
725  t->SetHeight(t->GetMinimizedHeight());
726  }
727  }
729 }
void RedrawProject(const bool bForceWaveTracks=false)
Definition: Project.cpp:1378
AudacityProject * GetProject() const
CommandContext mContext
Definition: Screenshot.cpp:100
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
void ScreenFrame::OnTallTracks ( wxCommandEvent &  event)
private

Definition at line 736 of file Screenshot.cpp.

References SizeTracks().

737 {
738  SizeTracks(85);
739 }
void SizeTracks(int h)
Definition: Screenshot.cpp:704
void ScreenFrame::OnTenSec ( wxCommandEvent &  event)
private

Definition at line 684 of file Screenshot.cpp.

References TimeZoom().

685 {
686  TimeZoom(10.0);
687 }
void TimeZoom(double seconds)
Definition: Screenshot.cpp:671
void ScreenFrame::OnToggleBackgroundBlue ( wxCommandEvent &  event)
private

Definition at line 555 of file Screenshot.cpp.

References mWhite.

556 {
557  mWhite->SetValue(false);
558 }
wxToggleButton * mWhite
Definition: Screenshot.cpp:96
void ScreenFrame::OnToggleBackgroundWhite ( wxCommandEvent &  event)
private

Definition at line 560 of file Screenshot.cpp.

References mBlue.

561 {
562  mBlue->SetValue(false);
563 }
wxToggleButton * mBlue
Definition: Screenshot.cpp:95
void ScreenFrame::OnUIUpdate ( wxUpdateUIEvent &  event)
private

Definition at line 508 of file Screenshot.cpp.

References GetActiveProject(), IdLastDelayedEvent, IdMainWindowSmall, mCommand, and mDirectoryTextBox.

509 {
510 #ifdef __WXMAC__
511  wxTopLevelWindow *top = mCommand->GetFrontWindow(GetActiveProject());
512  bool needupdate = false;
513  bool enable = false;
514 
515  if ((!top || top->IsIconized()) && mDirectoryTextBox->IsEnabled()) {
516  needupdate = true;
517  enable = false;
518  }
519  else if ((top && !top->IsIconized()) && !mDirectoryTextBox->IsEnabled()) {
520  needupdate = true;
521  enable = true;
522  }
523 
524  if (needupdate) {
525  for (int i = IdMainWindowSmall; i < IdLastDelayedEvent; i++) {
526  wxWindow *w = wxWindow::FindWindowById(i, this);
527  if (w) {
528  w->Enable(enable);
529  }
530  }
531  }
532 #endif
533 }
wxTextCtrl * mDirectoryTextBox
Definition: Screenshot.cpp:94
std::unique_ptr< ScreenshotCommand > mCommand
Definition: Screenshot.cpp:99
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
void ScreenFrame::Populate ( )
private

Definition at line 302 of file Screenshot.cpp.

References eIsCreating, and PopulateOrExchange().

Referenced by ScreenFrame().

303 {
304  ShuttleGui S(this, eIsCreating);
306 }
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:409
void PopulateOrExchange(ShuttleGui &S)
Definition: Screenshot.cpp:308
void ScreenFrame::PopulateOrExchange ( ShuttleGui S)
private

Definition at line 308 of file Screenshot.cpp.

References _(), ShuttleGuiBase::AddButton(), ShuttleGuiBase::AddCheckBox(), ShuttleGuiBase::AddTextBox(), ShuttleGuiBase::AddWindow(), ShuttleGuiBase::EndHorizontalLay(), ShuttleGuiBase::EndMultiColumn(), ShuttleGuiBase::EndPanel(), ShuttleGuiBase::EndStatic(), CommandContext::GetProject(), gPrefs, ShuttleGui::Id(), IdCaptureDevice, IdCaptureEdit, IdCaptureEffects, IdCaptureFirstTrack, IdCaptureFullScreen, IdCaptureFullWindow, IdCaptureMeter, IdCaptureMixer, IdCapturePlayMeter, IdCapturePreferences, IdCaptureRecordMeter, IdCaptureRuler, IdCaptureScriptables, IdCaptureScrub, IdCaptureSecondTrack, IdCaptureSelectionBar, IdCaptureSpectralSelection, IdCaptureToolbars, IdCaptureTools, IdCaptureTrackPanel, IdCaptureTracks, IdCaptureTranscription, IdCaptureTransport, IdCaptureWindowContents, IdCaptureWindowPlus, IdDelayCheckBox, IdDirChoose, IdDirectory, IdFiveMin, IdMainWindowLarge, IdMainWindowSmall, IdMedTracks, IdOneHour, IdOneMin, IdOneSec, IdShortTracks, IdTallTracks, IdTenSec, IdToggleBackgroundBlue, IdToggleBackgroundWhite, mBlue, mContext, mDelayCheckBox, mDirectoryTextBox, mWhite, safenew, ShuttleGuiBase::SetBorder(), ShuttleGuiBase::SetStretchyCol(), ShuttleGuiBase::StartHorizontalLay(), ShuttleGuiBase::StartMultiColumn(), ShuttleGuiBase::StartPanel(), and ShuttleGuiBase::StartStatic().

Referenced by Populate().

309 {
310  wxPanel *p = S.StartPanel();
311  {
312  S.SetBorder(3);
313 
314  S.StartStatic(_("Choose location to save files"));
315  {
316  S.StartMultiColumn(3, wxEXPAND);
317  {
318  S.SetStretchyCol(1);
319 
320  wxString dir =
321  gPrefs->Read(wxT("/ScreenshotPath"),
322  wxFileName::GetHomeDir());
324  S.Id(IdDirectory).AddTextBox(_("Save images to:"),
325  dir, 30);
326  S.Id(IdDirChoose).AddButton(_("Choose..."));
327  }
328  S.EndMultiColumn();
329  }
330  S.EndStatic();
331 
332  S.StartStatic(_("Capture entire window or screen"));
333  {
334  S.StartHorizontalLay();
335  {
336  S.Id(IdMainWindowSmall).AddButton(_("Resize Small"));
337  S.Id(IdMainWindowLarge).AddButton(_("Resize Large"));
338  /* i18n-hint: Bkgnd is short for background and appears on a small button
339  * It is OK to just translate this item as if it said 'Blue' */
340  wxASSERT(p); // To justify safenew
341  mBlue = safenew wxToggleButton(p,
343  _("Blue Bkgnd"));
344  S.AddWindow(mBlue);
345  /* i18n-hint: Bkgnd is short for background and appears on a small button
346  * It is OK to just translate this item as if it said 'White' */
347  mWhite = safenew wxToggleButton(p,
349  _("White Bkgnd"));
350  S.AddWindow(mWhite);
351  }
352  S.EndHorizontalLay();
353 
354  S.StartHorizontalLay();
355  {
356  S.Id(IdCaptureWindowContents).AddButton(_("Capture Window Only"));
357  S.Id(IdCaptureFullWindow).AddButton(_("Capture Full Window"));
358  S.Id(IdCaptureWindowPlus).AddButton(_("Capture Window Plus"));
359  }
360  S.EndHorizontalLay();
361 
362  S.StartHorizontalLay();
363  {
364  S.Id(IdCaptureFullScreen).AddButton(_("Capture Full Screen"));
365  }
366  S.EndHorizontalLay();
367 
368  S.StartHorizontalLay();
369  {
371  (_("Wait 5 seconds and capture frontmost window/dialog"),
372  _("false"));
373  }
374  S.EndHorizontalLay();
375  }
376  S.EndStatic();
377 
378  S.StartStatic(_("Capture part of a project window"));
379  {
380  S.StartHorizontalLay();
381  {
382  S.Id(IdCaptureToolbars).AddButton(_("All Toolbars"));
383  S.Id(IdCaptureEffects).AddButton(_("All Effects"));
384  S.Id(IdCaptureScriptables).AddButton(_("All Scriptables"));
385  S.Id(IdCapturePreferences).AddButton(_("All Preferences"));
386  }
387  S.EndHorizontalLay();
388 
389  S.StartHorizontalLay();
390  {
391  S.Id(IdCaptureSelectionBar).AddButton(_("SelectionBar"));
392  S.Id(IdCaptureSpectralSelection).AddButton(_("Spectral Selection"));
393  S.Id(IdCaptureTools).AddButton(_("Tools"));
394  S.Id(IdCaptureTransport).AddButton(_("Transport"));
395  }
396  S.EndHorizontalLay();
397 
398  S.StartHorizontalLay();
399  {
400  S.Id(IdCaptureMixer).AddButton(_("Mixer"));
401  S.Id(IdCaptureMeter).AddButton(_("Meter"));
402  S.Id(IdCapturePlayMeter).AddButton(_("Play Meter"));
403  S.Id(IdCaptureRecordMeter).AddButton(_("Record Meter"));
404  }
405  S.EndHorizontalLay();
406 
407  S.StartHorizontalLay();
408  {
409  S.Id(IdCaptureEdit).AddButton(_("Edit"));
410  S.Id(IdCaptureDevice).AddButton(_("Device"));
411  S.Id(IdCaptureTranscription).AddButton(_("Transcription"));
412  S.Id(IdCaptureScrub).AddButton(_("Scrub"));
413  }
414  S.EndHorizontalLay();
415 
416  S.StartHorizontalLay();
417  {
418  S.Id(IdCaptureTrackPanel).AddButton(_("Track Panel"));
419  S.Id(IdCaptureRuler).AddButton(_("Ruler"));
420  S.Id(IdCaptureTracks).AddButton(_("Tracks"));
421  S.Id(IdCaptureFirstTrack).AddButton(_("First Track"));
422  S.Id(IdCaptureSecondTrack).AddButton(_("Second Track"));
423  }
424  S.EndHorizontalLay();
425  }
426  S.EndStatic();
427 
428  S.StartStatic(_("Scale"));
429  {
430  S.StartHorizontalLay();
431  {
432  S.Id(IdOneSec).AddButton(_("One Sec"));
433  S.Id(IdTenSec).AddButton(_("Ten Sec"));
434  S.Id(IdOneMin).AddButton(_("One Min"));
435  S.Id(IdFiveMin).AddButton(_("Five Min"));
436  S.Id(IdOneHour).AddButton(_("One Hour"));
437  }
438  S.EndHorizontalLay();
439 
440  S.StartHorizontalLay();
441  {
442  S.Id(IdShortTracks).AddButton(_("Short Tracks"));
443  S.Id(IdMedTracks).AddButton(_("Medium Tracks"));
444  S.Id(IdTallTracks).AddButton(_("Tall Tracks"));
445  }
446  S.EndHorizontalLay();
447  }
448  S.EndStatic();
449  }
450  S.EndPanel();
451 
452  Layout();
453  GetSizer()->Fit(this);
454  SetMinSize(GetSize());
455 
456  int top = 0;
457 #ifdef __WXMAC__
458  // Allow for Mac menu bar
459  top += 20;
460 #endif
461 
462  int width, height;
463  GetSize(&width, &height);
464  int displayWidth, displayHeight;
465  wxDisplaySize(&displayWidth, &displayHeight);
466 
467  if (width > 100) {
468  Move(displayWidth - width - 16, top + 16);
469  }
470  else {
471  CentreOnParent();
472  }
473 
474  SetIcon(mContext.GetProject()->GetIcon());
475 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
AudacityProject * GetProject() const
CommandContext mContext
Definition: Screenshot.cpp:100
wxWindow * AddWindow(wxWindow *pWindow, int Flags=wxALIGN_CENTRE|wxALL)
Definition: ShuttleGui.cpp:288
void EndMultiColumn()
wxPanel * StartPanel(int iStyle=0)
Definition: ShuttleGui.cpp:847
#define safenew
Definition: Audacity.h:230
wxToggleButton * mWhite
Definition: Screenshot.cpp:96
void EndHorizontalLay()
wxTextCtrl * mDirectoryTextBox
Definition: Screenshot.cpp:94
wxTextCtrl * AddTextBox(const wxString &Caption, const wxString &Value, const int nChars)
Definition: ShuttleGui.cpp:540
wxCheckBox * AddCheckBox(const wxString &Prompt, const wxString &Selected)
Definition: ShuttleGui.cpp:298
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
wxToggleButton * mBlue
Definition: Screenshot.cpp:95
ShuttleGui & Id(int id)
wxCheckBox * mDelayCheckBox
Definition: Screenshot.cpp:93
_("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
wxStaticBox * StartStatic(const wxString &Str, int iProp=0)
Definition: ShuttleGui.cpp:763
void SetBorder(int Border)
Definition: ShuttleGui.h:286
wxButton * AddButton(const wxString &Text, int PositionFlags=wxALIGN_CENTRE)
Definition: ShuttleGui.cpp:341
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:203
bool ScreenFrame::ProcessEvent ( wxEvent &  event)
override

Definition at line 477 of file Screenshot.cpp.

References IdAllDelayedEvents, IdLastDelayedEvent, mDelayCheckBox, and safenew.

Referenced by ScreenFrameTimer::Notify().

478 {
479  int id = e.GetId();
480 
481  // If split into two parts to make for easier breakpoint
482  // when testing timer.
483  if (mDelayCheckBox &&
484  mDelayCheckBox->GetValue() &&
485  e.IsCommandEvent() &&
486  e.GetEventType() == wxEVT_COMMAND_BUTTON_CLICKED)
487  {
488  if( id >= IdAllDelayedEvents && id <= IdLastDelayedEvent &&
489  e.GetEventObject() != NULL) {
490  // safenew because it's a one-shot that deletes itself
491  ScreenFrameTimer *timer = safenew ScreenFrameTimer(this, e);
492  timer->Start(5000, true);
493  return true;
494  }
495  }
496 
497  if (e.IsCommandEvent() && e.GetEventObject() == NULL) {
498  e.SetEventObject(this);
499  }
500  return wxFrame::ProcessEvent(e);
501 }
#define safenew
Definition: Audacity.h:230
wxCheckBox * mDelayCheckBox
Definition: Screenshot.cpp:93
void ScreenFrame::SizeMainWindow ( int  w,
int  h 
)
private

Definition at line 565 of file Screenshot.cpp.

References CommandContext::GetProject(), and mContext.

Referenced by OnMainWindowLarge(), and OnMainWindowSmall().

566 {
567  int top = 20;
568 
569  mContext.GetProject()->Maximize(false);
570  mContext.GetProject()->SetSize(16, 16 + top, w, h);
571  //Bug383 - Toolbar Resets not wanted.
572  //mContext.GetProject()->GetToolManager()->Reset();
573 }
AudacityProject * GetProject() const
CommandContext mContext
Definition: Screenshot.cpp:100
void ScreenFrame::SizeTracks ( int  h)
private

Definition at line 704 of file Screenshot.cpp.

References CommandContext::GetProject(), AudacityProject::GetTracks(), mContext, AudacityProject::RedrawProject(), and Track::Wave.

Referenced by OnMedTracks(), and OnTallTracks().

705 {
707  for (Track * t = iter.First(); t; t = iter.Next()) {
708  if (t->GetKind() == Track::Wave) {
709  if (t->GetLink()) {
710  t->SetHeight(h);
711  }
712  else {
713  t->SetHeight(h*2);
714  }
715  }
716  }
718 }
void RedrawProject(const bool bForceWaveTracks=false)
Definition: Project.cpp:1378
AudacityProject * GetProject() const
CommandContext mContext
Definition: Screenshot.cpp:100
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
void ScreenFrame::TimeZoom ( double  seconds)
private

Definition at line 671 of file Screenshot.cpp.

References CommandContext::GetProject(), mContext, AudacityProject::mViewInfo, AudacityProject::RedrawProject(), and ZoomInfo::SetZoom().

Referenced by OnFiveMin(), OnOneHour(), OnOneMin(), OnOneSec(), and OnTenSec().

672 {
673  int width, height;
674  mContext.GetProject()->GetClientSize(&width, &height);
675  mContext.GetProject()->mViewInfo.SetZoom((0.75 * width) / seconds);
677 }
void SetZoom(double pixelsPerSecond)
Definition: ViewInfo.cpp:94
void RedrawProject(const bool bForceWaveTracks=false)
Definition: Project.cpp:1378
AudacityProject * GetProject() const
CommandContext mContext
Definition: Screenshot.cpp:100
ViewInfo mViewInfo
Definition: Project.h:558

Member Data Documentation

wxToggleButton* ScreenFrame::mBlue
private

Definition at line 95 of file Screenshot.cpp.

Referenced by DoCapture(), OnToggleBackgroundWhite(), and PopulateOrExchange().

std::unique_ptr<ScreenshotCommand> ScreenFrame::mCommand
private

Definition at line 99 of file Screenshot.cpp.

Referenced by DoCapture(), OnDirChoose(), OnUIUpdate(), and ScreenFrame().

CommandContext ScreenFrame::mContext
private
wxCheckBox* ScreenFrame::mDelayCheckBox
private

Definition at line 93 of file Screenshot.cpp.

Referenced by PopulateOrExchange(), ProcessEvent(), and ScreenFrame().

wxTextCtrl* ScreenFrame::mDirectoryTextBox
private

Definition at line 94 of file Screenshot.cpp.

Referenced by DoCapture(), OnDirChoose(), OnUIUpdate(), PopulateOrExchange(), and ScreenFrame().

wxStatusBar* ScreenFrame::mStatus
private

Definition at line 97 of file Screenshot.cpp.

Referenced by DoCapture(), and ScreenFrame().

wxToggleButton* ScreenFrame::mWhite
private

Definition at line 96 of file Screenshot.cpp.

Referenced by DoCapture(), OnToggleBackgroundBlue(), and PopulateOrExchange().


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