Audacity  3.0.3
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
ProjectWindow Class Referencefinal

A top-level window associated with a project, and handling scrollbars and zooming. More...

#include <ProjectWindow.h>

Inheritance diagram for ProjectWindow:
[legend]
Collaboration diagram for ProjectWindow:
[legend]

Classes

class  PlaybackScroller
 

Public Member Functions

 ProjectWindow (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, AudacityProject &project)
 
 ~ProjectWindow () override
 
int NextWindowID ()
 
bool IsActive () override
 
bool IsIconized () const override
 
bool IsBeingDeleted () const
 
void SetIsBeingDeleted ()
 
wxWindow * GetMainPage ()
 
wxPanel * GetMainPanel ()
 
wxPanel * GetTopPanel ()
 
void UpdateStatusWidths ()
 
PlaybackScrollerGetPlaybackScroller ()
 
void SetNormalizedWindowState (wxRect pSizeAndLocation)
 
wxRect GetNormalizedWindowState () const
 
void RedrawProject (const bool bForceWaveTracks=false)
 
void Zoom (double level)
 
void ZoomInByFactor (double ZoomFactor)
 
void ZoomOutByFactor (double ZoomFactor)
 
void ZoomBy (double multiplier)
 
void ZoomAfterImport (Track *pTrack)
 
double GetZoomOfToFit () const
 
void DoZoomFit ()
 
void ApplyUpdatedTheme ()
 
wxScrollBar & GetVerticalScrollBar ()
 
wxScrollBar & GetHorizontalScrollBar ()
 
void ScrollIntoView (double pos)
 
void ScrollIntoView (int x)
 
void OnScrollLeft ()
 
void OnScrollRight ()
 
void Rewind (bool shift)
 
void SkipEnd (bool shift)
 
void OnScrollLeftButton (wxScrollEvent &event)
 
void OnScrollRightButton (wxScrollEvent &event)
 
void FinishAutoScroll ()
 
void FixScrollbars ()
 
bool MayScrollBeyondZero () const
 
double ScrollingLowerBoundTime () const
 
double PixelWidthBeforeTime (double scrollto) const
 
void SetHorizontalThumb (double scrollto)
 
wxSize GetTPTracksUsableArea ()
 
void RefreshTPTrack (Track *pTrk, bool refreshbacking=true)
 
void TP_RedrawScrollbars () override
 
void TP_ScrollLeft () override
 
void TP_ScrollRight () override
 
void TP_ScrollWindow (double scrollto) override
 
bool TP_ScrollUpDown (int delta) override
 
void TP_HandleResize () override
 
void OnMenu (wxCommandEvent &event)
 
void OnUpdateUI (wxUpdateUIEvent &event)
 
void MacShowUndockedToolbars (bool show)
 
void OnActivate (wxActivateEvent &event)
 
void OnMouseEvent (wxMouseEvent &event)
 
void OnIconize (wxIconizeEvent &event)
 
void OnSize (wxSizeEvent &event)
 
void HandleResize ()
 
void UpdateLayout ()
 
void OnShow (wxShowEvent &event)
 
void OnMove (wxMoveEvent &event)
 
void DoScroll ()
 
void OnScroll (wxScrollEvent &event)
 
void OnToolBarUpdate (wxCommandEvent &event)
 
void OnUndoPushedModified (wxCommandEvent &)
 
void OnUndoRedo (wxCommandEvent &)
 
void OnUndoReset (wxCommandEvent &)
 
- Public Member Functions inherited from ProjectWindowBase
 ProjectWindowBase (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, AudacityProject &project)
 
 ~ProjectWindowBase () override
 
AudacityProjectGetProject ()
 
const AudacityProjectGetProject () const
 
- Public Member Functions inherited from TrackPanelListener
 TrackPanelListener ()
 
virtual ~TrackPanelListener ()
 
- Public Member Functions inherited from PrefsListener
 PrefsListener ()
 
virtual ~PrefsListener ()
 

Static Public Member Functions

static ProjectWindowGet (AudacityProject &project)
 
static const ProjectWindowGet (const AudacityProject &project)
 
static ProjectWindowFind (AudacityProject *pProject)
 
static const ProjectWindowFind (const AudacityProject *pProject)
 
- Static Public Member Functions inherited from PrefsListener
static void Broadcast (int id=0)
 Call this static function to notify all PrefsListener objects. More...
 

Public Attributes

bool mbInitializingScrollbar { false }
 

Private Member Functions

void OnThemeChange (wxCommandEvent &evt)
 
void UpdatePrefs () override
 

Private Attributes

wxRect mNormalizedWindowState
 
wxPanel * mTopPanel {}
 
wxWindow * mMainPage {}
 
wxPanel * mMainPanel {}
 
wxScrollBar * mHsbar {}
 
wxScrollBar * mVsbar {}
 
int mNextWindowID {}
 
bool mAutoScrolling { false }
 
bool mActive { true }
 
bool mIconized { false }
 
bool mShownOnce { false }
 
bool mIsDeleting { false }
 
std::unique_ptr< PlaybackScrollermPlaybackScroller
 

Additional Inherited Members

- Protected Member Functions inherited from PrefsListener
virtual void UpdateSelectedPrefs (int id)
 
- Protected Attributes inherited from ProjectWindowBase
AudacityProjectmProject
 

Detailed Description

A top-level window associated with a project, and handling scrollbars and zooming.

Definition at line 29 of file ProjectWindow.h.

Constructor & Destructor Documentation

◆ ProjectWindow()

ProjectWindow::ProjectWindow ( wxWindow *  parent,
wxWindowID  id,
const wxPoint &  pos,
const wxSize &  size,
AudacityProject project 
)
explicit

Definition at line 580 of file ProjectWindow.cpp.

583  : ProjectWindowBase{ parent, id, pos, size, project }
584 {
586 
587  // Two sub-windows need to be made before Init(),
588  // so that this constructor can complete, and then TrackPanel and
589  // AdornedRulerPanel can retrieve those windows from this in their
590  // factory functions
591 
592  // PRL: this panel groups the top tool dock and the ruler into one
593  // tab cycle.
594  // Must create it with non-default width equal to the main window width,
595  // or else the device toolbar doesn't make initial widths of the choice
596  // controls correct.
598  this, wxID_ANY, wxDefaultPosition,
599  wxSize{ this->GetSize().GetWidth(), -1 }
600  };
601  mTopPanel->SetLabel( "Top Panel" );// Not localised
602  mTopPanel->SetLayoutDirection(wxLayout_LeftToRight);
603  mTopPanel->SetAutoLayout(true);
604 #ifdef EXPERIMENTAL_DA2
605  mTopPanel->SetBackgroundColour(theTheme.Colour( clrMedium ));
606 #endif
607 
608  wxWindow * pPage;
609 
610 #ifdef EXPERIMENTAL_NOTEBOOK
611  // We are using a notebook (tabbed panel), so we create the notebook and add pages.
612  GuiFactory Factory;
613  wxNotebook * pNotebook;
614  mMainPanel = Factory.AddPanel(
615  this, wxPoint( left, top ), wxSize( width, height ) );
616  pNotebook = Factory.AddNotebook( mMainPanel );
617  /* i18n-hint: This is an experimental feature where the main panel in
618  Audacity is put on a notebook tab, and this is the name on that tab.
619  Other tabs in that notebook may have instruments, patch panels etc.*/
620  pPage = Factory.AddPage( pNotebook, _("Main Mix"));
621 #else
622  // Not using a notebook, so we place the track panel inside another panel,
623  // this keeps the notebook code and normal code consistent and also
624  // paves the way for adding additional windows inside the track panel.
625  mMainPanel = safenew wxPanelWrapper(this, -1,
626  wxDefaultPosition,
627  wxDefaultSize,
628  wxNO_BORDER);
629  mMainPanel->SetSizer( safenew wxBoxSizer(wxVERTICAL) );
630  mMainPanel->SetLabel("Main Panel");// Not localised.
631  pPage = mMainPanel;
632  // Set the colour here to the track panel background to avoid
633  // flicker when Audacity starts up.
634  // However, that leads to areas next to the horizontal scroller
635  // being painted in background colour and not scroller background
636  // colour, so suppress this for now.
637  //pPage->SetBackgroundColour( theTheme.Colour( clrDark ));
638 #endif
639  pPage->SetLayoutDirection(wxLayout_LeftToRight);
640 
641 #ifdef EXPERIMENTAL_DA2
642  pPage->SetBackgroundColour(theTheme.Colour( clrMedium ));
643 #endif
644 
645  mMainPage = pPage;
646 
647  mPlaybackScroller = std::make_unique<PlaybackScroller>( &project );
648 
649  // PRL: Old comments below. No longer observing the ordering that it
650  // recommends. ProjectWindow::OnActivate puts the focus directly into
651  // the TrackPanel, which avoids the problems.
652  // LLL: When Audacity starts or becomes active after returning from
653  // another application, the first window that can accept focus
654  // will be given the focus even if we try to SetFocus(). By
655  // creating the scrollbars after the TrackPanel, we resolve
656  // several focus problems.
657 
658  mHsbar = safenew ScrollBar(pPage, HSBarID, wxSB_HORIZONTAL);
659  mVsbar = safenew ScrollBar(pPage, VSBarID, wxSB_VERTICAL);
660 #if wxUSE_ACCESSIBILITY
661  // so that name can be set on a standard control
662  mHsbar->SetAccessible(safenew WindowAccessible(mHsbar));
663  mVsbar->SetAccessible(safenew WindowAccessible(mVsbar));
664 #endif
665  mHsbar->SetLayoutDirection(wxLayout_LeftToRight);
666  mHsbar->SetName(_("Horizontal Scrollbar"));
667  mVsbar->SetName(_("Vertical Scrollbar"));
668 
669  project.Bind( EVT_UNDO_MODIFIED, &ProjectWindow::OnUndoPushedModified, this );
670  project.Bind( EVT_UNDO_PUSHED, &ProjectWindow::OnUndoPushedModified, this );
671  project.Bind( EVT_UNDO_OR_REDO, &ProjectWindow::OnUndoRedo, this );
672  project.Bind( EVT_UNDO_RESET, &ProjectWindow::OnUndoReset, this );
673 
674  wxTheApp->Bind(EVT_THEME_CHANGE, &ProjectWindow::OnThemeChange, this);
675 }

References id, and size.

◆ ~ProjectWindow()

ProjectWindow::~ProjectWindow ( )
override

Definition at line 677 of file ProjectWindow.cpp.

678 {
679  // Tool manager gives us capture sometimes
680  if(HasCapture())
681  ReleaseMouse();
682 }

Member Function Documentation

◆ ApplyUpdatedTheme()

void ProjectWindow::ApplyUpdatedTheme ( )

Definition at line 703 of file ProjectWindow.cpp.

