summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-10-24 23:58:26 +0100
committerCarl Hetherington <cth@carlh.net>2012-10-24 23:58:26 +0100
commit110d7d4e111c2db31489296587d855328c5d8b34 (patch)
treeafe1f5f8912cb292f51d5f07b5947c291fbb7da4 /src/wx
parent165edfe3bb8afd0531729f732701756d711dde16 (diff)
Fix shared_ptr for Film.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/dci_name_dialog.cc4
-rw-r--r--src/wx/dci_name_dialog.h5
-rw-r--r--src/wx/dcp_range_dialog.cc4
-rw-r--r--src/wx/dcp_range_dialog.h4
-rw-r--r--src/wx/film_editor.cc24
-rw-r--r--src/wx/film_editor.h8
-rw-r--r--src/wx/film_viewer.cc11
-rw-r--r--src/wx/film_viewer.h6
-rw-r--r--src/wx/job_wrapper.cc4
-rw-r--r--src/wx/job_wrapper.h2
-rw-r--r--src/wx/properties_dialog.cc12
-rw-r--r--src/wx/properties_dialog.h4
12 files changed, 57 insertions, 31 deletions
diff --git a/src/wx/dci_name_dialog.cc b/src/wx/dci_name_dialog.cc
index ee8864ff9..bb6c25807 100644
--- a/src/wx/dci_name_dialog.cc
+++ b/src/wx/dci_name_dialog.cc
@@ -22,7 +22,9 @@
#include "wx_util.h"
#include "film.h"
-DCINameDialog::DCINameDialog (wxWindow* parent, Film* film)
+using boost::shared_ptr;
+
+DCINameDialog::DCINameDialog (wxWindow* parent, shared_ptr<Film> film)
: wxDialog (parent, wxID_ANY, _("DCI name"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
, _film (film)
{
diff --git a/src/wx/dci_name_dialog.h b/src/wx/dci_name_dialog.h
index d06420a6e..1fd5436b8 100644
--- a/src/wx/dci_name_dialog.h
+++ b/src/wx/dci_name_dialog.h
@@ -19,13 +19,14 @@
#include <wx/dialog.h>
#include <wx/textctrl.h>
+#include <boost/shared_ptr.hpp>
class Film;
class DCINameDialog : public wxDialog
{
public:
- DCINameDialog (wxWindow *, Film *);
+ DCINameDialog (wxWindow *, boost::shared_ptr<Film>);
private:
void audio_language_changed (wxCommandEvent &);
@@ -44,5 +45,5 @@ private:
wxTextCtrl* _facility;
wxTextCtrl* _package_type;
- Film* _film;
+ boost::shared_ptr<Film> _film;
};
diff --git a/src/wx/dcp_range_dialog.cc b/src/wx/dcp_range_dialog.cc
index 6363275ca..509db121e 100644
--- a/src/wx/dcp_range_dialog.cc
+++ b/src/wx/dcp_range_dialog.cc
@@ -21,7 +21,9 @@
#include "dcp_range_dialog.h"
#include "wx_util.h"
-DCPRangeDialog::DCPRangeDialog (wxWindow* p, Film* f)
+using boost::shared_ptr;
+
+DCPRangeDialog::DCPRangeDialog (wxWindow* p, shared_ptr<Film> f)
: wxDialog (p, wxID_ANY, wxString (_("DCP Range")))
, _film (f)
{
diff --git a/src/wx/dcp_range_dialog.h b/src/wx/dcp_range_dialog.h
index ea15154ba..2c5c3cec2 100644
--- a/src/wx/dcp_range_dialog.h
+++ b/src/wx/dcp_range_dialog.h
@@ -27,7 +27,7 @@ class Film;
class DCPRangeDialog : public wxDialog
{
public:
- DCPRangeDialog (wxWindow *, Film *);
+ DCPRangeDialog (wxWindow *, boost::shared_ptr<Film>);
boost::signals2::signal<void (int, TrimAction)> Changed;
@@ -40,7 +40,7 @@ private:
void set_sensitivity ();
void emit_changed ();
- Film* _film;
+ boost::shared_ptr<Film> _film;
wxRadioButton* _whole;
wxRadioButton* _first;
wxSpinCtrl* _n_frames;
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc
index b90731cf3..34223ce05 100644
--- a/src/wx/film_editor.cc
+++ b/src/wx/film_editor.cc
@@ -45,11 +45,17 @@
#include "dci_name_dialog.h"
#include "scaler.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::stringstream;
+using std::pair;
+using std::fixed;
+using std::setprecision;
+using std::list;
+using std::vector;
+using boost::shared_ptr;
/** @param f Film to edit */
-FilmEditor::FilmEditor (Film* f, wxWindow* parent)
+FilmEditor::FilmEditor (shared_ptr<Film> f, wxWindow* parent)
: wxPanel (parent)
, _ignore_changes (Film::NONE)
, _film (f)
@@ -231,6 +237,10 @@ FilmEditor::FilmEditor (Film* f, wxWindow* parent)
_scaler->Append (std_to_wx ((*i)->name()));
}
+ JobManager::instance()->ActiveJobsChanged.connect (
+ bind (&FilmEditor::active_jobs_changed, this, _1)
+ );
+
/* And set their values from the Film */
set_film (f);
@@ -587,7 +597,7 @@ FilmEditor::dcp_content_type_changed (wxCommandEvent &)
/** Sets the Film that we are editing */
void
-FilmEditor::set_film (Film* f)
+FilmEditor::set_film (shared_ptr<Film> f)
{
_film = f;
@@ -930,3 +940,9 @@ FilmEditor::setup_audio_details ()
_audio->SetLabel (std_to_wx (s.str ()));
}
}
+
+void
+FilmEditor::active_jobs_changed (bool a)
+{
+ set_things_sensitive (!a);
+}
diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h
index f6e180979..2d3659615 100644
--- a/src/wx/film_editor.h
+++ b/src/wx/film_editor.h
@@ -37,9 +37,9 @@ class Film;
class FilmEditor : public wxPanel
{
public:
- FilmEditor (Film *, wxWindow *);
+ FilmEditor (boost::shared_ptr<Film>, wxWindow *);
- void set_film (Film *);
+ void set_film (boost::shared_ptr<Film>);
void setup_visibility ();
boost::signals2::signal<void (std::string)> FileChanged;
@@ -85,10 +85,12 @@ private:
wxControl* video_control (wxControl *);
wxControl* still_control (wxControl *);
+ void active_jobs_changed (bool);
+
Film::Property _ignore_changes;
/** The film we are editing */
- Film* _film;
+ boost::shared_ptr<Film> _film;
/** The Film's name */
wxTextCtrl* _name;
wxStaticText* _dcp_name;
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 2496679aa..79de49406 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -40,7 +40,7 @@ using boost::shared_ptr;
class ThumbPanel : public wxPanel
{
public:
- ThumbPanel (wxPanel* parent, Film* film)
+ ThumbPanel (wxPanel* parent, shared_ptr<Film> film)
: wxPanel (parent)
, _film (film)
, _frame_rebuild_needed (false)
@@ -100,7 +100,7 @@ public:
Refresh ();
}
- void set_film (Film* f)
+ void set_film (shared_ptr<Film> f)
{
_film = f;
if (!_film) {
@@ -189,7 +189,7 @@ private:
}
}
- Film* _film;
+ shared_ptr<Film> _film;
shared_ptr<wxImage> _image;
wxImage _transformed_image;
/** currently-displayed thumbnail index */
@@ -224,9 +224,8 @@ EVT_PAINT (ThumbPanel::paint_event)
EVT_SIZE (ThumbPanel::size_event)
END_EVENT_TABLE ()
-FilmViewer::FilmViewer (Film* f, wxWindow* p)
+FilmViewer::FilmViewer (shared_ptr<Film> f, wxWindow* p)
: wxPanel (p)
- , _film (0)
{
_sizer = new wxBoxSizer (wxVERTICAL);
SetSizer (_sizer);
@@ -293,7 +292,7 @@ FilmViewer::film_changed (Film::Property p)
}
void
-FilmViewer::set_film (Film* f)
+FilmViewer::set_film (shared_ptr<Film> f)
{
if (_film == f) {
return;
diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h
index ecd6bc308..95bdf099d 100644
--- a/src/wx/film_viewer.h
+++ b/src/wx/film_viewer.h
@@ -32,9 +32,9 @@ class ThumbPanel;
class FilmViewer : public wxPanel
{
public:
- FilmViewer (Film *, wxWindow *);
+ FilmViewer (boost::shared_ptr<Film>, wxWindow *);
- void set_film (Film *);
+ void set_film (boost::shared_ptr<Film>);
void setup_visibility ();
private:
@@ -42,7 +42,7 @@ private:
void set_thumbnail (int);
void film_changed (Film::Property);
- Film* _film;
+ boost::shared_ptr<Film> _film;
wxBoxSizer* _sizer;
ThumbPanel* _thumb_panel;
wxSlider* _slider;
diff --git a/src/wx/job_wrapper.cc b/src/wx/job_wrapper.cc
index cc7507547..f2056cf49 100644
--- a/src/wx/job_wrapper.cc
+++ b/src/wx/job_wrapper.cc
@@ -23,10 +23,10 @@
#include "job_wrapper.h"
#include "wx_util.h"
-using namespace std;
+using boost::shared_ptr;
void
-JobWrapper::make_dcp (wxWindow* parent, Film* film, bool transcode)
+JobWrapper::make_dcp (wxWindow* parent, shared_ptr<Film> film, bool transcode)
{
if (!film) {
return;
diff --git a/src/wx/job_wrapper.h b/src/wx/job_wrapper.h
index 4722cfdd4..7120e9f10 100644
--- a/src/wx/job_wrapper.h
+++ b/src/wx/job_wrapper.h
@@ -24,6 +24,6 @@ class Film;
namespace JobWrapper
{
-void make_dcp (wxWindow *, Film *, bool);
+void make_dcp (wxWindow *, boost::shared_ptr<Film>, bool);
}
diff --git a/src/wx/properties_dialog.cc b/src/wx/properties_dialog.cc
index b8a47e0e3..0ffbd06cb 100644
--- a/src/wx/properties_dialog.cc
+++ b/src/wx/properties_dialog.cc
@@ -25,10 +25,14 @@
#include "properties_dialog.h"
#include "wx_util.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::stringstream;
+using std::fixed;
+using std::setprecision;
+using boost::shared_ptr;
+using boost::lexical_cast;
-PropertiesDialog::PropertiesDialog (wxWindow* parent, Film* film)
+PropertiesDialog::PropertiesDialog (wxWindow* parent, shared_ptr<Film> film)
: wxDialog (parent, wxID_ANY, _("Film Properties"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE)
, _film (film)
{
@@ -83,7 +87,7 @@ PropertiesDialog::frames_already_encoded () const
stringstream u;
try {
u << _film->encoded_frames ();
- } catch (thread_interrupted &) {
+ } catch (boost::thread_interrupted &) {
return "";
}
diff --git a/src/wx/properties_dialog.h b/src/wx/properties_dialog.h
index f72c83419..308c0f7b3 100644
--- a/src/wx/properties_dialog.h
+++ b/src/wx/properties_dialog.h
@@ -25,12 +25,12 @@ class ThreadedStaticText;
class PropertiesDialog : public wxDialog
{
public:
- PropertiesDialog (wxWindow *, Film *);
+ PropertiesDialog (wxWindow *, boost::shared_ptr<Film>);
private:
std::string frames_already_encoded () const;
- Film* _film;
+ boost::shared_ptr<Film> _film;
wxStaticText* _frames;
wxStaticText* _disk_for_frames;
wxStaticText* _total_disk;