summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-24 22:26:10 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-24 22:26:10 +0100
commite875c2935a4031fd5d50864b20a432c343f48248 (patch)
treed5cc1b072a1959cb61270591b6ca75f3a2c6d359 /src
parent4b4faedc4d6b41f1daf913a4540c977b3dbf6a4c (diff)
Fix track assignment.
Diffstat (limited to 'src')
-rw-r--r--src/wx/timeline.cc25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc
index 90fcf8d5c..8b0e4762a 100644
--- a/src/wx/timeline.cc
+++ b/src/wx/timeline.cc
@@ -74,10 +74,10 @@ private:
class ContentView : public View
{
public:
- ContentView (Timeline& tl, shared_ptr<Content> c, int t)
+ ContentView (Timeline& tl, shared_ptr<Content> c)
: View (tl)
, _content (c)
- , _track (t)
+ , _track (0)
, _selected (false)
{
_content_connection = c->Changed.connect (bind (&ContentView::content_changed, this, _2, _3));
@@ -197,8 +197,8 @@ private:
class AudioContentView : public ContentView
{
public:
- AudioContentView (Timeline& tl, shared_ptr<Content> c, int t)
- : ContentView (tl, c, t)
+ AudioContentView (Timeline& tl, shared_ptr<Content> c)
+ : ContentView (tl, c)
{}
private:
@@ -216,8 +216,8 @@ private:
class VideoContentView : public ContentView
{
public:
- VideoContentView (Timeline& tl, shared_ptr<Content> c, int t)
- : ContentView (tl, c, t)
+ VideoContentView (Timeline& tl, shared_ptr<Content> c)
+ : ContentView (tl, c)
{}
private:
@@ -385,10 +385,10 @@ Timeline::playlist_changed ()
for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
if (dynamic_pointer_cast<VideoContent> (*i)) {
- _views.push_back (shared_ptr<View> (new VideoContentView (*this, *i, 0)));
+ _views.push_back (shared_ptr<View> (new VideoContentView (*this, *i)));
}
if (dynamic_pointer_cast<AudioContent> (*i)) {
- _views.push_back (shared_ptr<View> (new AudioContentView (*this, *i, 0)));
+ _views.push_back (shared_ptr<View> (new AudioContentView (*this, *i)));
}
}
@@ -415,7 +415,7 @@ Timeline::assign_tracks ()
}
shared_ptr<Content> acv_content = acv->content();
-
+
int t = 1;
while (1) {
ViewList::iterator j = _views.begin();
@@ -429,8 +429,11 @@ Timeline::assign_tracks ()
shared_ptr<Content> test_content = test->content();
if (test && test->track() == t) {
- if ((acv_content->start() < test_content->start() && test_content->start() < acv_content->end()) ||
- (acv_content->start() < test_content->end() && test_content->end() < acv_content->end())) {
+ bool const no_overlap =
+ (acv_content->start() < test_content->start() && acv_content->end() < test_content->start()) ||
+ (acv_content->start() > test_content->end() && acv_content->end() > test_content->end());
+
+ if (!no_overlap) {
/* we have an overlap on track `t' */
++t;
break;