1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-03 06:03:13 +02:00

Compute default WaveTrack height analogously to NoteTrack...

... though in fact this comes to the same 150 pixels as before, given the
present layout table.
This commit is contained in:
Paul Licameli 2017-06-06 22:37:24 -04:00
parent f0c149b890
commit 84b5fd6075
3 changed files with 15 additions and 0 deletions

View File

@ -9791,6 +9791,16 @@ unsigned TrackInfo::DefaultNoteTrackHeight()
return (unsigned) std::max( needed, (int) Track::DefaultHeight );
}
unsigned TrackInfo::DefaultWaveTrackHeight()
{
int needed =
kTopMargin + kBottomMargin +
totalTCPLines( waveTrackTCPLines ) +
totalTCPLines( commonTrackTCPBottomLines ) -
kTrackInfoSliderExtra;
return (unsigned) std::max( needed, (int) Track::DefaultHeight );
}
LWSlider * TrackInfo::GainSlider(WaveTrack *t, bool captured) const
{
wxPoint topLeft{

View File

@ -119,6 +119,7 @@ private:
public:
static unsigned DefaultNoteTrackHeight();
static unsigned DefaultWaveTrackHeight();
LWSlider * GainSlider(WaveTrack *t, bool captured = false) const;
LWSlider * PanSlider(WaveTrack *t, bool captured = false) const;

View File

@ -59,6 +59,8 @@ Track classes.
#include "Experimental.h"
#include "TrackPanel.h" // for TrackInfo
using std::max;
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
@ -113,6 +115,8 @@ WaveTrack::WaveTrack(const std::shared_ptr<DirManager> &projDirManager, sampleFo
mLastScaleType = -1;
mLastdBRange = -1;
mAutoSaveIdent = 0;
SetHeight( TrackInfo::DefaultWaveTrackHeight() );
}
WaveTrack::WaveTrack(const WaveTrack &orig):