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

Move height calculation utilities to class TrackView

This commit is contained in:
Paul Licameli
2019-06-22 08:39:20 -04:00
parent a6e2ca0aa8
commit 4339c0df68
10 changed files with 46 additions and 43 deletions

View File

@@ -842,15 +842,6 @@ Track *TrackList::GetPrev(Track * t, bool linked) const
return nullptr;
}
/// For mono track height of track
/// For stereo track combined height of both channels.
int TrackList::GetGroupHeight(const Track * t) const
{
const auto GetHeight = []( const Track *track )
{ return TrackView::Get( *track ).GetHeight(); };
return Channels(t).sum( GetHeight );
}
bool TrackList::CanMoveUp(Track * t) const
{
return GetPrev(t, true) != NULL;
@@ -970,19 +961,6 @@ size_t TrackList::size() const
return cnt;
}
int TrackList::GetHeight() const
{
int height = 0;
if (!empty()) {
auto track = getPrev( getEnd() ).first->get();
auto &view = TrackView::Get( *track );
height = view.GetY() + view.GetHeight();
}
return height;
}
namespace {
// Abstract the common pattern of the following three member functions
inline double Accumulate