1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-18 09:00:52 +02:00

Disabled experimental mouse-over highlights of more TrackPanel things

This commit is contained in:
Paul Licameli 2017-07-11 13:58:37 -04:00
commit cfb67e2f18
20 changed files with 266 additions and 81 deletions

View File

@ -87,6 +87,9 @@ wxBrush AColor::tooltipBrush;
wxPen AColor::sparePen; wxPen AColor::sparePen;
wxBrush AColor::spareBrush; wxBrush AColor::spareBrush;
wxPen AColor::uglyPen;
wxBrush AColor::uglyBrush;
// //
// Draw an upward or downward pointing arrow. // Draw an upward or downward pointing arrow.
// //
@ -262,7 +265,7 @@ wxColour AColor::Blend( const wxColour & c1, const wxColour & c2 )
return c3; return c3;
} }
void AColor::BevelTrackInfo(wxDC & dc, bool up, const wxRect & r) void AColor::BevelTrackInfo(wxDC & dc, bool up, const wxRect & r, bool highlight)
{ {
#ifndef EXPERIMENTAL_THEMING #ifndef EXPERIMENTAL_THEMING
Bevel( dc, up, r ); Bevel( dc, up, r );
@ -270,7 +273,7 @@ void AColor::BevelTrackInfo(wxDC & dc, bool up, const wxRect & r)
wxColour col; wxColour col;
col = Blend( theTheme.Colour( clrTrackInfo ), up ? wxColour( 255,255,255):wxColour(0,0,0)); col = Blend( theTheme.Colour( clrTrackInfo ), up ? wxColour( 255,255,255):wxColour(0,0,0));
wxPen pen( col ); wxPen pen( highlight ? uglyPen : col );
dc.SetPen( pen ); dc.SetPen( pen );
dc.DrawLine(r.x, r.y, r.x + r.width, r.y); dc.DrawLine(r.x, r.y, r.x + r.width, r.y);
@ -279,7 +282,7 @@ void AColor::BevelTrackInfo(wxDC & dc, bool up, const wxRect & r)
col = Blend( theTheme.Colour( clrTrackInfo ), up ? wxColour(0,0,0): wxColour(255,255,255)); col = Blend( theTheme.Colour( clrTrackInfo ), up ? wxColour(0,0,0): wxColour(255,255,255));
pen.SetColour( col ); pen.SetColour( col );
dc.SetPen( pen ); dc.SetPen( highlight ? uglyPen : pen );
dc.DrawLine(r.x + r.width, r.y, r.x + r.width, r.y + r.height); dc.DrawLine(r.x + r.width, r.y, r.x + r.width, r.y + r.height);
dc.DrawLine(r.x, r.y + r.height, r.x + r.width + 1, r.y + r.height); dc.DrawLine(r.x, r.y + r.height, r.x + r.width + 1, r.y + r.height);
@ -299,13 +302,15 @@ void AColor::UseThemeColour( wxDC * dc, int iIndex, int index2 )
dc->SetPen( sparePen ); dc->SetPen( sparePen );
} }
void AColor::Light(wxDC * dc, bool selected) void AColor::Light(wxDC * dc, bool selected, bool highlight)
{ {
if (!inited) if (!inited)
Init(); Init();
int index = (int) selected; int index = (int) selected;
dc->SetBrush(lightBrush[index]); auto &brush = highlight ? AColor::uglyBrush : lightBrush[index];
dc->SetPen(lightPen[index]); dc->SetBrush( brush );
auto &pen = highlight ? AColor::uglyPen : lightPen[index];
dc->SetPen( pen );
} }
void AColor::Medium(wxDC * dc, bool selected) void AColor::Medium(wxDC * dc, bool selected)
@ -327,13 +332,15 @@ void AColor::MediumTrackInfo(wxDC * dc, bool selected)
} }
void AColor::Dark(wxDC * dc, bool selected) void AColor::Dark(wxDC * dc, bool selected, bool highlight)
{ {
if (!inited) if (!inited)
Init(); Init();
int index = (int) selected; int index = (int) selected;
dc->SetBrush(darkBrush[index]); auto &brush = highlight ? AColor::uglyBrush : darkBrush[index];
dc->SetPen(darkPen[index]); dc->SetBrush( brush );
auto &pen = highlight ? AColor::uglyPen : darkPen[index];
dc->SetPen( pen );
} }
void AColor::TrackPanelBackground(wxDC * dc, bool selected) void AColor::TrackPanelBackground(wxDC * dc, bool selected)
@ -503,6 +510,9 @@ void AColor::Init()
tooltipPen.SetColour( wxSystemSettingsNative::GetColour(wxSYS_COLOUR_INFOTEXT) ); tooltipPen.SetColour( wxSystemSettingsNative::GetColour(wxSYS_COLOUR_INFOTEXT) );
tooltipBrush.SetColour( wxSystemSettingsNative::GetColour(wxSYS_COLOUR_INFOBK) ); tooltipBrush.SetColour( wxSystemSettingsNative::GetColour(wxSYS_COLOUR_INFOBK) );
uglyPen.SetColour( wxColour{ 0, 255, 0 } ); // saturated green
uglyBrush.SetColour( wxColour{ 255, 0, 255 } ); // saturated magenta
// A tiny gradient of yellow surrounding the current focused track // A tiny gradient of yellow surrounding the current focused track
theTheme.SetPenColour( trackFocusPens[0], clrTrackFocus0); theTheme.SetPenColour( trackFocusPens[0], clrTrackFocus0);
theTheme.SetPenColour( trackFocusPens[1], clrTrackFocus1); theTheme.SetPenColour( trackFocusPens[1], clrTrackFocus1);

View File

