mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-13 15:17:42 +02:00
Rename "Actual" to "Expanded" height which explains purpose better
(cherry picked from audacity commit 579038e341a7fa58ca049754accf84f3212e4749) Signed-off-by: akleja <storspov@gmail.com>
This commit is contained in:
parent
ce2bc7f60e
commit
e8fb7b2803
@ -791,7 +791,7 @@ void ScreenshotBigDialog::SizeTracks(int h)
|
|||||||
auto nChannels = channels.size();
|
auto nChannels = channels.size();
|
||||||
auto height = nChannels == 1 ? 2 * h : h;
|
auto height = nChannels == 1 ? 2 * h : h;
|
||||||
for (auto channel : channels)
|
for (auto channel : channels)
|
||||||
TrackView::Get( *channel ).SetHeight(height);
|
TrackView::Get( *channel ).SetExpandedHeight(height);
|
||||||
}
|
}
|
||||||
ProjectWindow::Get( mContext.project ).RedrawProject();
|
ProjectWindow::Get( mContext.project ).RedrawProject();
|
||||||
}
|
}
|
||||||
@ -800,7 +800,7 @@ void ScreenshotBigDialog::OnShortTracks(wxCommandEvent & WXUNUSED(event))
|
|||||||
{
|
{
|
||||||
for (auto t : TrackList::Get( mContext.project ).Any<WaveTrack>()) {
|
for (auto t : TrackList::Get( mContext.project ).Any<WaveTrack>()) {
|
||||||
auto &view = TrackView::Get( *t );
|
auto &view = TrackView::Get( *t );
|
||||||
view.SetHeight( view.GetMinimizedHeight() );
|
view.SetExpandedHeight( view.GetMinimizedHeight() );
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectWindow::Get( mContext.project ).RedrawProject();
|
ProjectWindow::Get( mContext.project ).RedrawProject();
|
||||||
|
@ -69,7 +69,7 @@ UIHandle::Result TrackPanelResizeHandle::Click(
|
|||||||
int coord = 0;
|
int coord = 0;
|
||||||
for ( const auto channel : range ) {
|
for ( const auto channel : range ) {
|
||||||
int newCoord = ((double)ii++ /size) * height;
|
int newCoord = ((double)ii++ /size) * height;
|
||||||
TrackView::Get(*channel).SetHeight( newCoord - coord );
|
TrackView::Get(*channel).SetExpandedHeight( newCoord - coord );
|
||||||
coord = newCoord;
|
coord = newCoord;
|
||||||
}
|
}
|
||||||
ProjectHistory::Get( *pProject ).ModifyState(false);
|
ProjectHistory::Get( *pProject ).ModifyState(false);
|
||||||
@ -92,7 +92,7 @@ TrackPanelResizeHandle::TrackPanelResizeHandle
|
|||||||
auto last = *channels.rbegin();
|
auto last = *channels.rbegin();
|
||||||
auto &lastView = TrackView::Get( *last );
|
auto &lastView = TrackView::Get( *last );
|
||||||
mInitialTrackHeight = lastView.GetHeight();
|
mInitialTrackHeight = lastView.GetHeight();
|
||||||
mInitialActualHeight = lastView.GetActualHeight();
|
mInitialExpandedHeight = lastView.GetExpandedHeight();
|
||||||
mInitialMinimized = lastView.GetMinimized();
|
mInitialMinimized = lastView.GetMinimized();
|
||||||
|
|
||||||
if (channels.size() > 1) {
|
if (channels.size() > 1) {
|
||||||
@ -100,7 +100,7 @@ TrackPanelResizeHandle::TrackPanelResizeHandle
|
|||||||
auto &firstView = TrackView::Get( *first );
|
auto &firstView = TrackView::Get( *first );
|
||||||
|
|
||||||
mInitialUpperTrackHeight = firstView.GetHeight();
|
mInitialUpperTrackHeight = firstView.GetHeight();
|
||||||
mInitialUpperActualHeight = firstView.GetActualHeight();
|
mInitialUpperExpandedHeight = firstView.GetExpandedHeight();
|
||||||
|
|
||||||
if (track.get() == *channels.rbegin())
|
if (track.get() == *channels.rbegin())
|
||||||
// capturedTrack is the lowest track
|
// capturedTrack is the lowest track
|
||||||
@ -137,7 +137,7 @@ UIHandle::Result TrackPanelResizeHandle::Drag
|
|||||||
auto channels = TrackList::Channels( pTrack.get() );
|
auto channels = TrackList::Channels( pTrack.get() );
|
||||||
for (auto channel : channels) {
|
for (auto channel : channels) {
|
||||||
auto &channelView = TrackView::Get( *channel );
|
auto &channelView = TrackView::Get( *channel );
|
||||||
channelView.SetHeight(channelView.GetHeight());
|
channelView.SetExpandedHeight(channelView.GetHeight());
|
||||||
channelView.SetMinimized( false );
|
channelView.SetMinimized( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,8 +171,8 @@ UIHandle::Result TrackPanelResizeHandle::Drag
|
|||||||
if (newUpperTrackHeight < prevView.GetMinimizedHeight())
|
if (newUpperTrackHeight < prevView.GetMinimizedHeight())
|
||||||
newUpperTrackHeight = prevView.GetMinimizedHeight();
|
newUpperTrackHeight = prevView.GetMinimizedHeight();
|
||||||
|
|
||||||
view.SetHeight(newTrackHeight);
|
view.SetExpandedHeight(newTrackHeight);
|
||||||
prevView.SetHeight(newUpperTrackHeight);
|
prevView.SetExpandedHeight(newUpperTrackHeight);
|
||||||
};
|
};
|
||||||
|
|
||||||
auto doResizeBetween = [&] (Track *next, bool WXUNUSED(vStereo)) {
|
auto doResizeBetween = [&] (Track *next, bool WXUNUSED(vStereo)) {
|
||||||
@ -194,15 +194,15 @@ UIHandle::Result TrackPanelResizeHandle::Drag
|
|||||||
mInitialUpperTrackHeight + mInitialTrackHeight - view.GetMinimizedHeight();
|
mInitialUpperTrackHeight + mInitialTrackHeight - view.GetMinimizedHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
view.SetHeight(newUpperTrackHeight);
|
view.SetExpandedHeight(newUpperTrackHeight);
|
||||||
nextView.SetHeight(newTrackHeight);
|
nextView.SetExpandedHeight(newTrackHeight);
|
||||||
};
|
};
|
||||||
|
|
||||||
auto doResize = [&] {
|
auto doResize = [&] {
|
||||||
int newTrackHeight = mInitialTrackHeight + delta;
|
int newTrackHeight = mInitialTrackHeight + delta;
|
||||||
if (newTrackHeight < view.GetMinimizedHeight())
|
if (newTrackHeight < view.GetMinimizedHeight())
|
||||||
newTrackHeight = view.GetMinimizedHeight();
|
newTrackHeight = view.GetMinimizedHeight();
|
||||||
view.SetHeight(newTrackHeight);
|
view.SetExpandedHeight(newTrackHeight);
|
||||||
};
|
};
|
||||||
|
|
||||||
//STM: We may be dragging one or two (stereo) tracks.
|
//STM: We may be dragging one or two (stereo) tracks.
|
||||||
@ -268,7 +268,7 @@ UIHandle::Result TrackPanelResizeHandle::Cancel(AudacityProject *pProject)
|
|||||||
case IsResizing:
|
case IsResizing:
|
||||||
{
|
{
|
||||||
auto &view = TrackView::Get( *pTrack );
|
auto &view = TrackView::Get( *pTrack );
|
||||||
view.SetHeight(mInitialActualHeight);
|
view.SetExpandedHeight(mInitialExpandedHeight);
|
||||||
view.SetMinimized( mInitialMinimized );
|
view.SetMinimized( mInitialMinimized );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -277,9 +277,9 @@ UIHandle::Result TrackPanelResizeHandle::Cancel(AudacityProject *pProject)
|
|||||||
Track *const next = * ++ tracks.Find(pTrack.get());
|
Track *const next = * ++ tracks.Find(pTrack.get());
|
||||||
auto
|
auto
|
||||||
&view = TrackView::Get( *pTrack ), &nextView = TrackView::Get( *next );
|
&view = TrackView::Get( *pTrack ), &nextView = TrackView::Get( *next );
|
||||||
view.SetHeight(mInitialUpperActualHeight);
|
view.SetExpandedHeight(mInitialUpperExpandedHeight);
|
||||||
view.SetMinimized( mInitialMinimized );
|
view.SetMinimized( mInitialMinimized );
|
||||||
nextView.SetHeight(mInitialActualHeight);
|
nextView.SetExpandedHeight(mInitialExpandedHeight);
|
||||||
nextView.SetMinimized( mInitialMinimized );
|
nextView.SetMinimized( mInitialMinimized );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -288,9 +288,9 @@ UIHandle::Result TrackPanelResizeHandle::Cancel(AudacityProject *pProject)
|
|||||||
Track *const prev = * -- tracks.Find(pTrack.get());
|
Track *const prev = * -- tracks.Find(pTrack.get());
|
||||||
auto
|
auto
|
||||||
&view = TrackView::Get( *pTrack ), &prevView = TrackView::Get( *prev );
|
&view = TrackView::Get( *pTrack ), &prevView = TrackView::Get( *prev );
|
||||||
view.SetHeight(mInitialActualHeight);
|
view.SetExpandedHeight(mInitialExpandedHeight);
|
||||||
view.SetMinimized( mInitialMinimized );
|
view.SetMinimized( mInitialMinimized );
|
||||||
prevView.SetHeight(mInitialUpperActualHeight);
|
prevView.SetExpandedHeight(mInitialUpperExpandedHeight);
|
||||||
prevView.SetMinimized(mInitialMinimized);
|
prevView.SetMinimized(mInitialMinimized);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -58,9 +58,9 @@ private:
|
|||||||
|
|
||||||
bool mInitialMinimized{};
|
bool mInitialMinimized{};
|
||||||
int mInitialTrackHeight{};
|
int mInitialTrackHeight{};
|
||||||
int mInitialActualHeight{};
|
int mInitialExpandedHeight{};
|
||||||
int mInitialUpperTrackHeight{};
|
int mInitialUpperTrackHeight{};
|
||||||
int mInitialUpperActualHeight{};
|
int mInitialUpperExpandedHeight{};
|
||||||
|
|
||||||
int mMouseClickY{};
|
int mMouseClickY{};
|
||||||
};
|
};
|
||||||
|
@ -383,7 +383,7 @@ bool SetTrackVisualsCommand::ApplyInner(const CommandContext & context, Track *
|
|||||||
wt->SetWaveColorIndex( mColour );
|
wt->SetWaveColorIndex( mColour );
|
||||||
|
|
||||||
if( t && bHasHeight )
|
if( t && bHasHeight )
|
||||||
TrackView::Get( *t ).SetHeight( mHeight );
|
TrackView::Get( *t ).SetExpandedHeight( mHeight );
|
||||||
|
|
||||||
if( wt && bHasDisplayType ) {
|
if( wt && bHasDisplayType ) {
|
||||||
auto &view = WaveTrackView::Get( *wt );
|
auto &view = WaveTrackView::Get( *wt );
|
||||||
|
@ -154,7 +154,7 @@ void DoZoomFitV(AudacityProject &project)
|
|||||||
height = std::max( (int)TrackInfo::MinimumTrackHeight(), height );
|
height = std::max( (int)TrackInfo::MinimumTrackHeight(), height );
|
||||||
|
|
||||||
for (auto t : range)
|
for (auto t : range)
|
||||||
TrackView::Get( *t ).SetHeight(height);
|
TrackView::Get( *t ).SetExpandedHeight(height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -843,8 +843,8 @@ void WaveTrackMenuTable::OnMergeStereo(wxCommandEvent &)
|
|||||||
view.SetMinimized(false);
|
view.SetMinimized(false);
|
||||||
partnerView.SetMinimized(false);
|
partnerView.SetMinimized(false);
|
||||||
int AverageHeight = (view.GetHeight() + partnerView.GetHeight()) / 2;
|
int AverageHeight = (view.GetHeight() + partnerView.GetHeight()) / 2;
|
||||||
view.SetHeight(AverageHeight);
|
view.SetExpandedHeight(AverageHeight);
|
||||||
partnerView.SetHeight(AverageHeight);
|
partnerView.SetExpandedHeight(AverageHeight);
|
||||||
view.SetMinimized(bBothMinimizedp);
|
view.SetMinimized(bBothMinimizedp);
|
||||||
partnerView.SetMinimized(bBothMinimizedp);
|
partnerView.SetMinimized(bBothMinimizedp);
|
||||||
|
|
||||||
@ -879,7 +879,7 @@ void WaveTrackMenuTable::SplitStereo(bool stereo)
|
|||||||
|
|
||||||
//make sure no channel is smaller than its minimum height
|
//make sure no channel is smaller than its minimum height
|
||||||
if (view.GetHeight() < view.GetMinimizedHeight())
|
if (view.GetHeight() < view.GetMinimizedHeight())
|
||||||
view.SetHeight(view.GetMinimizedHeight());
|
view.SetExpandedHeight(view.GetMinimizedHeight());
|
||||||
totalHeight += view.GetHeight();
|
totalHeight += view.GetHeight();
|
||||||
++nChannels;
|
++nChannels;
|
||||||
}
|
}
|
||||||
@ -889,7 +889,7 @@ void WaveTrackMenuTable::SplitStereo(bool stereo)
|
|||||||
|
|
||||||
for (auto channel : channels)
|
for (auto channel : channels)
|
||||||
// Make tracks the same height
|
// Make tracks the same height
|
||||||
TrackView::Get( *channel ).SetHeight( averageHeight );
|
TrackView::Get( *channel ).SetExpandedHeight( averageHeight );
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Swap the left and right channels of a stero track...
|
/// Swap the left and right channels of a stero track...
|
||||||
|
@ -87,7 +87,7 @@ void TrackView::SetMinimized(bool isMinimized)
|
|||||||
|
|
||||||
void TrackView::WriteXMLAttributes( XMLWriter &xmlFile ) const
|
void TrackView::WriteXMLAttributes( XMLWriter &xmlFile ) const
|
||||||
{
|
{
|
||||||
xmlFile.WriteAttr(wxT("height"), GetActualHeight());
|
xmlFile.WriteAttr(wxT("height"), GetExpandedHeight());
|
||||||
xmlFile.WriteAttr(wxT("minimized"), GetMinimized());
|
xmlFile.WriteAttr(wxT("minimized"), GetMinimized());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ bool TrackView::HandleXMLAttribute( const wxChar *attr, const wxChar *value )
|
|||||||
// will stall Audacity as it tries to create an enormous vertical ruler.
|
// will stall Audacity as it tries to create an enormous vertical ruler.
|
||||||
// So clamp to reasonable values.
|
// So clamp to reasonable values.
|
||||||
nValue = std::max( 40l, std::min( nValue, 1000l ));
|
nValue = std::max( 40l, std::min( nValue, 1000l ));
|
||||||
SetHeight(nValue);
|
SetExpandedHeight(nValue);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (!wxStrcmp(attr, wxT("minimized")) &&
|
else if (!wxStrcmp(attr, wxT("minimized")) &&
|
||||||
@ -161,7 +161,7 @@ int TrackView::GetHeight() const
|
|||||||
return mHeight;
|
return mHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackView::SetHeight(int h)
|
void TrackView::SetExpandedHeight(int h)
|
||||||
{
|
{
|
||||||
DoSetHeight(h);
|
DoSetHeight(h);
|
||||||
FindTrack()->AdjustPositions();
|
FindTrack()->AdjustPositions();
|
||||||
|
@ -50,12 +50,20 @@ public:
|
|||||||
void SetMinimized( bool minimized );
|
void SetMinimized( bool minimized );
|
||||||
|
|
||||||
int GetY() const { return mY; }
|
int GetY() const { return mY; }
|
||||||
int GetActualHeight() const { return mHeight; }
|
|
||||||
|
//! @return height of the track when expanded
|
||||||
|
int GetExpandedHeight() const { return mHeight; }
|
||||||
|
|
||||||
|
//! @return height of the track when collapsed
|
||||||
virtual int GetMinimizedHeight() const = 0;
|
virtual int GetMinimizedHeight() const = 0;
|
||||||
int GetHeight() const;
|
int GetHeight() const;
|
||||||
|
|
||||||
void SetY(int y) { DoSetY( y ); }
|
void SetY(int y) { DoSetY( y ); }
|
||||||
void SetHeight(int height);
|
|
||||||
|
/*! Sets height for expanded state.
|
||||||
|
Does not expand a track if it is now collapsed.
|
||||||
|
*/
|
||||||
|
void SetExpandedHeight(int height);
|
||||||
|
|
||||||
// Return another, associated TrackPanelCell object that implements the
|
// Return another, associated TrackPanelCell object that implements the
|
||||||
// mouse actions for the vertical ruler
|
// mouse actions for the vertical ruler
|
||||||
@ -81,13 +89,15 @@ public:
|
|||||||
|
|
||||||
virtual void DoSetMinimized( bool isMinimized );
|
virtual void DoSetMinimized( bool isMinimized );
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
|
|
||||||
// No need yet to make this virtual
|
// No need yet to make this virtual
|
||||||
void DoSetY(int y);
|
void DoSetY(int y);
|
||||||
|
|
||||||
void DoSetHeight(int h);
|
void DoSetHeight(int h);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
// Private factory to make appropriate object; class TrackView handles
|
// Private factory to make appropriate object; class TrackView handles
|
||||||
// memory management thereafter
|
// memory management thereafter
|
||||||
virtual std::shared_ptr<TrackVRulerControls> DoGetVRulerControls() = 0;
|
virtual std::shared_ptr<TrackVRulerControls> DoGetVRulerControls() = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user