mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-22 15:20:15 +02:00
Move mute and solo state into PlayableTrack
This commit is contained in:
parent
ed0088491c
commit
6c4cf46c06
@ -7088,8 +7088,9 @@ void AudacityProject::OnMuteAllTracks()
|
|||||||
|
|
||||||
while (t)
|
while (t)
|
||||||
{
|
{
|
||||||
if (t->GetKind() == Track::Wave)
|
auto pt = dynamic_cast<PlayableTrack *>(t);
|
||||||
t->SetMute(true);
|
if (pt)
|
||||||
|
pt->SetMute(true);
|
||||||
|
|
||||||
t = iter.Next();
|
t = iter.Next();
|
||||||
}
|
}
|
||||||
@ -7107,7 +7108,9 @@ void AudacityProject::OnUnMuteAllTracks()
|
|||||||
|
|
||||||
while (t)
|
while (t)
|
||||||
{
|
{
|
||||||
t->SetMute(false);
|
auto pt = dynamic_cast<PlayableTrack *>(t);
|
||||||
|
if (pt)
|
||||||
|
pt->SetMute(false);
|
||||||
t = iter.Next();
|
t = iter.Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1110,9 +1110,11 @@ bool MixerBoard::HasSolo()
|
|||||||
{
|
{
|
||||||
TrackListIterator iterTracks(mTracks);
|
TrackListIterator iterTracks(mTracks);
|
||||||
Track* pTrack;
|
Track* pTrack;
|
||||||
for (pTrack = iterTracks.First(); pTrack; pTrack = iterTracks.Next())
|
for (pTrack = iterTracks.First(); pTrack; pTrack = iterTracks.Next()) {
|
||||||
if (pTrack->GetSolo())
|
auto pPlayable = dynamic_cast<PlayableTrack *>( pTrack );
|
||||||
|
if (pPlayable && pPlayable->GetSolo())
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
106
src/Project.cpp
106
src/Project.cpp
@ -3655,6 +3655,8 @@ void AudacityProject::WriteXML(XMLWriter &xmlFile, bool bWantSaveCompressed)
|
|||||||
while (t) {
|
while (t) {
|
||||||
if ((t->GetKind() == Track::Wave) && bWantSaveCompressed)
|
if ((t->GetKind() == Track::Wave) && bWantSaveCompressed)
|
||||||
{
|
{
|
||||||
|
auto wt = static_cast<const WaveTrack *>(t);
|
||||||
|
|
||||||
//vvv This should probably be a method, WaveTrack::WriteCompressedTrackXML().
|
//vvv This should probably be a method, WaveTrack::WriteCompressedTrackXML().
|
||||||
xmlFile.StartTag(wxT("import"));
|
xmlFile.StartTag(wxT("import"));
|
||||||
xmlFile.WriteAttr(wxT("filename"), mStrOtherNamesArray[ndx]); // Assumes mTracks order hasn't changed!
|
xmlFile.WriteAttr(wxT("filename"), mStrOtherNamesArray[ndx]); // Assumes mTracks order hasn't changed!
|
||||||
@ -3665,8 +3667,8 @@ void AudacityProject::WriteXML(XMLWriter &xmlFile, bool bWantSaveCompressed)
|
|||||||
// xmlFile.WriteAttr(wxT("linked"), t->GetLinked());
|
// xmlFile.WriteAttr(wxT("linked"), t->GetLinked());
|
||||||
|
|
||||||
xmlFile.WriteAttr(wxT("offset"), t->GetOffset(), 8);
|
xmlFile.WriteAttr(wxT("offset"), t->GetOffset(), 8);
|
||||||
xmlFile.WriteAttr(wxT("mute"), t->GetMute());
|
xmlFile.WriteAttr(wxT("mute"), wt->GetMute());
|
||||||
xmlFile.WriteAttr(wxT("solo"), t->GetSolo());
|
xmlFile.WriteAttr(wxT("solo"), wt->GetSolo());
|
||||||
xmlFile.WriteAttr(wxT("height"), t->GetActualHeight());
|
xmlFile.WriteAttr(wxT("height"), t->GetActualHeight());
|
||||||
xmlFile.WriteAttr(wxT("minimized"), t->GetMinimized());
|
xmlFile.WriteAttr(wxT("minimized"), t->GetMinimized());
|
||||||
|
|
||||||
@ -3975,10 +3977,12 @@ bool AudacityProject::Save(bool overwrite /* = true */ ,
|
|||||||
((pTrack != NULL) && (pSavedTrack != NULL));
|
((pTrack != NULL) && (pSavedTrack != NULL));
|
||||||
pTrack = iter.Next(), pSavedTrack = savedTrackIter.Next())
|
pTrack = iter.Next(), pSavedTrack = savedTrackIter.Next())
|
||||||
{
|
{
|
||||||
pWaveTrack = (WaveTrack*)pTrack;
|
pWaveTrack = static_cast<WaveTrack*>(pTrack);
|
||||||
|
auto pSavedWaveTrack = static_cast<const WaveTrack*>(pSavedTrack);
|
||||||
|
|
||||||
pWaveTrack->SetSelected(pSavedTrack->GetSelected());
|
pWaveTrack->SetSelected(pSavedTrack->GetSelected());
|
||||||
pWaveTrack->SetMute(pSavedTrack->GetMute());
|
pWaveTrack->SetMute(pSavedWaveTrack->GetMute());
|
||||||
pWaveTrack->SetSolo(pSavedTrack->GetSolo());
|
pWaveTrack->SetSolo(pSavedWaveTrack->GetSolo());
|
||||||
|
|
||||||
pWaveTrack->SetGain(((WaveTrack*)pSavedTrack)->GetGain());
|
pWaveTrack->SetGain(((WaveTrack*)pSavedTrack)->GetGain());
|
||||||
pWaveTrack->SetPan(((WaveTrack*)pSavedTrack)->GetPan());
|
pWaveTrack->SetPan(((WaveTrack*)pSavedTrack)->GetPan());
|
||||||
@ -5430,36 +5434,45 @@ void AudacityProject::HandleTrackMute(Track *t, const bool exclusive)
|
|||||||
if (exclusive)
|
if (exclusive)
|
||||||
{
|
{
|
||||||
TrackListIterator iter(GetTracks());
|
TrackListIterator iter(GetTracks());
|
||||||
Track *i = iter.First();
|
Track *it = iter.First();
|
||||||
while (i) {
|
while (it) {
|
||||||
if (i == t) {
|
auto i = dynamic_cast<PlayableTrack *>(it);
|
||||||
i->SetMute(true);
|
if (i) {
|
||||||
if(i->GetLinked()) { // also mute the linked track
|
if (i == t) {
|
||||||
i = iter.Next();
|
|
||||||
i->SetMute(true);
|
i->SetMute(true);
|
||||||
|
if(i->GetLinked()) { // also mute the linked track
|
||||||
|
it = iter.Next();
|
||||||
|
i->SetMute(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
i->SetMute(false);
|
||||||
|
}
|
||||||
|
i->SetSolo(false);
|
||||||
}
|
}
|
||||||
else {
|
it = iter.Next();
|
||||||
i->SetMute(false);
|
|
||||||
}
|
|
||||||
i->SetSolo(false);
|
|
||||||
i = iter.Next();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Normal click toggles this track.
|
// Normal click toggles this track.
|
||||||
t->SetMute(!t->GetMute());
|
auto pt = dynamic_cast<PlayableTrack *>( t );
|
||||||
|
if (!pt)
|
||||||
|
return;
|
||||||
|
|
||||||
|
pt->SetMute(!pt->GetMute());
|
||||||
if(t->GetLinked()) // set mute the same on both, if a pair
|
if(t->GetLinked()) // set mute the same on both, if a pair
|
||||||
{
|
{
|
||||||
bool muted = t->GetMute();
|
bool muted = pt->GetMute();
|
||||||
TrackListIterator iter(GetTracks());
|
TrackListIterator iter(GetTracks());
|
||||||
Track *i = iter.First();
|
Track *i = iter.First();
|
||||||
while (i != t) { // search for this track
|
while (i != t) { // search for this track
|
||||||
i = iter.Next();
|
i = iter.Next();
|
||||||
}
|
}
|
||||||
i = iter.Next(); // get the next one, since linked
|
i = iter.Next(); // get the next one, since linked
|
||||||
i->SetMute(muted); // and mute it as well
|
auto pi = dynamic_cast<PlayableTrack *>( i );
|
||||||
|
if (pi)
|
||||||
|
pi->SetMute(muted); // and mute it as well
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsSoloSimple() || IsSoloNone())
|
if (IsSoloSimple() || IsSoloNone())
|
||||||
@ -5471,18 +5484,23 @@ void AudacityProject::HandleTrackMute(Track *t, const bool exclusive)
|
|||||||
// We also set a solo indicator if we have just one track / stereo pair playing.
|
// We also set a solo indicator if we have just one track / stereo pair playing.
|
||||||
// otherwise clear solo on everything.
|
// otherwise clear solo on everything.
|
||||||
while (i) {
|
while (i) {
|
||||||
if( !i->GetMute())
|
auto pi = dynamic_cast<PlayableTrack *>( i );
|
||||||
{
|
if (pi) {
|
||||||
nPlaying += 1;
|
if( !pi->GetMute())
|
||||||
if(i->GetLinked())
|
{
|
||||||
i = iter.Next(); // don't count this one as it is linked
|
nPlaying += 1;
|
||||||
|
if(i->GetLinked())
|
||||||
|
i = iter.Next(); // don't count this one as it is linked
|
||||||
|
}
|
||||||
}
|
}
|
||||||
i = iter.Next();
|
i = iter.Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
i = iter.First();
|
i = iter.First();
|
||||||
while (i) {
|
while (i) {
|
||||||
i->SetSolo( (nPlaying==1) && !i->GetMute() ); // will set both of a stereo pair
|
auto pi = dynamic_cast<PlayableTrack *>( i );
|
||||||
|
if (pi)
|
||||||
|
pi->SetSolo( (nPlaying==1) && !pi->GetMute() ); // will set both of a stereo pair
|
||||||
i = iter.Next();
|
i = iter.Next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5492,8 +5510,12 @@ void AudacityProject::HandleTrackMute(Track *t, const bool exclusive)
|
|||||||
|
|
||||||
// Type of solo (standard or simple) follows the set preference, unless
|
// Type of solo (standard or simple) follows the set preference, unless
|
||||||
// alternate == true, which causes the opposite behavior.
|
// alternate == true, which causes the opposite behavior.
|
||||||
void AudacityProject::HandleTrackSolo(Track *t, const bool alternate)
|
void AudacityProject::HandleTrackSolo(Track *const t, const bool alternate)
|
||||||
{
|
{
|
||||||
|
const auto pt = dynamic_cast<PlayableTrack *>( t );
|
||||||
|
if (!pt)
|
||||||
|
return;
|
||||||
|
|
||||||
bool bSoloMultiple = !IsSoloSimple() ^ alternate;
|
bool bSoloMultiple = !IsSoloSimple() ^ alternate;
|
||||||
|
|
||||||
// Standard and Simple solo have opposite defaults:
|
// Standard and Simple solo have opposite defaults:
|
||||||
@ -5503,17 +5525,19 @@ void AudacityProject::HandleTrackSolo(Track *t, const bool alternate)
|
|||||||
// when in standard radio button mode.
|
// when in standard radio button mode.
|
||||||
if ( bSoloMultiple )
|
if ( bSoloMultiple )
|
||||||
{
|
{
|
||||||
t->SetSolo( !t->GetSolo() );
|
pt->SetSolo( !pt->GetSolo() );
|
||||||
if(t->GetLinked())
|
if(t->GetLinked())
|
||||||
{
|
{
|
||||||
bool soloed = t->GetSolo();
|
bool soloed = pt->GetSolo();
|
||||||
TrackListIterator iter(GetTracks());
|
TrackListIterator iter(GetTracks());
|
||||||
Track *i = iter.First();
|
Track *i = iter.First();
|
||||||
while (i != t) { // search for this track
|
while (i != t) { // search for this track
|
||||||
i = iter.Next();
|
i = iter.Next();
|
||||||
}
|
}
|
||||||
i = iter.Next(); // get the next one, since linked
|
i = iter.Next(); // get the next one, since linked
|
||||||
i->SetSolo(soloed); // and solo it as well
|
auto pi = dynamic_cast<PlayableTrack *>( i );
|
||||||
|
if (pi)
|
||||||
|
pi->SetSolo(soloed); // and solo it as well
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -5522,26 +5546,32 @@ void AudacityProject::HandleTrackSolo(Track *t, const bool alternate)
|
|||||||
// OR unmute and unsolo everything.
|
// OR unmute and unsolo everything.
|
||||||
TrackListIterator iter(GetTracks());
|
TrackListIterator iter(GetTracks());
|
||||||
Track *i = iter.First();
|
Track *i = iter.First();
|
||||||
bool bWasSolo = t->GetSolo();
|
bool bWasSolo = pt->GetSolo();
|
||||||
while (i) {
|
while (i) {
|
||||||
if( i==t )
|
if( i==t )
|
||||||
{
|
{
|
||||||
i->SetSolo(!bWasSolo);
|
pt->SetSolo(!bWasSolo);
|
||||||
if( IsSoloSimple() )
|
if( IsSoloSimple() )
|
||||||
i->SetMute(false);
|
pt->SetMute(false);
|
||||||
if(t->GetLinked())
|
if(t->GetLinked())
|
||||||
{
|
{
|
||||||
i = iter.Next();
|
i = iter.Next();
|
||||||
i->SetSolo(!bWasSolo);
|
auto pi = dynamic_cast<PlayableTrack *>( i );
|
||||||
if( IsSoloSimple() )
|
if (pi) {
|
||||||
i->SetMute(false);
|
pi->SetSolo(!bWasSolo);
|
||||||
|
if( IsSoloSimple() )
|
||||||
|
pi->SetMute(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
i->SetSolo(false);
|
auto pi = dynamic_cast<PlayableTrack *>( i );
|
||||||
if( IsSoloSimple() )
|
if (pi) {
|
||||||
i->SetMute(!bWasSolo);
|
pi->SetSolo(false);
|
||||||
|
if( IsSoloSimple() )
|
||||||
|
pi->SetMute(!bWasSolo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
i = iter.Next();
|
i = iter.Next();
|
||||||
}
|
}
|
||||||
|
@ -50,8 +50,6 @@ Track::Track(const std::shared_ptr<DirManager> &projDirManager)
|
|||||||
mList = NULL;
|
mList = NULL;
|
||||||
mSelected = false;
|
mSelected = false;
|
||||||
mLinked = false;
|
mLinked = false;
|
||||||
mMute = false;
|
|
||||||
mSolo = false;
|
|
||||||
|
|
||||||
mY = 0;
|
mY = 0;
|
||||||
mHeight = 150;
|
mHeight = 150;
|
||||||
@ -92,8 +90,6 @@ void Track::Init(const Track &orig)
|
|||||||
|
|
||||||
mSelected = orig.mSelected;
|
mSelected = orig.mSelected;
|
||||||
mLinked = orig.mLinked;
|
mLinked = orig.mLinked;
|
||||||
mMute = orig.mMute;
|
|
||||||
mSolo = orig.mSolo;
|
|
||||||
mHeight = orig.mHeight;
|
mHeight = orig.mHeight;
|
||||||
mMinimized = orig.mMinimized;
|
mMinimized = orig.mMinimized;
|
||||||
mChannel = orig.mChannel;
|
mChannel = orig.mChannel;
|
||||||
@ -112,8 +108,6 @@ void Track::SetSelected(bool s)
|
|||||||
void Track::Merge(const Track &orig)
|
void Track::Merge(const Track &orig)
|
||||||
{
|
{
|
||||||
mSelected = orig.mSelected;
|
mSelected = orig.mSelected;
|
||||||
mMute = orig.mMute;
|
|
||||||
mSolo = orig.mSolo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Track::~Track()
|
Track::~Track()
|
||||||
@ -331,6 +325,22 @@ bool Track::SyncLockAdjust(double oldT1, double newT1)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PlayableTrack::Init( const PlayableTrack &orig )
|
||||||
|
{
|
||||||
|
mMute = orig.mMute;
|
||||||
|
mSolo = orig.mSolo;
|
||||||
|
AudioTrack::Init( orig );
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlayableTrack::Merge( const Track &orig )
|
||||||
|
{
|
||||||
|
auto pOrig = dynamic_cast<const PlayableTrack *>(&orig);
|
||||||
|
wxASSERT( pOrig );
|
||||||
|
mMute = pOrig->mMute;
|
||||||
|
mSolo = pOrig->mSolo;
|
||||||
|
AudioTrack::Merge( *pOrig );
|
||||||
|
}
|
||||||
|
|
||||||
// TrackListIterator
|
// TrackListIterator
|
||||||
TrackListIterator::TrackListIterator(TrackList * val)
|
TrackListIterator::TrackListIterator(TrackList * val)
|
||||||
: l(val)
|
: l(val)
|
||||||
@ -1208,7 +1218,9 @@ unsigned TrackList::GetNumExportChannels(bool selectionOnly) const
|
|||||||
for (tr = iter.First(this); tr != NULL; tr = iter.Next()) {
|
for (tr = iter.First(this); tr != NULL; tr = iter.Next()) {
|
||||||
|
|
||||||
// Want only unmuted wave tracks.
|
// Want only unmuted wave tracks.
|
||||||
if ((tr->GetKind() != Track::Wave) || tr->GetMute())
|
auto wt = static_cast<const WaveTrack *>(tr);
|
||||||
|
if ((tr->GetKind() != Track::Wave) ||
|
||||||
|
wt->GetMute())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// do we only want selected ones?
|
// do we only want selected ones?
|
||||||
@ -1265,8 +1277,9 @@ namespace {
|
|||||||
|
|
||||||
for (; p != end; ++p) {
|
for (; p != end; ++p) {
|
||||||
const auto &track = *p;
|
const auto &track = *p;
|
||||||
|
auto wt = static_cast<const WaveTrack *>(&*track);
|
||||||
if (track->GetKind() == Track::Wave &&
|
if (track->GetKind() == Track::Wave &&
|
||||||
(includeMuted || !track->GetMute()) &&
|
(includeMuted || !wt->GetMute()) &&
|
||||||
(track->GetSelected() || !selectionOnly)) {
|
(track->GetSelected() || !selectionOnly)) {
|
||||||
waveTrackArray.push_back(static_cast<WaveTrack*>(track.get()));
|
waveTrackArray.push_back(static_cast<WaveTrack*>(track.get()));
|
||||||
}
|
}
|
||||||
|
18
src/Track.h
18
src/Track.h
@ -140,8 +140,6 @@ class AUDACITY_DLL_API Track /* not final */ : public XMLTagHandler
|
|||||||
protected:
|
protected:
|
||||||
int mChannel;
|
int mChannel;
|
||||||
double mOffset;
|
double mOffset;
|
||||||
bool mMute;
|
|
||||||
bool mSolo;
|
|
||||||
|
|
||||||
mutable std::shared_ptr<DirManager> mDirManager;
|
mutable std::shared_ptr<DirManager> mDirManager;
|
||||||
|
|
||||||
@ -189,14 +187,10 @@ class AUDACITY_DLL_API Track /* not final */ : public XMLTagHandler
|
|||||||
void SetDefaultName( const wxString &n ) { mDefaultName = n; }
|
void SetDefaultName( const wxString &n ) { mDefaultName = n; }
|
||||||
|
|
||||||
bool GetSelected() const { return mSelected; }
|
bool GetSelected() const { return mSelected; }
|
||||||
bool GetMute () const { return mMute; }
|
|
||||||
bool GetLinked () const { return mLinked; }
|
bool GetLinked () const { return mLinked; }
|
||||||
bool GetSolo () const { return mSolo; }
|
|
||||||
|
|
||||||
virtual void SetSelected(bool s);
|
virtual void SetSelected(bool s);
|
||||||
void SetMute (bool m) { mMute = m; }
|
|
||||||
void SetLinked (bool l);
|
void SetLinked (bool l);
|
||||||
void SetSolo (bool s) { mSolo = s; }
|
|
||||||
|
|
||||||
int GetChannel() const { return mChannel; }
|
int GetChannel() const { return mChannel; }
|
||||||
virtual double GetOffset() const = 0;
|
virtual double GetOffset() const = 0;
|
||||||
@ -265,6 +259,18 @@ public:
|
|||||||
PlayableTrack(const std::shared_ptr<DirManager> &projDirManager)
|
PlayableTrack(const std::shared_ptr<DirManager> &projDirManager)
|
||||||
: AudioTrack{ projDirManager } {}
|
: AudioTrack{ projDirManager } {}
|
||||||
PlayableTrack(const Track &orig) : AudioTrack{ orig } {}
|
PlayableTrack(const Track &orig) : AudioTrack{ orig } {}
|
||||||
|
|
||||||
|
bool GetMute () const { return mMute; }
|
||||||
|
bool GetSolo () const { return mSolo; }
|
||||||
|
void SetMute (bool m) { mMute = m; }
|
||||||
|
void SetSolo (bool s) { mSolo = s; }
|
||||||
|
|
||||||
|
void Init( const PlayableTrack &init );
|
||||||
|
void Merge( const Track &init ) override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool mMute { false };
|
||||||
|
bool mSolo { false };
|
||||||
};
|
};
|
||||||
|
|
||||||
class AUDACITY_DLL_API TrackListIterator /* not final */
|
class AUDACITY_DLL_API TrackListIterator /* not final */
|
||||||
|
@ -336,7 +336,8 @@ void TrackArtist::DrawTracks(TrackList * tracks,
|
|||||||
|
|
||||||
bool hasSolo = false;
|
bool hasSolo = false;
|
||||||
for (t = iter.First(); t; t = iter.Next()) {
|
for (t = iter.First(); t; t = iter.Next()) {
|
||||||
if (t->GetSolo()) {
|
auto pt = dynamic_cast<const PlayableTrack *>(t);
|
||||||
|
if (pt && pt->GetSolo()) {
|
||||||
hasSolo = true;
|
hasSolo = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -457,7 +458,8 @@ void TrackArtist::DrawTrack(const Track * t,
|
|||||||
clip->ClearDisplayRect();
|
clip->ClearDisplayRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool muted = (hasSolo || t->GetMute()) && !t->GetSolo();
|
bool muted = (hasSolo || wt->GetMute()) &&
|
||||||
|
!wt->GetSolo();
|
||||||
|
|
||||||
#if defined(__WXMAC__)
|
#if defined(__WXMAC__)
|
||||||
wxAntialiasMode aamode = dc.GetGraphicsContext()->GetAntialiasMode();
|
wxAntialiasMode aamode = dc.GetGraphicsContext()->GetAntialiasMode();
|
||||||
@ -493,7 +495,11 @@ void TrackArtist::DrawTrack(const Track * t,
|
|||||||
#ifdef USE_MIDI
|
#ifdef USE_MIDI
|
||||||
case Track::Note:
|
case Track::Note:
|
||||||
{
|
{
|
||||||
bool muted = (hasSolo || t->GetMute()) && !t->GetSolo();
|
auto nt = static_cast<const NoteTrack *>(t);
|
||||||
|
bool muted = false;
|
||||||
|
#ifdef EXPERIMENTAL_MIDI_OUT
|
||||||
|
muted = (hasSolo || nt->GetMute()) && !nt->GetSolo();
|
||||||
|
#endif
|
||||||
DrawNoteTrack((NoteTrack *)t, dc, rect, selectedRegion, zoomInfo, muted);
|
DrawNoteTrack((NoteTrack *)t, dc, rect, selectedRegion, zoomInfo, muted);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -9288,18 +9288,19 @@ void TrackInfo::DrawMuteSolo(wxDC * dc, const wxRect & rect, Track * t,
|
|||||||
return; // don't draw mute and solo buttons, because they don't fit into track label
|
return; // don't draw mute and solo buttons, because they don't fit into track label
|
||||||
|
|
||||||
AColor::MediumTrackInfo( dc, t->GetSelected());
|
AColor::MediumTrackInfo( dc, t->GetSelected());
|
||||||
|
auto pt = dynamic_cast<const PlayableTrack *>(t);
|
||||||
if( solo )
|
if( solo )
|
||||||
{
|
{
|
||||||
if( t->GetSolo() )
|
if( pt && pt->GetSolo() )
|
||||||
{
|
{
|
||||||
AColor::Solo(dc, t->GetSolo(), t->GetSelected());
|
AColor::Solo(dc, pt->GetSolo(), t->GetSelected());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( t->GetMute() )
|
if( pt && pt->GetMute() )
|
||||||
{
|
{
|
||||||
AColor::Mute(dc, t->GetMute(), t->GetSelected(), t->GetSolo());
|
AColor::Mute(dc, pt->GetMute(), t->GetSelected(), pt->GetSolo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//(solo) ? AColor::Solo(dc, t->GetSolo(), t->GetSelected()) :
|
//(solo) ? AColor::Solo(dc, t->GetSolo(), t->GetSelected()) :
|
||||||
@ -9318,7 +9319,11 @@ void TrackInfo::DrawMuteSolo(wxDC * dc, const wxRect & rect, Track * t,
|
|||||||
dc->GetTextExtent(str, &textWidth, &textHeight);
|
dc->GetTextExtent(str, &textWidth, &textHeight);
|
||||||
dc->DrawText(str, bev.x + (bev.width - textWidth) / 2, bev.y + (bev.height - textHeight) / 2);
|
dc->DrawText(str, bev.x + (bev.width - textWidth) / 2, bev.y + (bev.height - textHeight) / 2);
|
||||||
|
|
||||||
AColor::BevelTrackInfo(*dc, (solo?t->GetSolo():t->GetMute()) == down, bev);
|
AColor::BevelTrackInfo(
|
||||||
|
*dc,
|
||||||
|
(solo ? pt->GetSolo() : (pt && pt->GetMute())) == down,
|
||||||
|
bev
|
||||||
|
);
|
||||||
|
|
||||||
if (solo && !down) {
|
if (solo && !down) {
|
||||||
// Update the mute button, which may be grayed out depending on
|
// Update the mute button, which may be grayed out depending on
|
||||||
|
@ -363,7 +363,8 @@ wxAccStatus TrackPanelAx::GetName( int childId, wxString* name )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// LLL: Remove these during "refactor"
|
// LLL: Remove these during "refactor"
|
||||||
if( t->GetMute() )
|
auto pt = dynamic_cast<PlayableTrack *>(t);
|
||||||
|
if( pt && pt->GetMute() )
|
||||||
{
|
{
|
||||||
// The following comment also applies to the solo, selected,
|
// The following comment also applies to the solo, selected,
|
||||||
// and synclockselected states.
|
// and synclockselected states.
|
||||||
@ -376,7 +377,7 @@ wxAccStatus TrackPanelAx::GetName( int childId, wxString* name )
|
|||||||
name->Append( wxT(" ") + wxString(_( " Mute On" )) );
|
name->Append( wxT(" ") + wxString(_( " Mute On" )) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( t->GetSolo() )
|
if( pt && pt->GetSolo() )
|
||||||
{
|
{
|
||||||
/* i18n-hint: This is for screen reader software and indicates that
|
/* i18n-hint: This is for screen reader software and indicates that
|
||||||
on this track solo is on.*/
|
on this track solo is on.*/
|
||||||
@ -547,12 +548,13 @@ wxAccStatus TrackPanelAx::GetValue( int WXUNUSED(childId), wxString* WXUNUSED(st
|
|||||||
}
|
}
|
||||||
|
|
||||||
// LLL: Remove these during "refactor"
|
// LLL: Remove these during "refactor"
|
||||||
if( t->GetMute() )
|
auto pt = dynamic_cast<PlayableTrack *>(t);
|
||||||
|
if( pt && pt->GetMute() )
|
||||||
{
|
{
|
||||||
strValue->Append( _( " Mute On" ) );
|
strValue->Append( _( " Mute On" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( t->GetSolo() )
|
if( pt && pt->GetSolo() )
|
||||||
{
|
{
|
||||||
strValue->Append( _( " Solo On" ) );
|
strValue->Append( _( " Solo On" ) );
|
||||||
}
|
}
|
||||||
|
@ -161,10 +161,12 @@ bool GetProjectInfoCommand::testLinked(const Track * track) const
|
|||||||
|
|
||||||
bool GetProjectInfoCommand::testSolo(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
|
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")))
|
else if (mode.IsSameAs(wxT("Solo")))
|
||||||
{
|
{
|
||||||
if (t->GetKind() == Track::Wave)
|
auto pt = dynamic_cast<const PlayableTrack *>(t);
|
||||||
SendBooleanStatus(t->GetSolo());
|
if (pt)
|
||||||
|
SendBooleanStatus(pt->GetSolo());
|
||||||
else
|
else
|
||||||
SendBooleanStatus(false);
|
SendBooleanStatus(false);
|
||||||
}
|
}
|
||||||
else if (mode.IsSameAs(wxT("Mute")))
|
else if (mode.IsSameAs(wxT("Mute")))
|
||||||
{
|
{
|
||||||
if (t->GetKind() == Track::Wave)
|
auto pt = dynamic_cast<const PlayableTrack *>(t);
|
||||||
SendBooleanStatus(t->GetMute());
|
if (pt)
|
||||||
|
SendBooleanStatus(pt->GetMute());
|
||||||
else
|
else
|
||||||
SendBooleanStatus(false);
|
SendBooleanStatus(false);
|
||||||
}
|
}
|
||||||
|
@ -98,12 +98,14 @@ void SetProjectInfoCommand::setSelected(Track * trk, bool param) const
|
|||||||
|
|
||||||
void SetProjectInfoCommand::setSolo(Track * trk, bool param) const
|
void SetProjectInfoCommand::setSolo(Track * trk, bool param) const
|
||||||
{
|
{
|
||||||
if(trk->GetKind() == Track::Wave)
|
auto pt = dynamic_cast<PlayableTrack *>(trk);
|
||||||
trk->SetSolo(param);
|
if (pt)
|
||||||
|
pt->SetSolo(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetProjectInfoCommand::setMute(Track * trk, bool param) const
|
void SetProjectInfoCommand::setMute(Track * trk, bool param) const
|
||||||
{
|
{
|
||||||
if(trk->GetKind() == Track::Wave)
|
auto pt = dynamic_cast<PlayableTrack *>(trk);
|
||||||
trk->SetMute(param);
|
if (pt)
|
||||||
|
pt->SetMute(param);
|
||||||
}
|
}
|
||||||
|
@ -425,7 +425,9 @@ bool Exporter::ExamineTracks()
|
|||||||
|
|
||||||
while (tr) {
|
while (tr) {
|
||||||
if (tr->GetKind() == Track::Wave) {
|
if (tr->GetKind() == Track::Wave) {
|
||||||
if ( (tr->GetSelected() || !mSelectedOnly) && !tr->GetMute() ) { // don't count muted tracks
|
auto wt = static_cast<const WaveTrack *>(tr);
|
||||||
|
if ( (tr->GetSelected() || !mSelectedOnly) &&
|
||||||
|
!wt->GetMute() ) { // don't count muted tracks
|
||||||
mNumSelected++;
|
mNumSelected++;
|
||||||
|
|
||||||
if (tr->GetChannel() == Track::LeftChannel) {
|
if (tr->GetChannel() == Track::LeftChannel) {
|
||||||
@ -1255,7 +1257,9 @@ ExportMixerDialog::ExportMixerDialog( const TrackList *tracks, bool selectedOnly
|
|||||||
|
|
||||||
for( const Track *t = iter.First(); t; t = iter.Next() )
|
for( const Track *t = iter.First(); t; t = iter.Next() )
|
||||||
{
|
{
|
||||||
if( t->GetKind() == Track::Wave && ( t->GetSelected() || !selectedOnly ) && !t->GetMute() )
|
auto wt = static_cast<const WaveTrack *>(t);
|
||||||
|
if( t->GetKind() == Track::Wave && ( t->GetSelected() || !selectedOnly ) &&
|
||||||
|
!wt->GetMute() )
|
||||||
{
|
{
|
||||||
numTracks++;
|
numTracks++;
|
||||||
const wxString sTrackName = (t->GetName()).Left(20);
|
const wxString sTrackName = (t->GetName()).Left(20);
|
||||||
|
@ -154,7 +154,8 @@ void ExportMultiple::CountTracksAndLabels()
|
|||||||
// Count WaveTracks, and for linked pairs, count only the second of the pair.
|
// Count WaveTracks, and for linked pairs, count only the second of the pair.
|
||||||
case Track::Wave:
|
case Track::Wave:
|
||||||
{
|
{
|
||||||
if (!pTrack->GetMute() && !pTrack->GetLinked()) // Don't count muted tracks.
|
auto wt = static_cast<const WaveTrack *>(pTrack);
|
||||||
|
if (!wt->GetMute() && !pTrack->GetLinked()) // Don't count muted tracks.
|
||||||
mNumWaveTracks++;
|
mNumWaveTracks++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -811,7 +812,9 @@ ProgressResult ExportMultiple::ExportMultipleByTrack(bool byName,
|
|||||||
for (tr = iter.First(mTracks); tr != NULL; tr = iter.Next()) {
|
for (tr = iter.First(mTracks); tr != NULL; tr = iter.Next()) {
|
||||||
|
|
||||||
// Want only non-muted wave tracks.
|
// Want only non-muted wave tracks.
|
||||||
if ((tr->GetKind() != Track::Wave) || tr->GetMute())
|
auto wt = static_cast<const WaveTrack *>(tr);
|
||||||
|
if ((tr->GetKind() != Track::Wave) ||
|
||||||
|
wt->GetMute())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Get the times for the track
|
// Get the times for the track
|
||||||
@ -898,7 +901,8 @@ ProgressResult ExportMultiple::ExportMultipleByTrack(bool byName,
|
|||||||
for (tr = iter.First(mTracks); tr != NULL; tr = iter.Next()) {
|
for (tr = iter.First(mTracks); tr != NULL; tr = iter.Next()) {
|
||||||
|
|
||||||
// Want only non-muted wave tracks.
|
// Want only non-muted wave tracks.
|
||||||
if ((tr->GetKind() != Track::Wave) || (tr->GetMute() == true)) {
|
auto wt = static_cast<const WaveTrack *>(tr);
|
||||||
|
if ((tr->GetKind() != Track::Wave) || (wt->GetMute())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user