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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user