704 {
705  auto &project = mProject;
706  SetBackgroundColour(theTheme.Colour( clrMedium ));
707  ClearBackground();// For wxGTK.
708 }

References ThemeBase::Colour(), and theTheme.

Referenced by OnThemeChange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoScroll()

void ProjectWindow::DoScroll ( )

Definition at line 1439 of file ProjectWindow.cpp.

1440 {
1441  auto &project = mProject;
1442  auto &trackPanel = GetProjectPanel( project );
1443  auto &viewInfo = ViewInfo::Get( project );
1444  const double lowerBound = ScrollingLowerBoundTime();
1445 
1446  auto width = viewInfo.GetTracksUsableWidth();
1447  viewInfo.SetBeforeScreenWidth(viewInfo.sbarH, width, lowerBound);
1448 
1449 
1450  if (MayScrollBeyondZero()) {
1451  enum { SCROLL_PIXEL_TOLERANCE = 10 };
1452  if (std::abs(viewInfo.TimeToPosition(0.0, 0
1453  )) < SCROLL_PIXEL_TOLERANCE) {
1454  // Snap the scrollbar to 0
1455  viewInfo.h = 0;
1456  SetHorizontalThumb(0.0);
1457  }
1458  }
1459 
1460  viewInfo.vpos = mVsbar->GetThumbPosition() * viewInfo.scrollStep;
1461 
1462  //mchinen: do not always set this project to be the active one.
1463  //a project may autoscroll while playing in the background
1464  //I think this is okay since OnMouseEvent has one of these.
1465  //SetActiveProject(this);
1466 
1467  if (!mAutoScrolling) {
1468  trackPanel.Refresh(false);
1469  }
1470 }

References ViewInfo::Get(), GetProjectPanel(), mAutoScrolling, MayScrollBeyondZero(), ProjectWindowBase::mProject, mVsbar, ScrollingLowerBoundTime(), and SetHorizontalThumb().

Referenced by FinishAutoScroll(), OnScroll(), OnScrollLeftButton(), OnScrollRightButton(), TP_ScrollUpDown(), and TP_ScrollWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoZoomFit()

void ProjectWindow::DoZoomFit ( )

Definition at line 1843 of file ProjectWindow.cpp.

1844 {
1845  auto &project = mProject;
1846  auto &viewInfo = ViewInfo::Get( project );
1847  auto &tracks = TrackList::Get( project );
1848  auto &window = *this;
1849 
1850  const double start = viewInfo.bScrollBeyondZero
1851  ? std::min(tracks.GetStartTime(), 0.0)
1852  : 0;
1853 
1854  window.Zoom( window.GetZoomOfToFit() );
1855  window.TP_ScrollWindow(start);
1856 }

References ViewInfo::Get(), TrackList::Get(), min(), and ProjectWindowBase::mProject.

Referenced by ZoomAfterImport().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Find() [1/2]

ProjectWindow * ProjectWindow::Find ( AudacityProject pProject)
static

Definition at line 545 of file ProjectWindow.cpp.

546 {
547  return pProject
549  : nullptr;
550 }

References ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Find(), GetAttachedWindows(), and anonymous_namespace{ProjectWindow.cpp}::sProjectWindowKey.

Referenced by Exporter::CheckMix(), ExportMP3::Export(), ExportMultipleDialog::ExportMultipleByLabel(), ExportMultipleDialog::ExportMultipleByTrack(), Find(), Exporter::GetFilename(), ScreenshotCommand::GetFrontWindow(), ProjectManager::OnStatusChange(), ProjectManager::SetStatusText(), and ScreenshotCommand::WindowFileName().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Find() [2/2]

const ProjectWindow * ProjectWindow::Find ( const AudacityProject pProject)
static

Definition at line 552 of file ProjectWindow.cpp.

553 {
554  return Find( const_cast< AudacityProject * >( pProject ) );
555 }

References Find().

Here is the call graph for this function:

◆ FinishAutoScroll()

void ProjectWindow::FinishAutoScroll ( )

Definition at line 755 of file ProjectWindow.cpp.

756 {
757  // Set a flag so we don't have to generate two update events
758  mAutoScrolling = true;
759 
760  // Call our Scroll method which updates our ViewInfo variables
761  // to reflect the positions of the scrollbars
762  DoScroll();
763 
764  mAutoScrolling = false;
765 }

References DoScroll(), and mAutoScrolling.

Referenced by OnScrollLeft(), and OnScrollRight().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FixScrollbars()

void ProjectWindow::FixScrollbars ( )

Definition at line 1009 of file ProjectWindow.cpp.

1010 {
1011  auto &project = mProject;
1012  auto &tracks = TrackList::Get( project );
1013  auto &trackPanel = GetProjectPanel( project );
1014  auto &viewInfo = ViewInfo::Get( project );
1015 
1016  bool refresh = false;
1017  bool rescroll = false;
1018 
1019  int totalHeight = TrackView::GetTotalHeight( tracks ) + 32;
1020 
1021  auto panelWidth = viewInfo.GetTracksUsableWidth();
1022  auto panelHeight = viewInfo.GetHeight();
1023 
1024  // (From Debian...at least I think this is the change corresponding
1025  // to this comment)
1026  //
1027  // (2.) GTK critical warning "IA__gtk_range_set_range: assertion
1028  // 'min < max' failed" because of negative numbers as result of window
1029  // size checking. Added a sanity check that straightens up the numbers
1030  // in edge cases.
1031  if (panelWidth < 0) {
1032  panelWidth = 0;
1033  }
1034  if (panelHeight < 0) {
1035  panelHeight = 0;
1036  }
1037 
1038  auto LastTime = std::numeric_limits<double>::lowest();
1039  for (const Track *track : tracks) {
1040  // Iterate over pending changed tracks if present.
1041  track = track->SubstitutePendingChangedTrack().get();
1042  LastTime = std::max( LastTime, track->GetEndTime() );
1043  }
1044  LastTime =
1045  std::max(LastTime, viewInfo.selectedRegion.t1());
1046 
1047  const double screen =
1048  viewInfo.GetScreenEndTime() - viewInfo.h;
1049  const double halfScreen = screen / 2.0;
1050 
1051  // If we can scroll beyond zero,
1052  // Add 1/2 of a screen of blank space to the end
1053  // and another 1/2 screen before the beginning
1054  // so that any point within the union of the selection and the track duration
1055  // may be scrolled to the midline.
1056  // May add even more to the end, so that you can always scroll the starting time to zero.
1057  const double lowerBound = ScrollingLowerBoundTime();
1058  const double additional = MayScrollBeyondZero()
1059  ? -lowerBound + std::max(halfScreen, screen - LastTime)
1060  : screen / 4.0;
1061 
1062  viewInfo.total = LastTime + additional;
1063 
1064  // Don't remove time from total that's still on the screen
1065  viewInfo.total = std::max(viewInfo.total, viewInfo.h + screen);
1066 
1067  if (viewInfo.h < lowerBound) {
1068  viewInfo.h = lowerBound;
1069  rescroll = true;
1070  }
1071 
1072  viewInfo.sbarTotal = (wxInt64) (viewInfo.GetTotalWidth());
1073  viewInfo.sbarScreen = (wxInt64)(panelWidth);
1074  viewInfo.sbarH = (wxInt64) (viewInfo.GetBeforeScreenWidth());
1075 
1076  // PRL: Can someone else find a more elegant solution to bug 812, than
1077  // introducing this boolean member variable?
1078  // Setting mVSbar earlier, int HandlXMLTag, didn't succeed in restoring
1079  // the vertical scrollbar to its saved position. So defer that till now.
1080  // mbInitializingScrollbar should be true only at the start of the life
1081  // of an AudacityProject reopened from disk.
1082  if (!mbInitializingScrollbar) {
1083  viewInfo.vpos = mVsbar->GetThumbPosition() * viewInfo.scrollStep;
1084  }
1085  mbInitializingScrollbar = false;
1086 
1087  if (viewInfo.vpos >= totalHeight)
1088  viewInfo.vpos = totalHeight - 1;
1089  if (viewInfo.vpos < 0)
1090  viewInfo.vpos = 0;
1091 
1092  bool oldhstate;
1093  bool oldvstate;
1094  bool newhstate =
1095  (viewInfo.GetScreenEndTime() - viewInfo.h) < viewInfo.total;
1096  bool newvstate = panelHeight < totalHeight;
1097 
1098 #ifdef __WXGTK__
1099  oldhstate = mHsbar->IsShown();
1100  oldvstate = mVsbar->IsShown();
1101  mHsbar->Show(newhstate);
1102  mVsbar->Show(panelHeight < totalHeight);
1103 #else
1104  oldhstate = mHsbar->IsEnabled();
1105  oldvstate = mVsbar->IsEnabled();
1106  mHsbar->Enable(newhstate);
1107  mVsbar->Enable(panelHeight < totalHeight);
1108 #endif
1109 
1110  if (panelHeight >= totalHeight && viewInfo.vpos != 0) {
1111  viewInfo.vpos = 0;
1112 
1113  refresh = true;
1114  rescroll = false;
1115  }
1116  if (!newhstate && viewInfo.sbarH != 0) {
1117  viewInfo.sbarH = 0;
1118 
1119  refresh = true;
1120  rescroll = false;
1121  }
1122 
1123  // wxScrollbar only supports int values but we need a greater range, so
1124  // we scale the scrollbar coordinates on demand. We only do this if we
1125  // would exceed the int range, so we can always use the maximum resolution
1126  // available.
1127 
1128  // Don't use the full 2^31 max int range but a bit less, so rounding
1129  // errors in calculations do not overflow max int
1130  wxInt64 maxScrollbarRange = (wxInt64)(2147483647 * 0.999);
1131  if (viewInfo.sbarTotal > maxScrollbarRange)
1132  viewInfo.sbarScale = ((double)maxScrollbarRange) / viewInfo.sbarTotal;
1133  else
1134  viewInfo.sbarScale = 1.0; // use maximum resolution
1135 
1136  {
1137  int scaledSbarH = (int)(viewInfo.sbarH * viewInfo.sbarScale);
1138  int scaledSbarScreen = (int)(viewInfo.sbarScreen * viewInfo.sbarScale);
1139  int scaledSbarTotal = (int)(viewInfo.sbarTotal * viewInfo.sbarScale);
1140  const int offset =
1141  (int)(floor(0.5 + viewInfo.sbarScale * PixelWidthBeforeTime(0.0)));
1142 
1143  mHsbar->SetScrollbar(scaledSbarH + offset, scaledSbarScreen, scaledSbarTotal,
1144  scaledSbarScreen, TRUE);
1145  }
1146 
1147  // Vertical scrollbar
1148  mVsbar->SetScrollbar(viewInfo.vpos / viewInfo.scrollStep,
1149  panelHeight / viewInfo.scrollStep,
1150  totalHeight / viewInfo.scrollStep,
1151  panelHeight / viewInfo.scrollStep, TRUE);
1152 
1153  if (refresh || (rescroll &&
1154  (viewInfo.GetScreenEndTime() - viewInfo.h) < viewInfo.total)) {
1155  trackPanel.Refresh(false);
1156  }
1157 
1158  MenuManager::Get( project ).UpdateMenus();
1159 
1160  if (oldhstate != newhstate || oldvstate != newvstate) {
1161  UpdateLayout();
1162  }
1163 }

