From 89cd4aef8880ffc2e2c3ded9fb4a4fd26bde1d80 Mon Sep 17 00:00:00 2001 From: James Crook Date: Fri, 16 Feb 2018 10:40:46 +0000 Subject: [PATCH] More Screenshot options --- src/commands/ScreenshotCommand.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/commands/ScreenshotCommand.cpp b/src/commands/ScreenshotCommand.cpp index ae4edefad..b8f1ca8e6 100644 --- a/src/commands/ScreenshotCommand.cpp +++ b/src/commands/ScreenshotCommand.cpp @@ -78,6 +78,8 @@ enum kCaptureTypes ksecondtrack, ktracksplus, kfirsttrackplus, + kalltracks, + kalltracksplus, nCaptureWhats }; @@ -113,6 +115,8 @@ static const wxString kCaptureWhatStrings[nCaptureWhats] = XO("Second_Track"), XO("Tracks_Plus"), XO("First_Track_Plus"), + XO("All_Tracks"), + XO("All_Tracks_Plus"), }; @@ -815,6 +819,8 @@ bool ScreenshotCommand::Apply(const CommandContext & context) TrackPanel *panel = context.GetProject()->GetTrackPanel(); AdornedRulerPanel *ruler = panel->mRuler; + int nTracks = context.GetProject()->GetTracks()->size(); + int x1,y1,x2,y2; w->ClientToScreen(&x1, &y1); panel->ClientToScreen(&x2, &y2); @@ -897,6 +903,18 @@ bool ScreenshotCommand::Apply(const CommandContext & context) r = r.Union( GetTrackRect( context.GetProject(), panel, 3 )); return Capture(context, mFileName, panel, r ); } + else if (mCaptureMode.IsSameAs(wxT("All_Tracks"))) + { wxRect r = GetTrackRect( context.GetProject(), panel, 0 ); + r = r.Union( GetTrackRect( context.GetProject(), panel, nTracks-1 )); + return Capture(context, mFileName, panel, r ); + } + else if (mCaptureMode.IsSameAs(wxT("All_Tracks_Plus"))) + { wxRect r = GetTrackRect( context.GetProject(), panel, 0 ); + r.SetTop( r.GetTop() - ruler->GetRulerHeight() ); + r.SetHeight( r.GetHeight() + ruler->GetRulerHeight() ); + r = r.Union( GetTrackRect( context.GetProject(), panel, nTracks-1 )); + return Capture(context, mFileName, panel, r ); + } else return false;