1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 08:09:32 +02:00

weaken dependency of TrackPanel.cpp on LabelTrack.h, a bit

This commit is contained in:
Paul Licameli 2015-08-23 19:02:06 -04:00
parent e7b11b8856
commit 439fdc66ff
5 changed files with 20 additions and 4 deletions

View File

@ -1130,6 +1130,17 @@ double LabelTrack::GetEndTime() const
return end;
}
Track *LabelTrack::Duplicate()
{
return new LabelTrack(*this);
}
void LabelTrack::SetSelected(bool s)
{
Track::SetSelected(s);
if (!s)
Unselect();
}
/// OverGlyph returns 0 if not over a glyph,
/// 1 if over the left-hand glyph, and

View File

@ -139,7 +139,9 @@ class AUDACITY_DLL_API LabelTrack : public Track
virtual double GetStartTime() const;
virtual double GetEndTime() const;
virtual Track *Duplicate() { return new LabelTrack(*this); }
virtual Track *Duplicate();
virtual void SetSelected(bool s);
virtual bool HandleXMLTag(const wxChar *tag, const wxChar **attrs);
virtual XMLTagHandler *HandleXMLChild(const wxChar *tag);

View File

@ -112,6 +112,11 @@ void Track::Init(const Track &orig)
#endif
}
void Track::SetSelected(bool s)
{
mSelected = s;
}
void Track::Merge(const Track &orig)
{
mSelected = orig.mSelected;

View File

@ -159,7 +159,7 @@ class AUDACITY_DLL_API Track: public XMLTagHandler
bool GetLinked () const { return mLinked; }
bool GetSolo () const { return mSolo; }
void SetSelected(bool s) { mSelected = s; }
virtual void SetSelected(bool s);
void SetMute (bool m) { mMute = m; }
void SetLinked (bool l);
void SetSolo (bool s) { mSolo = s; }

View File

@ -996,8 +996,6 @@ void TrackPanel::SelectNone()
Track *t = iter.First();
while (t) {
t->SetSelected(false);
if (t->GetKind() == Track::Label)
((LabelTrack *) t)->Unselect();
t = iter.Next();
}
}