1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

Move Y position, height, and minimized state into TrackView...

... and eliminate some unnecessary calls to SubstitutePendingChangedTrack,
because the track and the substitute store Y and height in their shared
TrackView object.

Also make GetMinimizedHeight() virtual to avoid inclusion of TrackPanel.h in
TrackView.cpp.
This commit is contained in:
Paul Licameli
2019-06-18 11:32:26 -04:00
parent 3797a5227a
commit 66e32ca35d
28 changed files with 244 additions and 225 deletions

View File

@@ -43,6 +43,7 @@ This class now lists
#include "../prefs/PrefsDialog.h"
#include "../Shuttle.h"
#include "../PluginManager.h"
#include "../tracks/ui/TrackView.h"
#include "../ShuttleGui.h"
#include <wx/frame.h>
@@ -496,7 +497,7 @@ bool GetInfoCommand::SendTracks(const CommandContext & context)
context.AddBool( (trk == fTrack), "focused");
context.AddBool( trk->GetSelected(), "selected" );
//JKC: Possibly add later...
//context.AddItem( trk->GetHeight(), "height" );
//context.AddItem( GetTrackView::Get( *trk ).GetHeight(), "height" );
trk->TypeSwitch( [&] (const WaveTrack* t ) {
float vzmin, vzmax;
t->GetDisplayBounds(&vzmin, &vzmax);
@@ -722,8 +723,9 @@ void GetInfoCommand::ExploreTrackPanel( const CommandContext &context,
wxRect trackRect = pWin->GetRect();
for ( auto t : TrackList::Get( *pProj ).Any() + IsVisibleTrack{ pProj } ) {
trackRect.y = t->GetY() - viewInfo.vpos;
trackRect.height = t->GetHeight();
auto &view = TrackView::Get( *t );
trackRect.y = view.GetY() - viewInfo.vpos;
trackRect.height = view.GetHeight();
#if 0
// Work in progress on getting the TCP button positions and sizes.

View File

@@ -770,8 +770,8 @@ wxRect ScreenshotCommand::GetTrackRect( AudacityProject * pProj, TrackPanel * pa
// Omit the outermost ring of gray pixels
// (Note that TrackPanel paints its focus over the "top margin" of the
// rectangle allotted to the track, according to Track::GetY() and
// Track::GetHeight(), but also over the margin of the next track.)
// rectangle allotted to the track, according to TrackView::GetY() and
// TrackView::GetHeight(), but also over the margin of the next track.)
rect.height += kBottomMargin;
int dy = kTopMargin - 1;

View File

@@ -43,6 +43,7 @@ SetTrackAudioCommand and SetTrackVisualsCommand.
#include "../prefs/SpectrogramSettings.h"
#include "../Shuttle.h"
#include "../ShuttleGui.h"
#include "../tracks/ui/TrackView.h"
#include "CommandContext.h"
SetTrackBase::SetTrackBase(){
@@ -348,7 +349,7 @@ bool SetTrackVisualsCommand::ApplyInner(const CommandContext & context, Track *
wt->SetWaveColorIndex( mColour );
if( t && bHasHeight )
t->SetHeight( mHeight );
TrackView::Get( *t ).SetHeight( mHeight );
if( wt && bHasDisplayType )
wt->SetDisplay(