mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-20 06:10:06 +02:00
Fix for bug #887
A little overkill, but low risk since the majority of the source changed isn't actually used.
This commit is contained in:
parent
f98d9ce712
commit
cbcc78b183
@ -285,7 +285,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.proj->mToolManager->Reset();
|
mContext.GetProject()->mToolManager->Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
ScreenFrame::~ScreenFrame()
|
ScreenFrame::~ScreenFrame()
|
||||||
@ -447,7 +447,7 @@ void ScreenFrame::PopulateOrExchange(ShuttleGui & S)
|
|||||||
CentreOnParent();
|
CentreOnParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
SetIcon(mContext.proj->GetIcon());
|
SetIcon(mContext.GetProject()->GetIcon());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScreenFrame::ProcessEvent(wxEvent & e)
|
bool ScreenFrame::ProcessEvent(wxEvent & e)
|
||||||
@ -541,9 +541,9 @@ void ScreenFrame::SizeMainWindow(int w, int h)
|
|||||||
{
|
{
|
||||||
int top = 20;
|
int top = 20;
|
||||||
|
|
||||||
mContext.proj->Maximize(false);
|
mContext.GetProject()->Maximize(false);
|
||||||
mContext.proj->SetSize(16, 16 + top, w, h);
|
mContext.GetProject()->SetSize(16, 16 + top, w, h);
|
||||||
mContext.proj->mToolManager->Reset();
|
mContext.GetProject()->mToolManager->Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenFrame::OnMainWindowSmall(wxCommandEvent & WXUNUSED(event))
|
void ScreenFrame::OnMainWindowSmall(wxCommandEvent & WXUNUSED(event))
|
||||||
@ -660,9 +660,9 @@ void ScreenFrame::OnCaptureSecondTrack(wxCommandEvent & WXUNUSED(event))
|
|||||||
void ScreenFrame::TimeZoom(double seconds)
|
void ScreenFrame::TimeZoom(double seconds)
|
||||||
{
|
{
|
||||||
int width, height;
|
int width, height;
|
||||||
mContext.proj->GetClientSize(&width, &height);
|
mContext.GetProject()->GetClientSize(&width, &height);
|
||||||
mContext.proj->mViewInfo.zoom = (0.75 * width) / seconds;
|
mContext.GetProject()->mViewInfo.zoom = (0.75 * width) / seconds;
|
||||||
mContext.proj->RedrawProject();
|
mContext.GetProject()->RedrawProject();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenFrame::OnOneSec(wxCommandEvent & WXUNUSED(event))
|
void ScreenFrame::OnOneSec(wxCommandEvent & WXUNUSED(event))
|
||||||
@ -692,7 +692,7 @@ void ScreenFrame::OnOneHour(wxCommandEvent & WXUNUSED(event))
|
|||||||
|
|
||||||
void ScreenFrame::SizeTracks(int h)
|
void ScreenFrame::SizeTracks(int h)
|
||||||
{
|
{
|
||||||
TrackListIterator iter(mContext.proj->GetTracks());
|
TrackListIterator iter(mContext.GetProject()->GetTracks());
|
||||||
for (Track * t = iter.First(); t; t = iter.Next()) {
|
for (Track * t = iter.First(); t; t = iter.Next()) {
|
||||||
if (t->GetKind() == Track::Wave) {
|
if (t->GetKind() == Track::Wave) {
|
||||||
if (t->GetLink()) {
|
if (t->GetLink()) {
|
||||||
@ -703,18 +703,18 @@ void ScreenFrame::SizeTracks(int h)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mContext.proj->RedrawProject();
|
mContext.GetProject()->RedrawProject();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenFrame::OnShortTracks(wxCommandEvent & WXUNUSED(event))
|
void ScreenFrame::OnShortTracks(wxCommandEvent & WXUNUSED(event))
|
||||||
{
|
{
|
||||||
TrackListIterator iter(mContext.proj->GetTracks());
|
TrackListIterator iter(mContext.GetProject()->GetTracks());
|
||||||
for (Track * t = iter.First(); t; t = iter.Next()) {
|
for (Track * t = iter.First(); t; t = iter.Next()) {
|
||||||
if (t->GetKind() == Track::Wave) {
|
if (t->GetKind() == Track::Wave) {
|
||||||
t->SetHeight(t->GetMinimizedHeight());
|
t->SetHeight(t->GetMinimizedHeight());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mContext.proj->RedrawProject();
|
mContext.GetProject()->RedrawProject();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenFrame::OnMedTracks(wxCommandEvent & WXUNUSED(event))
|
void ScreenFrame::OnMedTracks(wxCommandEvent & WXUNUSED(event))
|
||||||
|
@ -27,6 +27,8 @@ be controlled by a script should be separated out into its own Command class.
|
|||||||
#ifndef __COMMAND__
|
#ifndef __COMMAND__
|
||||||
#define __COMMAND__
|
#define __COMMAND__
|
||||||
|
|
||||||
|
#include <wx/app.h>
|
||||||
|
|
||||||
#include "CommandMisc.h"
|
#include "CommandMisc.h"
|
||||||
#include "CommandSignature.h"
|
#include "CommandSignature.h"
|
||||||
|
|
||||||
@ -36,11 +38,21 @@ class CommandOutputTarget;
|
|||||||
|
|
||||||
class CommandExecutionContext
|
class CommandExecutionContext
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AudacityApp *app;
|
CommandExecutionContext(AudacityApp *WXUNUSED(app), AudacityProject *WXUNUSED(proj))
|
||||||
AudacityProject *proj;
|
{
|
||||||
CommandExecutionContext(AudacityApp *app, AudacityProject *proj)
|
};
|
||||||
: app(app), proj(proj) {}
|
AudacityApp *GetApp() const
|
||||||
|
{
|
||||||
|
return (AudacityApp *) wxTheApp;
|
||||||
|
};
|
||||||
|
AudacityProject *GetProject() const
|
||||||
|
{
|
||||||
|
// TODO: Presumably, this would be different if running in a command context.
|
||||||
|
// So, if this command system is ever actually enabled, then this will need to
|
||||||
|
// be reviewed.
|
||||||
|
return GetActiveProject();
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// Interface
|
// Interface
|
||||||
|
@ -34,7 +34,8 @@ CommandHandler::~CommandHandler()
|
|||||||
|
|
||||||
void CommandHandler::SetProject(AudacityProject *proj)
|
void CommandHandler::SetProject(AudacityProject *proj)
|
||||||
{
|
{
|
||||||
mCurrentContext->proj = proj;
|
// TODO: Review if the extend command handling is ever utilized
|
||||||
|
// mCurrentContext->proj = proj;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandHandler::OnReceiveCommand(AppCommandEvent &event)
|
void CommandHandler::OnReceiveCommand(AppCommandEvent &event)
|
||||||
@ -56,5 +57,5 @@ void CommandHandler::OnReceiveCommand(AppCommandEvent &event)
|
|||||||
delete cmd;
|
delete cmd;
|
||||||
|
|
||||||
// Redraw the project
|
// Redraw the project
|
||||||
mCurrentContext->proj->RedrawProject();
|
mCurrentContext->GetProject()->RedrawProject();
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ inline int min(int a, int b)
|
|||||||
|
|
||||||
bool CompareAudioCommand::Apply(CommandExecutionContext context)
|
bool CompareAudioCommand::Apply(CommandExecutionContext context)
|
||||||
{
|
{
|
||||||
if (!GetSelection(*context.proj))
|
if (!GetSelection(*context.GetProject()))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ Command *ExecMenuCommandType::Create(CommandOutputTarget *target)
|
|||||||
|
|
||||||
bool ExecMenuCommand::Apply(CommandExecutionContext context)
|
bool ExecMenuCommand::Apply(CommandExecutionContext context)
|
||||||
{
|
{
|
||||||
CommandManager *cmdManager = context.proj->GetCommandManager();
|
CommandManager *cmdManager = context.GetProject()->GetCommandManager();
|
||||||
|
|
||||||
wxString cmdName = GetString(wxT("CommandName"));
|
wxString cmdName = GetString(wxT("CommandName"));
|
||||||
wxUint32 cmdFlags = 0; // TODO ?
|
wxUint32 cmdFlags = 0; // TODO ?
|
||||||
|
@ -37,7 +37,7 @@ bool GetAllMenuCommands::Apply(CommandExecutionContext context)
|
|||||||
{
|
{
|
||||||
bool showStatus = GetBool(wxT("ShowStatus"));
|
bool showStatus = GetBool(wxT("ShowStatus"));
|
||||||
wxArrayString names;
|
wxArrayString names;
|
||||||
CommandManager *cmdManager = context.proj->GetCommandManager();
|
CommandManager *cmdManager = context.GetProject()->GetCommandManager();
|
||||||
cmdManager->GetAllCommandNames(names, false);
|
cmdManager->GetAllCommandNames(names, false);
|
||||||
wxArrayString::iterator iter;
|
wxArrayString::iterator iter;
|
||||||
for (iter = names.begin(); iter != names.end(); ++iter)
|
for (iter = names.begin(); iter != names.end(); ++iter)
|
||||||
|
@ -50,11 +50,11 @@ Command *GetProjectInfoCommandType::Create(CommandOutputTarget *target)
|
|||||||
bool GetProjectInfoCommand::Apply(CommandExecutionContext context)
|
bool GetProjectInfoCommand::Apply(CommandExecutionContext context)
|
||||||
{
|
{
|
||||||
wxString mode = GetString(wxT("Type"));
|
wxString mode = GetString(wxT("Type"));
|
||||||
TrackList *projTracks = context.proj->GetTracks();
|
TrackList *projTracks = context.GetProject()->GetTracks();
|
||||||
|
|
||||||
if (mode.IsSameAs(wxT("Name")))
|
if (mode.IsSameAs(wxT("Name")))
|
||||||
{
|
{
|
||||||
Status(context.proj->GetFileName());
|
Status(context.GetProject()->GetFileName());
|
||||||
}
|
}
|
||||||
else if (mode.IsSameAs(wxT("FocusedTrackID")))
|
else if (mode.IsSameAs(wxT("FocusedTrackID")))
|
||||||
{
|
{
|
||||||
@ -94,7 +94,7 @@ int GetProjectInfoCommand::SendNumberOfTracks(CommandExecutionContext context)
|
|||||||
{
|
{
|
||||||
int returnVal=0;
|
int returnVal=0;
|
||||||
|
|
||||||
TrackListIterator iter(context.proj->GetTracks());
|
TrackListIterator iter(context.GetProject()->GetTracks());
|
||||||
Track *t = iter.First();
|
Track *t = iter.First();
|
||||||
while (t)
|
while (t)
|
||||||
{
|
{
|
||||||
@ -111,10 +111,10 @@ int GetProjectInfoCommand::SendFocusedTrackIndex(CommandExecutionContext context
|
|||||||
{
|
{
|
||||||
int returnVal=0;
|
int returnVal=0;
|
||||||
int focusTrackIndex=0;
|
int focusTrackIndex=0;
|
||||||
TrackPanel *panel = context.proj->GetTrackPanel();
|
TrackPanel *panel = context.GetProject()->GetTrackPanel();
|
||||||
Track* focusedTrack = panel->GetFocusedTrack();
|
Track* focusedTrack = panel->GetFocusedTrack();
|
||||||
|
|
||||||
TrackListIterator iter(context.proj->GetTracks());
|
TrackListIterator iter(context.GetProject()->GetTracks());
|
||||||
Track *t = iter.First();
|
Track *t = iter.First();
|
||||||
while (t)
|
while (t)
|
||||||
{
|
{
|
||||||
|
@ -77,7 +77,7 @@ bool GetTrackInfoCommand::Apply(CommandExecutionContext context)
|
|||||||
// Get the track indicated by the TrackIndex parameter
|
// Get the track indicated by the TrackIndex parameter
|
||||||
// (Note: this ought to be somewhere else)
|
// (Note: this ought to be somewhere else)
|
||||||
long i = 0;
|
long i = 0;
|
||||||
TrackListIterator iter(context.proj->GetTracks());
|
TrackListIterator iter(context.GetProject()->GetTracks());
|
||||||
Track *t = iter.First();
|
Track *t = iter.First();
|
||||||
while (t && i != trackIndex)
|
while (t && i != trackIndex)
|
||||||
{
|
{
|
||||||
@ -115,7 +115,7 @@ bool GetTrackInfoCommand::Apply(CommandExecutionContext context)
|
|||||||
}
|
}
|
||||||
else if (mode.IsSameAs(wxT("Focused")))
|
else if (mode.IsSameAs(wxT("Focused")))
|
||||||
{
|
{
|
||||||
TrackPanel *panel = context.proj->GetTrackPanel();
|
TrackPanel *panel = context.GetProject()->GetTrackPanel();
|
||||||
SendBooleanStatus(panel->GetFocusedTrack() == t);
|
SendBooleanStatus(panel->GetFocusedTrack() == t);
|
||||||
}
|
}
|
||||||
else if (mode.IsSameAs(wxT("Selected")))
|
else if (mode.IsSameAs(wxT("Selected")))
|
||||||
|
@ -38,7 +38,7 @@ Command *ImportCommandType::Create(CommandOutputTarget *target)
|
|||||||
bool ImportCommand::Apply(CommandExecutionContext context)
|
bool ImportCommand::Apply(CommandExecutionContext context)
|
||||||
{
|
{
|
||||||
wxString filename = GetString(wxT("Filename"));
|
wxString filename = GetString(wxT("Filename"));
|
||||||
return context.proj->Import(filename);
|
return context.GetProject()->Import(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImportCommand::~ImportCommand()
|
ImportCommand::~ImportCommand()
|
||||||
@ -81,13 +81,13 @@ bool ExportCommand::Apply(CommandExecutionContext context)
|
|||||||
double t0, t1;
|
double t0, t1;
|
||||||
if (selection)
|
if (selection)
|
||||||
{
|
{
|
||||||
t0 = context.proj->mViewInfo.selectedRegion.t0();
|
t0 = context.GetProject()->mViewInfo.selectedRegion.t0();
|
||||||
t1 = context.proj->mViewInfo.selectedRegion.t1();
|
t1 = context.GetProject()->mViewInfo.selectedRegion.t1();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
t0 = 0.0;
|
t0 = 0.0;
|
||||||
t1 = context.proj->GetTracks()->GetEndTime();
|
t1 = context.GetProject()->GetTracks()->GetEndTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the extension and check it's valid
|
// Find the extension and check it's valid
|
||||||
@ -101,7 +101,7 @@ bool ExportCommand::Apply(CommandExecutionContext context)
|
|||||||
|
|
||||||
Exporter exporter;
|
Exporter exporter;
|
||||||
|
|
||||||
bool exportSuccess = exporter.Process(context.proj, numChannels,
|
bool exportSuccess = exporter.Process(context.GetProject(), numChannels,
|
||||||
extension.c_str(), filename,
|
extension.c_str(), filename,
|
||||||
selection, t0, t1);
|
selection, t0, t1);
|
||||||
|
|
||||||
|
@ -41,16 +41,16 @@ bool OpenProjectCommand::Apply(CommandExecutionContext context)
|
|||||||
{
|
{
|
||||||
wxString fileName = GetString(wxT("Filename"));
|
wxString fileName = GetString(wxT("Filename"));
|
||||||
bool addToHistory = GetBool(wxT("AddToHistory"));
|
bool addToHistory = GetBool(wxT("AddToHistory"));
|
||||||
wxString oldFileName = context.proj->GetFileName();
|
wxString oldFileName = context.GetProject()->GetFileName();
|
||||||
if(fileName == wxEmptyString)
|
if(fileName == wxEmptyString)
|
||||||
{
|
{
|
||||||
context.proj->OnOpen();
|
context.GetProject()->OnOpen();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
context.proj->OpenFile(fileName,addToHistory);
|
context.GetProject()->OpenFile(fileName,addToHistory);
|
||||||
}
|
}
|
||||||
wxString newFileName = context.proj->GetFileName();
|
wxString newFileName = context.GetProject()->GetFileName();
|
||||||
|
|
||||||
// Because Open does not return a success or failure, we have to guess
|
// Because Open does not return a success or failure, we have to guess
|
||||||
// at this point, based on whether the project file name has
|
// at this point, based on whether the project file name has
|
||||||
@ -91,9 +91,9 @@ bool SaveProjectCommand::Apply(CommandExecutionContext context)
|
|||||||
bool saveCompressed = GetBool(wxT("Compress"));
|
bool saveCompressed = GetBool(wxT("Compress"));
|
||||||
bool addToHistory = GetBool(wxT("AddToHistory"));
|
bool addToHistory = GetBool(wxT("AddToHistory"));
|
||||||
if(fileName == wxEmptyString)
|
if(fileName == wxEmptyString)
|
||||||
return context.proj->SaveAs(saveCompressed);
|
return context.GetProject()->SaveAs(saveCompressed);
|
||||||
else
|
else
|
||||||
return context.proj->SaveAs(fileName,saveCompressed,addToHistory);
|
return context.GetProject()->SaveAs(fileName,saveCompressed,addToHistory);
|
||||||
}
|
}
|
||||||
|
|
||||||
SaveProjectCommand::~SaveProjectCommand()
|
SaveProjectCommand::~SaveProjectCommand()
|
||||||
|
@ -354,9 +354,9 @@ bool ScreenshotCommand::Apply(CommandExecutionContext context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reset the toolbars to a known state
|
// Reset the toolbars to a known state
|
||||||
context.proj->mToolManager->Reset();
|
context.GetProject()->mToolManager->Reset();
|
||||||
|
|
||||||
wxTopLevelWindow *w = GetFrontWindow(context.proj);
|
wxTopLevelWindow *w = GetFrontWindow(context.GetProject());
|
||||||
if (!w)
|
if (!w)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@ -370,7 +370,7 @@ bool ScreenshotCommand::Apply(CommandExecutionContext context)
|
|||||||
w->ClientToScreen(&x, &y);
|
w->ClientToScreen(&x, &y);
|
||||||
w->GetClientSize(&width, &height);
|
w->GetClientSize(&width, &height);
|
||||||
|
|
||||||
if (w != context.proj && w->GetTitle() != wxT("")) {
|
if (w != context.GetProject() && w->GetTitle() != wxT("")) {
|
||||||
fileName = MakeFileName(filePath,
|
fileName = MakeFileName(filePath,
|
||||||
captureMode + (wxT("-") + w->GetTitle() + wxT("-")));
|
captureMode + (wxT("-") + w->GetTitle() + wxT("-")));
|
||||||
}
|
}
|
||||||
@ -385,7 +385,7 @@ bool ScreenshotCommand::Apply(CommandExecutionContext context)
|
|||||||
r.SetPosition(w->GetScreenPosition());
|
r.SetPosition(w->GetScreenPosition());
|
||||||
r = w->GetScreenRect();
|
r = w->GetScreenRect();
|
||||||
|
|
||||||
if (w != context.proj && w->GetTitle() != wxT("")) {
|
if (w != context.GetProject() && w->GetTitle() != wxT("")) {
|
||||||
fileName = MakeFileName(filePath,
|
fileName = MakeFileName(filePath,
|
||||||
captureMode + (wxT("-") + w->GetTitle() + wxT("-")));
|
captureMode + (wxT("-") + w->GetTitle() + wxT("-")));
|
||||||
}
|
}
|
||||||
@ -417,43 +417,43 @@ bool ScreenshotCommand::Apply(CommandExecutionContext context)
|
|||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("toolbars")))
|
else if (captureMode.IsSameAs(wxT("toolbars")))
|
||||||
{
|
{
|
||||||
CaptureDock(context.proj->mToolManager->GetTopDock(), fileName);
|
CaptureDock(context.GetProject()->mToolManager->GetTopDock(), fileName);
|
||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("selectionbar")))
|
else if (captureMode.IsSameAs(wxT("selectionbar")))
|
||||||
{
|
{
|
||||||
CaptureDock(context.proj->mToolManager->GetBotDock(), fileName);
|
CaptureDock(context.GetProject()->mToolManager->GetBotDock(), fileName);
|
||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("tools")))
|
else if (captureMode.IsSameAs(wxT("tools")))
|
||||||
{
|
{
|
||||||
CaptureToolbar(context.proj->mToolManager, ToolsBarID, fileName);
|
CaptureToolbar(context.GetProject()->mToolManager, ToolsBarID, fileName);
|
||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("transport")))
|
else if (captureMode.IsSameAs(wxT("transport")))
|
||||||
{
|
{
|
||||||
CaptureToolbar(context.proj->mToolManager, TransportBarID, fileName);
|
CaptureToolbar(context.GetProject()->mToolManager, TransportBarID, fileName);
|
||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("mixer")))
|
else if (captureMode.IsSameAs(wxT("mixer")))
|
||||||
{
|
{
|
||||||
CaptureToolbar(context.proj->mToolManager, MixerBarID, fileName);
|
CaptureToolbar(context.GetProject()->mToolManager, MixerBarID, fileName);
|
||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("meter")))
|
else if (captureMode.IsSameAs(wxT("meter")))
|
||||||
{
|
{
|
||||||
CaptureToolbar(context.proj->mToolManager, MeterBarID, fileName);
|
CaptureToolbar(context.GetProject()->mToolManager, MeterBarID, fileName);
|
||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("edit")))
|
else if (captureMode.IsSameAs(wxT("edit")))
|
||||||
{
|
{
|
||||||
CaptureToolbar(context.proj->mToolManager, EditBarID, fileName);
|
CaptureToolbar(context.GetProject()->mToolManager, EditBarID, fileName);
|
||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("device")))
|
else if (captureMode.IsSameAs(wxT("device")))
|
||||||
{
|
{
|
||||||
CaptureToolbar(context.proj->mToolManager, DeviceBarID, fileName);
|
CaptureToolbar(context.GetProject()->mToolManager, DeviceBarID, fileName);
|
||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("transcription")))
|
else if (captureMode.IsSameAs(wxT("transcription")))
|
||||||
{
|
{
|
||||||
CaptureToolbar(context.proj->mToolManager, TranscriptionBarID, fileName);
|
CaptureToolbar(context.GetProject()->mToolManager, TranscriptionBarID, fileName);
|
||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("trackpanel")))
|
else if (captureMode.IsSameAs(wxT("trackpanel")))
|
||||||
{
|
{
|
||||||
TrackPanel *panel = context.proj->mTrackPanel;
|
TrackPanel *panel = context.GetProject()->mTrackPanel;
|
||||||
//AdornedRulerPanel *ruler = panel->mRuler;
|
//AdornedRulerPanel *ruler = panel->mRuler;
|
||||||
|
|
||||||
int h = panel->mRuler->GetRulerHeight();
|
int h = panel->mRuler->GetRulerHeight();
|
||||||
@ -468,7 +468,7 @@ bool ScreenshotCommand::Apply(CommandExecutionContext context)
|
|||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("ruler")))
|
else if (captureMode.IsSameAs(wxT("ruler")))
|
||||||
{
|
{
|
||||||
TrackPanel *panel = context.proj->mTrackPanel;
|
TrackPanel *panel = context.GetProject()->mTrackPanel;
|
||||||
AdornedRulerPanel *ruler = panel->mRuler;
|
AdornedRulerPanel *ruler = panel->mRuler;
|
||||||
|
|
||||||
int x = 0, y = 0;
|
int x = 0, y = 0;
|
||||||
@ -483,7 +483,7 @@ bool ScreenshotCommand::Apply(CommandExecutionContext context)
|
|||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("tracks")))
|
else if (captureMode.IsSameAs(wxT("tracks")))
|
||||||
{
|
{
|
||||||
TrackPanel *panel = context.proj->mTrackPanel;
|
TrackPanel *panel = context.GetProject()->mTrackPanel;
|
||||||
|
|
||||||
int x = 0, y = 0;
|
int x = 0, y = 0;
|
||||||
int width, height;
|
int width, height;
|
||||||
@ -496,8 +496,8 @@ bool ScreenshotCommand::Apply(CommandExecutionContext context)
|
|||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("firsttrack")))
|
else if (captureMode.IsSameAs(wxT("firsttrack")))
|
||||||
{
|
{
|
||||||
TrackPanel *panel = context.proj->mTrackPanel;
|
TrackPanel *panel = context.GetProject()->mTrackPanel;
|
||||||
TrackListIterator iter(context.proj->GetTracks());
|
TrackListIterator iter(context.GetProject()->GetTracks());
|
||||||
Track * t = iter.First();
|
Track * t = iter.First();
|
||||||
if (!t) {
|
if (!t) {
|
||||||
return false;
|
return false;
|
||||||
@ -516,8 +516,8 @@ bool ScreenshotCommand::Apply(CommandExecutionContext context)
|
|||||||
}
|
}
|
||||||
else if (captureMode.IsSameAs(wxT("secondtrack")))
|
else if (captureMode.IsSameAs(wxT("secondtrack")))
|
||||||
{
|
{
|
||||||
TrackPanel *panel = context.proj->mTrackPanel;
|
TrackPanel *panel = context.GetProject()->mTrackPanel;
|
||||||
TrackListIterator iter(context.proj->GetTracks());
|
TrackListIterator iter(context.GetProject()->GetTracks());
|
||||||
Track * t = iter.First();
|
Track * t = iter.First();
|
||||||
if (!t) {
|
if (!t) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -59,12 +59,12 @@ bool SelectCommand::Apply(CommandExecutionContext context)
|
|||||||
if (mode.IsSameAs(wxT("None")))
|
if (mode.IsSameAs(wxT("None")))
|
||||||
{
|
{
|
||||||
// select none
|
// select none
|
||||||
context.proj->OnSelectNone();
|
context.GetProject()->OnSelectNone();
|
||||||
}
|
}
|
||||||
else if (mode.IsSameAs(wxT("All")))
|
else if (mode.IsSameAs(wxT("All")))
|
||||||
{
|
{
|
||||||
// select all
|
// select all
|
||||||
context.proj->OnSelectAll();
|
context.GetProject()->OnSelectAll();
|
||||||
}
|
}
|
||||||
else if (mode.IsSameAs(wxT("Range")))
|
else if (mode.IsSameAs(wxT("Range")))
|
||||||
{
|
{
|
||||||
@ -72,14 +72,14 @@ bool SelectCommand::Apply(CommandExecutionContext context)
|
|||||||
double t0 = GetDouble(wxT("StartTime"));
|
double t0 = GetDouble(wxT("StartTime"));
|
||||||
double t1 = GetDouble(wxT("EndTime"));
|
double t1 = GetDouble(wxT("EndTime"));
|
||||||
|
|
||||||
TrackList *tracks = context.proj->GetTracks();
|
TrackList *tracks = context.GetProject()->GetTracks();
|
||||||
|
|
||||||
if (t0 < context.proj->GetTracks()->GetMinOffset())
|
if (t0 < context.GetProject()->GetTracks()->GetMinOffset())
|
||||||
{
|
{
|
||||||
Error(wxT("Start time is before start of track!"));
|
Error(wxT("Start time is before start of track!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (t1 > context.proj->GetTracks()->GetEndTime())
|
if (t1 > context.GetProject()->GetTracks()->GetEndTime())
|
||||||
{
|
{
|
||||||
Error(wxT("End time is after end of track!"));
|
Error(wxT("End time is after end of track!"));
|
||||||
return false;
|
return false;
|
||||||
@ -90,9 +90,9 @@ bool SelectCommand::Apply(CommandExecutionContext context)
|
|||||||
// defaulted, as in the second branch?
|
// defaulted, as in the second branch?
|
||||||
// Or should this command take more parameters?
|
// Or should this command take more parameters?
|
||||||
#if 1
|
#if 1
|
||||||
context.proj->mViewInfo.selectedRegion.setTimes(t0, t1);
|
context.GetProject()->mViewInfo.selectedRegion.setTimes(t0, t1);
|
||||||
#else
|
#else
|
||||||
context.proj->mViewInfo.selectedRegion = SelectedRegion(t0, t1);
|
context.GetProject()->mViewInfo.selectedRegion = SelectedRegion(t0, t1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// select specified tracks
|
// select specified tracks
|
||||||
@ -128,7 +128,7 @@ bool SelectCommand::Apply(CommandExecutionContext context)
|
|||||||
else if (mode.IsSameAs(wxT("Name")))
|
else if (mode.IsSameAs(wxT("Name")))
|
||||||
{
|
{
|
||||||
wxString name = GetString(wxT("TrackName"));
|
wxString name = GetString(wxT("TrackName"));
|
||||||
TrackList *tracks = context.proj->GetTracks();
|
TrackList *tracks = context.GetProject()->GetTracks();
|
||||||
TrackListIterator iter(tracks);
|
TrackListIterator iter(tracks);
|
||||||
Track *t = iter.First();
|
Track *t = iter.First();
|
||||||
while (t) {
|
while (t) {
|
||||||
|
@ -57,14 +57,14 @@ bool SetProjectInfoCommand::Apply(CommandExecutionContext context)
|
|||||||
wxString settingsString = GetString(wxT(kSetOfTracksStr));
|
wxString settingsString = GetString(wxT(kSetOfTracksStr));
|
||||||
|
|
||||||
if (mode.IsSameAs(wxT("SelectedTracks")))
|
if (mode.IsSameAs(wxT("SelectedTracks")))
|
||||||
SetAllTracksParam( context.proj->GetTracks(), settingsString,
|
SetAllTracksParam( context.GetProject()->GetTracks(), settingsString,
|
||||||
&SetProjectInfoCommand::setSelected);
|
&SetProjectInfoCommand::setSelected);
|
||||||
|
|
||||||
else if (mode.IsSameAs(wxT("SoloTracks")))
|
else if (mode.IsSameAs(wxT("SoloTracks")))
|
||||||
SetAllTracksParam( context.proj->GetTracks(), settingsString, &SetProjectInfoCommand::setSolo);
|
SetAllTracksParam( context.GetProject()->GetTracks(), settingsString, &SetProjectInfoCommand::setSolo);
|
||||||
|
|
||||||
else if (mode.IsSameAs(wxT("MuteTracks")))
|
else if (mode.IsSameAs(wxT("MuteTracks")))
|
||||||
SetAllTracksParam( context.proj->GetTracks(), settingsString, &SetProjectInfoCommand::setMute);
|
SetAllTracksParam( context.GetProject()->GetTracks(), settingsString, &SetProjectInfoCommand::setMute);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Error(wxT("Invalid info type!"));
|
Error(wxT("Invalid info type!"));
|
||||||
|
@ -50,7 +50,7 @@ bool SetTrackInfoCommand::Apply(CommandExecutionContext context)
|
|||||||
|
|
||||||
// (Note: track selection ought to be somewhere else)
|
// (Note: track selection ought to be somewhere else)
|
||||||
long i = 0;
|
long i = 0;
|
||||||
TrackListIterator iter(context.proj->GetTracks());
|
TrackListIterator iter(context.GetProject()->GetTracks());
|
||||||
Track *t = iter.First();
|
Track *t = iter.First();
|
||||||
while (t && i != trackIndex)
|
while (t && i != trackIndex)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user