summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-11-23 01:15:37 +0000
committerCarl Hetherington <cth@carlh.net>2018-11-23 01:15:37 +0000
commit673ba43fb66eb0dee43807501753749f144254a7 (patch)
tree1c337ccebdc2dc6f25d76d761252976814f34d57 /src/wx
parente13e5cd4cfda39b0a0b77ed8036e14e15f93ec2e (diff)
Remove required Film from content examine.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/content_view.cc26
-rw-r--r--src/wx/content_view.h3
-rw-r--r--src/wx/swaroop_controls.cc5
3 files changed, 5 insertions, 29 deletions
diff --git a/src/wx/content_view.cc b/src/wx/content_view.cc
index fdc7afcab..035118245 100644
--- a/src/wx/content_view.cc
+++ b/src/wx/content_view.cc
@@ -40,9 +40,8 @@ using boost::weak_ptr;
using boost::optional;
using boost::dynamic_pointer_cast;
-ContentView::ContentView (wxWindow* parent, weak_ptr<Film> film)
+ContentView::ContentView (wxWindow* parent)
: wxListCtrl (parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_NO_HEADER)
- , _film (film)
{
AppendColumn (wxT(""), wxLIST_FORMAT_LEFT, 80);
/* type */
@@ -66,11 +65,6 @@ ContentView::selected () const
void
ContentView::update ()
{
- shared_ptr<Film> film = _film.lock ();
- if (!film) {
- return;
- }
-
using namespace boost::filesystem;
DeleteAllItems ();
@@ -95,7 +89,7 @@ ContentView::update ()
}
if (content) {
- shared_ptr<ExamineContentJob> job(new ExamineContentJob(film, content));
+ shared_ptr<ExamineContentJob> job(new ExamineContentJob(shared_ptr<Film>(), content));
jm->add (job);
jobs.push_back (job);
}
@@ -133,13 +127,10 @@ ContentView::add (shared_ptr<Content> content)
{
int const N = GetItemCount();
- shared_ptr<Film> film = _film.lock ();
- DCPOMATIC_ASSERT (film);
-
wxListItem it;
it.SetId(N);
it.SetColumn(0);
- DCPTime length = content->length_after_trim (film);
+ DCPTime length = content->approximate_length ();
int h, m, s, f;
length.split (24, h, m, s, f);
it.SetText(wxString::Format("%02d:%02d:%02d", h, m, s));
@@ -170,14 +161,3 @@ ContentView::get (string digest) const
return shared_ptr<Content>();
}
-
-void
-ContentView::set_film (weak_ptr<Film> film)
-{
- if (_film.lock() == film.lock()) {
- return;
- }
-
- _film = film;
- update ();
-}
diff --git a/src/wx/content_view.h b/src/wx/content_view.h
index d27638c05..334e9bb68 100644
--- a/src/wx/content_view.h
+++ b/src/wx/content_view.h
@@ -30,13 +30,12 @@ class Film;
class ContentView : public wxListCtrl, public ContentStore
{
public:
- ContentView (wxWindow* parent, boost::weak_ptr<Film> film);
+ ContentView (wxWindow* parent);
boost::shared_ptr<Content> selected () const;
void update ();
boost::shared_ptr<Content> get (std::string digest) const;
- void set_film (boost::weak_ptr<Film> film);
private:
void add (boost::shared_ptr<Content> content);
diff --git a/src/wx/swaroop_controls.cc b/src/wx/swaroop_controls.cc
index 538d34942..dc65f1b85 100644
--- a/src/wx/swaroop_controls.cc
+++ b/src/wx/swaroop_controls.cc
@@ -51,7 +51,7 @@ SwaroopControls::SwaroopControls (wxWindow* parent, shared_ptr<FilmViewer> viewe
left_sizer->Add (_spl_view, 1, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP);
- _content_view = new ContentView (this, _film);
+ _content_view = new ContentView (this);
left_sizer->Add (_content_view, 1, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP);
_current_spl_view = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_NO_HEADER);
@@ -240,9 +240,6 @@ void
SwaroopControls::set_film (shared_ptr<Film> film)
{
Controls::set_film (film);
-
- _content_view->set_film (film);
update_playlist_directory ();
-
setup_sensitivity ();
}