diff --git a/timeline/clip.cpp b/timeline/clip.cpp index e1d212058..cac020813 100644 --- a/timeline/clip.cpp +++ b/timeline/clip.cpp @@ -86,7 +86,8 @@ bool Clip::IsActiveAt(long timecode) return enabled() && timeline_in(true) < timecode && timeline_out(true) > timecode - && timecode - timeline_in(true) + clip_in(true) < media_length(); + && timecode - timeline_in(true) + clip_in(true) < media_length() + && !track()->IsEffectivelyMuted(); } bool Clip::IsSelected(bool containing) diff --git a/timeline/track.cpp b/timeline/track.cpp index 079f3f236..7778d10b7 100644 --- a/timeline/track.cpp +++ b/timeline/track.cpp @@ -345,6 +345,27 @@ long Track::GetEndFrame() return end_frame; } +bool Track::IsEffectivelyMuted() +{ + // Check if this track is muted + if (muted_) { + return true; + } + + // Check if any tracks are soloed + bool a_track_is_soloed = false; + + for (int i=0;iTrackCount();i++) { + if (track_list()->TrackAt(i)->IsSoloed()) { + a_track_is_soloed = true; + break; + } + } + + // Return if a track is soloed and this track is not soloed + return (a_track_is_soloed && !soloed_); +} + bool Track::IsMuted() { return muted_; diff --git a/timeline/track.h b/timeline/track.h index 3614064a0..52f98a7a5 100644 --- a/timeline/track.h +++ b/timeline/track.h @@ -86,6 +86,7 @@ public: long GetEndFrame(); + bool IsEffectivelyMuted(); bool IsMuted(); bool IsSoloed(); bool IsLocked();