mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-21 22:12:58 +02:00
Move mute and solo state into PlayableTrack
This commit is contained in:
@@ -161,10 +161,12 @@ bool GetProjectInfoCommand::testLinked(const Track * track) const
|
||||
|
||||
bool GetProjectInfoCommand::testSolo(const Track * track) const
|
||||
{
|
||||
return track->GetSolo();
|
||||
auto pt = dynamic_cast<const PlayableTrack *>(track);
|
||||
return pt && pt->GetSolo();
|
||||
}
|
||||
|
||||
bool GetProjectInfoCommand::testMute(const Track * track) const
|
||||
{
|
||||
return track->GetMute();
|
||||
auto pt = dynamic_cast<const PlayableTrack *>(track);
|
||||
return pt && pt->GetMute();
|
||||
}
|
||||
|
@@ -127,15 +127,17 @@ bool GetTrackInfoCommand::Apply(CommandExecutionContext context)
|
||||
}
|
||||
else if (mode.IsSameAs(wxT("Solo")))
|
||||
{
|
||||
if (t->GetKind() == Track::Wave)
|
||||
SendBooleanStatus(t->GetSolo());
|
||||
auto pt = dynamic_cast<const PlayableTrack *>(t);
|
||||
if (pt)
|
||||
SendBooleanStatus(pt->GetSolo());
|
||||
else
|
||||
SendBooleanStatus(false);
|
||||
}
|
||||
else if (mode.IsSameAs(wxT("Mute")))
|
||||
{
|
||||
if (t->GetKind() == Track::Wave)
|
||||
SendBooleanStatus(t->GetMute());
|
||||
auto pt = dynamic_cast<const PlayableTrack *>(t);
|
||||
if (pt)
|
||||
SendBooleanStatus(pt->GetMute());
|
||||
else
|
||||
SendBooleanStatus(false);
|
||||
}
|
||||
|
@@ -98,12 +98,14 @@ void SetProjectInfoCommand::setSelected(Track * trk, bool param) const
|
||||
|
||||
void SetProjectInfoCommand::setSolo(Track * trk, bool param) const
|
||||
{
|
||||
if(trk->GetKind() == Track::Wave)
|
||||
trk->SetSolo(param);
|
||||
auto pt = dynamic_cast<PlayableTrack *>(trk);
|
||||
if (pt)
|
||||
pt->SetSolo(param);
|
||||
}
|
||||
|
||||
void SetProjectInfoCommand::setMute(Track * trk, bool param) const
|
||||
{
|
||||
if(trk->GetKind() == Track::Wave)
|
||||
trk->SetMute(param);
|
||||
auto pt = dynamic_cast<PlayableTrack *>(trk);
|
||||
if (pt)
|
||||
pt->SetMute(param);
|
||||
}
|
||||
|
Reference in New Issue
Block a user