@ -68,16 +68,16 @@ class AColor {
static void Bevel(wxDC & dc, bool up, const wxRect & r); static void Bevel(wxDC & dc, bool up, const wxRect & r);
static void Bevel2 static void Bevel2
(wxDC & dc, bool up, const wxRect & r, bool bSel=false, bool bHighlight = false); (wxDC & dc, bool up, const wxRect & r, bool bSel=false, bool bHighlight = false);
static void BevelTrackInfo(wxDC & dc, bool up, const wxRect & r); static void BevelTrackInfo(wxDC & dc, bool up, const wxRect & r, bool highlight = false);
static wxColour Blend(const wxColour & c1, const wxColour & c2); static wxColour Blend(const wxColour & c1, const wxColour & c2);
static void UseThemeColour( wxDC * dc, int iIndex, int index2 =-1 ); static void UseThemeColour( wxDC * dc, int iIndex, int index2 =-1 );
static void TrackPanelBackground(wxDC * dc, bool selected); static void TrackPanelBackground(wxDC * dc, bool selected);
static void Light(wxDC * dc, bool selected); static void Light(wxDC * dc, bool selected, bool highlight = false);
static void Medium(wxDC * dc, bool selected); static void Medium(wxDC * dc, bool selected);
static void MediumTrackInfo(wxDC * dc, bool selected); static void MediumTrackInfo(wxDC * dc, bool selected);
static void Dark(wxDC * dc, bool selected); static void Dark(wxDC * dc, bool selected, bool highlight = false);
static void CursorColor(wxDC * dc); static void CursorColor(wxDC * dc);
static void IndicatorColor(wxDC * dc, bool bIsNotRecording); static void IndicatorColor(wxDC * dc, bool bIsNotRecording);
@ -139,6 +139,10 @@ class AColor {
static const int gradientSteps = 512; static const int gradientSteps = 512;
static unsigned char gradient_pre[ColorGradientTotal][2][gradientSteps][3]; static unsigned char gradient_pre[ColorGradientTotal][2][gradientSteps][3];
// For experiments in mouse-over highlighting only
static wxPen uglyPen;
static wxBrush uglyBrush;
private: private:
static wxPen sparePen; static wxPen sparePen;
static wxBrush spareBrush; static wxBrush spareBrush;

View File

@ -27,6 +27,7 @@ a draggable point type.
*//*******************************************************************/ *//*******************************************************************/
#include "Envelope.h" #include "Envelope.h"
#include "Experimental.h"
#include "ViewInfo.h" #include "ViewInfo.h"
#include <math.h> #include <math.h>
@ -312,6 +313,7 @@ static void DrawPoint(wxDC & dc, const wxRect & r, int x, int y, bool top)
} }
#include "TrackPanelDrawingContext.h" #include "TrackPanelDrawingContext.h"
#include "tracks/ui/EnvelopeHandle.h"
/// TODO: This should probably move to track artist. /// TODO: This should probably move to track artist.
void Envelope::DrawPoints void Envelope::DrawPoints
@ -320,7 +322,13 @@ void Envelope::DrawPoints
float zoomMin, float zoomMax, bool mirrored) const float zoomMin, float zoomMax, bool mirrored) const
{ {
auto &dc = context.dc; auto &dc = context.dc;
dc.SetPen(AColor::envelopePen); bool highlight = false;
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
auto target = dynamic_cast<EnvelopeHandle*>(context.target.get());
highlight = target && target->GetEnvelope() == this;
#endif
wxPen &pen = highlight ? AColor::uglyPen : AColor::envelopePen;
dc.SetPen( pen );
dc.SetBrush(*wxWHITE_BRUSH); dc.SetBrush(*wxWHITE_BRUSH);
for (int i = 0; i < (int)mEnv.size(); i++) { for (int i = 0; i < (int)mEnv.size(); i++) {
@ -329,7 +337,7 @@ void Envelope::DrawPoints
if (position >= 0 && position < r.width) { if (position >= 0 && position < r.width) {
// Change colour if this is the draggable point... // Change colour if this is the draggable point...
if (i == mDragPoint) { if (i == mDragPoint) {
dc.SetPen(AColor::envelopePen); dc.SetPen( pen );
dc.SetBrush(AColor::envelopeBrush); dc.SetBrush(AColor::envelopeBrush);
} }
@ -371,7 +379,7 @@ void Envelope::DrawPoints
// Change colour back again if was the draggable point. // Change colour back again if was the draggable point.
if (i == mDragPoint) { if (i == mDragPoint) {
dc.SetPen(AColor::envelopePen); dc.SetPen( pen );
dc.SetBrush(*wxWHITE_BRUSH); dc.SetBrush(*wxWHITE_BRUSH);
} }
} }

View File

@ -208,4 +208,10 @@
// interpolating in frequency domain. // interpolating in frequency domain.
#define EXPERIMENTAL_ZERO_PADDED_SPECTROGRAMS #define EXPERIMENTAL_ZERO_PADDED_SPECTROGRAMS
// PRL 11 Jul 2017
// Highlight more things in TrackPanel when the mouse moves over them,
// using delibrately ugly pens and brushes until there is better cooperation
// with themes
//#define EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
#endif #endif

View File

@ -30,6 +30,7 @@ for drawing different aspects of the label and its text box.
#include "Audacity.h" #include "Audacity.h"
#include "LabelTrack.h" #include "LabelTrack.h"
#include "Experimental.h"
#include "TrackPanel.h" #include "TrackPanel.h"
#include <stdio.h> #include <stdio.h>
@ -774,6 +775,7 @@ namespace {
} }
#include "TrackPanelDrawingContext.h" #include "TrackPanelDrawingContext.h"
#include "tracks/labeltrack/ui/LabelTextHandle.h"
/// Draw calls other functions to draw the LabelTrack. /// Draw calls other functions to draw the LabelTrack.
/// @param dc the device context /// @param dc the device context
@ -840,13 +842,30 @@ void LabelTrack::Draw
}} }}
// Draw the label boxes. // Draw the label boxes.
{ int i = -1; for (auto &labelStruct : mLabels) { ++i; {
if( mSelIndex==i) bool highlightTrack = false;
dc.SetBrush(AColor::labelTextEditBrush); #ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
labelStruct.DrawTextBox( dc, r ); auto target = dynamic_cast<LabelTextHandle*>(context.target.get());
if( mSelIndex==i) highlightTrack = target && target->GetTrack().get() == this;
dc.SetBrush(AColor::labelTextNormalBrush); #endif
}} int i = -1; for (auto &labelStruct : mLabels) { ++i;
bool highlight = false;
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
highlight = highlightTrack && target->GetLabelNum() == i;
#endif
bool selected = mSelIndex == i;
const wxBrush &brush = dc.GetBrush();
if( selected )
dc.SetBrush( AColor::labelTextEditBrush );
else if ( highlight )
dc.SetBrush( AColor::uglyBrush );
labelStruct.DrawTextBox( dc, r );
if (highlight || selected)
dc.SetBrush( brush );
}
}
// Draw highlights // Draw highlights
if ((mInitialCursorPos != mCurrentCursorPos) && (mSelIndex >= 0 )) if ((mInitialCursorPos != mCurrentCursorPos) && (mSelIndex >= 0 ))

View File

