From c77dabbe4e6bb031edf4aa82f5e890fe605bafe1 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 26 May 2013 00:21:53 +0100 Subject: [PATCH] Add unfinished timing tab; fix crash on reconstruction of timeline; fix lack of black / silence at end of films. --- src/lib/content.cc | 2 - src/lib/player.cc | 61 ++++++++++++++++---------- src/lib/player.h | 4 +- src/lib/sndfile_content.cc | 1 + src/wx/film_editor.cc | 54 +++++++++++++++++------ src/wx/film_editor.h | 8 ++-- src/wx/timecode.cc | 90 ++++++++++++++++++++++++++++++++++++++ src/wx/timecode.h | 36 +++++++++++++++ src/wx/timeline.cc | 20 ++++----- src/wx/timeline.h | 5 ++- src/wx/wscript | 1 + 11 files changed, 226 insertions(+), 56 deletions(-) create mode 100644 src/wx/timecode.cc create mode 100644 src/wx/timecode.h diff --git a/src/lib/content.cc b/src/lib/content.cc index ad61f4d6c..aaf2e4f9c 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -1,5 +1,3 @@ -/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */ - /* Copyright (C) 2013 Carl Hetherington diff --git a/src/lib/player.cc b/src/lib/player.cc index ff13f95db..786180a6a 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -1,5 +1,3 @@ -/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */ - /* Copyright (C) 2013 Carl Hetherington @@ -103,18 +101,18 @@ Player::pass () shared_ptr earliest; for (list >::iterator i = _pieces.begin(); i != _pieces.end(); ++i) { - cout << "check " << (*i)->content->file() << " start=" << (*i)->content->start() << ", next=" << (*i)->decoder->next() << ", end=" << (*i)->content->end() << "\n"; +// cout << "check " << (*i)->content->file() << " start=" << (*i)->content->start() << ", next=" << (*i)->decoder->next() << ", end=" << (*i)->content->end() << "\n"; if (((*i)->decoder->next() + (*i)->content->start()) >= (*i)->content->end()) { continue; } - if (!_audio && dynamic_pointer_cast ((*i)->content)) { + if (!_audio && dynamic_pointer_cast ((*i)->decoder) && !dynamic_pointer_cast ((*i)->decoder)) { continue; } Time const t = (*i)->content->start() + (*i)->decoder->next(); if (t < earliest_t) { - cout << "\t candidate; " << t << " " << (t / TIME_HZ) << ".\n"; +// cout << "\t candidate; " << t << " " << (t / TIME_HZ) << ".\n"; earliest_t = t; earliest = *i; } @@ -148,8 +146,6 @@ Player::pass () void Player::process_video (weak_ptr weak_content, shared_ptr image, bool same, shared_ptr sub, Time time) { - cout << "[V]\n"; - shared_ptr content = weak_content.lock (); if (!content) { return; @@ -208,13 +204,13 @@ Player::seek (Time t) return; } - cout << "seek to " << t << " " << (t / TIME_HZ) << "\n"; +// cout << "seek to " << t << " " << (t / TIME_HZ) << "\n"; for (list >::iterator i = _pieces.begin(); i != _pieces.end(); ++i) { Time s = t - (*i)->content->start (); s = max (static_cast