References ViewInfo::Get(), MenuManager::Get(), TrackList::Get(), GetProjectPanel(), TrackView::GetTotalHeight(), MayScrollBeyondZero(), mbInitializingScrollbar, mHsbar, ProjectWindowBase::mProject, mVsbar, PixelWidthBeforeTime(), ScrollingLowerBoundTime(), UpdateLayout(), and MenuManager::UpdateMenus().

Referenced by HandleResize(), InitProjectWindow(), TP_RedrawScrollbars(), Zoom(), and ZoomBy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get() [1/2]

ProjectWindow & ProjectWindow::Get ( AudacityProject project)
static

Definition at line 535 of file ProjectWindow.cpp.

536 {
538 }

References ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), GetAttachedWindows(), and anonymous_namespace{ProjectWindow.cpp}::sProjectWindowKey.

Referenced by ProjectSelectionManager::AS_SetSnapTo(), anonymous_namespace{TrackMenus.cpp}::DoAlign(), MacroCommands::DoAudacityCommand(), anonymous_namespace{SelectMenus.cpp}::DoBoundaryMove(), anonymous_namespace{ClipMenus.cpp}::DoClipLeftOrRight(), anonymous_namespace{ClipMenus.cpp}::DoCursorClipBoundary(), LOFImportFileHandle::doDurationAndScrollOffset(), LabelTrackView::DoEditLabels(), EffectUI::DoEffect(), anonymous_namespace{FileMenus.cpp}::DoImport(), DoImportMIDI(), anonymous_namespace{TrackMenus.cpp}::DoMixAndRender(), anonymous_namespace{TransportMenus.cpp}::DoMoveToLabel(), anonymous_namespace{TrackMenus.cpp}::DoPanTracks(), anonymous_namespace{EditMenus.cpp}::DoPasteNothingSelected(), anonymous_namespace{EditMenus.cpp}::DoPasteText(), TrackUtilities::DoRemoveTrack(), anonymous_namespace{ClipMenus.cpp}::DoSelectClip(), Get(), GetNextWindowPlacement(), anonymous_namespace{ViewMenus.cpp}::GetZoomOfPreset(), anonymous_namespace{ViewMenus.cpp}::GetZoomOfSelection(), LabelTrackView::KeyDown(), anonymous_namespace{SelectMenus.cpp}::MoveWhenAudioInactive(), TrackActions::Handler::MuteTracks(), ProjectManager::New(), anonymous_namespace{NavigationMenus.cpp}::NextOrPrevFrame(), PluginActions::Handler::OnApplyMacroDirectlyByName(), ApplyMacroDialog::OnApplyToFiles(), MixerTrackCluster::OnButton_Mute(), MixerTrackCluster::OnButton_Solo(), FileActions::Handler::OnClose(), ProjectManager::OnCloseWindow(), ViewActions::Handler::OnCollapseAllTracks(), SelectActions::Handler::OnCursorSelEnd(), SelectActions::Handler::OnCursorSelStart(), SelectActions::Handler::OnCursorTrackEnd(), SelectActions::Handler::OnCursorTrackStart(), EditActions::Handler::OnCut(), EditActions::Handler::OnDelete(), EditActions::Handler::OnDisjoin(), EditActions::Handler::OnDuplicate(), AudacityApp::OnExceptionInMainLoop(), ViewActions::Handler::OnExpandAllTracks(), ControlToolBar::OnFF(), ViewActions::Handler::OnGoSelEnd(), ViewActions::Handler::OnGoSelStart(), FileActions::Handler::OnImportLabels(), EditActions::Handler::OnJoin(), TrackActions::Handler::OnNewLabelTrack(), TrackActions::Handler::OnNewStereoTrack(), TrackActions::Handler::OnNewTimeTrack(), TrackActions::Handler::OnNewWaveTrack(), EditActions::Handler::OnPaste(), CommandHandler::OnReceiveCommand(), ProjectManager::OnReconnectionFailure(), EditActions::Handler::OnRedo(), TrackActions::Handler::OnResample(), ControlToolBar::OnRewind(), LabelDialog::OnSelectCell(), SelectActions::Handler::OnSelectionRestore(), SelectActions::Handler::OnSelToEnd(), SelectActions::Handler::OnSelToStart(), ScreenshotBigDialog::OnShortTracks(), EditActions::Handler::OnSplitCut(), EditActions::Handler::OnSplitDelete(), EditActions::Handler::OnSplitNew(), ProjectWindow::PlaybackScroller::OnTimer(), PlayIndicatorOverlay::OnTimer(), SelectHandle::TimerHandler::OnTimer(), TrackPanel::OnTimer(), TransportActions::Handler::OnTimerRecord(), ToolsToolBar::OnToolChanged(), EditActions::Handler::OnTrim(), EditActions::Handler::OnUndo(), ViewActions::Handler::OnZoomFit(), ViewActions::Handler::OnZoomFitV(), ViewActions::Handler::OnZoomIn(), ViewActions::Handler::OnZoomNormal(), ViewActions::Handler::OnZoomOut(), ViewActions::Handler::OnZoomSel(), ViewActions::Handler::OnZoomToggle(), ProjectFileManager::OpenFile(), ProjectManager::OpenProject(), ProjectFileManager::OpenProjectFile(), anonymous_namespace{ProjectWindow.cpp}::MouseWheelHandler::operator()(), PlayIndicatorOverlay::PlayIndicatorOverlay(), ProjectManager::SaveWindowSize(), anonymous_namespace{SelectMenus.cpp}::SeekWhenAudioInactive(), ScreenshotBigDialog::SizeTracks(), ProjectSelectionManager::SnapSelection(), ControlToolBar::StartScrolling(), ControlToolBar::StartScrollingIfPreferred(), ControlToolBar::StopScrolling(), ScreenshotBigDialog::TimeZoom(), and TrackPanel::TrackPanel().

Here is the call graph for this function:

◆ Get() [2/2]

const ProjectWindow & ProjectWindow::Get ( const AudacityProject project)
static

Definition at line 540 of file ProjectWindow.cpp.

541 {
542  return Get( const_cast< AudacityProject & >( project ) );
543 }

References Get().

Here is the call graph for this function:

◆ GetHorizontalScrollBar()

wxScrollBar& ProjectWindow::GetHorizontalScrollBar ( )
inline

Definition at line 110 of file ProjectWindow.h.

110 { return *mHsbar; }

Referenced by InitProjectWindow().

Here is the caller graph for this function:

◆ GetMainPage()

wxWindow* ProjectWindow::GetMainPage ( )
inline

Definition at line 54 of file ProjectWindow.h.

54 { return mMainPage; }

Referenced by InitProjectWindow().

Here is the caller graph for this function:

◆ GetMainPanel()

wxPanel* ProjectWindow::GetMainPanel ( )
inline

Definition at line 55 of file ProjectWindow.h.

55 { return mMainPanel; }

Referenced by InitProjectWindow().

Here is the caller graph for this function:

◆ GetNormalizedWindowState()

wxRect ProjectWindow::GetNormalizedWindowState ( ) const
inline

Definition at line 93 of file ProjectWindow.h.

93 { return mNormalizedWindowState; }

Referenced by ProjectManager::SaveWindowSize().

Here is the caller graph for this function:

◆ GetPlaybackScroller()

PlaybackScroller& ProjectWindow::GetPlaybackScroller ( )
inline

Definition at line 90 of file ProjectWindow.h.

90 { return *mPlaybackScroller; }

Referenced by PlayIndicatorOverlay::PlayIndicatorOverlay(), ControlToolBar::StartScrolling(), ControlToolBar::StartScrollingIfPreferred(), and ControlToolBar::StopScrolling().

Here is the caller graph for this function:

◆ GetTopPanel()

wxPanel* ProjectWindow::GetTopPanel ( )
inline

Definition at line 56 of file ProjectWindow.h.

56 { return mTopPanel; }

Referenced by InitProjectWindow(), InstallTopPanelHook::InstallTopPanelHook(), and anonymous_namespace{NavigationMenus.cpp}::NextOrPrevFrame().

Here is the caller graph for this function:

◆ GetTPTracksUsableArea()

wxSize ProjectWindow::GetTPTracksUsableArea ( )

◆ GetVerticalScrollBar()

wxScrollBar& ProjectWindow::GetVerticalScrollBar ( )
inline

Definition at line 109 of file ProjectWindow.h.

109 { return *mVsbar; }

Referenced by InitProjectWindow().

Here is the caller graph for this function:

◆ GetZoomOfToFit()

double ProjectWindow::GetZoomOfToFit ( ) const

Definition at line 1823 of file ProjectWindow.cpp.

1824 {
1825  auto &project = mProject;
1826  auto &tracks = TrackList::Get( project );
1827  auto &viewInfo = ViewInfo::Get( project );
1828 
1829  const double end = tracks.GetEndTime();
1830  const double start = viewInfo.bScrollBeyondZero
1831  ? std::min( tracks.GetStartTime(), 0.0)
1832  : 0;
1833  const double len = end - start;
1834 
1835  if (len <= 0.0)
1836  return viewInfo.GetZoom();
1837 
1838  auto w = viewInfo.GetTracksUsableWidth();
1839  w -= 10;
1840  return w/len;
1841 }

References ViewInfo::Get(), TrackList::Get(), min(), and ProjectWindowBase::mProject.

Here is the call graph for this function:

◆ HandleResize()

void ProjectWindow::HandleResize ( )

Definition at line 1206 of file ProjectWindow.cpp.

1207 {
1208  // Activate events can fire during window teardown, so just
1209  // ignore them.
1210  if (mIsDeleting) {
1211  return;
1212  }
1213 
1214  CallAfter( [this]{
1215 
1216  if (mIsDeleting)
1217  return;
1218 
1219  FixScrollbars();
1220  UpdateLayout();
1221 
1222  });
1223 }

References BasicUI::CallAfter(), FixScrollbars(), mIsDeleting, and UpdateLayout().

Referenced by OnSize(), OnToolBarUpdate(), OnUndoRedo(), OnUndoReset(), and TP_HandleResize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsActive()

bool ProjectWindow::IsActive ( )
override

Definition at line 1539 of file ProjectWindow.cpp.

1540 {
1541  return mActive;
1542 }

References mActive.

◆ IsBeingDeleted()

bool ProjectWindow::IsBeingDeleted ( ) const
inline

Definition at line 51 of file ProjectWindow.h.

51 { return mIsDeleting; }

Referenced by OnActivate().