@ -15,6 +15,7 @@
#include "Audacity.h" #include "Audacity.h"
#include "TimeTrack.h" #include "TimeTrack.h"
#include "Experimental.h"
#include <cfloat> #include <cfloat>
#include <wx/intl.h> #include <wx/intl.h>
@ -258,11 +259,17 @@ void TimeTrack::WriteXML(XMLWriter &xmlFile) const
} }
#include "TrackPanelDrawingContext.h" #include "TrackPanelDrawingContext.h"
#include "tracks/ui/EnvelopeHandle.h"
void TimeTrack::Draw void TimeTrack::Draw
(TrackPanelDrawingContext &context, const wxRect & r, const ZoomInfo &zoomInfo) const (TrackPanelDrawingContext &context, const wxRect & r, const ZoomInfo &zoomInfo) const
{ {
auto &dc = context.dc; auto &dc = context.dc;
bool highlight = false;
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
auto target = dynamic_cast<EnvelopeHandle*>(context.target.get());
highlight = target && target->GetEnvelope() == this->GetEnvelope();
#endif
double min = zoomInfo.PositionToTime(0); double min = zoomInfo.PositionToTime(0);
double max = zoomInfo.PositionToTime(r.width); double max = zoomInfo.PositionToTime(r.width);
@ -294,7 +301,8 @@ void TimeTrack::Draw
GetEnvelope()->GetValues GetEnvelope()->GetValues
( 0, 0, envValues.get(), mid.width, 0, zoomInfo ); ( 0, 0, envValues.get(), mid.width, 0, zoomInfo );
dc.SetPen(AColor::envelopePen); wxPen &pen = highlight ? AColor::uglyPen : AColor::envelopePen;
dc.SetPen( pen );
double logLower = log(std::max(1.0e-7, mRangeLower)), logUpper = log(std::max(1.0e-7, mRangeUpper)); double logLower = log(std::max(1.0e-7, mRangeLower)), logUpper = log(std::max(1.0e-7, mRangeUpper));
for (int x = 0; x < mid.width; x++) for (int x = 0; x < mid.width; x++)

View File

@ -518,6 +518,11 @@ void TrackArtist::DrawVRuler
(TrackPanelDrawingContext &context, const Track *t, wxRect & rect) (TrackPanelDrawingContext &context, const Track *t, wxRect & rect)
{ {
auto dc = &context.dc; auto dc = &context.dc;
bool highlight = false;
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
highlight = rect.Contains(context.lastState.GetPosition());
#endif
int kind = t->GetKind(); int kind = t->GetKind();
// Label and Time tracks do not have a vruler // Label and Time tracks do not have a vruler
@ -560,7 +565,7 @@ void TrackArtist::DrawVRuler
wxRect bev = rect; wxRect bev = rect;
bev.Inflate(-1, 0); bev.Inflate(-1, 0);
bev.width += 1; bev.width += 1;
AColor::BevelTrackInfo(*dc, true, bev); AColor::BevelTrackInfo(*dc, true, bev, highlight);
// Right align the ruler // Right align the ruler
wxRect rr = rect; wxRect rr = rect;
@ -583,7 +588,7 @@ void TrackArtist::DrawVRuler
if (kind == Track::Note) { if (kind == Track::Note) {
UpdateVRuler(t, rect); UpdateVRuler(t, rect);
dc->SetPen(*wxTRANSPARENT_PEN); dc->SetPen(highlight ? AColor::uglyPen : *wxTRANSPARENT_PEN);
dc->SetBrush(*wxWHITE_BRUSH); dc->SetBrush(*wxWHITE_BRUSH);
wxRect bev = rect; wxRect bev = rect;
bev.x++; bev.x++;
@ -1040,7 +1045,8 @@ void TrackArtist::DrawWaveformBackground(wxDC &dc, int leftOffset, const wxRect
bool dB, float dBRange, bool dB, float dBRange,
double t0, double t1, double t0, double t1,
const ZoomInfo &zoomInfo, const ZoomInfo &zoomInfo,
bool drawEnvelope, bool bIsSyncLockSelected) bool drawEnvelope, bool bIsSyncLockSelected,
bool highlightEnvelope)
{ {
// Visually (one vertical slice of the waveform background, on its side; // Visually (one vertical slice of the waveform background, on its side;
@ -1115,6 +1121,11 @@ void TrackArtist::DrawWaveformBackground(wxDC &dc, int leftOffset, const wxRect
dc.DrawRectangle(l, rect.y + lmaxtop, w, lminbot - lmaxtop); dc.DrawRectangle(l, rect.y + lmaxtop, w, lminbot - lmaxtop);
} }
if (highlightEnvelope && lmaxbot < lmintop - 1) {
dc.SetBrush( AColor::uglyBrush );
dc.DrawRectangle(l, rect.y + lmaxbot, w, lmintop - lmaxbot);
}
lmaxtop = maxtop; lmaxtop = maxtop;
lmintop = mintop; lmintop = mintop;
lmaxbot = maxbot; lmaxbot = maxbot;
@ -1133,6 +1144,10 @@ void TrackArtist::DrawWaveformBackground(wxDC &dc, int leftOffset, const wxRect
else { else {
dc.DrawRectangle(l, rect.y + lmaxtop, w, lminbot - lmaxtop); dc.DrawRectangle(l, rect.y + lmaxtop, w, lminbot - lmaxtop);
} }
if (highlightEnvelope && lmaxbot < lmintop - 1) {
dc.SetBrush( AColor::uglyBrush );
dc.DrawRectangle(l, rect.y + lmaxbot, w, lmintop - lmaxbot);
}
// If sync-lock selected, draw in linked graphics. // If sync-lock selected, draw in linked graphics.
if (bIsSyncLockSelected && t0 < t1) { if (bIsSyncLockSelected && t0 < t1) {
@ -1312,7 +1327,8 @@ void TrackArtist::DrawIndividualSamples(wxDC &dc, int leftOffset, const wxRect &
bool dB, float dBRange, bool dB, float dBRange,
const WaveClip *clip, const WaveClip *clip,
const ZoomInfo &zoomInfo, const ZoomInfo &zoomInfo,
bool bigPoints, bool showPoints, bool muted) bool bigPoints, bool showPoints, bool muted,
bool highlight)
{ {
const double toffset = clip->GetOffset(); const double toffset = clip->GetOffset();
double rate = clip->GetRate(); double rate = clip->GetRate();
@ -1345,7 +1361,8 @@ void TrackArtist::DrawIndividualSamples(wxDC &dc, int leftOffset, const wxRect &
if (mShowClipping) if (mShowClipping)
clipped.reinit( size_t(slen) ); clipped.reinit( size_t(slen) );
dc.SetPen(muted ? muteSamplePen : samplePen); auto &pen = highlight ? AColor::uglyPen : muted ? muteSamplePen : samplePen;
dc.SetPen( pen );
for (decltype(slen) s = 0; s < slen; s++) { for (decltype(slen) s = 0; s < slen; s++) {
const double time = toffset + (s + s0).as_double() / rate; const double time = toffset + (s + s0).as_double() / rate;
@ -1376,7 +1393,10 @@ void TrackArtist::DrawIndividualSamples(wxDC &dc, int leftOffset, const wxRect &
pr.width = tickSize; pr.width = tickSize;
pr.height = tickSize; pr.height = tickSize;
//different colour when draggable. //different colour when draggable.
dc.SetBrush( bigPoints ? dragsampleBrush : sampleBrush); auto &brush = highlight
? AColor::uglyBrush
: bigPoints ? dragsampleBrush : sampleBrush;
dc.SetBrush( brush );
for (decltype(slen) s = 0; s < slen; s++) { for (decltype(slen) s = 0; s < slen; s++) {
if (ypos[s] >= 0 && ypos[s] < rect.height) { if (ypos[s] >= 0 && ypos[s] < rect.height) {
pr.x = rect.x + xpos[s] - tickSize/2; pr.x = rect.x + xpos[s] - tickSize/2;
@ -1417,11 +1437,12 @@ void TrackArtist::DrawIndividualSamples(wxDC &dc, int leftOffset, const wxRect &
void TrackArtist::DrawEnvelope(wxDC &dc, const wxRect &rect, const double env[], void TrackArtist::DrawEnvelope(wxDC &dc, const wxRect &rect, const double env[],
float zoomMin, float zoomMax, float zoomMin, float zoomMax,
bool dB, float dBRange) bool dB, float dBRange, bool highlight)
{ {
int h = rect.height; int h = rect.height;
dc.SetPen(AColor::envelopePen); auto &pen = highlight ? AColor::uglyPen : AColor::envelopePen;
dc.SetPen( pen );
for (int x0 = 0; x0 < rect.width; ++x0) { for (int x0 = 0; x0 < rect.width; ++x0) {
int cenvTop = GetWaveYPos(env[x0], zoomMin, zoomMax, int cenvTop = GetWaveYPos(env[x0], zoomMin, zoomMax,
@ -1473,6 +1494,8 @@ void TrackArtist::DrawEnvLine(wxDC &dc, const wxRect &rect, int x0, int y0, int
} }
} }
#include "tracks/ui/TimeShiftHandle.h"
#include "tracks/playabletrack/wavetrack/ui/CutlineHandle.h"
void TrackArtist::DrawWaveform(TrackPanelDrawingContext &context, void TrackArtist::DrawWaveform(TrackPanelDrawingContext &context,
const WaveTrack *track, const WaveTrack *track,
const wxRect & rect, const wxRect & rect,
@ -1484,6 +1507,15 @@ void TrackArtist::DrawWaveform(TrackPanelDrawingContext &context,
bool muted) bool muted)
{ {
auto &dc = context.dc; auto &dc = context.dc;
bool highlight = false;
bool gripHit = false;
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
auto target = dynamic_cast<TimeShiftHandle*>(context.target.get());
gripHit = target && target->IsGripHit();
highlight = target && target->GetTrack().get() == track;
#endif
const bool dB = !track->GetWaveformSettings().isLinear(); const bool dB = !track->GetWaveformSettings().isLinear();
DrawBackgroundWithSelection(&dc, rect, track, blankSelectedBrush, blankBrush, DrawBackgroundWithSelection(&dc, rect, track, blankSelectedBrush, blankBrush,
@ -1497,34 +1529,43 @@ void TrackArtist::DrawWaveform(TrackPanelDrawingContext &context,
// Update cache for locations, e.g. cutlines and merge points // Update cache for locations, e.g. cutlines and merge points
track->UpdateLocationsCache(); track->UpdateLocationsCache();
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
auto target2 = dynamic_cast<CutlineHandle*>(context.target.get());
#endif
for (const auto loc : track->GetCachedLocations()) { for (const auto loc : track->GetCachedLocations()) {
bool highlight = false;
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
highlight =
target2 && target2->GetTrack().get() == track &&
target2->GetLocation() == loc;
#endif
const int xx = zoomInfo.TimeToPosition(loc.pos); const int xx = zoomInfo.TimeToPosition(loc.pos);
if (xx >= 0 && xx < rect.width) { if (xx >= 0 && xx < rect.width) {
// delta is used to adjust the top and bottom edge of a split line. // delta is used to adjust the top and bottom edge of a split line.
int delta =0; int delta =0;
dc.SetPen(*wxGREY_PEN); dc.SetPen( highlight ? AColor::uglyPen : *wxGREY_PEN );
AColor::Line(dc, (int) (rect.x + xx - 1), rect.y, (int) (rect.x + xx - 1), rect.y + rect.height); AColor::Line(dc, (int) (rect.x + xx - 1), rect.y, (int) (rect.x + xx - 1), rect.y + rect.height);
if (loc.typ == WaveTrackLocation::locationCutLine) { if (loc.typ == WaveTrackLocation::locationCutLine) {
dc.SetPen(*wxRED_PEN); dc.SetPen( highlight ? AColor::uglyPen : *wxRED_PEN );
} }
else { else {
delta = rect.height/3; delta = rect.height/3;
#ifdef EXPERIMENTAL_DA #ifdef EXPERIMENTAL_DA
// JKC Black does not show up enough. // JKC Black does not show up enough.
dc.SetPen(*wxWHITE_PEN); dc.SetPen(highlight ? AColor::uglyPen : *wxWHITE_PEN);
#else #else
dc.SetPen(*wxBLACK_PEN); dc.SetPen(highlight ? AColor::uglyPen : *wxBLACK_PEN);
#endif #endif
} }
AColor::Line(dc, (int) (rect.x + xx), rect.y+delta, (int) (rect.x + xx), rect.y - delta + rect.height); AColor::Line(dc, (int) (rect.x + xx), rect.y+delta, (int) (rect.x + xx), rect.y - delta + rect.height);
dc.SetPen(*wxGREY_PEN); dc.SetPen( highlight ? AColor::uglyPen : *wxGREY_PEN );
AColor::Line(dc, (int) (rect.x + xx + 1), rect.y+delta, (int) (rect.x + xx + 1), rect.y - delta + rect.height); AColor::Line(dc, (int) (rect.x + xx + 1), rect.y+delta, (int) (rect.x + xx + 1), rect.y - delta + rect.height);
} }
} }
if (drawSliders) { if (drawSliders) {
DrawTimeSlider(dc, rect, true); // directed right DrawTimeSlider(dc, rect, true, highlight && gripHit); // directed right
DrawTimeSlider(dc, rect, false); // directed left DrawTimeSlider(dc, rect, false, highlight && gripHit); // directed left
} }
} }
@ -1743,6 +1784,8 @@ void FindWavePortions
} }
} }
#include "tracks/playabletrack/wavetrack/ui/SampleHandle.h"
#include "tracks/ui/EnvelopeHandle.h"
void TrackArtist::DrawClipWaveform(TrackPanelDrawingContext &context, void TrackArtist::DrawClipWaveform(TrackPanelDrawingContext &context,
const WaveTrack *track, const WaveTrack *track,
const WaveClip *clip, const WaveClip *clip,
@ -1759,6 +1802,12 @@ void TrackArtist::DrawClipWaveform(TrackPanelDrawingContext &context,
Profiler profiler; Profiler profiler;
#endif #endif
bool highlightEnvelope = false;
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
auto target = dynamic_cast<EnvelopeHandle*>(context.target.get());
highlightEnvelope = target && target->GetEnvelope() == clip->GetEnvelope();
#endif
const ClipParameters params(false, track, clip, rect, selectedRegion, zoomInfo); const ClipParameters params(false, track, clip, rect, selectedRegion, zoomInfo);
const wxRect &hiddenMid = params.hiddenMid; const wxRect &hiddenMid = params.hiddenMid;
// The "hiddenMid" rect contains the part of the display actually // The "hiddenMid" rect contains the part of the display actually
@ -1819,7 +1868,7 @@ void TrackArtist::DrawClipWaveform(TrackPanelDrawingContext &context,
track->ZeroLevelYCoordinate(mid), track->ZeroLevelYCoordinate(mid),
dB, dBRange, dB, dBRange,
t0, t1, zoomInfo, drawEnvelope, t0, t1, zoomInfo, drawEnvelope,
!track->GetSelected()); !track->GetSelected(), highlightEnvelope);
} }
WaveDisplay display(hiddenMid.width); WaveDisplay display(hiddenMid.width);
@ -1949,18 +1998,24 @@ void TrackArtist::DrawClipWaveform(TrackPanelDrawingContext &context,
#endif #endif
); );
} }
else else {
bool highlight = false;
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
auto target = dynamic_cast<SampleHandle*>(context.target.get());
highlight = target && target->GetTrack().get() == track;
#endif
DrawIndividualSamples(dc, leftOffset, rect, zoomMin, zoomMax, DrawIndividualSamples(dc, leftOffset, rect, zoomMin, zoomMax,
dB, dBRange, dB, dBRange,
clip, zoomInfo, clip, zoomInfo,
bigPoints, showPoints, muted); bigPoints, showPoints, muted, highlight);
}
} }
leftOffset += rect.width + skippedRight; leftOffset += rect.width + skippedRight;
} }
if (drawEnvelope) { if (drawEnvelope) {
DrawEnvelope(dc, mid, env, zoomMin, zoomMax, dB, dBRange); DrawEnvelope(dc, mid, env, zoomMin, zoomMax, dB, dBRange, highlightEnvelope);
clip->GetEnvelope()->DrawPoints clip->GetEnvelope()->DrawPoints
(context, rect, zoomInfo, dB, dBRange, zoomMin, zoomMax, true); (context, rect, zoomInfo, dB, dBRange, zoomMin, zoomMax, true);
} }
@ -1988,7 +2043,7 @@ void TrackArtist::DrawClipWaveform(TrackPanelDrawingContext &context,
void TrackArtist::DrawTimeSlider(wxDC & dc, void TrackArtist::DrawTimeSlider(wxDC & dc,
const wxRect & rect, const wxRect & rect,
bool rightwards) bool rightwards, bool highlight)
{ {
const int border = 3; // 3 pixels all round. const int border = 3; // 3 pixels all round.
const int width = 6; // width of the drag box. const int width = 6; // width of the drag box.
@ -2014,12 +2069,12 @@ void TrackArtist::DrawTimeSlider(wxDC & dc,
int yTop = rect.y + border; int yTop = rect.y + border;
int yBot = rect.y + rect.height - border - 1; int yBot = rect.y + rect.height - border - 1;
AColor::Light(&dc, false); AColor::Light(&dc, false, highlight);
AColor::Line(dc, xLeft, yBot - leftTaper, xLeft, yTop + leftTaper); AColor::Line(dc, xLeft, yBot - leftTaper, xLeft, yTop + leftTaper);
AColor::Line(dc, xLeft, yTop + leftTaper, xLeft + xFlat, yTop); AColor::Line(dc, xLeft, yTop + leftTaper, xLeft + xFlat, yTop);
AColor::Line(dc, xLeft + xFlat, yTop, xLeft + width, yTop + rightTaper); AColor::Line(dc, xLeft + xFlat, yTop, xLeft + width, yTop + rightTaper);
AColor::Dark(&dc, false); AColor::Dark(&dc, false, highlight);
AColor::Line(dc, xLeft + width, yTop + rightTaper, xLeft + width, yBot - rightTaper); AColor::Line(dc, xLeft + width, yTop + rightTaper, xLeft + width, yBot - rightTaper);
AColor::Line(dc, xLeft + width, yBot - rightTaper, xLeft + width-xFlat, yBot); AColor::Line(dc, xLeft + width, yBot - rightTaper, xLeft + width-xFlat, yBot);
AColor::Line(dc, xLeft + width - xFlat, yBot, xLeft, yBot - leftTaper); AColor::Line(dc, xLeft + width - xFlat, yBot, xLeft, yBot - leftTaper);
@ -2030,12 +2085,12 @@ void TrackArtist::DrawTimeSlider(wxDC & dc,
int yy; int yy;
int i; int i;
AColor::Light(&dc, false); AColor::Light(&dc, false, highlight);
for (i = 0;i < nBars; i++) { for (i = 0;i < nBars; i++) {
yy = firstBar + barSpacing * i; yy = firstBar + barSpacing * i;
AColor::Line(dc, xLeft, yy, xLeft + barWidth, yy); AColor::Line(dc, xLeft, yy, xLeft + barWidth, yy);
} }
AColor::Dark(&dc, false); AColor::Dark(&dc, false, highlight);
for(i = 0;i < nBars; i++){ for(i = 0;i < nBars; i++){
yy = firstBar + barSpacing * i + 1; yy = firstBar + barSpacing * i + 1;
AColor::Line(dc, xLeft, yy, xLeft + barWidth, yy); AColor::Line(dc, xLeft, yy, xLeft + barWidth, yy);

View File

@ -133,7 +133,7 @@ class AUDACITY_DLL_API TrackArtist {
const wxRect & rect, const ZoomInfo &zoomInfo); const wxRect & rect, const ZoomInfo &zoomInfo);
void DrawTimeSlider(wxDC & dc, const wxRect & rect, void DrawTimeSlider(wxDC & dc, const wxRect & rect,
bool rightwards); bool rightwards, bool highlight);
void DrawClipWaveform(TrackPanelDrawingContext &context, void DrawClipWaveform(TrackPanelDrawingContext &context,
const WaveTrack *track, const WaveClip *clip, const WaveTrack *track, const WaveClip *clip,
@ -154,7 +154,8 @@ class AUDACITY_DLL_API TrackArtist {
int zeroLevelYCoordinate, int zeroLevelYCoordinate,
bool dB, float dBRange, bool dB, float dBRange,
double t0, double t1, const ZoomInfo &zoomInfo, double t0, double t1, const ZoomInfo &zoomInfo,
bool drawEnvelope, bool bIsSyncLockSelected); bool drawEnvelope, bool bIsSyncLockSelected,
bool highlightEnvelope);
void DrawMinMaxRMS(wxDC &dc, const wxRect & rect, const double env[], void DrawMinMaxRMS(wxDC &dc, const wxRect & rect, const double env[],
float zoomMin, float zoomMax, float zoomMin, float zoomMax,
bool dB, float dBRange, bool dB, float dBRange,
@ -169,13 +170,14 @@ class AUDACITY_DLL_API TrackArtist {
bool dB, float dBRange, bool dB, float dBRange,
const WaveClip *clip, const WaveClip *clip,
const ZoomInfo &zoomInfo, const ZoomInfo &zoomInfo,
bool bigPoints, bool showPoints, bool muted); bool bigPoints, bool showPoints, bool muted,
bool highlight);
void DrawNegativeOffsetTrackArrows(wxDC & dc, const wxRect & rect); void DrawNegativeOffsetTrackArrows(wxDC & dc, const wxRect & rect);
void DrawEnvelope(wxDC & dc, const wxRect & rect, const double env[], void DrawEnvelope(wxDC & dc, const wxRect & rect, const double env[],
float zoomMin, float zoomMax, float zoomMin, float zoomMax,
bool dB, float dBRange); bool dB, float dBRange, bool highlight);
void DrawEnvLine(wxDC & dc, const wxRect & rect, int x0, int y0, int cy, bool top); void DrawEnvLine(wxDC & dc, const wxRect & rect, int x0, int y0, int cy, bool top);
// Preference values // Preference values

View File

@ -1648,12 +1648,14 @@ void TrackPanel::RefreshTrack(Track *trk, bool refreshbacking)
link = trk->GetLink(); link = trk->GetLink();
} }
// subtract insets and shadows from the rectangle, but not border // So that the highlighting of the resizer refreshes,
// This matters because some separators do paint over the border // include left and right inset areas,
wxRect rect(kLeftInset, // exclude the inset above,
// but include the inset below.
wxRect rect(0,
-mViewInfo->vpos + trk->GetY() + kTopInset, -mViewInfo->vpos + trk->GetY() + kTopInset,
GetRect().GetWidth() - kLeftInset - kRightInset - kShadowThickness, GetRect().GetWidth(),
trk->GetHeight() - kTopInset - kShadowThickness); trk->GetHeight() );
if (link) { if (link) {
rect.height += link->GetHeight(); rect.height += link->GetHeight();
@ -1749,7 +1751,8 @@ void TrackPanel::DrawEverythingElse(TrackPanelDrawingContext &context,
trackRect.height = 0; // for drawing background in no tracks case. trackRect.height = 0; // for drawing background in no tracks case.
VisibleTrackIterator iter(GetProject()); VisibleTrackIterator iter(GetProject());
for (Track *t = iter.First(); t; t = iter.Next()) { Track *prev{};
for (Track *t = iter.First(); t; prev = t, t = iter.Next()) {
trackRect.y = t->GetY() - mViewInfo->vpos; trackRect.y = t->GetY() - mViewInfo->vpos;
trackRect.height = t->GetHeight(); trackRect.height = t->GetHeight();
@ -1793,7 +1796,7 @@ void TrackPanel::DrawEverythingElse(TrackPanelDrawingContext &context,
if (mAx->IsFocused(t)) { if (mAx->IsFocused(t)) {
focusRect = borderRect; focusRect = borderRect;
} }
DrawOutside(context, borderTrack, borderRect); DrawOutside(context, borderTrack, prev, borderRect);
} }
// Believe it or not, we can speed up redrawing if we don't // Believe it or not, we can speed up redrawing if we don't
@ -1835,7 +1838,7 @@ void TrackPanel::DrawEverythingElse(TrackPanelDrawingContext &context,
mUIHandle->DrawExtras(UIHandle::Cells, dc, region, clip); mUIHandle->DrawExtras(UIHandle::Cells, dc, region, clip);
// Paint over the part below the tracks // Paint over the part below the tracks
trackRect.y += trackRect.height; trackRect.y += trackRect.height + kTopInset;
if (trackRect.y < clip.GetBottom()) { if (trackRect.y < clip.GetBottom()) {
AColor::TrackPanelBackground(dc, false); AColor::TrackPanelBackground(dc, false);
dc->DrawRectangle(trackRect.x, dc->DrawRectangle(trackRect.x,
@ -2291,7 +2294,7 @@ void TrackInfo::Status2DrawFunction
void TrackPanel::DrawOutside void TrackPanel::DrawOutside
(TrackPanelDrawingContext &context, (TrackPanelDrawingContext &context,
Track * t, const wxRect & rec) Track * t, Track *prev, const wxRect & rec)
{ {
auto dc = &context.dc; auto dc = &context.dc;
bool bIsWave = (t->GetKind() == Track::Wave); bool bIsWave = (t->GetKind() == Track::Wave);
@ -2300,7 +2303,7 @@ void TrackPanel::DrawOutside
{ {
// Start with whole track rect // Start with whole track rect
wxRect rect = rec; wxRect rect = rec;
DrawOutsideOfTrack(context, t, rect); DrawOutsideOfTrack(context, t, prev, rect);
// Now exclude left, right, and top insets // Now exclude left, right, and top insets
rect.x += kLeftInset; rect.x += kLeftInset;
@ -2342,7 +2345,7 @@ void TrackPanel::DrawOutside
// If linked to a following channel, also paint the separator area, which // If linked to a following channel, also paint the separator area, which
// overlaps the next track rectangle's top // overlaps the next track rectangle's top
void TrackPanel::DrawOutsideOfTrack void TrackPanel::DrawOutsideOfTrack
(TrackPanelDrawingContext &context, Track * t, const wxRect & rect) (TrackPanelDrawingContext &context, Track * t, Track *prev, const wxRect & rect)
{ {
auto dc = &context.dc; auto dc = &context.dc;
@ -2355,10 +2358,13 @@ void TrackPanel::DrawOutsideOfTrack
side.width = kLeftInset; side.width = kLeftInset;
dc->DrawRectangle(side); dc->DrawRectangle(side);
// Area between panel border and top track border if (!prev)
side = rect; {
side.height = kTopInset; // Area above the first track
dc->DrawRectangle(side); side = rect;
side.height = kTopInset;
dc->DrawRectangle(side);
}
// Area between panel border and right track border // Area between panel border and right track border
side = rect; side = rect;
@ -2366,17 +2372,32 @@ void TrackPanel::DrawOutsideOfTrack
side.width = kTopInset; side.width = kTopInset;
dc->DrawRectangle(side); dc->DrawRectangle(side);
// Area between tracks of stereo group auto target = dynamic_cast<TrackPanelResizeHandle*>(context.target.get());
if (t->GetLinked() auto highlight = target && target->GetTrack().get() == t;
side = rect;
side.y += t->GetHeight();
// Area below the track
if (highlight ||
t->GetLinked()
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY #ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|| MONO_WAVE_PAN(t) || MONO_WAVE_PAN(t)
#endif #endif
) { ) {
// Paint the channel separator over (what would be) the shadow of the top // Paint the channel separator over (what would be) the shadow of the top
// channel, and the top inset of the bottom channel // channel, and the top inset of the bottom channel
side = rect;
side.y += t->GetHeight() - kShadowThickness; // (Or, highlight the resizer area below the track)
side.y -= kShadowThickness;
side.height = kTopInset + kShadowThickness; side.height = kTopInset + kShadowThickness;
if (highlight)
dc->SetBrush( AColor::uglyBrush );
dc->DrawRectangle(side);
}
else
{
side.height = kTopInset;
dc->DrawRectangle(side); dc->DrawRectangle(side);
} }
} }

View File

@ -417,14 +417,14 @@ protected:
const wxRect & clip); const wxRect & clip);
void DrawOutside void DrawOutside
(TrackPanelDrawingContext &context, (TrackPanelDrawingContext &context,
Track *t, const wxRect & rec); Track *t, Track *prev, const wxRect & rec);
void HighlightFocusedTrack (wxDC* dc, const wxRect &rect); void HighlightFocusedTrack (wxDC* dc, const wxRect &rect);
void DrawShadow (Track *t, wxDC* dc, const wxRect & rect); void DrawShadow (Track *t, wxDC* dc, const wxRect & rect);
void DrawBordersAroundTrack(Track *t, wxDC* dc, const wxRect & rect, const int labelw, const int vrul); void DrawBordersAroundTrack(Track *t, wxDC* dc, const wxRect & rect, const int labelw, const int vrul);
void DrawOutsideOfTrack void DrawOutsideOfTrack
(TrackPanelDrawingContext &context, (TrackPanelDrawingContext &context,
Track *t, const wxRect & rect); Track *t, Track *prev, const wxRect & rect);
public: public:
// Set the object that performs catch-all event handling when the pointer // Set the object that performs catch-all event handling when the pointer

View File

@ -67,6 +67,8 @@ TrackPanelResizeHandle::TrackPanelResizeHandle
: mpTrack{ track } : mpTrack{ track }
, mMouseClickY( y ) , mMouseClickY( y )
{ {
mChangeHighlight = RefreshCode::RefreshCell;
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY #ifdef EXPERIMENTAL_OUTPUT_DISPLAY
if (MONO_WAVE_PAN(track)){ if (MONO_WAVE_PAN(track)){
//STM: Determine whether we should rescale one or two tracks //STM: Determine whether we should rescale one or two tracks

View File

@ -36,4 +36,19 @@ struct WaveTrackLocation {
int clipidx2; // second clip (right one) int clipidx2; // second clip (right one)
}; };
inline
bool operator == (const WaveTrackLocation &a, const WaveTrackLocation &b)
{
return a.pos == b.pos &&
a.typ == b.typ &&
a.clipidx1 == b.clipidx1 &&
a.clipidx2 == b.clipidx2;
}
inline
bool operator != (const WaveTrackLocation &a, const WaveTrackLocation &b)
{
return !( a == b );
}
#endif #endif

View File

@ -10,6 +10,7 @@ Paul Licameli split from TrackPanel.cpp
#include "../../../Audacity.h" #include "../../../Audacity.h"
#include "LabelTextHandle.h" #include "LabelTextHandle.h"
#include "../../Experimental.h"
#include "../../../HitTestResult.h" #include "../../../HitTestResult.h"
#include "../../../LabelTrack.h" #include "../../../LabelTrack.h"
#include "../../../Project.h" #include "../../../Project.h"
@ -22,7 +23,11 @@ LabelTextHandle::LabelTextHandle
( const std::shared_ptr<LabelTrack> &pLT, int labelNum ) ( const std::shared_ptr<LabelTrack> &pLT, int labelNum )
: mpLT{ pLT } : mpLT{ pLT }
, mLabelNum{ labelNum } , mLabelNum{ labelNum }
{} {
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;
#endif
}
HitTestPreview LabelTextHandle::HitPreview() HitTestPreview LabelTextHandle::HitPreview()
{ {

View File

@ -10,6 +10,7 @@ Paul Licameli split from TrackPanel.cpp
#include "../../../../Audacity.h" #include "../../../../Audacity.h"
#include "NoteTrackVZoomHandle.h" #include "NoteTrackVZoomHandle.h"
#include "../../../../Experimental.h"
#include "NoteTrackVRulerControls.h" #include "NoteTrackVRulerControls.h"
#include "../../../../HitTestResult.h" #include "../../../../HitTestResult.h"
@ -38,7 +39,11 @@ NoteTrackVZoomHandle::NoteTrackVZoomHandle
(const std::shared_ptr<NoteTrack> &pTrack, const wxRect &rect, int y) (const std::shared_ptr<NoteTrack> &pTrack, const wxRect &rect, int y)
: mZoomStart(y), mZoomEnd(y), mRect(rect) : mZoomStart(y), mZoomEnd(y), mRect(rect)
, mpTrack{ pTrack } , mpTrack{ pTrack }
{} {
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;
#endif
}
HitTestPreview NoteTrackVZoomHandle::HitPreview(const wxMouseState &state) HitTestPreview NoteTrackVZoomHandle::HitPreview(const wxMouseState &state)
{ {

View File

@ -10,6 +10,7 @@ Paul Licameli split from TrackPanel.cpp
#include "../../../../Audacity.h" #include "../../../../Audacity.h"
#include "CutlineHandle.h" #include "CutlineHandle.h"
#include "../../../../Experimental.h"
#include "../../../../MemoryX.h" #include "../../../../MemoryX.h"
@ -26,7 +27,11 @@ CutlineHandle::CutlineHandle
( const std::shared_ptr<WaveTrack> &pTrack, WaveTrackLocation location ) ( const std::shared_ptr<WaveTrack> &pTrack, WaveTrackLocation location )
: mpTrack{ pTrack } : mpTrack{ pTrack }
, mLocation{ location } , mLocation{ location }
{} {
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;
#endif
}
HitTestPreview CutlineHandle::HitPreview(bool cutline, bool unsafe) HitTestPreview CutlineHandle::HitPreview(bool cutline, bool unsafe)
{ {

View File

@ -10,6 +10,7 @@ Paul Licameli split from TrackPanel.cpp
#include "../../../../Audacity.h" #include "../../../../Audacity.h"
#include "SampleHandle.h" #include "SampleHandle.h"
#include "../../Experimental.h"
#include <algorithm> #include <algorithm>
#include "../../../../MemoryX.h" #include "../../../../MemoryX.h"
@ -36,7 +37,11 @@ static const double SMOOTHING_PROPORTION_MIN = 0.0;
SampleHandle::SampleHandle( const std::shared_ptr<WaveTrack> &pTrack ) SampleHandle::SampleHandle( const std::shared_ptr<WaveTrack> &pTrack )
: mClickedTrack{ pTrack } : mClickedTrack{ pTrack }
{} {
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;
#endif
}
HitTestPreview SampleHandle::HitPreview HitTestPreview SampleHandle::HitPreview
(const wxMouseState &state, const AudacityProject *pProject, bool unsafe) (const wxMouseState &state, const AudacityProject *pProject, bool unsafe)

View File

@ -10,6 +10,7 @@ Paul Licameli split from TrackPanel.cpp
#include "../../../../Audacity.h" #include "../../../../Audacity.h"
#include "WaveTrackVZoomHandle.h" #include "WaveTrackVZoomHandle.h"
#include "../../../../Experimental.h"
#include "WaveTrackVRulerControls.h" #include "WaveTrackVRulerControls.h"
#include "../../../../HitTestResult.h" #include "../../../../HitTestResult.h"
@ -47,7 +48,9 @@ WaveTrackVZoomHandle::WaveTrackVZoomHandle
(const std::shared_ptr<WaveTrack> &pTrack, const wxRect &rect, int y) (const std::shared_ptr<WaveTrack> &pTrack, const wxRect &rect, int y)
: mZoomStart(y), mZoomEnd(y), mRect(rect) : mZoomStart(y), mZoomEnd(y), mRect(rect)
, mpTrack{ pTrack } , mpTrack{ pTrack }
{} {
mChangeHighlight = RefreshCode::RefreshCell;
}
void WaveTrackVZoomHandle::DoZoom void WaveTrackVZoomHandle::DoZoom
(AudacityProject *pProject, (AudacityProject *pProject,

View File

@ -10,6 +10,7 @@ Paul Licameli split from TrackPanel.cpp
#include "../../Audacity.h" #include "../../Audacity.h"
#include "EnvelopeHandle.h" #include "EnvelopeHandle.h"
#include "../../Experimental.h"
#include "../../MemoryX.h" #include "../../MemoryX.h"
@ -28,12 +29,17 @@ Paul Licameli split from TrackPanel.cpp
EnvelopeHandle::EnvelopeHandle( Envelope *pEnvelope ) EnvelopeHandle::EnvelopeHandle( Envelope *pEnvelope )
: mEnvelope{ pEnvelope } : mEnvelope{ pEnvelope }
{} {
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;
#endif
}
EnvelopeHandle::~EnvelopeHandle() EnvelopeHandle::~EnvelopeHandle()
{} {}
HitTestPreview EnvelopeHandle::HitPreview(const AudacityProject *pProject, bool unsafe) HitTestPreview EnvelopeHandle::HitPreview
(const AudacityProject *pProject, bool unsafe)
{ {
static auto disabledCursor = static auto disabledCursor =
::MakeCursor(wxCURSOR_NO_ENTRY, DisabledCursorXpm, 16, 16); ::MakeCursor(wxCURSOR_NO_ENTRY, DisabledCursorXpm, 16, 16);

View File

@ -28,7 +28,8 @@ class EnvelopeHandle final : public UIHandle
{ {
EnvelopeHandle(const EnvelopeHandle&) = delete; EnvelopeHandle(const EnvelopeHandle&) = delete;
EnvelopeHandle &operator=(const EnvelopeHandle&) = delete; EnvelopeHandle &operator=(const EnvelopeHandle&) = delete;
static HitTestPreview HitPreview(const AudacityProject *pProject, bool unsafe); static HitTestPreview HitPreview
(const AudacityProject *pProject, bool unsafe);
static UIHandlePtr HitEnvelope static UIHandlePtr HitEnvelope
(std::weak_ptr<EnvelopeHandle> &holder, (std::weak_ptr<EnvelopeHandle> &holder,

View File

@ -10,6 +10,7 @@ Paul Licameli split from TrackPanel.cpp
#include "../../Audacity.h" #include "../../Audacity.h"
#include "TimeShiftHandle.h" #include "TimeShiftHandle.h"
#include "../../Experimental.h"
#include "TrackControls.h" #include "TrackControls.h"
#include "../../AColor.h" #include "../../AColor.h"
@ -27,7 +28,11 @@ TimeShiftHandle::TimeShiftHandle
( const std::shared_ptr<Track> &pTrack, bool gripHit ) ( const std::shared_ptr<Track> &pTrack, bool gripHit )
: mCapturedTrack{ pTrack } : mCapturedTrack{ pTrack }
, mGripHit{ gripHit } , mGripHit{ gripHit }
{} {
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;
#endif
}
HitTestPreview TimeShiftHandle::HitPreview HitTestPreview TimeShiftHandle::HitPreview
(const AudacityProject *pProject, bool unsafe) (const AudacityProject *pProject, bool unsafe)