mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-08 16:11:14 +02:00
Store choices as numerical codes in ScreenshotCommand, not strings...
... there was confusion whether they were meant to be a translated strings or not
This commit is contained in:
parent
78f058b844
commit
277537c7b8
@ -73,7 +73,7 @@ class ScreenFrame final : public wxFrame
|
|||||||
void OnToggleBackgroundBlue(wxCommandEvent & event);
|
void OnToggleBackgroundBlue(wxCommandEvent & event);
|
||||||
void OnToggleBackgroundWhite(wxCommandEvent & event);
|
void OnToggleBackgroundWhite(wxCommandEvent & event);
|
||||||
|
|
||||||
void DoCapture(wxString captureMode);
|
void DoCapture(int captureMode);
|
||||||
void OnCaptureSomething(wxCommandEvent & event);
|
void OnCaptureSomething(wxCommandEvent & event);
|
||||||
|
|
||||||
void TimeZoom(double seconds);
|
void TimeZoom(double seconds);
|
||||||
@ -582,12 +582,15 @@ void ScreenFrame::OnMainWindowLarge(wxCommandEvent & WXUNUSED(event))
|
|||||||
SizeMainWindow(900, 600);
|
SizeMainWindow(900, 600);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenFrame::DoCapture(wxString captureMode)
|
void ScreenFrame::DoCapture(int captureMode)
|
||||||
{
|
{
|
||||||
Hide();
|
Hide();
|
||||||
//mCommand->SetParameter(wxT("FilePath"), mDirectoryTextBox->GetValue());
|
//mCommand->SetParameter(wxT("FilePath"), mDirectoryTextBox->GetValue());
|
||||||
//mCommand->SetParameter(wxT("CaptureMode"), captureMode);
|
//mCommand->SetParameter(wxT("CaptureMode"), captureMode);
|
||||||
mCommand->mBack = mWhite->GetValue() ? "White" : mBlue->GetValue() ? "Blue" : "None";
|
mCommand->mBack = mWhite->GetValue()
|
||||||
|
? ScreenshotCommand::kWhite
|
||||||
|
: mBlue->GetValue()
|
||||||
|
? ScreenshotCommand::kBlue : ScreenshotCommand::kNone;
|
||||||
mCommand->mPath = mDirectoryTextBox->GetValue();
|
mCommand->mPath = mDirectoryTextBox->GetValue();
|
||||||
mCommand->mWhat = captureMode;
|
mCommand->mWhat = captureMode;
|
||||||
if (!mCommand->Apply(mContext))
|
if (!mCommand->Apply(mContext))
|
||||||
@ -599,36 +602,70 @@ void ScreenFrame::OnCaptureSomething(wxCommandEvent & event)
|
|||||||
{
|
{
|
||||||
int i = event.GetId() - IdCaptureFirst;
|
int i = event.GetId() - IdCaptureFirst;
|
||||||
|
|
||||||
wxArrayString Names;
|
/*
|
||||||
|
IdCaptureEffects= IdCaptureFirst,
|
||||||
|
IdCaptureScriptables,
|
||||||
|
IdCapturePreferences,
|
||||||
|
IdCaptureToolbars,
|
||||||
|
|
||||||
Names.Add(wxT("Effects"));
|
// Put all events that need delay between AllDelayed and LastDelayed.
|
||||||
Names.Add(wxT("Scriptables"));
|
IdAllDelayedEvents,
|
||||||
Names.Add(wxT("Preferences"));
|
IdCaptureWindowContents=IdAllDelayedEvents,
|
||||||
Names.Add(wxT("Toolbars"));
|
IdCaptureFullWindow,
|
||||||
|
IdCaptureWindowPlus,
|
||||||
|
IdCaptureFullScreen,
|
||||||
|
|
||||||
|
IdCaptureSelectionBar,
|
||||||
|
IdCaptureSpectralSelection,
|
||||||
|
IdCaptureTools,
|
||||||
|
IdCaptureTransport,
|
||||||
|
IdCaptureMixer,
|
||||||
|
IdCaptureMeter,
|
||||||
|
IdCapturePlayMeter,
|
||||||
|
IdCaptureRecordMeter,
|
||||||
|
IdCaptureEdit,
|
||||||
|
IdCaptureDevice,
|
||||||
|
IdCaptureTranscription,
|
||||||
|
IdCaptureScrub,
|
||||||
|
|
||||||
Names.Add(wxT("Window"));
|
IdCaptureTrackPanel,
|
||||||
Names.Add(wxT("Full_Window"));
|
IdCaptureRuler,
|
||||||
Names.Add(wxT("Window_Plus"));
|
IdCaptureTracks,
|
||||||
Names.Add(wxT("Fullscreen"));
|
IdCaptureFirstTrack,
|
||||||
Names.Add(wxT("Selectionbar"));
|
IdCaptureSecondTrack,
|
||||||
Names.Add(wxT("Spectral_Selection"));
|
IdCaptureLast = IdCaptureSecondTrack,
|
||||||
Names.Add(wxT("Tools"));
|
*/
|
||||||
Names.Add(wxT("Transport"));
|
|
||||||
Names.Add(wxT("Mixer"));
|
|
||||||
Names.Add(wxT("Meter"));
|
|
||||||
Names.Add(wxT("Play_Meter"));
|
|
||||||
Names.Add(wxT("Record_Meter"));
|
|
||||||
Names.Add(wxT("Edit"));
|
|
||||||
Names.Add(wxT("Device"));
|
|
||||||
Names.Add(wxT("Transcription"));
|
|
||||||
Names.Add(wxT("Scrub"));
|
|
||||||
Names.Add(wxT("Trackpanel"));
|
|
||||||
Names.Add(wxT("Ruler"));
|
|
||||||
Names.Add(wxT("Tracks"));
|
|
||||||
Names.Add(wxT("First_Track"));
|
|
||||||
Names.Add(wxT("Second_Track"));
|
|
||||||
|
|
||||||
DoCapture(Names[i]);
|
static int codes[] = {
|
||||||
|
ScreenshotCommand::keffects,
|
||||||
|
ScreenshotCommand::kscriptables,
|
||||||
|
ScreenshotCommand::kpreferences,
|
||||||
|
ScreenshotCommand::ktoolbars,
|
||||||
|
|
||||||
|
ScreenshotCommand::kwindow,
|
||||||
|
ScreenshotCommand::kfullwindow,
|
||||||
|
ScreenshotCommand::kwindowplus,
|
||||||
|
ScreenshotCommand::kfullscreen,
|
||||||
|
ScreenshotCommand::kselectionbar,
|
||||||
|
ScreenshotCommand::kspectralselection,
|
||||||
|
ScreenshotCommand::ktools,
|
||||||
|
ScreenshotCommand::ktransport,
|
||||||
|
ScreenshotCommand::kmixer,
|
||||||
|
ScreenshotCommand::kmeter,
|
||||||
|
ScreenshotCommand::kplaymeter,
|
||||||
|
ScreenshotCommand::krecordmeter,
|
||||||
|
ScreenshotCommand::kedit,
|
||||||
|
ScreenshotCommand::kdevice,
|
||||||
|
ScreenshotCommand::ktranscription,
|
||||||
|
ScreenshotCommand::kscrub,
|
||||||
|
ScreenshotCommand::ktrackpanel,
|
||||||
|
ScreenshotCommand::kruler,
|
||||||
|
ScreenshotCommand::ktracks,
|
||||||
|
ScreenshotCommand::kfirsttrack,
|
||||||
|
ScreenshotCommand::ksecondtrack,
|
||||||
|
};
|
||||||
|
|
||||||
|
DoCapture(codes[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenFrame::TimeZoom(double seconds)
|
void ScreenFrame::TimeZoom(double seconds)
|
||||||
|
@ -46,44 +46,7 @@ small calculations of rectangles.
|
|||||||
#include "CommandContext.h"
|
#include "CommandContext.h"
|
||||||
|
|
||||||
|
|
||||||
enum kCaptureTypes
|
static const wxString kCaptureWhatStrings[ ScreenshotCommand::nCaptureWhats ] =
|
||||||
{
|
|
||||||
kwindow,
|
|
||||||
kfullwindow,
|
|
||||||
kwindowplus,
|
|
||||||
kfullscreen,
|
|
||||||
ktoolbars,
|
|
||||||
keffects,
|
|
||||||
kscriptables,
|
|
||||||
kpreferences,
|
|
||||||
kselectionbar,
|
|
||||||
kspectralselection,
|
|
||||||
ktools,
|
|
||||||
ktransport,
|
|
||||||
kmixer,
|
|
||||||
kmeter,
|
|
||||||
kplaymeter,
|
|
||||||
krecordmeter,
|
|
||||||
kedit,
|
|
||||||
kdevice,
|
|
||||||
kscrub,
|
|
||||||
ktranscription,
|
|
||||||
ktrackpanel,
|
|
||||||
kruler,
|
|
||||||
ktracks,
|
|
||||||
kfirsttrack,
|
|
||||||
kfirsttwotracks,
|
|
||||||
kfirstthreetracks,
|
|
||||||
kfirstfourtracks,
|
|
||||||
ksecondtrack,
|
|
||||||
ktracksplus,
|
|
||||||
kfirsttrackplus,
|
|
||||||
kalltracks,
|
|
||||||
kalltracksplus,
|
|
||||||
nCaptureWhats
|
|
||||||
};
|
|
||||||
|
|
||||||
static const wxString kCaptureWhatStrings[nCaptureWhats] =
|
|
||||||
{
|
{
|
||||||
XO("Window"),
|
XO("Window"),
|
||||||
XO("Full_Window"),
|
XO("Full_Window"),
|
||||||
@ -120,15 +83,7 @@ static const wxString kCaptureWhatStrings[nCaptureWhats] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
enum kBackgrounds
|
static const wxString kBackgroundStrings[ ScreenshotCommand::nBackgrounds ] =
|
||||||
{
|
|
||||||
kBlue,
|
|
||||||
kWhite,
|
|
||||||
kNone,
|
|
||||||
nBackgrounds
|
|
||||||
};
|
|
||||||
|
|
||||||
static const wxString kBackgroundStrings[nBackgrounds] =
|
|
||||||
{
|
{
|
||||||
XO("Blue"),
|
XO("Blue"),
|
||||||
XO("White"),
|
XO("White"),
|
||||||
@ -140,8 +95,8 @@ bool ScreenshotCommand::DefineParams( ShuttleParams & S ){
|
|||||||
wxArrayString whats(nCaptureWhats, kCaptureWhatStrings);
|
wxArrayString whats(nCaptureWhats, kCaptureWhatStrings);
|
||||||
wxArrayString backs(nBackgrounds, kBackgroundStrings);
|
wxArrayString backs(nBackgrounds, kBackgroundStrings);
|
||||||
S.Define( mPath, wxT("Path"), wxT(""));
|
S.Define( mPath, wxT("Path"), wxT(""));
|
||||||
S.DefineEnum( mWhat, wxT("CaptureWhat"), wxT("Window"), whats );
|
S.DefineEnum( mWhat, wxT("CaptureWhat"), kwindow, whats );
|
||||||
S.OptionalN(bHasBackground).DefineEnum( mBack, wxT("Background"), wxT("None"), backs );
|
S.OptionalN(bHasBackground).DefineEnum( mBack, wxT("Background"), kNone, backs );
|
||||||
S.OptionalN(bHasBringToTop).Define( mbBringToTop, wxT("ToTop"), true );
|
S.OptionalN(bHasBringToTop).Define( mbBringToTop, wxT("ToTop"), true );
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
@ -671,17 +626,17 @@ void ScreenshotCommand::GetDerivedParams()
|
|||||||
// Read the parameters that were passed in
|
// Read the parameters that were passed in
|
||||||
mFilePath = mPath;
|
mFilePath = mPath;
|
||||||
mCaptureMode = mWhat;
|
mCaptureMode = mWhat;
|
||||||
wxString background = mBack;
|
|
||||||
|
|
||||||
// Build a suitable filename
|
// Build a suitable filename
|
||||||
mFileName = MakeFileName(mFilePath, mCaptureMode);
|
mFileName = MakeFileName(mFilePath,
|
||||||
|
GetCustomTranslation( kCaptureWhatStrings[ mCaptureMode ] ));
|
||||||
|
|
||||||
if (background.IsSameAs(wxT("Blue")))
|
if (mBack == kBlue)
|
||||||
{
|
{
|
||||||
mBackground = true;
|
mBackground = true;
|
||||||
mBackColor = wxColour(51, 102, 153);
|
mBackColor = wxColour(51, 102, 153);
|
||||||
}
|
}
|
||||||
else if (background.IsSameAs(wxT("White")))
|
else if (mBack == kWhite)
|
||||||
{
|
{
|
||||||
mBackground = true;
|
mBackground = true;
|
||||||
mBackColor = wxColour(255, 255, 255);
|
mBackColor = wxColour(255, 255, 255);
|
||||||
@ -714,7 +669,7 @@ wxRect ScreenshotCommand::GetFullWindowRect(wxTopLevelWindow *w){
|
|||||||
r.height += wxSystemSettings::GetMetric(wxSYS_CAPTION_Y, w) +
|
r.height += wxSystemSettings::GetMetric(wxSYS_CAPTION_Y, w) +
|
||||||
wxSystemSettings::GetMetric(wxSYS_BORDER_Y, w);
|
wxSystemSettings::GetMetric(wxSYS_BORDER_Y, w);
|
||||||
#endif
|
#endif
|
||||||
if (!mBackground && mCaptureMode.IsSameAs(wxT("Window_Plus")))
|
if (!mBackground && mCaptureMode == kwindowplus )
|
||||||
{
|
{
|
||||||
// background colour not selected but we want a background
|
// background colour not selected but we want a background
|
||||||
wxRect b = GetBackgroundRect();
|
wxRect b = GetBackgroundRect();
|
||||||
@ -824,7 +779,8 @@ wxRect ScreenshotCommand::GetTrackRect( AudacityProject * pProj, TrackPanel * pa
|
|||||||
wxString ScreenshotCommand::WindowFileName(AudacityProject * proj, wxTopLevelWindow *w){
|
wxString ScreenshotCommand::WindowFileName(AudacityProject * proj, wxTopLevelWindow *w){
|
||||||
if (w != proj && w->GetTitle() != wxT("")) {
|
if (w != proj && w->GetTitle() != wxT("")) {
|
||||||
mFileName = MakeFileName(mFilePath,
|
mFileName = MakeFileName(mFilePath,
|
||||||
mCaptureMode + (wxT("-") + w->GetTitle() + wxT("-")));
|
GetCustomTranslation( kCaptureWhatStrings[ mCaptureMode ] ) +
|
||||||
|
(wxT("-") + w->GetTitle() + wxT("-")));
|
||||||
}
|
}
|
||||||
return mFileName;
|
return mFileName;
|
||||||
}
|
}
|
||||||
@ -851,96 +807,101 @@ bool ScreenshotCommand::Apply(const CommandContext & context)
|
|||||||
|
|
||||||
wxPoint p( x2-x1, y2-y1);
|
wxPoint p( x2-x1, y2-y1);
|
||||||
|
|
||||||
if (mCaptureMode.IsSameAs(wxT("Window")))
|
switch (mCaptureMode) {
|
||||||
|
case kwindow:
|
||||||
return Capture(context, WindowFileName( context.GetProject(), w ) , w, GetWindowRect(w));
|
return Capture(context, WindowFileName( context.GetProject(), w ) , w, GetWindowRect(w));
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Fullwindow"))
|
case kfullwindow:
|
||||||
|| mCaptureMode.IsSameAs(wxT("Window_Plus")))
|
case kwindowplus:
|
||||||
return Capture(context, WindowFileName( context.GetProject(), w ) , w, GetFullWindowRect(w));
|
return Capture(context, WindowFileName( context.GetProject(), w ) , w, GetFullWindowRect(w));
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Fullscreen")))
|
case kfullscreen:
|
||||||
return Capture(context, mFileName, w,GetScreenRect());
|
return Capture(context, mFileName, w,GetScreenRect());
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Toolbars")))
|
case ktoolbars:
|
||||||
return CaptureDock(context, context.GetProject()->GetToolManager()->GetTopDock(), mFileName);
|
return CaptureDock(context, context.GetProject()->GetToolManager()->GetTopDock(), mFileName);
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Scriptables")))
|
case kscriptables:
|
||||||
CaptureScriptables(context, context.GetProject(), mFileName);
|
CaptureScriptables(context, context.GetProject(), mFileName);
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Effects")))
|
break;
|
||||||
|
case keffects:
|
||||||
CaptureEffects(context, context.GetProject(), mFileName);
|
CaptureEffects(context, context.GetProject(), mFileName);
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Preferences")))
|
break;
|
||||||
|
case kpreferences:
|
||||||
CapturePreferences(context, context.GetProject(), mFileName);
|
CapturePreferences(context, context.GetProject(), mFileName);
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Selectionbar")))
|
break;
|
||||||
|
case kselectionbar:
|
||||||
return CaptureToolbar(context, context.GetProject()->GetToolManager(), SelectionBarID, mFileName);
|
return CaptureToolbar(context, context.GetProject()->GetToolManager(), SelectionBarID, mFileName);
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Frequency_Selection")))
|
case kspectralselection:
|
||||||
return CaptureToolbar(context, context.GetProject()->GetToolManager(), SpectralSelectionBarID, mFileName);
|
return CaptureToolbar(context, context.GetProject()->GetToolManager(), SpectralSelectionBarID, mFileName);
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Tools")))
|
case ktools:
|
||||||
return CaptureToolbar(context, context.GetProject()->GetToolManager(), ToolsBarID, mFileName);
|
return CaptureToolbar(context, context.GetProject()->GetToolManager(), ToolsBarID, mFileName);
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Transport")))
|
case ktransport:
|
||||||
return CaptureToolbar(context, context.GetProject()->GetToolManager(), TransportBarID, mFileName);
|
return CaptureToolbar(context, context.GetProject()->GetToolManager(), TransportBarID, mFileName);
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Mixer")))
|
case kmixer:
|
||||||
return CaptureToolbar(context, context.GetProject()->GetToolManager(), MixerBarID, mFileName);
|
return CaptureToolbar(context, context.GetProject()->GetToolManager(), MixerBarID, mFileName);
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Meter")))
|
case kmeter:
|
||||||
return CaptureToolbar(context, context.GetProject()->GetToolManager(), MeterBarID, mFileName);
|
return CaptureToolbar(context, context.GetProject()->GetToolManager(), MeterBarID, mFileName);
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Recordmeter")))
|
case krecordmeter:
|
||||||
return CaptureToolbar(context, context.GetProject()->GetToolManager(), RecordMeterBarID, mFileName);
|
return CaptureToolbar(context, context.GetProject()->GetToolManager(), RecordMeterBarID, mFileName);
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Playmeter")))
|
case kplaymeter:
|
||||||
return CaptureToolbar(context, context.GetProject()->GetToolManager(), PlayMeterBarID, mFileName);
|
return CaptureToolbar(context, context.GetProject()->GetToolManager(), PlayMeterBarID, mFileName);
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Edit")))
|
case kedit:
|
||||||
return CaptureToolbar(context, context.GetProject()->GetToolManager(), EditBarID, mFileName);
|
return CaptureToolbar(context, context.GetProject()->GetToolManager(), EditBarID, mFileName);
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Device")))
|
case kdevice:
|
||||||
return CaptureToolbar(context, context.GetProject()->GetToolManager(), DeviceBarID, mFileName);
|
return CaptureToolbar(context, context.GetProject()->GetToolManager(), DeviceBarID, mFileName);
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Transcription")))
|
case ktranscription:
|
||||||
return CaptureToolbar(context, context.GetProject()->GetToolManager(), TranscriptionBarID, mFileName);
|
return CaptureToolbar(context, context.GetProject()->GetToolManager(), TranscriptionBarID, mFileName);
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Scrub")))
|
case kscrub:
|
||||||
return CaptureToolbar(context, context.GetProject()->GetToolManager(), ScrubbingBarID, mFileName);
|
return CaptureToolbar(context, context.GetProject()->GetToolManager(), ScrubbingBarID, mFileName);
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Trackpanel")))
|
case ktrackpanel:
|
||||||
return Capture(context, mFileName, panel, GetPanelRect(panel));
|
return Capture(context, mFileName, panel, GetPanelRect(panel));
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Ruler")))
|
case kruler:
|
||||||
return Capture(context, mFileName, ruler, GetRulerRect(ruler) );
|
return Capture(context, mFileName, ruler, GetRulerRect(ruler) );
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Tracks")))
|
case ktracks:
|
||||||
return Capture(context, mFileName, panel, GetTracksRect(panel));
|
return Capture(context, mFileName, panel, GetTracksRect(panel));
|
||||||
else if (mCaptureMode.IsSameAs(wxT("First_Track")))
|
case kfirsttrack:
|
||||||
return Capture(context, mFileName, panel, GetTrackRect( context.GetProject(), panel, 0 ) );
|
return Capture(context, mFileName, panel, GetTrackRect( context.GetProject(), panel, 0 ) );
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Second_Track")))
|
case ksecondtrack:
|
||||||
return Capture(context, mFileName, panel, GetTrackRect( context.GetProject(), panel, 1 ) );
|
return Capture(context, mFileName, panel, GetTrackRect( context.GetProject(), panel, 1 ) );
|
||||||
else if (mCaptureMode.IsSameAs(wxT("Tracks_Plus")))
|
case ktracksplus:
|
||||||
{ wxRect r = GetTracksRect(panel);
|
{ wxRect r = GetTracksRect(panel);
|
||||||
r.SetTop( r.GetTop() - ruler->GetRulerHeight() );
|
r.SetTop( r.GetTop() - ruler->GetRulerHeight() );
|
||||||
r.SetHeight( r.GetHeight() + ruler->GetRulerHeight() );
|
r.SetHeight( r.GetHeight() + ruler->GetRulerHeight() );
|
||||||
return Capture(context, mFileName, panel, r);
|
return Capture(context, mFileName, panel, r);
|
||||||
}
|
}
|
||||||
else if (mCaptureMode.IsSameAs(wxT("First_Track_Plus")))
|
case kfirsttrackplus:
|
||||||
{ wxRect r = GetTrackRect(context.GetProject(), panel, 0 );
|
{ wxRect r = GetTrackRect(context.GetProject(), panel, 0 );
|
||||||
r.SetTop( r.GetTop() - ruler->GetRulerHeight() );
|
r.SetTop( r.GetTop() - ruler->GetRulerHeight() );
|
||||||
r.SetHeight( r.GetHeight() + ruler->GetRulerHeight() );
|
r.SetHeight( r.GetHeight() + ruler->GetRulerHeight() );
|
||||||
return Capture(context, mFileName, panel, r );
|
return Capture(context, mFileName, panel, r );
|
||||||
}
|
}
|
||||||
else if (mCaptureMode.IsSameAs(wxT("First_Two_Tracks")))
|
case kfirsttwotracks:
|
||||||
{ wxRect r = GetTrackRect( context.GetProject(), panel, 0 );
|
{ wxRect r = GetTrackRect( context.GetProject(), panel, 0 );
|
||||||
r = r.Union( GetTrackRect( context.GetProject(), panel, 1 ));
|
r = r.Union( GetTrackRect( context.GetProject(), panel, 1 ));
|
||||||
return Capture(context, mFileName, panel, r );
|
return Capture(context, mFileName, panel, r );
|
||||||
}
|
}
|
||||||
else if (mCaptureMode.IsSameAs(wxT("First_Three_Tracks")))
|
case kfirstthreetracks:
|
||||||
{ wxRect r = GetTrackRect( context.GetProject(), panel, 0 );
|
{ wxRect r = GetTrackRect( context.GetProject(), panel, 0 );
|
||||||
r = r.Union( GetTrackRect( context.GetProject(), panel, 2 ));
|
r = r.Union( GetTrackRect( context.GetProject(), panel, 2 ));
|
||||||
return Capture(context, mFileName, panel, r );
|
return Capture(context, mFileName, panel, r );
|
||||||
}
|
}
|
||||||
else if (mCaptureMode.IsSameAs(wxT("First_Four_Tracks")))
|
case kfirstfourtracks:
|
||||||
{ wxRect r = GetTrackRect( context.GetProject(), panel, 0 );
|
{ wxRect r = GetTrackRect( context.GetProject(), panel, 0 );
|
||||||
r = r.Union( GetTrackRect( context.GetProject(), panel, 3 ));
|
r = r.Union( GetTrackRect( context.GetProject(), panel, 3 ));
|
||||||
return Capture(context, mFileName, panel, r );
|
return Capture(context, mFileName, panel, r );
|
||||||
}
|
}
|
||||||
else if (mCaptureMode.IsSameAs(wxT("All_Tracks")))
|
case kalltracks:
|
||||||
{ wxRect r = GetTrackRect( context.GetProject(), panel, 0 );
|
{ wxRect r = GetTrackRect( context.GetProject(), panel, 0 );
|
||||||
r = r.Union( GetTrackRect( context.GetProject(), panel, nTracks-1 ));
|
r = r.Union( GetTrackRect( context.GetProject(), panel, nTracks-1 ));
|
||||||
return Capture(context, mFileName, panel, r );
|
return Capture(context, mFileName, panel, r );
|
||||||
}
|
}
|
||||||
else if (mCaptureMode.IsSameAs(wxT("All_Tracks_Plus")))
|
case kalltracksplus:
|
||||||
{ wxRect r = GetTrackRect( context.GetProject(), panel, 0 );
|
{ wxRect r = GetTrackRect( context.GetProject(), panel, 0 );
|
||||||
r.SetTop( r.GetTop() - ruler->GetRulerHeight() );
|
r.SetTop( r.GetTop() - ruler->GetRulerHeight() );
|
||||||
r.SetHeight( r.GetHeight() + ruler->GetRulerHeight() );
|
r.SetHeight( r.GetHeight() + ruler->GetRulerHeight() );
|
||||||
r = r.Union( GetTrackRect( context.GetProject(), panel, nTracks-1 ));
|
r = r.Union( GetTrackRect( context.GetProject(), panel, nTracks-1 ));
|
||||||
return Capture(context, mFileName, panel, r );
|
return Capture(context, mFileName, panel, r );
|
||||||
}
|
}
|
||||||
else
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,51 @@ class CommandContext;
|
|||||||
class ScreenshotCommand : public AudacityCommand
|
class ScreenshotCommand : public AudacityCommand
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
enum kBackgrounds
|
||||||
|
{
|
||||||
|
kBlue,
|
||||||
|
kWhite,
|
||||||
|
kNone,
|
||||||
|
nBackgrounds
|
||||||
|
};
|
||||||
|
|
||||||
|
enum kCaptureTypes
|
||||||
|
{
|
||||||
|
kwindow,
|
||||||
|
kfullwindow,
|
||||||
|
kwindowplus,
|
||||||
|
kfullscreen,
|
||||||
|
ktoolbars,
|
||||||
|
keffects,
|
||||||
|
kscriptables,
|
||||||
|
kpreferences,
|
||||||
|
kselectionbar,
|
||||||
|
kspectralselection,
|
||||||
|
ktools,
|
||||||
|
ktransport,
|
||||||
|
kmixer,
|
||||||
|
kmeter,
|
||||||
|
kplaymeter,
|
||||||
|
krecordmeter,
|
||||||
|
kedit,
|
||||||
|
kdevice,
|
||||||
|
kscrub,
|
||||||
|
ktranscription,
|
||||||
|
ktrackpanel,
|
||||||
|
kruler,
|
||||||
|
ktracks,
|
||||||
|
kfirsttrack,
|
||||||
|
kfirsttwotracks,
|
||||||
|
kfirstthreetracks,
|
||||||
|
kfirstfourtracks,
|
||||||
|
ksecondtrack,
|
||||||
|
ktracksplus,
|
||||||
|
kfirsttrackplus,
|
||||||
|
kalltracks,
|
||||||
|
kalltracksplus,
|
||||||
|
nCaptureWhats
|
||||||
|
};
|
||||||
|
|
||||||
ScreenshotCommand(){ mbBringToTop=true;};
|
ScreenshotCommand(){ mbBringToTop=true;};
|
||||||
// CommandDefinitionInterface overrides
|
// CommandDefinitionInterface overrides
|
||||||
wxString GetSymbol() override {return SCREENSHOT_PLUGIN_SYMBOL;};
|
wxString GetSymbol() override {return SCREENSHOT_PLUGIN_SYMBOL;};
|
||||||
@ -44,8 +89,8 @@ public:
|
|||||||
wxString ManualPage() override {return wxT("Help_Menu:_Tools#screenshot_tools");};
|
wxString ManualPage() override {return wxT("Help_Menu:_Tools#screenshot_tools");};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxString mWhat;
|
int mWhat;
|
||||||
wxString mBack;
|
int mBack;
|
||||||
wxString mPath;
|
wxString mPath;
|
||||||
bool mbBringToTop;
|
bool mbBringToTop;
|
||||||
bool bHasBackground;
|
bool bHasBackground;
|
||||||
@ -66,7 +111,7 @@ private:
|
|||||||
|
|
||||||
wxString mFilePath;
|
wxString mFilePath;
|
||||||
wxString mFileName;
|
wxString mFileName;
|
||||||
wxString mCaptureMode;
|
int mCaptureMode;
|
||||||
|
|
||||||
wxString MakeFileName(const wxString &path, const wxString &basename);
|
wxString MakeFileName(const wxString &path, const wxString &basename);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user