Here is the caller graph for this function:

◆ IsIconized()

bool ProjectWindow::IsIconized ( ) const
override

Definition at line 1226 of file ProjectWindow.cpp.

1227 {
1228  return mIconized;
1229 }

References mIconized.

Referenced by GetNextWindowPlacement(), OnMove(), and OnSize().

Here is the caller graph for this function:

◆ MacShowUndockedToolbars()

void ProjectWindow::MacShowUndockedToolbars ( bool  show)

Definition at line 1258 of file ProjectWindow.cpp.

1259 {
1260  (void)show;//compiler food
1261 #ifdef __WXMAC__
1262  // Save the focus so we can restore it to whatever had it before since
1263  // showing a previously hidden toolbar will cause the focus to be set to
1264  // its frame. If this is not done it will appear that activation events
1265  // aren't being sent to the project window since they are actually being
1266  // delivered to the last tool frame shown.
1267  wxWindow *focused = FindFocus();
1268 
1269  // Find all the floating toolbars, and show or hide them
1270  const auto &children = GetChildren();
1271  for(const auto &child : children) {
1272  if (auto frame = dynamic_cast<ToolFrame*>(child)) {
1273  if (!show) {
1274  frame->Hide();
1275  }
1276  else if (frame->GetBar() &&
1277  frame->GetBar()->IsVisible() ) {
1278  frame->Show();
1279  }
1280  }
1281  }
1282 
1283  // Restore the focus if needed
1284  if (focused) {
1285  focused->SetFocus();
1286  }
1287 #endif
1288 }

Referenced by OnIconize().

Here is the caller graph for this function:

◆ MayScrollBeyondZero()

bool ProjectWindow::MayScrollBeyondZero ( ) const

Definition at line 902 of file ProjectWindow.cpp.

