mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-22 14:32:58 +02:00
Remove a friend declaration from Project, privatize a pointer member...
... and make implementation of that pointer a smart one.
This commit is contained in:
@@ -852,7 +852,7 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
|
|||||||
//
|
//
|
||||||
// Create the ToolDock
|
// Create the ToolDock
|
||||||
//
|
//
|
||||||
mToolManager = new ToolManager( this );
|
mToolManager = std::make_unique<ToolManager>( this );
|
||||||
GetSelectionBar()->SetListener(this);
|
GetSelectionBar()->SetListener(this);
|
||||||
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
|
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
|
||||||
GetSpectralSelectionBar()->SetListener(this);
|
GetSpectralSelectionBar()->SetListener(this);
|
||||||
@@ -2272,8 +2272,7 @@ void AudacityProject::OnCloseWindow(wxCloseEvent & event)
|
|||||||
|
|
||||||
// Delete the tool manager before the children since it needs
|
// Delete the tool manager before the children since it needs
|
||||||
// to save the state of the toolbars.
|
// to save the state of the toolbars.
|
||||||
delete mToolManager;
|
mToolManager.reset();
|
||||||
mToolManager = NULL;
|
|
||||||
|
|
||||||
DestroyChildren();
|
DestroyChildren();
|
||||||
|
|
||||||
@@ -2693,7 +2692,7 @@ void AudacityProject::OpenFile(const wxString &fileNameArg, bool addtohistory)
|
|||||||
|
|
||||||
bool err = false;
|
bool err = false;
|
||||||
Track *t;
|
Track *t;
|
||||||
TrackListIterator iter(mTracks);
|
TrackListIterator iter(GetTracks());
|
||||||
mLastSavedTracks = new TrackList();
|
mLastSavedTracks = new TrackList();
|
||||||
|
|
||||||
t = iter.First();
|
t = iter.First();
|
||||||
|
@@ -612,8 +612,10 @@ public:
|
|||||||
Meter *mPlaybackMeter{};
|
Meter *mPlaybackMeter{};
|
||||||
Meter *mCaptureMeter{};
|
Meter *mCaptureMeter{};
|
||||||
|
|
||||||
|
std::unique_ptr<ToolManager> mToolManager{};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ToolManager *mToolManager{};
|
ToolManager *GetToolManager() { return mToolManager.get(); }
|
||||||
bool mShowSplashScreen;
|
bool mShowSplashScreen;
|
||||||
wxString mHelpPref;
|
wxString mHelpPref;
|
||||||
wxString mSoloPref;
|
wxString mSoloPref;
|
||||||
@@ -675,9 +677,6 @@ public:
|
|||||||
// Last effect applied to this project
|
// Last effect applied to this project
|
||||||
PluginID mLastEffect{};
|
PluginID mLastEffect{};
|
||||||
|
|
||||||
// The screenshot class needs to access internals
|
|
||||||
friend class ScreenshotCommand;
|
|
||||||
|
|
||||||
wxRect mNormalizedWindowState;
|
wxRect mNormalizedWindowState;
|
||||||
|
|
||||||
//flag for cancellation of timer record.
|
//flag for cancellation of timer record.
|
||||||
|
@@ -296,7 +296,7 @@ ScreenFrame::ScreenFrame(wxWindow * parent, wxWindowID id)
|
|||||||
// Note that the audio could be playing.
|
// Note that the audio could be playing.
|
||||||
// The monitoring will switch off temporarily
|
// The monitoring will switch off temporarily
|
||||||
// because we've switched monitor mid play.
|
// because we've switched monitor mid play.
|
||||||
mContext.GetProject()->mToolManager->Reset();
|
mContext.GetProject()->GetToolManager()->Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
ScreenFrame::~ScreenFrame()
|
ScreenFrame::~ScreenFrame()
|
||||||
@@ -555,7 +555,7 @@ void ScreenFrame::SizeMainWindow(int w, int h)
|
|||||||
|
|
||||||
mContext.GetProject()->Maximize(false);
|
mContext.GetProject()->Maximize(false);
|
||||||
mContext.GetProject()->SetSize(16, 16 + top, w, h);
|
mContext.GetProject()->SetSize(16, 16 + top, w, h);
|
||||||
mContext.GetProject()->mToolManager->Reset();
|
mContext.GetProject()->GetToolManager()->Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenFrame::OnMainWindowSmall(wxCommandEvent & WXUNUSED(event))
|
void ScreenFrame::OnMainWindowSmall(wxCommandEvent & WXUNUSED(event))
|
||||||
|
@@ -226,7 +226,7 @@ void Theme::ApplyUpdatedImages()
|
|||||||
AudacityProject *p = GetActiveProject();
|
AudacityProject *p = GetActiveProject();
|
||||||
for( int ii = 0; ii < ToolBarCount; ++ii )
|
for( int ii = 0; ii < ToolBarCount; ++ii )
|
||||||
{
|
{
|
||||||
ToolBar *pToolBar = p->mToolManager->GetToolBar(ii);
|
ToolBar *pToolBar = p->GetToolManager()->GetToolBar(ii);
|
||||||
if( pToolBar )
|
if( pToolBar )
|
||||||
pToolBar->ReCreateButtons();
|
pToolBar->ReCreateButtons();
|
||||||
}
|
}
|
||||||
|
@@ -355,7 +355,7 @@ bool ScreenshotCommand::Apply(CommandExecutionContext context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reset the toolbars to a known state
|
// Reset the toolbars to a known state
|
||||||
context.GetProject()->mToolManager->Reset();
|
context.GetProject()->GetToolManager()->Reset();
|
||||||
|
|
||||||
wxTopLevelWindow *w = GetFrontWindow(context.GetProject());
|
wxTopLevelWindow *w = GetFrontWindow(context.GetProject());
|
||||||
if (!w)
|
if (!w)
|
||||||
@@ -418,43 +418,43 @@ bool ScreenshotCommand::Apply(CommandExecutionContext context)
|
|||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("toolbars")))
|
else if (captureMode.IsSameAs(wxT("toolbars")))
|
||||||
{
|
{
|
||||||
CaptureDock(context.GetProject()->mToolManager->GetTopDock(), fileName);
|
CaptureDock(context.GetProject()->GetToolManager()->GetTopDock(), fileName);
|
||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("selectionbar")))
|
else if (captureMode.IsSameAs(wxT("selectionbar")))
|
||||||
{
|
{
|
||||||
CaptureDock(context.GetProject()->mToolManager->GetBotDock(), fileName);
|
CaptureDock(context.GetProject()->GetToolManager()->GetBotDock(), fileName);
|
||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("tools")))
|
else if (captureMode.IsSameAs(wxT("tools")))
|
||||||
{
|
{
|
||||||
CaptureToolbar(context.GetProject()->mToolManager, ToolsBarID, fileName);
|
CaptureToolbar(context.GetProject()->GetToolManager(), ToolsBarID, fileName);
|
||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("transport")))
|
else if (captureMode.IsSameAs(wxT("transport")))
|
||||||
{
|
{
|
||||||
CaptureToolbar(context.GetProject()->mToolManager, TransportBarID, fileName);
|
CaptureToolbar(context.GetProject()->GetToolManager(), TransportBarID, fileName);
|
||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("mixer")))
|
else if (captureMode.IsSameAs(wxT("mixer")))
|
||||||
{
|
{
|
||||||
CaptureToolbar(context.GetProject()->mToolManager, MixerBarID, fileName);
|
CaptureToolbar(context.GetProject()->GetToolManager(), MixerBarID, fileName);
|
||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("meter")))
|
else if (captureMode.IsSameAs(wxT("meter")))
|
||||||
{
|
{
|
||||||
CaptureToolbar(context.GetProject()->mToolManager, MeterBarID, fileName);
|
CaptureToolbar(context.GetProject()->GetToolManager(), MeterBarID, fileName);
|
||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("edit")))
|
else if (captureMode.IsSameAs(wxT("edit")))
|
||||||
{
|
{
|
||||||
CaptureToolbar(context.GetProject()->mToolManager, EditBarID, fileName);
|
CaptureToolbar(context.GetProject()->GetToolManager(), EditBarID, fileName);
|
||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("device")))
|
else if (captureMode.IsSameAs(wxT("device")))
|
||||||
{
|
{
|
||||||
CaptureToolbar(context.GetProject()->mToolManager, DeviceBarID, fileName);
|
CaptureToolbar(context.GetProject()->GetToolManager(), DeviceBarID, fileName);
|
||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("transcription")))
|
else if (captureMode.IsSameAs(wxT("transcription")))
|
||||||
{
|
{
|
||||||
CaptureToolbar(context.GetProject()->mToolManager, TranscriptionBarID, fileName);
|
CaptureToolbar(context.GetProject()->GetToolManager(), TranscriptionBarID, fileName);
|
||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("trackpanel")))
|
else if (captureMode.IsSameAs(wxT("trackpanel")))
|
||||||
{
|
{
|
||||||
TrackPanel *panel = context.GetProject()->mTrackPanel;
|
TrackPanel *panel = context.GetProject()->GetTrackPanel();
|
||||||
//AdornedRulerPanel *ruler = panel->mRuler;
|
//AdornedRulerPanel *ruler = panel->mRuler;
|
||||||
|
|
||||||
int h = panel->mRuler->GetRulerHeight();
|
int h = panel->mRuler->GetRulerHeight();
|
||||||
@@ -469,7 +469,7 @@ bool ScreenshotCommand::Apply(CommandExecutionContext context)
|
|||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("ruler")))
|
else if (captureMode.IsSameAs(wxT("ruler")))
|
||||||
{
|
{
|
||||||
TrackPanel *panel = context.GetProject()->mTrackPanel;
|
TrackPanel *panel = context.GetProject()->GetTrackPanel();
|
||||||
AdornedRulerPanel *ruler = panel->mRuler;
|
AdornedRulerPanel *ruler = panel->mRuler;
|
||||||
|
|
||||||
int x = 0, y = 0;
|
int x = 0, y = 0;
|
||||||
@@ -484,7 +484,7 @@ bool ScreenshotCommand::Apply(CommandExecutionContext context)
|
|||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("tracks")))
|
else if (captureMode.IsSameAs(wxT("tracks")))
|
||||||
{
|
{
|
||||||
TrackPanel *panel = context.GetProject()->mTrackPanel;
|
TrackPanel *panel = context.GetProject()->GetTrackPanel();
|
||||||
|
|
||||||
int x = 0, y = 0;
|
int x = 0, y = 0;
|
||||||
int width, height;
|
int width, height;
|
||||||
@@ -497,7 +497,7 @@ bool ScreenshotCommand::Apply(CommandExecutionContext context)
|
|||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("firsttrack")))
|
else if (captureMode.IsSameAs(wxT("firsttrack")))
|
||||||
{
|
{
|
||||||
TrackPanel *panel = context.GetProject()->mTrackPanel;
|
TrackPanel *panel = context.GetProject()->GetTrackPanel();
|
||||||
TrackListIterator iter(context.GetProject()->GetTracks());
|
TrackListIterator iter(context.GetProject()->GetTracks());
|
||||||
Track * t = iter.First();
|
Track * t = iter.First();
|
||||||
if (!t) {
|
if (!t) {
|
||||||
@@ -517,7 +517,7 @@ bool ScreenshotCommand::Apply(CommandExecutionContext context)
|
|||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("secondtrack")))
|
else if (captureMode.IsSameAs(wxT("secondtrack")))
|
||||||
{
|
{
|
||||||
TrackPanel *panel = context.GetProject()->mTrackPanel;
|
TrackPanel *panel = context.GetProject()->GetTrackPanel();
|
||||||
TrackListIterator iter(context.GetProject()->GetTracks());
|
TrackListIterator iter(context.GetProject()->GetTracks());
|
||||||
Track * t = iter.First();
|
Track * t = iter.First();
|
||||||
if (!t) {
|
if (!t) {
|
||||||
|
Reference in New Issue
Block a user