42#include <wx/display.h>
43#include <wx/scrolbar.h>
45#include <wx/splitter.h>
46#include <wx/wupdlock.h>
52#ifdef HAS_AUDIOCOM_UPLOAD
73 unsigned int n = wxDisplay::GetCount();
74 for(
unsigned int i = 0;i<n;i++){
76 wxRect scr = d.GetClientArea();
77 if( scr.Contains( r ) )
88 if( wxDisplay::GetFromPoint( r.GetTopLeft() ) == wxNOT_FOUND)
return false;
89 if( wxDisplay::GetFromPoint( r.GetBottomRight() ) == wxNOT_FOUND)
return false;
97 wxRect targetTitleRect(requestedRect->GetLeftTop(), requestedRect->GetBottomRight());
100 targetTitleRect.x += 15;
101 targetTitleRect.width -= 100;
102 if (targetTitleRect.width < 165) targetTitleRect.width = 165;
103 targetTitleRect.height = 15;
104 int targetBottom = targetTitleRect.GetBottom();
105 int targetRight = targetTitleRect.GetRight();
108 for (
int i = targetTitleRect.GetLeft(); i < targetRight; i++) {
109 for (
int j = targetTitleRect.GetTop(); j < targetBottom; j++) {
110 int monitor = display.GetFromPoint(wxPoint(i, j));
122 *defRect = wxGetClientDisplayRect();
143 if (width < defRect->width)
145 defRect->x = (defRect->width - width)/2;
146 defRect->width = width;
149 if (height < defRect->height)
151 defRect->y = (defRect->height - height)/2;
156 const int pixelsFormenu = 60;
157 if( defRect->y < pixelsFormenu )
159 defRect->height = height;
191 if (normalRect.width == 0 || normalRect.height == 0) {
192 normalRect = defaultRect;
194 if (windowRect.width == 0 || windowRect.height == 0) {
195 windowRect = defaultRect;
199 wxRect screenRect( wxGetClientDisplayRect());
200#if defined(__WXMAC__)
204 if (normalRect.y < screenRect.y) {
205 normalRect = defaultRect;
207 if (windowRect.y < screenRect.y) {
208 windowRect = defaultRect;
215 if (*pMaximized || *pIconized) {
216 *nextRect = normalRect;
219 *nextRect = windowRect;
223 *nextRect = defaultRect;
226 *nextRect = defaultRect;
244 normalRect = defaultRect;
247 windowRect = defaultRect;
250 bool validWindowSize =
false;
255 auto pProject = *iter;
257 validWindowSize =
true;
262 if (validWindowSize) {
263 *nextRect = validProject->GetRect();
264 *pMaximized = validProject->IsMaximized();
268 *nextRect = defaultRect;
272 *nextRect = normalRect;
289 const int edgeSlop = 10;
293 wxPoint p = nextRect->GetLeftTop();
294 int scr = std::max( 0, wxDisplay::GetFromPoint( p ));
296 screenRect = d.GetClientArea();
300 wxPoint bottomRight = nextRect->GetBottomRight();
301 if (bottomRight.x > (screenRect.GetRight()+edgeSlop)) {
302 int newWidth = screenRect.GetWidth() - nextRect->GetLeft();
303 if (newWidth < defaultRect.GetWidth()) {
304 nextRect->x = windowRect.x;
305 nextRect->y = windowRect.y;
306 nextRect->width = windowRect.width;
309 nextRect->width = newWidth;
314 bottomRight = nextRect->GetBottomRight();
315 if (bottomRight.y > (screenRect.GetBottom()+edgeSlop)) {
317 bottomRight = nextRect->GetBottomRight();
318 if (bottomRight.y > (screenRect.GetBottom()+edgeSlop)) {
319 nextRect->SetBottom(screenRect.GetBottom());
327 *nextRect = defaultRect;
340 : wxScrollBar(parent,
id, wxDefaultPosition, wxDefaultSize, style)
346 wxWindow *w = e.GetWindow();
352 void SetScrollbar(
int position,
int thumbSize,
353 int range,
int pageSize,
354 bool refresh =
true)
override;
357 DECLARE_EVENT_TABLE()
360void ScrollBar::SetScrollbar(
int position,
int thumbSize,
361 int range,
int pageSize,
370 position != GetThumbPosition() ||
371 thumbSize != GetThumbSize() ||
372 range != GetRange() ||
373 pageSize != GetPageSize();
377 wxScrollBar::SetScrollbar(position, thumbSize, range, pageSize, refresh);
381 EVT_SET_FOCUS(ScrollBar::OnSetFocus)
389[mVertScrollRemainder = 0.0](
401 const wxMouseEvent &
event = evt.event;
405 const auto steps = evt.steps;
407 if (event.ShiftDown()
414 window.TP_ScrollWindow(
415 viewInfo.OffsetTimeByPixels(
416 viewInfo.PositionToTime(0), 50.0 * -steps));
418 else if (event.CmdDown())
425 double ZoomFactor = pow(2.0, steps);
430 p->ZoomInByFactor( ZoomFactor );
432 p->ZoomOutByFactor( ZoomFactor );
437 int trackLeftEdge = viewInfo.GetLeftOffset();
442 double mouse_h = viewInfo.PositionToTime(event.m_x, trackLeftEdge);
446 center_h = viewInfo.h +
447 (viewInfo.GetScreenEndTime() - viewInfo.h) / 2.0;
449 else if( steps <= 0 )
452 else if((viewInfo.selectedRegion.t1() - viewInfo.selectedRegion.t0() ) < 0.00001 )
455 else if( mouse_h < viewInfo.selectedRegion.t0() )
456 center_h = viewInfo.selectedRegion.t0();
458 else if( mouse_h > viewInfo.selectedRegion.t1() )
459 center_h = viewInfo.selectedRegion.t1();
464 xx = viewInfo.TimeToPosition(center_h, trackLeftEdge);
477 if (center_h > audioEndTime)
479 center_h = audioEndTime;
483 wxCoord xTrackEnd = viewInfo.TimeToPosition( audioEndTime );
484 viewInfo.ZoomBy(pow(2.0, steps));
486 double new_center_h = viewInfo.PositionToTime(xx, trackLeftEdge);
487 viewInfo.h += (center_h - new_center_h);
491 if( viewInfo.h > audioEndTime )
492 viewInfo.h += audioEndTime - viewInfo.PositionToTime( xTrackEnd );
499#ifdef EXPERIMENTAL_SCRUBBING_SCROLL_WHEEL
502 evt.event.Skip(
false);
508 double lines = steps * 4 + mVertScrollRemainder;
509 mVertScrollRemainder = lines - floor(lines);
510 lines = floor(lines);
511 auto didSomething = window.TP_ScrollUpDown((
int)-lines);
523 bool bMaximized =
false;
524 bool bIconized =
false;
530 wxSize(wndRect.width, wndRect.height),
534 auto &window = *pWindow;
537 window.SetPosition(wndRect.GetPosition());
540 window.Maximize(
true);
542 else if (bIconized) {
577 auto& project = context.
project;
606 constexpr auto EffectsPanelMaxWidth { 500 };
607 constexpr auto TrackPanelMinWidth { 250 };
620 this, wxID_ANY, wxDefaultPosition,
621 wxSize{ this->GetSize().GetWidth(), -1 }
624 mTopPanel->SetLayoutDirection(wxLayout_LeftToRight);
626#ifdef EXPERIMENTAL_DA2
630 auto container =
safenew wxSplitterWindow(
this, wxID_ANY,
633 wxNO_BORDER | wxSP_LIVE_UPDATE | wxSP_THIN_SASH);
634 container->Bind(wxEVT_SPLITTER_DOUBLECLICKED, [](wxSplitterEvent& event){
638 container->Bind(wxEVT_SPLITTER_SASH_POS_CHANGING, [=](wxSplitterEvent& event){
639 if(event.GetSashPosition() > EffectsPanelMaxWidth)
641 event.SetSashPosition(-1);
656#ifdef EXPERIMENTAL_DA2
673#if wxUSE_ACCESSIBILITY
678 mHsbar->SetLayoutDirection(wxLayout_LeftToRight);
679 mHsbar->SetName(
_(
"Horizontal Scrollbar"));
680 mVsbar->SetName(
_(
"Vertical Scrollbar"));
684 switch (message.
type) {
685 case UndoRedoMessage::Pushed:
686 case UndoRedoMessage::Modified:
687 return OnUndoPushedModified();
688 case UndoRedoMessage::UndoOrRedo:
690 case UndoRedoMessage::Reset:
691 return OnUndoReset();
735 auto pThis = wxWeakRef<ProjectWindow>(
this);
740 if (pThis->IsBeingDeleted())
743 auto pProject = pThis->FindProject();
747 auto &project = *pProject;
750 pThis->FixScrollbars();
751 if (bForceWaveTracks)
753 for (
auto pWaveTrack : tracks.Any<
WaveTrack >() )
754 for (
const auto &clip: pWaveTrack->GetClips())
757 trackPanel.Refresh(
false);
767 auto &project = *pProject;
773 toolManager.ForEach([](
auto pToolBar){
775 pToolBar->ReCreateButtons();
797#if defined(__WXMAC__)
802#elif defined(__WXMSW__)
803const int sbarSpaceWidth = 16;
804const int sbarControlWidth = 16;
805const int sbarExtraLen = 0;
808const int sbarSpaceWidth = 15;
809const int sbarControlWidth = 15;
810const int sbarExtraLen = 0;
821 auto &project = *pProject;
824 auto w = viewInfo.GetTracksUsableWidth();
826 int pixel = viewInfo.TimeToPosition(pos);
827 if (pixel < 0 || pixel >= w)
830 (viewInfo.OffsetTimeByPixels(pos, -(w / 2)));
831 trackPanel.Refresh(
false);
840 auto &project = *pProject;
842 ScrollIntoView(viewInfo.PositionToTime(x, viewInfo.GetLeftOffset()));
854 auto &project = *pProject;
856 wxInt64 pos =
mHsbar->GetThumbPosition();
858 pos -= wxMax((wxInt64)(
sbarHjump * viewInfo.sbarScale), 1);
861 viewInfo.sbarH = std::max(viewInfo.sbarH,
865 if (pos !=
mHsbar->GetThumbPosition()) {
866 mHsbar->SetThumbPosition((
int)pos);
880 auto &project = *pProject;
882 wxInt64 pos =
mHsbar->GetThumbPosition();
885 pos += wxMax((wxInt64)(
sbarHjump * viewInfo.sbarScale), 1);
886 wxInt64 max =
mHsbar->GetRange() -
mHsbar->GetThumbSize();
887 pos = wxMin(pos, max);
889 viewInfo.sbarH =
std::min(viewInfo.sbarH,
893 if (pos !=
mHsbar->GetThumbPosition()) {
894 mHsbar->SetThumbPosition((
int)pos);
908 auto &project = *pProject;
910 wxInt64 pos =
mHsbar->GetThumbPosition();
912 pos -= wxMax((wxInt64)(
sbarHjump * viewInfo.sbarScale), 1);
915 viewInfo.sbarH = std::max(viewInfo.sbarH,
918 if (pos !=
mHsbar->GetThumbPosition()) {
919 mHsbar->SetThumbPosition((
int)pos);
932 auto &project = *pProject;
934 wxInt64 pos =
mHsbar->GetThumbPosition();
937 pos += wxMax((wxInt64)(
sbarHjump * viewInfo.sbarScale), 1);
938 wxInt64 max =
mHsbar->GetRange() -
mHsbar->GetThumbSize();
939 pos = wxMin(pos, max);
941 viewInfo.sbarH =
std::min(viewInfo.sbarH,
945 if (pos !=
mHsbar->GetThumbPosition()) {
946 mHsbar->SetThumbPosition((
int)pos);
957 auto &project = *pProject;
960 if (viewInfo.bScrollBeyondZero)
963 if (scrubber.HasMark() ||
981 auto &project = *pProject;
986 const double screen = viewInfo.GetScreenEndTime() - viewInfo.h;
987 return std::min(tracks.GetStartTime(), -screen);
997 auto &project = *pProject;
1002 viewInfo.TimeRangeToPixelWidth(scrollto - lowerBound);
1010 auto &project = *pProject;
1013 const int max =
mHsbar->GetRange() -
mHsbar->GetThumbSize();
1017 (
int)(floor(0.5 + unscaled * viewInfo.sbarScale))));
1018 mHsbar->SetThumbPosition(pos);
1020 viewInfo.sbarH = std::max(viewInfo.sbarH,
1022 viewInfo.sbarH =
std::min(viewInfo.sbarH,
1047 int oldPos =
mVsbar->GetThumbPosition();
1048 int pos = oldPos + delta;
1062 mVsbar->SetThumbPosition(pos);
1076 auto &project = *pProject;
1081 bool refresh =
false;
1082 bool rescroll =
false;
1086 auto panelWidth = viewInfo.GetTracksUsableWidth();
1087 auto panelHeight = viewInfo.GetHeight();
1096 if (panelWidth < 0) {
1099 if (panelHeight < 0) {
1103 auto LastTime = std::numeric_limits<double>::lowest();
1104 for (
const Track *track : tracks) {
1106 track = track->SubstitutePendingChangedTrack().get();
1107 LastTime = std::max( LastTime, track->GetEndTime() );
1110 std::max(LastTime, viewInfo.selectedRegion.t1());
1112 const double screen =
1113 viewInfo.GetScreenEndTime() - viewInfo.h;
1114 const double halfScreen = screen / 2.0;
1124 ? -lowerBound + std::max(halfScreen, screen - LastTime)
1127 viewInfo.total = LastTime + additional;
1130 viewInfo.total = std::max(viewInfo.total, viewInfo.h + screen);
1132 if (viewInfo.h < lowerBound) {
1133 viewInfo.h = lowerBound;
1137 viewInfo.sbarTotal = (wxInt64) (viewInfo.GetTotalWidth());
1138 viewInfo.sbarScreen = (wxInt64)(panelWidth);
1139 viewInfo.sbarH = (wxInt64) (viewInfo.GetBeforeScreenWidth());
1148 viewInfo.vpos =
mVsbar->GetThumbPosition() * viewInfo.scrollStep;
1152 if (viewInfo.vpos >= totalHeight)
1153 viewInfo.vpos = totalHeight - 1;
1154 if (viewInfo.vpos < 0)
1160 (viewInfo.GetScreenEndTime() - viewInfo.h) < viewInfo.total;
1161 bool newvstate = panelHeight < totalHeight;
1164 oldhstate =
mHsbar->IsShown();
1165 oldvstate =
mVsbar->IsShown();
1167 mVsbar->Show(panelHeight < totalHeight);
1169 oldhstate =
mHsbar->IsEnabled();
1170 oldvstate =
mVsbar->IsEnabled();
1171 mHsbar->Enable(newhstate);
1172 mVsbar->Enable(panelHeight < totalHeight);
1175 if (panelHeight >= totalHeight && viewInfo.vpos != 0) {
1181 if (!newhstate && viewInfo.sbarH != 0) {
1195 wxInt64 maxScrollbarRange = (wxInt64)(2147483647 * 0.999);
1196 if (viewInfo.sbarTotal > maxScrollbarRange)
1197 viewInfo.sbarScale = ((double)maxScrollbarRange) / viewInfo.sbarTotal;
1199 viewInfo.sbarScale = 1.0;
1202 int scaledSbarH = (int)(viewInfo.sbarH * viewInfo.sbarScale);
1203 int scaledSbarScreen = (int)(viewInfo.sbarScreen * viewInfo.sbarScale);
1204 int scaledSbarTotal = (int)(viewInfo.sbarTotal * viewInfo.sbarScale);
1208 mHsbar->SetScrollbar(scaledSbarH + offset, scaledSbarScreen, scaledSbarTotal,
1209 scaledSbarScreen, TRUE);
1213 mVsbar->SetScrollbar(viewInfo.vpos / viewInfo.scrollStep,
1214 panelHeight / viewInfo.scrollStep,
1215 totalHeight / viewInfo.scrollStep,
1216 panelHeight / viewInfo.scrollStep, TRUE);
1218 if (refresh || (rescroll &&
1219 (viewInfo.GetScreenEndTime() - viewInfo.h) < viewInfo.total)) {
1220 trackPanel.Refresh(
false);
1225 if (oldhstate != newhstate || oldvstate != newvstate) {
1235 auto &project = *pProject;
1243 toolManager.LayoutToolBars();
1257 wxSize mainsz = GetSize();
1261 wxPoint tppos = ClientToScreen(trackPanel.GetParent()->GetPosition());
1265 wxPoint sbpos = ClientToScreen(toolManager.GetBotDock()->GetPosition());
1268 SetMinSize( wxSize(250, (mainsz.y - sbpos.y) + tppos.y + 50));
1270 SetMinSize( wxSize(250, 250));
1271 SetMaxSize( wxSize(20000, 20000));
1319 SetSize(defaultRect.width, defaultRect.height);
1327 auto &project = *pProject;
1329 int widths[ nWidths ]{ 0 };
1331 const auto statusBar = GetStatusBar();
1337 int &width = widths[ ii ];
1338 for (
const auto &function : functions ) {
1341 for (
const auto &
string : results.first ) {
1343 statusBar->GetTextExtent(
string.Translation(), &w,
nullptr);
1344 width = std::max<int>( width, w + results.second );
1350 statusBar->SetStatusWidths( nWidths, widths );
1362 wxWindow *focused = FindFocus();
1365 const auto &children = GetChildren();
1366 for(
const auto &child : children) {
1367 if (
auto frame =
dynamic_cast<ToolFrame*
>(child)) {
1371 else if (frame->GetBar() &&
1372 frame->GetBar()->IsVisible() ) {
1380 focused->SetFocus();
1393#if defined(__WXMAC__)
1405 auto VisibleProjectCount = std::count_if(
1426 if (!this->IsMaximized() && !this->
IsIconized())
1443 if (!this->IsMaximized() && !this->
IsIconized())
1480 GetEventHandler()->QueueEvent(
safenew wxSizeEvent(GetSize()));
1518 auto &project = *pProject;
1522 (wxInt64)(
mHsbar->GetThumbPosition() / viewInfo.sbarScale) - offset;
1530 wxTheApp->ProcessIdle();
1539 auto &project = *pProject;
1544 auto width = viewInfo.GetTracksUsableWidth();
1545 viewInfo.SetBeforeScreenWidth(viewInfo.sbarH, width, lowerBound);
1549 enum { SCROLL_PIXEL_TOLERANCE = 10 };
1550 if (std::abs(viewInfo.TimeToPosition(0.0, 0
1551 )) < SCROLL_PIXEL_TOLERANCE) {
1558 viewInfo.vpos =
mVsbar->GetThumbPosition() * viewInfo.scrollStep;
1566 trackPanel.Refresh(
false);
1580 if( event.GetId() < 17000){
1588 auto &project = *pProject;
1590 bool handled = commandManager.HandleMenuID( project,
1597 event.ResumePropagation( 999 );
1607 auto &project = *pProject;
1622 auto &project = *pProject;
1640 if ( ! toolManager.RestoreFocus() )
1656 auto &project = *pProject;
1657 if (event.ButtonDown())
1666 auto &project = *pProject;
1672 trackPanel.SetFocus();
1674 pTrack = *tracks.Selected().begin();
1676 pTrack = *tracks.
Any().begin();
1689 auto &project = *pProject;
1691 viewInfo.SetZoom(level);
1695 float t0 = viewInfo.selectedRegion.t0();
1696 float t1 = viewInfo.selectedRegion.t1();
1697 float tAvailable = viewInfo.GetScreenEndTime() - viewInfo.h;
1698 float tOnLeft = (tAvailable - t0 + t1)/2.0;
1711 auto &project = *pProject;
1713 viewInfo.ZoomBy(multiplier);
1730 auto &project = *pProject;
1732 viewInfo.selectedRegion.setT0(0,
false);
1734 viewInfo.selectedRegion.setT1(0);
1753 auto &project = *pProject;
1756 double len = tracks.GetEndTime();
1758 viewInfo.selectedRegion.setT1(len,
false);
1760 viewInfo.selectedRegion.setT0(len);
1797 mRecentStreamTime = gAudioIO->GetStreamTime();
1799 auto cleanup =
finally([&]{
1806 else if (mMode == Mode::Refresh) {
1813 trackPanel.Refresh(
false);
1815 else if (mMode != Mode::Off) {
1821 const int posX = viewInfo.TimeToPosition(mRecentStreamTime);
1822 auto width = viewInfo.GetTracksUsableWidth();
1834 deltaX = posX - width;
break;
1837 viewInfo.OffsetTimeByPixels(viewInfo.h, deltaX,
true);
1840 viewInfo.h = std::max(0.0, viewInfo.h);
1841 trackPanel.Refresh(
false);
1850 auto &project = *pProject;
1856 if (gAudioIO->IsStreamActive(
1858 !gAudioIO->IsPaused()){
1868 const double endTime = viewInfo.GetScreenEndTime();
1869 const double duration = endTime - viewInfo.h;
1871 bool selectionIsOnscreen =
1872 (viewInfo.selectedRegion.t0() < endTime) &&
1873 (viewInfo.selectedRegion.t1() >= viewInfo.h);
1875 bool selectionFillsScreen =
1876 (viewInfo.selectedRegion.t0() < viewInfo.h) &&
1877 (viewInfo.selectedRegion.t1() > endTime);
1879 if (selectionIsOnscreen && !selectionFillsScreen) {
1881 double selCenter = (viewInfo.selectedRegion.t0() +
1882 viewInfo.selectedRegion.t1()) / 2;
1886 if (selCenter < viewInfo.h)
1887 selCenter = viewInfo.h +
1888 (viewInfo.selectedRegion.t1() - viewInfo.h) / 2;
1889 if (selCenter > endTime)
1890 selCenter = endTime -
1891 (endTime - viewInfo.selectedRegion.t0()) / 2;
1895 const double newDuration =
1896 viewInfo.GetScreenEndTime() - viewInfo.h;
1904 double origLeft = viewInfo.h;
1905 double origWidth = duration;
1908 const double newDuration =
1909 viewInfo.GetScreenEndTime() - viewInfo.h;
1910 double newh = origLeft + (origWidth - newDuration) / 2;
1933 auto &project = *pProject;
1937 const double origLeft = viewInfo.h;
1938 const double origWidth = viewInfo.GetScreenEndTime() - origLeft;
1941 const double newWidth = viewInfo.GetScreenEndTime() - viewInfo.h;
1943 const double newh = origLeft + (origWidth - newWidth) / 2;
1953 auto &project = *pProject;
1957 const double end = tracks.GetEndTime();
1958 const double start = viewInfo.bScrollBeyondZero
1959 ?
std::min( tracks.GetStartTime(), 0.0)
1961 const double len =
end - start;
1964 return viewInfo.GetZoom();
1966 auto w = viewInfo.GetTracksUsableWidth();
1976 auto &project = *pProject;
1979 auto &window = *
this;
1981 const double start = viewInfo.bScrollBeyondZero
1982 ?
std::min(tracks.GetStartTime(), 0.0)
1985 window.Zoom( window.GetZoomOfToFit() );
1986 window.TP_ScrollWindow(start);
1989static ToolManager::TopPanelHook::Scope
scope {
1990[]( wxWindow &window ){
1991 auto pProjectWindow =
dynamic_cast< ProjectWindow*
>( &window );
1992 return pProjectWindow ? pProjectWindow->
GetTopPanel() :
nullptr;
void SetActiveProject(AudacityProject *project)
Handle changing of active project and keep global project pointer.
EVT_MENU(OnSetPlayRegionToSelectionID, AdornedRulerPanel::OnSetPlayRegionToSelection) EVT_COMMAND(OnTogglePinnedStateID
EVT_COMMAND(wxID_ANY, EVT_FREQUENCYTEXTCTRL_UPDATED, LabelDialog::OnFreqUpdate) LabelDialog
IntSetting ProjectWindowY
bool CornersOnScreen(wxRect &r)
IntSetting ProjectWindowX
void GetDefaultWindowRect(wxRect *defRect)
IntSetting ProjectWindowWidth
BoolSetting ProjectWindowIconized
bool IsWindowAccessible(wxRect *requestedRect)
BoolSetting ProjectWindowMaximized
IntSetting ProjectWindowNormalHeight
IntSetting ProjectWindowHeight
IntSetting ProjectWindowNormalX
void GetNextWindowPlacement(wxRect *nextRect, bool *pMaximized, bool *pIconized)
static ToolManager::TopPanelHook::Scope scope
int ScreenContaining(wxRect &r)
IntSetting ProjectWindowNormalWidth
IntSetting ProjectWindowNormalY
AUDACITY_DLL_API wxWindow & GetProjectPanel(AudacityProject &project)
Get the main sub-window of the project frame that displays track data.
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 ...
AUDACITY_DLL_API AttachedWindows & GetAttachedWindows(AudacityProject &project)
accessors for certain important windows associated with each project
const_reverse_iterator rend() const
const_iterator end() const
Container::value_type value_type
const_iterator begin() const
const_reverse_iterator rbegin() const
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
This specialization of Setting for bool adds a Toggle method to negate the saved value.
Subclass * Find(const RegisteredFactory &key)
Get a (bare) pointer to an attachment, or null, down-cast it to Subclass *; will not create on demand...
Subclass & Get(const RegisteredFactory &key)
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass.
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
AudacityProject & project
static CommandManager & Get(AudacityProject &project)
Specialization of Setting for int.
Subscription Subscribe(Callback callback)
Connect a callback to the Publisher; later-connected are called earlier.
CallbackReturn Publish(const ProjectWindowDestroyedMessage &message)
Send a message to connected callbacks.
bool IsAudioActive() const
int GetAudioIOToken() const
static ProjectAudioIO & Get(AudacityProject &project)
static const StatusWidthFunctions & GetStatusWidthFunctions()
A top-level window associated with a project.
std::shared_ptr< AudacityProject > FindProject()
A top-level window associated with a project, and handling scrollbars and zooming.
void OnToolBarUpdate(wxCommandEvent &event)
void ZoomAfterImport(Track *pTrack)
void ZoomOutByFactor(double ZoomFactor)
wxSplitterWindow * mContainerWindow
void ZoomBy(double multiplier)
static ProjectWindow & Get(AudacityProject &project)
void SetHorizontalThumb(double scrollto)
void TP_ScrollLeft() override
void UpdatePrefs() override
void OnActivate(wxActivateEvent &event)
double GetZoomOfToFit() const
void OnScrollLeftButton(wxScrollEvent &event)
void TP_HandleResize() override
void OnUpdateUI(wxUpdateUIEvent &event)
wxPanel * GetTopPanel() noexcept
Top panel contains project-related controls and tools.
void RedrawProject(const bool bForceWaveTracks=false)
static ProjectWindow * Find(AudacityProject *pProject)
Observer::Subscription mThemeChangeSubscription
wxWindow * GetTrackListWindow() noexcept
Track list window is the parent container for TrackPanel.
double ScrollingLowerBoundTime() const
void OnMove(wxMoveEvent &event)
wxSplitterWindow * GetContainerWindow() noexcept
Container is a parent window for both effects panel and track list windows.
double PixelWidthBeforeTime(double scrollto) const
void SetNormalizedWindowState(wxRect pSizeAndLocation)
bool MayScrollBeyondZero() const
void OnMouseEvent(wxMouseEvent &event)
bool mbInitializingScrollbar
void ScrollIntoView(double pos)
~ProjectWindow() override
bool IsBeingDeleted() const
void OnScrollRightButton(wxScrollEvent &event)
void OnScroll(wxScrollEvent &event)
void OnUndoPushedModified()
std::unique_ptr< PlaybackScroller > mPlaybackScroller
void OnSize(wxSizeEvent &event)
void UpdateStatusWidths()
static void OnResetWindow(const CommandContext &context)
void OnThemeChange(struct ThemeChangeMessage)
bool TP_ScrollUpDown(int delta) override
Observer::Subscription mUndoSubscription
void ZoomInByFactor(double ZoomFactor)
void TP_ScrollRight() override
void TP_ScrollWindow(double scrollto) override
void OnMenu(wxCommandEvent &event)
void TP_RedrawScrollbars() override
bool IsIconized() const override
void OnShow(wxShowEvent &event)
wxWindow * mTrackListWindow
ProjectWindow(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, AudacityProject &project)
void OnIconize(wxIconizeEvent &event)
void MacShowUndockedToolbars(bool show)
void HandleScrollWheel(int steps)
bool IsScrollScrubbing() const
static Scrubber & Get(AudacityProject &project)
bool ReadWithDefault(T *pVar, const T &defaultValue) const
overload of ReadWithDefault returning a boolean that is true if the value was previously defined */
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined */
wxColour & Colour(int iIndex)
Abstract base class for an object holding data associated with points on a time axis.
void EnsureVisible(bool modifyState=false)
double GetEndTime() const
static TrackList & Get(AudacityProject &project)
static int GetTotalHeight(const TrackList &list)
static double GetPinnedHeadPositionPreference()
static UndoManager & Get(AudacityProject &project)
static ViewInfo & Get(AudacityProject &project)
A Track that contains audio waveform data.
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
void CallAfter(Action action)
Schedule an action to be done later, and in the main thread.
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
Namespace containing an enum 'what to do on a refresh?'.
void OnCloseWindow(wxCloseEvent &e)
constexpr int DEFAULT_WINDOW_HEIGHT
AttachedWindows::RegisteredFactory sProjectWindowKey
constexpr int DEFAULT_WINDOW_WIDTH
std::optional< PreferredSystemAppearance > appearance
Type of message published by UndoManager.
enum UndoRedoMessage::Type type