903 {
904  auto &project = mProject;
905  auto &scrubber = Scrubber::Get( project );
906  auto &viewInfo = ViewInfo::Get( project );
907  if (viewInfo.bScrollBeyondZero)
908  return true;
909 
910  if (scrubber.HasMark() ||
911  ProjectAudioIO::Get( project ).IsAudioActive()) {
912  if (mPlaybackScroller) {
913  auto mode = mPlaybackScroller->GetMode();
914  if (mode == PlaybackScroller::Mode::Pinned ||
916  return true;
917  }
918  }
919 
920  return false;
921 }

References ViewInfo::Get(), ProjectAudioIO::Get(), Scrubber::Get(), ProjectAudioIO::IsAudioActive(), mPlaybackScroller, ProjectWindowBase::mProject, ProjectWindow::PlaybackScroller::Pinned, and ProjectWindow::PlaybackScroller::Right.

Referenced by DoScroll(), FixScrollbars(), ProjectWindow::PlaybackScroller::OnTimer(), and ScrollingLowerBoundTime().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NextWindowID()

int ProjectWindow::NextWindowID ( )

Definition at line 557 of file ProjectWindow.cpp.

558 {
559  return mNextWindowID++;
560 }

References mNextWindowID.

◆ OnActivate()

void ProjectWindow::OnActivate ( wxActivateEvent &  event)

Definition at line 1507 of file ProjectWindow.cpp.

1508 {
1509  // Activate events can fire during window teardown, so just
1510  // ignore them.
1511  if (IsBeingDeleted()) {
1512  return;
1513  }
1514 
1515  auto &project = mProject;
1516 
1517  mActive = event.GetActive();
1518 
1519  // Under Windows, focus can be "lost" when returning to
1520  // Audacity from a different application.
1521  //
1522  // This was observed by minimizing all windows using WINDOWS+M and
1523  // then ALT+TAB to return to Audacity. Focus will be given to the
1524  // project window frame which is not at all useful.
1525  //
1526  // So, we use ToolManager's observation of focus changes in a wxEventFilter.
1527  // Then, when we receive the
1528  // activate event, we restore that focus to the child or the track
1529  // panel if no child had the focus (which probably should never happen).
1530  if (mActive) {
1531  auto &toolManager = ToolManager::Get( project );
1532  SetActiveProject( &project );
1533  if ( ! toolManager.RestoreFocus() )
1534  GetProjectPanel( project ).SetFocus();
1535  }
1536  event.Skip();
1537 }

References ToolManager::Get(), GetProjectPanel(), IsBeingDeleted(), mActive, ProjectWindowBase::mProject, and SetActiveProject().

Here is the call graph for this function:

◆ OnIconize()

void ProjectWindow::OnIconize ( wxIconizeEvent &  event)

Definition at line 1290 of file ProjectWindow.cpp.

1291 {
1292  //JKC: On Iconizing we get called twice. Don't know
1293  // why but it does no harm.
1294  // Should we be returning true/false rather than
1295  // void return? I don't know.
1296  mIconized = event.IsIconized();
1297 
1298 #if defined(__WXMAC__)
1299  // Readdresses bug 1431 since a crash could occur when restoring iconized
1300  // floating toolbars due to recursion (bug 2411).
1302  if( !mIconized )
1303  {
1304  Raise();
1305  }
1306 #endif
1307 
1308  // VisibileProjectCount seems to be just a counter for debugging.
1309  // It's not used outside this function.
1310  auto VisibleProjectCount = std::count_if(
1311  AllProjects{}.begin(), AllProjects{}.end(),
1312  []( const AllProjects::value_type &ptr ){
1313  return !GetProjectFrame( *ptr ).IsIconized();
1314  }
1315  );
1316  event.Skip();
1317 
1318  // This step is to fix part of Bug 2040, where the BackingPanel
1319  // size was not restored after we leave Iconized state.
1320 
1321  // Queue up a resize event using OnShow so that we
1322  // refresh the track panel. But skip this, if we're iconized.
1323  if( mIconized )
1324  return;
1325  wxShowEvent Evt;
1326  OnShow( Evt );
1327 }

References AllProjects::begin(), AllProjects::end(), GetProjectFrame(), MacShowUndockedToolbars(), mIconized, and OnShow().

Here is the call graph for this function:

◆ OnMenu()

void ProjectWindow::OnMenu ( wxCommandEvent &  event)

Definition at line 1472 of file ProjectWindow.cpp.

1473 {
1474 #ifdef __WXMSW__
1475  // Bug 1642: We can arrive here with bogus menu IDs, which we
1476  // proceed to process. So if bogus, don't.
1477  // The bogus menu IDs are probably generated by controls on the TrackPanel,
1478  // such as the Project Rate.
1479  // 17000 is the magic number at which we start our menu.
1480  // This code would probably NOT be OK on Mac, since we assign
1481  // some specific ID numbers.
1482  if( event.GetId() < 17000){
1483  event.Skip();
1484  return;
1485  }
1486 #endif
1487  auto &project = mProject;
1488  auto &commandManager = CommandManager::Get( project );
1489  bool handled = commandManager.HandleMenuID( GetProject(),
1490  event.GetId(), MenuManager::Get( project ).GetUpdateFlags(),
1491  false);
1492 
1493  if (handled)
1494  event.Skip(false);
1495  else{
1496  event.ResumePropagation( 999 );
1497  event.Skip(true);
1498  }
1499 }

References CommandManager::Get(), MenuManager::Get(), ProjectWindowBase::GetProject(), MenuManager::GetUpdateFlags(), and ProjectWindowBase::mProject.

Here is the call graph for this function:

◆ OnMouseEvent()

void ProjectWindow::OnMouseEvent ( wxMouseEvent &  event)

Definition at line 1544 of file ProjectWindow.cpp.

1545 {
1546  auto &project = mProject;
1547  if (event.ButtonDown())
1548  SetActiveProject( &project );
1549 }

References ProjectWindowBase::mProject, and SetActiveProject().

Here is the call graph for this function:

◆ OnMove()

void ProjectWindow::OnMove ( wxMoveEvent &  event)

Definition at line 1329 of file ProjectWindow.cpp.

1330 {
1331  if (!this->IsMaximized() && !this->IsIconized())
1332  SetNormalizedWindowState(this->GetRect());
1333  event.Skip();
1334 }

References IsIconized(), and SetNormalizedWindowState().

Here is the call graph for this function:

◆ OnScroll()

void ProjectWindow::OnScroll ( wxScrollEvent &  event)

Definition at line 1421 of file ProjectWindow.cpp.

1422 {
1423  auto &project = mProject;
1424  auto &viewInfo = ViewInfo::Get( project );
1425  const wxInt64 offset = PixelWidthBeforeTime(0.0);
1426  viewInfo.sbarH =
1427  (wxInt64)(mHsbar->GetThumbPosition() / viewInfo.sbarScale) - offset;
1428  DoScroll();
1429 
1430 #ifndef __WXMAC__
1431  // Bug2179
1432  // This keeps the time ruler in sync with horizontal scrolling, without
1433  // making an undesirable compilation dependency of this source file on
1434  // the ruler
1435  wxTheApp->ProcessIdle();
1436 #endif
1437 }

References DoScroll(), ViewInfo::Get(), mHsbar, ProjectWindowBase::mProject, and PixelWidthBeforeTime().

Here is the call graph for this function:

◆ OnScrollLeft()

void ProjectWindow::OnScrollLeft ( )

This method handles general left-scrolling, either for drag-scrolling or when the scrollbar is clicked to the left of the thumb

Definition at line 811 of file ProjectWindow.cpp.

812 {
813  auto &project = mProject;
814  auto &viewInfo = ViewInfo::Get( project );
815  wxInt64 pos = mHsbar->GetThumbPosition();
816  // move at least one scroll increment
817  pos -= wxMax((wxInt64)(sbarHjump * viewInfo.sbarScale), 1);
818  pos = wxMax(pos, 0);
819  viewInfo.sbarH -= sbarHjump;
820  viewInfo.sbarH = std::max(viewInfo.sbarH,
821  -(wxInt64) PixelWidthBeforeTime(0.0));
822 
823 
824  if (pos != mHsbar->GetThumbPosition()) {
825  mHsbar->SetThumbPosition((int)pos);
827  }
828 }

References FinishAutoScroll(), ViewInfo::Get(), mHsbar, ProjectWindowBase::mProject, PixelWidthBeforeTime(), and sbarHjump.

Referenced by TP_ScrollLeft().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnScrollLeftButton()

void ProjectWindow::OnScrollLeftButton ( wxScrollEvent &  event)

This handles the event when the left direction button on the scrollbar is depressed

Definition at line 859 of file ProjectWindow.cpp.

860 {
861  auto &project = mProject;
862  auto &viewInfo = ViewInfo::Get( project );
863  wxInt64 pos = mHsbar->GetThumbPosition();
864  // move at least one scroll increment
865  pos -= wxMax((wxInt64)(sbarHjump * viewInfo.sbarScale), 1);
866  pos = wxMax(pos, 0);
867  viewInfo.sbarH -= sbarHjump;
868  viewInfo.sbarH = std::max(viewInfo.sbarH,
869  - (wxInt64) PixelWidthBeforeTime(0.0));
870 
871  if (pos != mHsbar->GetThumbPosition()) {
872  mHsbar->SetThumbPosition((int)pos);
873  DoScroll();
874  }
875 }

References DoScroll(), ViewInfo::Get(), mHsbar, ProjectWindowBase::mProject, PixelWidthBeforeTime(), and sbarHjump.

Here is the call graph for this function:

◆ OnScrollRight()

void ProjectWindow::OnScrollRight ( )

This method handles general right-scrolling, either for drag-scrolling or when the scrollbar is clicked to the right of the thumb

Definition at line 834 of file ProjectWindow.cpp.

835 {
836  auto &project = mProject;
837  auto &viewInfo = ViewInfo::Get( project );
838  wxInt64 pos = mHsbar->GetThumbPosition();
839  // move at least one scroll increment
840  // use wxInt64 for calculation to prevent temporary overflow
841  pos += wxMax((wxInt64)(sbarHjump * viewInfo.sbarScale), 1);
842  wxInt64 max = mHsbar->GetRange() - mHsbar->GetThumbSize();
843  pos = wxMin(pos, max);
844  viewInfo.sbarH += sbarHjump;
845  viewInfo.sbarH = std::min(viewInfo.sbarH,
846  viewInfo.sbarTotal
847  - (wxInt64) PixelWidthBeforeTime(0.0) - viewInfo.sbarScreen);
848 
849  if (pos != mHsbar->GetThumbPosition()) {
850  mHsbar->SetThumbPosition((int)pos);
852  }
853 }

References FinishAutoScroll(), ViewInfo::Get(), mHsbar, min(), ProjectWindowBase::mProject, PixelWidthBeforeTime(), and sbarHjump.

Referenced by TP_ScrollRight().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnScrollRightButton()

void ProjectWindow::OnScrollRightButton ( wxScrollEvent &  event)

This handles the event when the right direction button on the scrollbar is depressed

Definition at line 880 of file ProjectWindow.cpp.

881 {
882  auto &project = mProject;
883  auto &viewInfo = ViewInfo::Get( project );
884  wxInt64 pos = mHsbar->GetThumbPosition();
885  // move at least one scroll increment
886  // use wxInt64 for calculation to prevent temporary overflow
887  pos += wxMax((wxInt64)(sbarHjump * viewInfo.sbarScale), 1);
888  wxInt64 max = mHsbar->GetRange() - mHsbar->GetThumbSize();
889  pos = wxMin(pos, max);
890  viewInfo.sbarH += sbarHjump;
891  viewInfo.sbarH = std::min(viewInfo.sbarH,
892  viewInfo.sbarTotal
893  - (wxInt64) PixelWidthBeforeTime(0.0) - viewInfo.sbarScreen);
894 
895  if (pos != mHsbar->GetThumbPosition()) {
896  mHsbar->SetThumbPosition((int)pos);
897  DoScroll();
898  }
899 }

References DoScroll(), ViewInfo::Get(), mHsbar, min(), ProjectWindowBase::mProject, PixelWidthBeforeTime(), and sbarHjump.

Here is the call graph for this function:

◆ OnShow()

void ProjectWindow::OnShow ( wxShowEvent &  event)

Definition at line 1354 of file ProjectWindow.cpp.

1355 {
1356  // Remember that the window has been shown at least once
1357  mShownOnce = true;
1358 
1359  // (From Debian...see also TrackPanel::OnTimer and AudacityTimer::Notify)
1360  //
1361  // Description: Workaround for wxWidgets bug: Reentry in clipboard
1362  // The wxWidgets bug http://trac.wxwidgets.org/ticket/16636 prevents
1363  // us from doing clipboard operations in wxShowEvent and wxTimerEvent
1364  // processing because those event could possibly be processed during
1365  // the (not sufficiently protected) Yield() of a first clipboard
1366  // operation, causing reentry. Audacity had a workaround in place
1367  // for this problem (the class "CaptureEvents"), which however isn't
1368  // applicable with wxWidgets 3.0 because it's based on changing the
1369  // gdk event handler, a change that would be overridden by wxWidgets's
1370  // own gdk event handler change.
1371  // Instead, as a NEW workaround, specifically protect those processings
1372  // of wxShowEvent and wxTimerEvent that try to do clipboard operations
1373  // from being executed within Yield(). This is done by delaying their
1374  // execution by posting pure wxWidgets events - which are never executed
1375  // during Yield().
1376  // Author: Martin Stegh fer <[email protected]>
1377  // Bug-Debian: https://bugs.debian.org/765341
1378 
1379  // the actual creation/showing of the window).
1380  // Post the event instead of calling OnSize(..) directly. This ensures that
1381  // this is a pure wxWidgets event (no GDK event behind it) and that it
1382  // therefore isn't processed within the YieldFor(..) of the clipboard
1383  // operations (workaround for Debian bug #765341).
1384  // QueueEvent() will take ownership of the event
1385  GetEventHandler()->QueueEvent(safenew wxSizeEvent(GetSize()));
1386 
1387  // Further processing by default handlers
1388  event.Skip();
1389 }

References mShownOnce, and safenew.

Referenced by OnIconize().

Here is the caller graph for this function:

◆ OnSize()

void ProjectWindow::OnSize ( wxSizeEvent &  event)

Definition at line 1336 of file ProjectWindow.cpp.

1337 {
1338  // (From Debian)
1339  //
1340  // (3.) GTK critical warning "IA__gdk_window_get_origin: assertion
1341  // 'GDK_IS_WINDOW (window)' failed": Received events of type wxSizeEvent
1342  // on the main project window cause calls to "ClientToScreen" - which is
1343  // not available until the window is first shown. So the class has to
1344  // keep track of wxShowEvent events and inhibit those actions until the
1345  // window is first shown.
1346  if (mShownOnce) {
1347  HandleResize();
1348  if (!this->IsMaximized() && !this->IsIconized())
1349  SetNormalizedWindowState(this->GetRect());
1350  }
1351  event.Skip();
1352 }

References HandleResize(), IsIconized(), mShownOnce, and SetNormalizedWindowState().

Here is the call graph for this function:

◆ OnThemeChange()

void ProjectWindow::OnThemeChange ( wxCommandEvent &  evt)
private

Definition at line 735 of file ProjectWindow.cpp.

736 {
737  evt.Skip();
738  auto &project = mProject;
739  this->ApplyUpdatedTheme();
740  auto &toolManager = ToolManager::Get( project );
741  for( int ii = 0; ii < ToolBarCount; ++ii )
742  {
743  ToolBar *pToolBar = toolManager.GetToolBar(ii);
744  if( pToolBar )
745  pToolBar->ReCreateButtons();
746  }
747 }

References ApplyUpdatedTheme(), ToolManager::Get(), ProjectWindowBase::mProject, ToolBar::ReCreateButtons(), and ToolBarCount.

Here is the call graph for this function:

◆ OnToolBarUpdate()

void ProjectWindow::OnToolBarUpdate ( wxCommandEvent &  event)

A toolbar has been updated, so handle it like a sizing event.

Definition at line 1394 of file ProjectWindow.cpp.

1395 {
1396  HandleResize();
1397 
1398  event.Skip(false); /* No need to propagate any further */
1399 }

References HandleResize().

Here is the call graph for this function:

◆ OnUndoPushedModified()

void ProjectWindow::OnUndoPushedModified ( wxCommandEvent &  evt)

Definition at line 1401 of file ProjectWindow.cpp.

1402 {
1403  evt.Skip();
1404  RedrawProject();
1405 }

References RedrawProject().

Here is the call graph for this function:

◆ OnUndoRedo()

void ProjectWindow::OnUndoRedo ( wxCommandEvent &  evt)

Definition at line 1407 of file ProjectWindow.cpp.

1408 {
1409  evt.Skip();
1410  HandleResize();
1411  RedrawProject();
1412 }

References HandleResize(), and RedrawProject().

Here is the call graph for this function:

◆ OnUndoReset()

void ProjectWindow::OnUndoReset ( wxCommandEvent &  evt)

Definition at line 1414 of file ProjectWindow.cpp.

1415 {
1416  evt.Skip();
1417  HandleResize();
1418  // RedrawProject(); // Should we do this here too?
1419 }

References HandleResize().

Here is the call graph for this function:

◆ OnUpdateUI()

void ProjectWindow::OnUpdateUI ( wxUpdateUIEvent &  event)

Definition at line 1501 of file ProjectWindow.cpp.

1502 {
1503  auto &project = mProject;
1504  MenuManager::Get( project ).UpdateMenus();
1505 }

References MenuManager::Get(), ProjectWindowBase::mProject, and MenuManager::UpdateMenus().

Here is the call graph for this function:

◆ PixelWidthBeforeTime()

double ProjectWindow::PixelWidthBeforeTime ( double  scrollto) const

Definition at line 936 of file ProjectWindow.cpp.

937 {
938  auto &project = mProject;
939  auto &viewInfo = ViewInfo::Get( project );
940  const double lowerBound = ScrollingLowerBoundTime();
941  return
942  // Ignoring fisheye is correct here
943  viewInfo.TimeRangeToPixelWidth(scrollto - lowerBound);
944 }

References ViewInfo::Get(), ProjectWindowBase::mProject, and ScrollingLowerBoundTime().

Referenced by FixScrollbars(), OnScroll(), OnScrollLeft(), OnScrollLeftButton(), OnScrollRight(), OnScrollRightButton(), and SetHorizontalThumb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RedrawProject()

void ProjectWindow::RedrawProject ( const bool  bForceWaveTracks = false)

Definition at line 710 of file ProjectWindow.cpp.

711 {
712  auto pThis = wxWeakRef<ProjectWindow>(this);
713  CallAfter( [pThis, bForceWaveTracks]{
714 
715  if (!pThis)
716  return;
717  if (pThis->IsBeingDeleted())
718  return;
719 
720  auto &project = pThis->mProject ;
721  auto &tracks = TrackList::Get( project );
722  auto &trackPanel = GetProjectPanel( project );
723  pThis->FixScrollbars();
724  if (bForceWaveTracks)
725  {
726  for ( auto pWaveTrack : tracks.Any< WaveTrack >() )
727  for (const auto &clip: pWaveTrack->GetClips())
728  clip->MarkChanged();
729  }
730  trackPanel.Refresh(false);
731 
732  });
733 }

References BasicUI::CallAfter(), for(), TrackList::Get(), and GetProjectPanel().

Referenced by MixerTrackCluster::OnButton_Mute(), MixerTrackCluster::OnButton_Solo(), AudacityApp::OnExceptionInMainLoop(), CommandHandler::OnReceiveCommand(), LabelDialog::OnSelectCell(), ScreenshotBigDialog::OnShortTracks(), ToolsToolBar::OnToolChanged(), OnUndoPushedModified(), OnUndoRedo(), and ScreenshotBigDialog::SizeTracks().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RefreshTPTrack()

void ProjectWindow::RefreshTPTrack ( Track pTrk,
bool  refreshbacking = true 
)

◆ Rewind()

void ProjectWindow::Rewind ( bool  shift)

Definition at line 1606 of file ProjectWindow.cpp.

1607 {
1608  auto &project = mProject;
1609  auto &viewInfo = ViewInfo::Get( project );
1610  viewInfo.selectedRegion.setT0(0, false);
1611  if (!shift)
1612  viewInfo.selectedRegion.setT1(0);
1613 
1614  TP_ScrollWindow(0);
1615 }

References ViewInfo::Get(), ProjectWindowBase::mProject, and TP_ScrollWindow().

Referenced by ControlToolBar::OnRewind().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ScrollingLowerBoundTime()

double ProjectWindow::ScrollingLowerBoundTime ( ) const

Definition at line 923 of file ProjectWindow.cpp.

924 {
925  auto &project = mProject;
926  auto &tracks = TrackList::Get( project );
927  auto &viewInfo = ViewInfo::Get( project );
928  if (!MayScrollBeyondZero())
929  return 0;
930  const double screen = viewInfo.GetScreenEndTime() - viewInfo.h;
931  return std::min(tracks.GetStartTime(), -screen);
932 }

References ViewInfo::Get(), TrackList::Get(), MayScrollBeyondZero(), min(), and ProjectWindowBase::mProject.

Referenced by DoScroll(), FixScrollbars(), and PixelWidthBeforeTime().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ScrollIntoView() [1/2]

void ProjectWindow::ScrollIntoView ( double  pos)

Definition at line 786 of file ProjectWindow.cpp.

787 {
788  auto &trackPanel = GetProjectPanel( mProject );
789  auto &viewInfo = ViewInfo::Get( mProject );
790  auto w = viewInfo.GetTracksUsableWidth();
791 
792  int pixel = viewInfo.TimeToPosition(pos);
793  if (pixel < 0 || pixel >= w)
794  {
796  (viewInfo.OffsetTimeByPixels(pos, -(w / 2)));
797  trackPanel.Refresh(false);
798  }
799 }

References ViewInfo::Get(), GetProjectPanel(), ProjectWindowBase::mProject, and TP_ScrollWindow().

Referenced by LabelTrackView::KeyDown(), ScrollIntoView(), SkipEnd(), and ZoomInByFactor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ScrollIntoView() [2/2]

void ProjectWindow::ScrollIntoView ( int  x)

Definition at line 801 of file ProjectWindow.cpp.

802 {
803  auto &viewInfo = ViewInfo::Get( mProject );
804  ScrollIntoView(viewInfo.PositionToTime(x, viewInfo.GetLeftOffset()));
805 }

References ViewInfo::Get(), ProjectWindowBase::mProject, and ScrollIntoView().

Here is the call graph for this function:

◆ SetHorizontalThumb()

void ProjectWindow::SetHorizontalThumb ( double  scrollto)

Definition at line 946 of file ProjectWindow.cpp.

947 {
948  auto &project = mProject;
949  auto &viewInfo = ViewInfo::Get( project );
950  const auto unscaled = PixelWidthBeforeTime(scrollto);
951  const int max = mHsbar->GetRange() - mHsbar->GetThumbSize();
952  const int pos =
953  std::min(max,
954  std::max(0,
955  (int)(floor(0.5 + unscaled * viewInfo.sbarScale))));
956  mHsbar->SetThumbPosition(pos);
957  viewInfo.sbarH = floor(0.5 + unscaled - PixelWidthBeforeTime(0.0));
958  viewInfo.sbarH = std::max(viewInfo.sbarH,
959  - (wxInt64) PixelWidthBeforeTime(0.0));
960  viewInfo.sbarH = std::min(viewInfo.sbarH,
961  viewInfo.sbarTotal
962  - (wxInt64) PixelWidthBeforeTime(0.0) - viewInfo.sbarScreen);
963 }

References ViewInfo::Get(), mHsbar, min(), ProjectWindowBase::mProject, and PixelWidthBeforeTime().

Referenced by DoScroll(), and TP_ScrollWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetIsBeingDeleted()

void ProjectWindow::SetIsBeingDeleted ( )
inline

Definition at line 52 of file ProjectWindow.h.

52 { mIsDeleting = true; }

◆ SetNormalizedWindowState()

void ProjectWindow::SetNormalizedWindowState ( wxRect  pSizeAndLocation)
inline

Definition at line 92 of file ProjectWindow.h.

92 { mNormalizedWindowState = pSizeAndLocation; }

Referenced by OnMove(), and OnSize().

Here is the caller graph for this function:

◆ SkipEnd()

void ProjectWindow::SkipEnd ( bool  shift)

Definition at line 1626 of file ProjectWindow.cpp.

1627 {
1628  auto &project = mProject;
1629  auto &tracks = TrackList::Get( project );
1630  auto &viewInfo = ViewInfo::Get( project );
1631  double len = tracks.GetEndTime();
1632 
1633  viewInfo.selectedRegion.setT1(len, false);
1634  if (!shift)
1635  viewInfo.selectedRegion.setT0(len);
1636 
1637  // Make sure the end of the track is visible
1638  ScrollIntoView(len);
1639 }

References ViewInfo::Get(), TrackList::Get(), ProjectWindowBase::mProject, and ScrollIntoView().

Referenced by ControlToolBar::OnFF().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TP_HandleResize()

void ProjectWindow::TP_HandleResize ( )
overridevirtual

Implements TrackPanelListener.

Definition at line 1659 of file ProjectWindow.cpp.

1660 {
1661  HandleResize();
1662 }

References HandleResize().

Here is the call graph for this function:

◆ TP_RedrawScrollbars()

void ProjectWindow::TP_RedrawScrollbars ( )
overridevirtual

Implements TrackPanelListener.

Definition at line 1654 of file ProjectWindow.cpp.

1655 {
1656  FixScrollbars();
1657 }

References FixScrollbars().

Here is the call graph for this function:

◆ TP_ScrollLeft()

void ProjectWindow::TP_ScrollLeft ( )
overridevirtual

Implements TrackPanelListener.

Definition at line 1642 of file ProjectWindow.cpp.

1643 {
1644  OnScrollLeft();
1645 }

References OnScrollLeft().

Here is the call graph for this function:

◆ TP_ScrollRight()

void ProjectWindow::TP_ScrollRight ( )
overridevirtual

Implements TrackPanelListener.

Definition at line 1648 of file ProjectWindow.cpp.

1649 {
1650  OnScrollRight();
1651 }

References OnScrollRight().

Here is the call graph for this function:

◆ TP_ScrollUpDown()

bool ProjectWindow::TP_ScrollUpDown ( int  delta)
overridevirtual

Implements TrackPanelListener.

Definition at line 983 of file ProjectWindow.cpp.

984 {
985  int oldPos = mVsbar->GetThumbPosition();
986  int pos = oldPos + delta;
987  int max = mVsbar->GetRange() - mVsbar->GetThumbSize();
988 
989  // Can be negative in case of only one track
990  if (max < 0)
991  max = 0;
992 
993  if (pos > max)
994  pos = max;
995  else if (pos < 0)
996  pos = 0;
997 
998  if (pos != oldPos)
999  {
1000  mVsbar->SetThumbPosition(pos);
1001 
1002  DoScroll();
1003  return true;
1004  }
1005  else
1006  return false;
1007 }

References DoScroll(), and mVsbar.

Here is the call graph for this function:

◆ TP_ScrollWindow()

void ProjectWindow::TP_ScrollWindow ( double  scrollto)
overridevirtual

Implements TrackPanelListener.

Definition at line 969 of file ProjectWindow.cpp.

970 {
971  SetHorizontalThumb(scrollto);
972 
973  // Call our Scroll method which updates our ViewInfo variables
974  // to reflect the positions of the scrollbars
975  DoScroll();
976 }

References DoScroll(), and SetHorizontalThumb().

Referenced by LOFImportFileHandle::doDurationAndScrollOffset(), Rewind(), ScrollIntoView(), Zoom(), ZoomInByFactor(), and ZoomOutByFactor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateLayout()

void ProjectWindow::UpdateLayout ( )

Definition at line 1165 of file ProjectWindow.cpp.

1166 {
1167  auto &project = mProject;
1168  auto &trackPanel = GetProjectPanel( project );
1169  auto &toolManager = ToolManager::Get( project );
1170 
1171  // 1. Layout panel, to get widths of the docks.
1172  Layout();
1173  // 2. Layout toolbars to pack the toolbars correctly in docks which
1174  // are now the correct width.
1175  toolManager.LayoutToolBars();
1176  // 3. Layout panel, to resize docks, in particular reducing the height
1177  // of any empty docks, or increasing the height of docks that need it.
1178  Layout();
1179 
1180  // Bug 2455
1181  // The commented out code below is to calculate a nice minimum size for
1182  // the window. However on Ubuntu when the window is minimised it leads to
1183  // an insanely tall window.
1184  // Using a fixed min size fixes that.
1185  // However there is still something strange when minimised, as once
1186  // UpdateLayout is called once, when minimised, it gets called repeatedly.
1187 #if 0
1188  // Retrieve size of this projects window
1189  wxSize mainsz = GetSize();
1190 
1191  // Retrieve position of the track panel to use as the size of the top
1192  // third of the window
1193  wxPoint tppos = ClientToScreen(trackPanel.GetParent()->GetPosition());
1194 
1195  // Retrieve position of bottom dock to use as the size of the bottom
1196  // third of the window
1197  wxPoint sbpos = ClientToScreen(toolManager.GetBotDock()->GetPosition());
1198 
1199  // The "+ 50" is the minimum height of the TrackPanel
1200  SetMinSize( wxSize(250, (mainsz.y - sbpos.y) + tppos.y + 50));
1201 #endif
1202  SetMinSize( wxSize(250, 250));
1203  SetMaxSize( wxSize(20000, 20000));
1204 }

References ToolManager::Get(), GetProjectPanel(), and ProjectWindowBase::mProject.

Referenced by FixScrollbars(), and HandleResize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdatePrefs()

void ProjectWindow::UpdatePrefs ( )
overrideprivatevirtual

Implements PrefsListener.

Definition at line 749 of file ProjectWindow.cpp.

750 {
751  // Update status bar widths in case of language change
753 }

References UpdateStatusWidths().

Here is the call graph for this function:

◆ UpdateStatusWidths()

void ProjectWindow::UpdateStatusWidths ( )

Definition at line 1231 of file ProjectWindow.cpp.

1232 {
1233  enum { nWidths = nStatusBarFields + 1 };
1234  int widths[ nWidths ]{ 0 };
1235  widths[ rateStatusBarField ] = 150;
1236  const auto statusBar = GetStatusBar();
1237  const auto &functions = ProjectStatus::GetStatusWidthFunctions();
1238  // Start from 1 not 0
1239  // Specifying a first column always of width 0 was needed for reasons
1240  // I forget now
1241  for ( int ii = 1; ii <= nStatusBarFields; ++ii ) {
1242  int &width = widths[ ii ];
1243  for ( const auto &function : functions ) {
1244  auto results =
1245  function( mProject, static_cast< StatusBarField >( ii ) );
1246  for ( const auto &string : results.first ) {
1247  int w;
1248  statusBar->GetTextExtent(string.Translation(), &w, nullptr);
1249  width = std::max<int>( width, w + results.second );
1250  }
1251  }
1252  }
1253  // The main status field is not fixed width
1254  widths[ mainStatusBarField ] = -1;
1255  statusBar->SetStatusWidths( nWidths, widths );
1256 }

References ProjectStatus::GetStatusWidthFunctions(), mainStatusBarField, ProjectWindowBase::mProject, nStatusBarFields, and rateStatusBarField.

Referenced by InitProjectWindow(), and UpdatePrefs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Zoom()

void ProjectWindow::Zoom ( double  level)

Definition at line 1571 of file ProjectWindow.cpp.

1572 {
1573  auto &project = mProject;
1574  auto &viewInfo = ViewInfo::Get( project );
1575  viewInfo.SetZoom(level);
1576  FixScrollbars();
1577  // See if we can center the selection on screen, and have it actually fit.
1578  // tOnLeft is the amount of time we would need before the selection left edge to center it.
1579  float t0 = viewInfo.selectedRegion.t0();
1580  float t1 = viewInfo.selectedRegion.t1();
1581  float tAvailable = viewInfo.GetScreenEndTime() - viewInfo.h;
1582  float tOnLeft = (tAvailable - t0 + t1)/2.0;
1583  // Bug 1292 (Enh) is effectively a request to do this scrolling of the selection into view.
1584  // If tOnLeft is positive, then we have room for the selection, so scroll to it.
1585  if( tOnLeft >=0 )
1586  TP_ScrollWindow( t0-tOnLeft);
1587 }

References FixScrollbars(), ViewInfo::Get(), ProjectWindowBase::mProject, and TP_ScrollWindow().

Here is the call graph for this function:

◆ ZoomAfterImport()

void ProjectWindow::ZoomAfterImport ( Track pTrack)

Definition at line 1551 of file ProjectWindow.cpp.

1552 {
1553  auto &project = mProject;
1554  auto &tracks = TrackList::Get( project );
1555  auto &trackPanel = GetProjectPanel( project );
1556 
1557  DoZoomFit();
1558 
1559  trackPanel.SetFocus();
1560  if (!pTrack)
1561  pTrack = *tracks.Selected().begin();
1562  if (!pTrack)
1563  pTrack = *tracks.Any().begin();
1564  if (pTrack) {
1565  TrackFocus::Get(project).Set(pTrack);
1566  pTrack->EnsureVisible();
1567  }
1568 }

References Track::Any(), DoZoomFit(), Track::EnsureVisible(), TrackFocus::Get(), TrackList::Get(), GetProjectPanel(), and ProjectWindowBase::mProject.

Referenced by DoImportMIDI(), ApplyMacroDialog::OnApplyToFiles(), and ProjectFileManager::OpenFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ZoomBy()

void ProjectWindow::ZoomBy ( double  multiplier)

Definition at line 1590 of file ProjectWindow.cpp.

1591 {
1592  auto &project = mProject;
1593  auto &viewInfo = ViewInfo::Get( project );
1594  viewInfo.ZoomBy(multiplier);
1595  FixScrollbars();
1596 }

References FixScrollbars(), ViewInfo::Get(), and ProjectWindowBase::mProject.

Referenced by LOFImportFileHandle::doDurationAndScrollOffset(), ZoomInByFactor(), and ZoomOutByFactor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ZoomInByFactor()

void ProjectWindow::ZoomInByFactor ( double  ZoomFactor)

Definition at line 1726 of file ProjectWindow.cpp.

1727 {
1728  auto &project = mProject;
1729  auto &viewInfo = ViewInfo::Get( project );
1730 
1731  auto gAudioIO = AudioIO::Get();
1732  // LLL: Handling positioning differently when audio is
1733  // actively playing. Don't do this if paused.
1734  if (gAudioIO->IsStreamActive(
1735  ProjectAudioIO::Get( project ).GetAudioIOToken()) &&
1736  !gAudioIO->IsPaused()){
1737  ZoomBy(ZoomFactor);
1738  ScrollIntoView(gAudioIO->GetStreamTime());
1739  return;
1740  }
1741 
1742  // DMM: Here's my attempt to get logical zooming behavior
1743  // when there's a selection that's currently at least
1744  // partially on-screen
1745 
1746  const double endTime = viewInfo.GetScreenEndTime();
1747  const double duration = endTime - viewInfo.h;
1748 
1749  bool selectionIsOnscreen =
1750  (viewInfo.selectedRegion.t0() < endTime) &&
1751  (viewInfo.selectedRegion.t1() >= viewInfo.h);
1752 
1753  bool selectionFillsScreen =
1754  (viewInfo.selectedRegion.t0() < viewInfo.h) &&
1755  (viewInfo.selectedRegion.t1() > endTime);
1756 
1757  if (selectionIsOnscreen && !selectionFillsScreen) {
1758  // Start with the center of the selection
1759  double selCenter = (viewInfo.selectedRegion.t0() +
1760  viewInfo.selectedRegion.t1()) / 2;
1761 
1762  // If the selection center is off-screen, pick the
1763  // center of the part that is on-screen.
1764  if (selCenter < viewInfo.h)
1765  selCenter = viewInfo.h +
1766  (viewInfo.selectedRegion.t1() - viewInfo.h) / 2;
1767  if (selCenter > endTime)
1768  selCenter = endTime -
1769  (endTime - viewInfo.selectedRegion.t0()) / 2;
1770 
1771  // Zoom in
1772  ZoomBy(ZoomFactor);
1773  const double newDuration =
1774  viewInfo.GetScreenEndTime() - viewInfo.h;
1775 
1776  // Recenter on selCenter
1777  TP_ScrollWindow(selCenter - newDuration / 2);
1778  return;
1779  }
1780 
1781 
1782  double origLeft = viewInfo.h;
1783  double origWidth = duration;
1784  ZoomBy(ZoomFactor);
1785 
1786  const double newDuration =
1787  viewInfo.GetScreenEndTime() - viewInfo.h;
1788  double newh = origLeft + (origWidth - newDuration) / 2;
1789 
1790  // MM: Commented this out because it was confusing users
1791  /*
1792  // make sure that the *right-hand* end of the selection is
1793  // no further *left* than 1/3 of the way across the screen
1794  if (viewInfo.selectedRegion.t1() < newh + viewInfo.screen / 3)
1795  newh = viewInfo.selectedRegion.t1() - viewInfo.screen / 3;
1796 
1797  // make sure that the *left-hand* end of the selection is
1798  // no further *right* than 2/3 of the way across the screen
1799  if (viewInfo.selectedRegion.t0() > newh + viewInfo.screen * 2 / 3)
1800  newh = viewInfo.selectedRegion.t0() - viewInfo.screen * 2 / 3;
1801  */
1802 
1803  TP_ScrollWindow(newh);
1804 }

References AudioIO::Get(), ViewInfo::Get(), ProjectAudioIO::Get(), ProjectAudioIO::GetAudioIOToken(), ProjectWindowBase::mProject, ScrollIntoView(), TP_ScrollWindow(), and ZoomBy().

Here is the call graph for this function:

◆ ZoomOutByFactor()

void ProjectWindow::ZoomOutByFactor ( double  ZoomFactor)

Definition at line 1806 of file ProjectWindow.cpp.

1807 {
1808  auto &project = mProject;
1809  auto &viewInfo = ViewInfo::Get( project );
1810 
1811  //Zoom() may change these, so record original values:
1812  const double origLeft = viewInfo.h;
1813  const double origWidth = viewInfo.GetScreenEndTime() - origLeft;
1814 
1815  ZoomBy(ZoomFactor);
1816  const double newWidth = viewInfo.GetScreenEndTime() - viewInfo.h;
1817 
1818  const double newh = origLeft + (origWidth - newWidth) / 2;
1819  // newh = (newh > 0) ? newh : 0;
1820  TP_ScrollWindow(newh);
1821 }

References ViewInfo::Get(), ProjectWindowBase::mProject, TP_ScrollWindow(), and ZoomBy().

Here is the call graph for this function:

Member Data Documentation

◆ mActive

bool ProjectWindow::mActive { true }
private

Definition at line 190 of file ProjectWindow.h.

Referenced by IsActive(), and OnActivate().

◆ mAutoScrolling

bool ProjectWindow::mAutoScrolling { false }
private

Definition at line 189 of file ProjectWindow.h.

Referenced by DoScroll(), and FinishAutoScroll().

◆ mbInitializingScrollbar

bool ProjectWindow::mbInitializingScrollbar { false }

Definition at line 176 of file ProjectWindow.h.

Referenced by FixScrollbars().

◆ mHsbar

wxScrollBar* ProjectWindow::mHsbar {}
private

◆ mIconized

bool ProjectWindow::mIconized { false }
private

Definition at line 191 of file ProjectWindow.h.

Referenced by IsIconized(), and OnIconize().

◆ mIsDeleting

bool ProjectWindow::mIsDeleting { false }
private

Definition at line 196 of file ProjectWindow.h.

Referenced by HandleResize().

◆ mMainPage

wxWindow* ProjectWindow::mMainPage {}
private

Definition at line 182 of file ProjectWindow.h.

◆ mMainPanel

wxPanel* ProjectWindow::mMainPanel {}
private

Definition at line 183 of file ProjectWindow.h.

◆ mNextWindowID

int ProjectWindow::mNextWindowID {}
private

Definition at line 187 of file ProjectWindow.h.

Referenced by NextWindowID().

◆ mNormalizedWindowState

wxRect ProjectWindow::mNormalizedWindowState
private

Definition at line 179 of file ProjectWindow.h.

◆ mPlaybackScroller

std::unique_ptr<PlaybackScroller> ProjectWindow::mPlaybackScroller
private

Definition at line 200 of file ProjectWindow.h.

Referenced by MayScrollBeyondZero().

◆ mShownOnce

bool ProjectWindow::mShownOnce { false }
private

Definition at line 192 of file ProjectWindow.h.

Referenced by OnShow(), and OnSize().

◆ mTopPanel

wxPanel* ProjectWindow::mTopPanel {}
private

Definition at line 181 of file ProjectWindow.h.

◆ mVsbar

wxScrollBar* ProjectWindow::mVsbar {}
private

Definition at line 185 of file ProjectWindow.h.

Referenced by DoScroll(), FixScrollbars(), and TP_ScrollUpDown().


The documentation for this class was generated from the following files:
size
size_t size
Definition: ffmpeg-2.3.6-single-header.h:412
VSBarID
@ VSBarID
Definition: ProjectWindow.cpp:568
ProjectWindow::DoScroll
void DoScroll()
Definition: ProjectWindow.cpp:1439
ViewInfo::Get
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:241
AllProjects::begin
const_iterator begin() const
Definition: Project.cpp:24
ProjectAudioIO::GetAudioIOToken
int GetAudioIOToken() const
Definition: ProjectAudioIO.cpp:41
Scrubber::Get
static Scrubber & Get(AudacityProject &project)
Definition: Scrubbing.cpp:201
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:69
ProjectWindow::mIconized
bool mIconized
Definition: ProjectWindow.h:191
ToolBarCount
@ ToolBarCount
Definition: ToolBar.h:87
ProjectWindow::UpdateLayout
void UpdateLayout()
Definition: ProjectWindow.cpp:1165
ProjectWindow::IsBeingDeleted
bool IsBeingDeleted() const
Definition: ProjectWindow.h:51
ToolFrame
class ToolFrame
Definition: ToolManager.h:166
ProjectWindow::FixScrollbars
void FixScrollbars()
Definition: ProjectWindow.cpp:1009
ClientData::Site::Find
Subclass * Find(const RegisteredFactory &key)
Get a (bare) pointer to an attachment, or null, down-cast it to Subclass *; will not create on demand...
Definition: ClientData.h:333
Track::EnsureVisible
void EnsureVisible(bool modifyState=false)
Definition: Track.cpp:100
wxPanelWrapper
Definition: wxPanelWrapper.h:41
ClientData::Site::Get
Subclass & Get(const RegisteredFactory &key)
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass.
Definition: ClientData.h:309
AllProjects::end
const_iterator end() const
Definition: Project.cpp:29
ProjectWindow::TP_ScrollWindow
void TP_ScrollWindow(double scrollto) override
Definition: ProjectWindow.cpp:969
StatusBarField
StatusBarField
Definition: ProjectStatus.h:24
ToolManager::Get
static ToolManager & Get(AudacityProject &project)
Definition: ToolManager.cpp:356
ProjectWindow::mHsbar
wxScrollBar * mHsbar
Definition: ProjectWindow.h:184
ProjectWindow::OnShow
void OnShow(wxShowEvent &event)
Definition: ProjectWindow.cpp:1354
ProjectWindow::mMainPanel
wxPanel * mMainPanel
Definition: ProjectWindow.h:183
anonymous_namespace{ProjectWindow.cpp}::sProjectWindowKey
AttachedWindows::RegisteredFactory sProjectWindowKey
Definition: ProjectWindow.cpp:502
ProjectWindow::mbInitializingScrollbar
bool mbInitializingScrollbar
Definition: ProjectWindow.h:176
for
for(int ii=0, nn=names.size();ii< nn;++ii)
Definition: SpectrumVZoomHandle.cpp:276
ProjectWindow::mMainPage
wxWindow * mMainPage
Definition: ProjectWindow.h:182
sbarHjump
const int sbarHjump
Definition: ProjectWindow.cpp:781
ProjectStatus::GetStatusWidthFunctions
static const StatusWidthFunctions & GetStatusWidthFunctions()
Definition: ProjectStatus.cpp:67
Track::Any
bool Any() const
Definition: Track.cpp:370
ProjectWindow::PixelWidthBeforeTime
double PixelWidthBeforeTime(double scrollto) const
Definition: ProjectWindow.cpp:936
ProjectWindow::Get
static ProjectWindow & Get(AudacityProject &project)
Definition: ProjectWindow.cpp:535
ToolBar::ReCreateButtons
virtual void ReCreateButtons()
Definition: ToolBar.cpp:516
BasicUI::CallAfter
void CallAfter(Action action)
Schedule an action to be done later, and in the main thread.
Definition: BasicUI.cpp:38
ProjectWindowBase::mProject
AudacityProject & mProject
Definition: ProjectWindowBase.h:33
ProjectWindow::OnScrollRight
void OnScrollRight()
Definition: ProjectWindow.cpp:834
ProjectAudioIO::Get
static ProjectAudioIO & Get(AudacityProject &project)
Definition: ProjectAudioIO.cpp:22
ProjectWindow::ZoomBy
void ZoomBy(double multiplier)
Definition: ProjectWindow.cpp:1590
ProjectAudioIO::IsAudioActive
bool IsAudioActive() const
Definition: ProjectAudioIO.cpp:51
ProjectWindow::MacShowUndockedToolbars
void MacShowUndockedToolbars(bool show)
Definition: ProjectWindow.cpp:1258
ProjectWindowBase::GetProject
AudacityProject & GetProject()
Definition: ProjectWindowBase.h:29
ProjectWindow::ScrollIntoView
void ScrollIntoView(double pos)
Definition: ProjectWindow.cpp:786
ProjectWindow::ApplyUpdatedTheme
void ApplyUpdatedTheme()
Definition: ProjectWindow.cpp:703
ProjectWindow::mIsDeleting
bool mIsDeleting
Definition: ProjectWindow.h:196
mainStatusBarField
@ mainStatusBarField
Definition: ProjectStatus.h:26
NextID
@ NextID
Definition: ProjectWindow.cpp:570
MenuManager::UpdateMenus
void UpdateMenus(bool checkActive=true)
Definition: Menus.cpp:635
ProjectWindow::HandleResize
void HandleResize()
Definition: ProjectWindow.cpp:1206
ProjectWindow::SetHorizontalThumb
void SetHorizontalThumb(double scrollto)
Definition: ProjectWindow.cpp:946
ProjectWindow
A top-level window associated with a project, and handling scrollbars and zooming.
Definition: ProjectWindow.h:32
GetAttachedWindows
AUDACITY_DLL_API AttachedWindows & GetAttachedWindows(AudacityProject &project)
Definition: ProjectWindows.cpp:114
ProjectWindow::PlaybackScroller::Mode::Right
@ Right
TrackView::GetTotalHeight
static int GetTotalHeight(const TrackList &list)
Definition: TrackView.cpp:47
rateStatusBarField
@ rateStatusBarField
Definition: ProjectStatus.h:27
ProjectWindowBase
A top-level window associated with a project.
Definition: ProjectWindowBase.h:20
HSBarID
@ HSBarID
Definition: ProjectWindow.cpp:567
TrackFocus::Get
Track * Get()
Definition: TrackPanelAx.cpp:755
WindowAccessible
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
ProjectWindow::mTopPanel
wxPanel * mTopPanel
Definition: ProjectWindow.h:181
ProjectWindow::mVsbar
wxScrollBar * mVsbar
Definition: ProjectWindow.h:185
ProjectWindow::OnUndoRedo
void OnUndoRedo(wxCommandEvent &)
Definition: ProjectWindow.cpp:1407
ProjectWindow::DoZoomFit
void DoZoomFit()
Definition: ProjectWindow.cpp:1843
ProjectWindow::PlaybackScroller::Mode::Pinned
@ Pinned
theTheme
THEME_API Theme theTheme
Definition: Theme.cpp:79
id
int id
Definition: WaveTrackControls.cpp:577
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
ProjectWindow::UpdateStatusWidths
void UpdateStatusWidths()
Definition: ProjectWindow.cpp:1231
ProjectWindow::ScrollingLowerBoundTime
double ScrollingLowerBoundTime() const
Definition: ProjectWindow.cpp:923
ProjectWindow::SetNormalizedWindowState
void SetNormalizedWindowState(wxRect pSizeAndLocation)
Definition: ProjectWindow.h:92
ProjectWindow::IsIconized
bool IsIconized() const override
Definition: ProjectWindow.cpp:1226
ProjectWindow::FinishAutoScroll
void FinishAutoScroll()
Definition: ProjectWindow.cpp:755
TrackList::Get
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:506
ProjectWindow::OnUndoReset
void OnUndoReset(wxCommandEvent &)
Definition: ProjectWindow.cpp:1414
ProjectWindow::OnThemeChange
void OnThemeChange(wxCommandEvent &evt)
Definition: ProjectWindow.cpp:735
Track
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:239
_
#define _(s)
Definition: Internat.h:75
ProjectWindow::OnScrollLeft
void OnScrollLeft()
Definition: ProjectWindow.cpp:811
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
ProjectWindow::mNextWindowID
int mNextWindowID
Definition: ProjectWindow.h:187
SetActiveProject
void SetActiveProject(AudacityProject *project)
Definition: ActiveProject.cpp:29
ProjectWindow::MayScrollBeyondZero
bool MayScrollBeyondZero() const
Definition: ProjectWindow.cpp:902
ProjectWindow::mShownOnce
bool mShownOnce
Definition: ProjectWindow.h:192
GetProjectFrame
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
Definition: ProjectWindows.cpp:72
ProjectWindow::Find
static ProjectWindow * Find(AudacityProject *pProject)
Definition: ProjectWindow.cpp:545
MenuManager::Get
static MenuManager & Get(AudacityProject &project)
Definition: Menus.cpp:70
AllProjects
Definition: Project.h:35
ToolBar
Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed.
Definition: ToolBar.h:98
ProjectWindow::mNormalizedWindowState
wxRect mNormalizedWindowState
Definition: ProjectWindow.h:179
ProjectWindow::mActive
bool mActive
Definition: ProjectWindow.h:190
ThemeBase::Colour
wxColour & Colour(int iIndex)
Definition: Theme.cpp:1189
ProjectWindow::RedrawProject
void RedrawProject(const bool bForceWaveTracks=false)
Definition: ProjectWindow.cpp:710
GetProjectPanel
AUDACITY_DLL_API wxWindow & GetProjectPanel(AudacityProject &project)
Get the main sub-window of the project frame that displays track data.
Definition: ProjectWindows.cpp:49
CommandManager::Get
static CommandManager & Get(AudacityProject &project)
Definition: CommandManager.cpp:207
AudioIO::Get
static AudioIO * Get()
Definition: AudioIO.cpp:141
ProjectWindow::OnUndoPushedModified
void OnUndoPushedModified(wxCommandEvent &)
Definition: ProjectWindow.cpp:1401
safenew
#define safenew
Definition: MemoryX.h:10
MenuManager::GetUpdateFlags
CommandFlag GetUpdateFlags(bool checkActive=false) const
Definition: Menus.cpp:545
AllProjects::value_type
Container::value_type value_type
Definition: Project.h:56
nStatusBarFields
@ nStatusBarFields
Definition: ProjectStatus.h:29
ProjectWindow::mAutoScrolling
bool mAutoScrolling
Definition: ProjectWindow.h:189
ProjectWindow::mPlaybackScroller
std::unique_ptr< PlaybackScroller > mPlaybackScroller
Definition: ProjectWindow.h:200