44#include <wx/display.h>
45#include <wx/scrolbar.h>
47#include <wx/splitter.h>
48#include <wx/wupdlock.h>
54#ifdef HAS_AUDIOCOM_UPLOAD
75 unsigned int n = wxDisplay::GetCount();
76 for(
unsigned int i = 0;i<n;i++){
78 wxRect scr = d.GetClientArea();
79 if( scr.Contains( r ) )
90 if( wxDisplay::GetFromPoint( r.GetTopLeft() ) == wxNOT_FOUND)
return false;
91 if( wxDisplay::GetFromPoint( r.GetBottomRight() ) == wxNOT_FOUND)
return false;
99 wxRect targetTitleRect(requestedRect->GetLeftTop(), requestedRect->GetBottomRight());
102 targetTitleRect.x += 15;
103 targetTitleRect.width -= 100;
104 if (targetTitleRect.width < 165) targetTitleRect.width = 165;
105 targetTitleRect.height = 15;
106 int targetBottom = targetTitleRect.GetBottom();
107 int targetRight = targetTitleRect.GetRight();
110 for (
int i = targetTitleRect.GetLeft(); i < targetRight; i++) {
111 for (
int j = targetTitleRect.GetTop(); j < targetBottom; j++) {
112 int monitor = display.GetFromPoint(wxPoint(i, j));
124 *defRect = wxGetClientDisplayRect();
145 if (width < defRect->width)
147 defRect->x = (defRect->width - width)/2;
148 defRect->width = width;
151 if (height < defRect->height)
153 defRect->y = (defRect->height - height)/2;
158 const int pixelsFormenu = 60;
159 if( defRect->y < pixelsFormenu )
161 defRect->height = height;
193 if (normalRect.width == 0 || normalRect.height == 0) {
194 normalRect = defaultRect;
196 if (windowRect.width == 0 || windowRect.height == 0) {
197 windowRect = defaultRect;
201 wxRect screenRect( wxGetClientDisplayRect());
202#if defined(__WXMAC__)
206 if (normalRect.y < screenRect.y) {
207 normalRect = defaultRect;
209 if (windowRect.y < screenRect.y) {
210 windowRect = defaultRect;
217 if (*pMaximized || *pIconized) {
218 *nextRect = normalRect;
221 *nextRect = windowRect;
225 *nextRect = defaultRect;
228 *nextRect = defaultRect;
246 normalRect = defaultRect;
249 windowRect = defaultRect;
252 bool validWindowSize =
false;
257 auto pProject = *iter;
259 validWindowSize =
true;
264 if (validWindowSize) {
265 *nextRect = validProject->GetRect();
266 *pMaximized = validProject->IsMaximized();
270 *nextRect = defaultRect;
274 *nextRect = normalRect;
291 const int edgeSlop = 10;
295 wxPoint p = nextRect->GetLeftTop();
296 int scr = std::max( 0, wxDisplay::GetFromPoint( p ));
298 screenRect = d.GetClientArea();
302 wxPoint bottomRight = nextRect->GetBottomRight();
303 if (bottomRight.x > (screenRect.GetRight()+edgeSlop)) {
304 int newWidth = screenRect.GetWidth() - nextRect->GetLeft();
305 if (newWidth < defaultRect.GetWidth()) {
306 nextRect->x = windowRect.x;
307 nextRect->y = windowRect.y;
308 nextRect->width = windowRect.width;
311 nextRect->width = newWidth;
316 bottomRight = nextRect->GetBottomRight();
317 if (bottomRight.y > (screenRect.GetBottom()+edgeSlop)) {
319 bottomRight = nextRect->GetBottomRight();
320 if (bottomRight.y > (screenRect.GetBottom()+edgeSlop)) {
321 nextRect->SetBottom(screenRect.GetBottom());
329 *nextRect = defaultRect;
342 : wxScrollBar(parent,
id, wxDefaultPosition, wxDefaultSize, style)
348 wxWindow *w = e.GetWindow();
354 void SetScrollbar(
int position,
int thumbSize,
355 int range,
int pageSize,
356 bool refresh =
true)
override;
359 DECLARE_EVENT_TABLE()
362void ScrollBar::SetScrollbar(
int position,
int thumbSize,
363 int range,
int pageSize,
372 position != GetThumbPosition() ||
373 thumbSize != GetThumbSize() ||
374 range != GetRange() ||
375 pageSize != GetPageSize();
379 wxScrollBar::SetScrollbar(position, thumbSize, range, pageSize, refresh);
383 EVT_SET_FOCUS(ScrollBar::OnSetFocus)
391[mVertScrollRemainder = 0.0](
403 const wxMouseEvent &
event = evt.event;
407 const auto steps = evt.steps;
409 if (event.ShiftDown()
416 window.TP_ScrollWindow(
417 viewInfo.OffsetTimeByPixels(
418 viewInfo.PositionToTime(0), 50.0 * -steps));
420 else if (event.CmdDown())
427 double ZoomFactor = pow(2.0, steps);
432 p->ZoomInByFactor( ZoomFactor );
434 p->ZoomOutByFactor( ZoomFactor );
439 int trackLeftEdge = viewInfo.GetLeftOffset();
444 double mouse_h = viewInfo.PositionToTime(event.m_x, trackLeftEdge);
448 center_h = viewInfo.h +
449 (viewInfo.GetScreenEndTime() - viewInfo.h) / 2.0;
451 else if( steps <= 0 )
454 else if((viewInfo.selectedRegion.t1() - viewInfo.selectedRegion.t0() ) < 0.00001 )
457 else if( mouse_h < viewInfo.selectedRegion.t0() )
458 center_h = viewInfo.selectedRegion.t0();
460 else if( mouse_h > viewInfo.selectedRegion.t1() )
461 center_h = viewInfo.selectedRegion.t1();
466 xx = viewInfo.TimeToPosition(center_h, trackLeftEdge);
479 if (center_h > audioEndTime)
481 center_h = audioEndTime;
485 wxCoord xTrackEnd = viewInfo.TimeToPosition( audioEndTime );
486 viewInfo.ZoomBy(pow(2.0, steps/4.0));
488 double new_center_h = viewInfo.PositionToTime(xx, trackLeftEdge);
489 viewInfo.h += (center_h - new_center_h);
493 if( viewInfo.h > audioEndTime )
494 viewInfo.h += audioEndTime - viewInfo.PositionToTime( xTrackEnd );
501#ifdef EXPERIMENTAL_SCRUBBING_SCROLL_WHEEL
504 evt.event.Skip(
false);
510 double lines = steps * 4 + mVertScrollRemainder;
511 mVertScrollRemainder = lines - floor(lines);
512 lines = floor(lines);
513 auto didSomething = window.TP_ScrollUpDown((
int)-lines);
525 bool bMaximized =
false;
526 bool bIconized =
false;
532 wxSize(wndRect.width, wndRect.height),
536 auto &window = *pWindow;
539 window.SetPosition(wndRect.GetPosition());
542 window.Maximize(
true);
544 else if (bIconized) {
579 auto& project = context.
project;
608 constexpr auto EffectsPanelMaxWidth { 500 };
609 constexpr auto TrackPanelMinWidth { 250 };
622 this, wxID_ANY, wxDefaultPosition,
623 wxSize{ this->GetSize().GetWidth(), -1 }
626 mTopPanel->SetLayoutDirection(wxLayout_LeftToRight);
628#ifdef EXPERIMENTAL_DA2
632 auto container =
safenew wxSplitterWindow(
this, wxID_ANY,
635 wxNO_BORDER | wxSP_LIVE_UPDATE | wxSP_THIN_SASH);
636 container->Bind(wxEVT_SPLITTER_DOUBLECLICKED, [](wxSplitterEvent& event){
640 container->Bind(wxEVT_SPLITTER_SASH_POS_CHANGING, [=](wxSplitterEvent& event){
641 if(event.GetSashPosition() > EffectsPanelMaxWidth)
643 event.SetSashPosition(-1);
658#ifdef EXPERIMENTAL_DA2
675#if wxUSE_ACCESSIBILITY
680 mHsbar->SetLayoutDirection(wxLayout_LeftToRight);
681 mHsbar->SetName(
_(
"Horizontal Scrollbar"));
682 mVsbar->SetName(
_(
"Vertical Scrollbar"));
686 switch (message.
type) {
687 case UndoRedoMessage::Pushed:
688 case UndoRedoMessage::Modified:
689 return OnUndoPushedModified();
690 case UndoRedoMessage::UndoOrRedo:
692 case UndoRedoMessage::Reset:
693 return OnUndoReset();
747 auto pThis = wxWeakRef<ProjectWindow>(
this);
752 if (pThis->IsBeingDeleted())
755 auto pProject = pThis->FindProject();
759 auto &project = *pProject;
762 pThis->FixScrollbars();
763 if (bForceWaveTracks)
765 for (
auto pWaveTrack : tracks.Any<
WaveTrack >() )
766 for (
const auto &clip: pWaveTrack->GetClips())
769 trackPanel.Refresh(
false);
779 auto &project = *pProject;
785 toolManager.ForEach([](
auto pToolBar){
787 pToolBar->ReCreateButtons();
809#if defined(__WXMAC__)
814#elif defined(__WXMSW__)
815const int sbarSpaceWidth = 16;
816const int sbarControlWidth = 16;
817const int sbarExtraLen = 0;
820const int sbarSpaceWidth = 15;
821const int sbarControlWidth = 15;
822const int sbarExtraLen = 0;
833 auto &project = *pProject;
836 auto w = viewInfo.GetTracksUsableWidth();
838 int pixel = viewInfo.TimeToPosition(pos);
839 if (pixel < 0 || pixel >= w)
842 (viewInfo.OffsetTimeByPixels(pos, -(w / 2)));
843 trackPanel.Refresh(
false);
852 auto &project = *pProject;
854 ScrollIntoView(viewInfo.PositionToTime(x, viewInfo.GetLeftOffset()));
866 auto &project = *pProject;
868 wxInt64 pos =
mHsbar->GetThumbPosition();
870 pos -= wxMax((wxInt64)(
sbarHjump * viewInfo.sbarScale), 1);
873 viewInfo.sbarH = std::max(viewInfo.sbarH,
877 if (pos !=
mHsbar->GetThumbPosition()) {
878 mHsbar->SetThumbPosition((
int)pos);
892 auto &project = *pProject;
894 wxInt64 pos =
mHsbar->GetThumbPosition();
897 pos += wxMax((wxInt64)(
sbarHjump * viewInfo.sbarScale), 1);
898 wxInt64 max =
mHsbar->GetRange() -
mHsbar->GetThumbSize();
899 pos = wxMin(pos, max);
901 viewInfo.sbarH =
std::min(viewInfo.sbarH,
905 if (pos !=
mHsbar->GetThumbPosition()) {
906 mHsbar->SetThumbPosition((
int)pos);
920 auto &project = *pProject;
922 wxInt64 pos =
mHsbar->GetThumbPosition();
924 pos -= wxMax((wxInt64)(
sbarHjump * viewInfo.sbarScale), 1);
927 viewInfo.sbarH = std::max(viewInfo.sbarH,
930 if (pos !=
mHsbar->GetThumbPosition()) {
931 mHsbar->SetThumbPosition((
int)pos);
944 auto &project = *pProject;
946 wxInt64 pos =
mHsbar->GetThumbPosition();
949 pos += wxMax((wxInt64)(
sbarHjump * viewInfo.sbarScale), 1);
950 wxInt64 max =
mHsbar->GetRange() -
mHsbar->GetThumbSize();
951 pos = wxMin(pos, max);
953 viewInfo.sbarH =
std::min(viewInfo.sbarH,
957 if (pos !=
mHsbar->GetThumbPosition()) {
958 mHsbar->SetThumbPosition((
int)pos);
969 auto &project = *pProject;
972 if (viewInfo.bScrollBeyondZero)
975 if (scrubber.HasMark() ||
993 auto &project = *pProject;
998 const double screen = viewInfo.GetScreenEndTime() - viewInfo.h;
999 return std::min(tracks.GetStartTime(), -screen);
1009 auto &project = *pProject;
1014 viewInfo.TimeRangeToPixelWidth(scrollto - lowerBound);
1022 auto &project = *pProject;
1025 const int max =
mHsbar->GetRange() -
mHsbar->GetThumbSize();
1029 (
int)(floor(0.5 + unscaled * viewInfo.sbarScale))));
1030 mHsbar->SetThumbPosition(pos);
1032 viewInfo.sbarH = std::max(viewInfo.sbarH,
1034 viewInfo.sbarH =
std::min(viewInfo.sbarH,
1059 int oldPos =
mVsbar->GetThumbPosition();
1060 int pos = oldPos + delta;
1074 mVsbar->SetThumbPosition(pos);
1088 auto &project = *pProject;
1093 bool refresh =
false;
1094 bool rescroll =
false;
1098 auto panelWidth = viewInfo.GetTracksUsableWidth();
1099 auto panelHeight = viewInfo.GetHeight();
1108 if (panelWidth < 0) {
1111 if (panelHeight < 0) {
1115 auto LastTime = std::numeric_limits<double>::lowest();
1116 for (
const Track *track : tracks) {
1118 track = track->SubstitutePendingChangedTrack().get();
1119 LastTime = std::max( LastTime, track->GetEndTime() );
1122 std::max(LastTime, viewInfo.selectedRegion.t1());
1124 const double screen =
1125 viewInfo.GetScreenEndTime() - viewInfo.h;
1126 const double halfScreen = screen / 2.0;
1136 ? -lowerBound + std::max(halfScreen, screen - LastTime)
1139 viewInfo.total = LastTime + additional;
1142 viewInfo.total = std::max(viewInfo.total, viewInfo.h + screen);
1144 if (viewInfo.h < lowerBound) {
1145 viewInfo.h = lowerBound;
1149 viewInfo.sbarTotal = (wxInt64) (viewInfo.GetTotalWidth());
1150 viewInfo.sbarScreen = (wxInt64)(panelWidth);
1151 viewInfo.sbarH = (wxInt64) (viewInfo.GetBeforeScreenWidth());
1160 viewInfo.vpos =
mVsbar->GetThumbPosition() * viewInfo.scrollStep;
1164 if (viewInfo.vpos >= totalHeight)
1165 viewInfo.vpos = totalHeight - 1;
1166 if (viewInfo.vpos < 0)
1172 (viewInfo.GetScreenEndTime() - viewInfo.h) < viewInfo.total;
1173 bool newvstate = panelHeight < totalHeight;
1176 oldhstate =
mHsbar->IsShown();
1177 oldvstate =
mVsbar->IsShown();
1179 mVsbar->Show(panelHeight < totalHeight);
1181 oldhstate =
mHsbar->IsEnabled();
1182 oldvstate =
mVsbar->IsEnabled();
1183 mHsbar->Enable(newhstate);
1184 mVsbar->Enable(panelHeight < totalHeight);
1187 if (panelHeight >= totalHeight && viewInfo.vpos != 0) {
1193 if (!newhstate && viewInfo.sbarH != 0) {
1207 wxInt64 maxScrollbarRange = (wxInt64)(2147483647 * 0.999);
1208 if (viewInfo.sbarTotal > maxScrollbarRange)
1209 viewInfo.sbarScale = ((double)maxScrollbarRange) / viewInfo.sbarTotal;
1211 viewInfo.sbarScale = 1.0;
1214 int scaledSbarH = (int)(viewInfo.sbarH * viewInfo.sbarScale);
1215 int scaledSbarScreen = (int)(viewInfo.sbarScreen * viewInfo.sbarScale);
1216 int scaledSbarTotal = (int)(viewInfo.sbarTotal * viewInfo.sbarScale);
1220 mHsbar->SetScrollbar(scaledSbarH + offset, scaledSbarScreen, scaledSbarTotal,
1221 scaledSbarScreen, TRUE);
1225 mVsbar->SetScrollbar(viewInfo.vpos / viewInfo.scrollStep,
1226 panelHeight / viewInfo.scrollStep,
1227 totalHeight / viewInfo.scrollStep,
1228 panelHeight / viewInfo.scrollStep, TRUE);
1230 if (refresh || (rescroll &&
1231 (viewInfo.GetScreenEndTime() - viewInfo.h) < viewInfo.total)) {
1232 trackPanel.Refresh(
false);
1237 if (oldhstate != newhstate || oldvstate != newvstate) {
1247 auto &project = *pProject;
1255 toolManager.LayoutToolBars();
1269 wxSize mainsz = GetSize();
1273 wxPoint tppos = ClientToScreen(trackPanel.GetParent()->GetPosition());
1277 wxPoint sbpos = ClientToScreen(toolManager.GetBotDock()->GetPosition());
1280 SetMinSize( wxSize(250, (mainsz.y - sbpos.y) + tppos.y + 50));
1282 SetMinSize( wxSize(250, 250));
1283 SetMaxSize( wxSize(20000, 20000));
1331 SetSize(defaultRect.width, defaultRect.height);
1339 auto &project = *pProject;
1341 int widths[ nWidths ]{ 0 };
1343 const auto statusBar = GetStatusBar();
1349 int &width = widths[ ii ];
1350 for (
const auto &function : functions ) {
1353 for (
const auto &
string : results.first ) {
1355 statusBar->GetTextExtent(
string.Translation(), &w,
nullptr);
1356 width = std::max<int>( width, w + results.second );
1362 statusBar->SetStatusWidths( nWidths, widths );
1377 const auto &children = GetChildren();
1378 for(
const auto &child : children) {
1379 if (
auto frame =
dynamic_cast<ToolFrame*
>(child)) {
1383 else if (frame->GetBar() &&
1384 frame->GetBar()->IsVisible() ) {
1392 focused->SetFocus();
1405#if defined(__WXMAC__)
1417 auto VisibleProjectCount = std::count_if(
1438 if (!this->IsMaximized() && !this->
IsIconized())
1455 if (!this->IsMaximized() && !this->
IsIconized())
1492 GetEventHandler()->QueueEvent(
safenew wxSizeEvent(GetSize()));
1531 auto &project = *pProject;
1533 if (
name != GetTitle()) {
1545 auto &project = *pProject;
1549 (wxInt64)(
mHsbar->GetThumbPosition() / viewInfo.sbarScale) - offset;
1557 wxTheApp->ProcessIdle();
1566 auto &project = *pProject;
1571 auto width = viewInfo.GetTracksUsableWidth();
1572 viewInfo.SetBeforeScreenWidth(viewInfo.sbarH, width, lowerBound);
1576 enum { SCROLL_PIXEL_TOLERANCE = 10 };
1577 if (std::abs(viewInfo.TimeToPosition(0.0, 0
1578 )) < SCROLL_PIXEL_TOLERANCE) {
1585 viewInfo.vpos =
mVsbar->GetThumbPosition() * viewInfo.scrollStep;
1593 trackPanel.Refresh(
false);
1607 if( event.GetId() < 17000){
1615 auto &project = *pProject;
1617 bool handled = commandManager.HandleMenuID( project,
1624 event.ResumePropagation( 999 );
1634 auto &project = *pProject;
1649 auto &project = *pProject;
1667 if ( ! toolManager.RestoreFocus() )
1683 auto &project = *pProject;
1684 if (event.ButtonDown())
1693 auto &project = *pProject;
1699 trackPanel.SetFocus();
1701 pTrack = *tracks.Selected().begin();
1703 pTrack = *tracks.
Any().begin();
1716 auto &project = *pProject;
1718 viewInfo.SetZoom(level);
1722 float t0 = viewInfo.selectedRegion.t0();
1723 float t1 = viewInfo.selectedRegion.t1();
1724 float tAvailable = viewInfo.GetScreenEndTime() - viewInfo.h;
1725 float tOnLeft = (tAvailable - t0 + t1)/2.0;
1738 auto &project = *pProject;
1740 viewInfo.ZoomBy(multiplier);
1757 auto &project = *pProject;
1759 viewInfo.selectedRegion.setT0(0,
false);
1761 viewInfo.selectedRegion.setT1(0);
1780 auto &project = *pProject;
1783 double len = tracks.GetEndTime();
1785 viewInfo.selectedRegion.setT1(len,
false);
1787 viewInfo.selectedRegion.setT0(len);
1824 mRecentStreamTime = gAudioIO->GetStreamTime();
1826 auto cleanup =
finally([&]{
1833 else if (mMode == Mode::Refresh) {
1840 trackPanel.Refresh(
false);
1842 else if (mMode != Mode::Off) {
1848 const int posX = viewInfo.TimeToPosition(mRecentStreamTime);
1849 auto width = viewInfo.GetTracksUsableWidth();
1861 deltaX = posX - width;
break;
1864 viewInfo.OffsetTimeByPixels(viewInfo.h, deltaX,
true);
1867 viewInfo.h = std::max(0.0, viewInfo.h);
1868 trackPanel.Refresh(
false);
1877 auto &project = *pProject;
1883 if (gAudioIO->IsStreamActive(
1885 !gAudioIO->IsPaused()){
1895 const double endTime = viewInfo.GetScreenEndTime();
1896 const double duration = endTime - viewInfo.h;
1898 bool selectionIsOnscreen =
1899 (viewInfo.selectedRegion.t0() < endTime) &&
1900 (viewInfo.selectedRegion.t1() >= viewInfo.h);
1902 bool selectionFillsScreen =
1903 (viewInfo.selectedRegion.t0() < viewInfo.h) &&
1904 (viewInfo.selectedRegion.t1() > endTime);
1906 if (selectionIsOnscreen && !selectionFillsScreen) {
1908 double selCenter = (viewInfo.selectedRegion.t0() +
1909 viewInfo.selectedRegion.t1()) / 2;
1913 if (selCenter < viewInfo.h)
1914 selCenter = viewInfo.h +
1915 (viewInfo.selectedRegion.t1() - viewInfo.h) / 2;
1916 if (selCenter > endTime)
1917 selCenter = endTime -
1918 (endTime - viewInfo.selectedRegion.t0()) / 2;
1922 const double newDuration =
1923 viewInfo.GetScreenEndTime() - viewInfo.h;
1931 double origLeft = viewInfo.h;
1932 double origWidth = duration;
1935 const double newDuration =
1936 viewInfo.GetScreenEndTime() - viewInfo.h;
1937 double newh = origLeft + (origWidth - newDuration) / 2;
1960 auto &project = *pProject;
1964 const double origLeft = viewInfo.h;
1965 const double origWidth = viewInfo.GetScreenEndTime() - origLeft;
1968 const double newWidth = viewInfo.GetScreenEndTime() - viewInfo.h;
1970 const double newh = origLeft + (origWidth - newWidth) / 2;
1980 auto &project = *pProject;
1984 const double end = tracks.GetEndTime();
1985 const double start = viewInfo.bScrollBeyondZero
1986 ?
std::min( tracks.GetStartTime(), 0.0)
1988 const double len =
end - start;
1991 return viewInfo.GetZoom();
1993 auto w = viewInfo.GetTracksUsableWidth();
2003 auto &project = *pProject;
2006 auto &window = *
this;
2008 const double start = viewInfo.bScrollBeyondZero
2009 ?
std::min(tracks.GetStartTime(), 0.0)
2012 window.Zoom( window.GetZoomOfToFit() );
2013 window.TP_ScrollWindow(start);
2017[]( wxWindow &window ){
2018 auto pProjectWindow =
dynamic_cast< ProjectWindow*
>( &window );
2019 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
const TranslatableString name
EVT_COMMAND(wxID_ANY, EVT_FREQUENCYTEXTCTRL_UPDATED, LabelDialog::OnFreqUpdate) LabelDialog
ProjectFileIOMessage
Subscribe to ProjectFileIO to receive messages; always in idle time.
@ ProjectTitleChange
A normal occurrence.
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)
typename GlobalVariable< TopPanelHook, const std::function< wxWindow * >, nullptr, Options... >::Scope Scope
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)
const wxString & GetProjectTitle() const
static ProjectFileIO & Get(AudacityProject &project)
static ProjectSnap & 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()
void OnProjectTitleChange(ProjectFileIOMessage)
static void OnResetWindow(const CommandContext &context)
void OnThemeChange(struct ThemeChangeMessage)
Observer::Subscription mTitleChangeSubcription
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
Observer::Subscription mSnappingChangedSubscription
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.
std::unique_ptr< WindowPlacement > FindFocus()
Find the window that is accepting keyboard input, if any.
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