summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-08-19 13:55:46 +0100
committerCarl Hetherington <cth@carlh.net>2018-08-19 13:55:46 +0100
commit4408e6eea87ce9630e71e4a7d40e2dade091b0ee (patch)
tree634dd286de7ee2b18cbdc6bcb8837b52b2f8655f /src/wx
parent67c604d3fa2391b98ea436e2c6412f1c83a98f77 (diff)
Similar pending/done for Film::Change.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/film_editor.cc8
-rw-r--r--src/wx/film_editor.h2
-rw-r--r--src/wx/film_viewer.cc8
-rw-r--r--src/wx/film_viewer.h2
-rw-r--r--src/wx/hints_dialog.cc16
-rw-r--r--src/wx/hints_dialog.h6
-rw-r--r--src/wx/timeline.cc10
-rw-r--r--src/wx/timeline.h2
-rw-r--r--src/wx/timeline_dialog.cc10
-rw-r--r--src/wx/timeline_dialog.h2
10 files changed, 42 insertions, 24 deletions
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc
index 1c1c02f5b..cbdbe0f36 100644
--- a/src/wx/film_editor.cc
+++ b/src/wx/film_editor.cc
@@ -68,8 +68,12 @@ FilmEditor::FilmEditor (wxWindow* parent, FilmViewer* viewer)
* @param p Property of the Film that has changed.
*/
void
-FilmEditor::film_changed (Film::Property p)
+FilmEditor::film_change (ChangeType type, Film::Property p)
{
+ if (type != CHANGE_TYPE_DONE) {
+ return;
+ }
+
ensure_ui_thread ();
if (!_film) {
@@ -121,7 +125,7 @@ FilmEditor::set_film (shared_ptr<Film> film)
_dcp_panel->set_film (_film);
if (_film) {
- _film->Changed.connect (bind (&FilmEditor::film_changed, this, _1));
+ _film->Change.connect (bind (&FilmEditor::film_change, this, _1, _2));
_film->ContentChange.connect (bind (&FilmEditor::film_content_change, this, _1, _3));
}
diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h
index cd2180b3c..cbc8f92be 100644
--- a/src/wx/film_editor.h
+++ b/src/wx/film_editor.h
@@ -56,7 +56,7 @@ public:
}
/* Handle changes to the model */
- void film_changed (Film::Property);
+ void film_change (ChangeType, Film::Property);
void film_content_change (ChangeType type, int);
void set_general_sensitivity (bool);
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 463854992..a5e1577fe 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -224,7 +224,7 @@ FilmViewer::set_film (shared_ptr<Film> film)
_player->set_always_burn_open_subtitles ();
_player->set_play_referenced ();
- _film->Changed.connect (boost::bind (&FilmViewer::film_changed, this, _1));
+ _film->Change.connect (boost::bind (&FilmViewer::film_change, this, _1, _2));
_player->Change.connect (boost::bind (&FilmViewer::player_change, this, _1, _2, _3));
/* Keep about 1 second's worth of history samples */
@@ -720,8 +720,12 @@ FilmViewer::setup_sensitivity ()
}
void
-FilmViewer::film_changed (Film::Property p)
+FilmViewer::film_change (ChangeType type, Film::Property p)
{
+ if (type != CHANGE_TYPE_DONE) {
+ return;
+ }
+
if (p == Film::CONTENT || p == Film::THREE_D) {
setup_sensitivity ();
} else if (p == Film::AUDIO_CHANNELS) {
diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h
index d6d9a99a8..0e7da10b1 100644
--- a/src/wx/film_viewer.h
+++ b/src/wx/film_viewer.h
@@ -105,7 +105,7 @@ private:
void seek (DCPTime t, bool accurate);
void refresh_panel ();
void setup_sensitivity ();
- void film_changed (Film::Property);
+ void film_change (ChangeType, Film::Property);
DCPTime nudge_amount (wxKeyboardState &);
void timecode_clicked ();
void frame_number_clicked ();
diff --git a/src/wx/hints_dialog.cc b/src/wx/hints_dialog.cc
index 3872ea8ae..cbd48ec36 100644
--- a/src/wx/hints_dialog.cc
+++ b/src/wx/hints_dialog.cc
@@ -75,8 +75,8 @@ HintsDialog::HintsDialog (wxWindow* parent, boost::weak_ptr<Film> film, bool ok)
boost::shared_ptr<Film> locked_film = _film.lock ();
if (locked_film) {
- _film_changed_connection = locked_film->Changed.connect (boost::bind (&HintsDialog::film_changed, this));
- _film_content_changed_connection = locked_film->ContentChange.connect (boost::bind (&HintsDialog::film_content_change, this, _1));
+ _film_change_connection = locked_film->Change.connect (boost::bind (&HintsDialog::film_change, this, _1));
+ _film_content_change_connection = locked_film->ContentChange.connect (boost::bind (&HintsDialog::film_content_change, this, _1));
}
_hints->Hint.connect (bind (&HintsDialog::hint, this, _1));
@@ -84,12 +84,16 @@ HintsDialog::HintsDialog (wxWindow* parent, boost::weak_ptr<Film> film, bool ok)
_hints->Pulse.connect (bind (&HintsDialog::pulse, this));
_hints->Finished.connect (bind (&HintsDialog::finished, this));
- film_changed ();
+ film_change (CHANGE_TYPE_DONE);
}
void
-HintsDialog::film_changed ()
+HintsDialog::film_change (ChangeType type)
{
+ if (type != CHANGE_TYPE_DONE) {
+ return;
+ }
+
_text->Clear ();
_current.clear ();
@@ -109,9 +113,7 @@ HintsDialog::film_changed ()
void
HintsDialog::film_content_change (ChangeType type)
{
- if (type == CHANGE_TYPE_DONE) {
- film_changed ();
- }
+ film_change (type);
}
void
diff --git a/src/wx/hints_dialog.h b/src/wx/hints_dialog.h
index 83510643a..2755c70fd 100644
--- a/src/wx/hints_dialog.h
+++ b/src/wx/hints_dialog.h
@@ -33,7 +33,7 @@ public:
HintsDialog (wxWindow* parent, boost::weak_ptr<Film>, bool ok);
private:
- void film_changed ();
+ void film_change (ChangeType);
void film_content_change (ChangeType type);
void shut_up (wxCommandEvent& ev);
void update ();
@@ -49,6 +49,6 @@ private:
boost::shared_ptr<Hints> _hints;
std::list<std::string> _current;
- boost::signals2::scoped_connection _film_changed_connection;
- boost::signals2::scoped_connection _film_content_changed_connection;
+ boost::signals2::scoped_connection _film_change_connection;
+ boost::signals2::scoped_connection _film_content_change_connection;
};
diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc
index 7353baf82..0231bc400 100644
--- a/src/wx/timeline.cc
+++ b/src/wx/timeline.cc
@@ -105,11 +105,11 @@ Timeline::Timeline (wxWindow* parent, ContentPanel* cp, shared_ptr<Film> film)
_main_canvas->Bind (wxEVT_SCROLLWIN_PAGEDOWN, boost::bind (&Timeline::scrolled, this, _1));
_main_canvas->Bind (wxEVT_SCROLLWIN_THUMBTRACK, boost::bind (&Timeline::scrolled, this, _1));
- film_changed (Film::CONTENT);
+ film_change (CHANGE_TYPE_DONE, Film::CONTENT);
SetMinSize (wxSize (640, 4 * pixels_per_track() + 96));
- _film_changed_connection = film->Changed.connect (bind (&Timeline::film_changed, this, _1));
+ _film_changed_connection = film->Change.connect (bind (&Timeline::film_change, this, _1, _2));
_film_content_change_connection = film->ContentChange.connect (bind (&Timeline::film_content_change, this, _1, _3, _4));
setup_scrollbars ();
@@ -197,8 +197,12 @@ Timeline::paint_main ()
}
void
-Timeline::film_changed (Film::Property p)
+Timeline::film_change (ChangeType type, Film::Property p)
{
+ if (type != CHANGE_TYPE_DONE) {
+ return;
+ }
+
if (p == Film::CONTENT || p == Film::REEL_TYPE || p == Film::REEL_LENGTH) {
ensure_ui_thread ();
recreate_views ();
diff --git a/src/wx/timeline.h b/src/wx/timeline.h
index 9f3a4a47b..89fd94179 100644
--- a/src/wx/timeline.h
+++ b/src/wx/timeline.h
@@ -91,7 +91,7 @@ private:
void mouse_moved (wxMouseEvent &);
void mouse_moved_select (wxMouseEvent &);
void mouse_moved_zoom (wxMouseEvent &);
- void film_changed (Film::Property);
+ void film_change (ChangeType type, Film::Property);
void film_content_change (ChangeType type, int, bool frequent);
void resized ();
void assign_tracks ();
diff --git a/src/wx/timeline_dialog.cc b/src/wx/timeline_dialog.cc
index d2194f5c7..050f90053 100644
--- a/src/wx/timeline_dialog.cc
+++ b/src/wx/timeline_dialog.cc
@@ -87,9 +87,9 @@ TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr<Film> film)
sizer->SetSizeHints (this);
_toolbar->ToggleTool ((int) Timeline::SNAP, _timeline.snap ());
- film_changed (Film::SEQUENCE);
+ film_change (CHANGE_TYPE_DONE, Film::SEQUENCE);
- _film_changed_connection = film->Changed.connect (bind (&TimelineDialog::film_changed, this, _1));
+ _film_changed_connection = film->Change.connect (bind (&TimelineDialog::film_change, this, _1, _2));
}
wxString
@@ -100,8 +100,12 @@ TimelineDialog::bitmap_path (string name)
}
void
-TimelineDialog::film_changed (Film::Property p)
+TimelineDialog::film_change (ChangeType type, Film::Property p)
{
+ if (type != CHANGE_TYPE_DONE) {
+ return;
+ }
+
shared_ptr<Film> film = _film.lock ();
if (!film) {
return;
diff --git a/src/wx/timeline_dialog.h b/src/wx/timeline_dialog.h
index b7aaba14d..1aff36c8c 100644
--- a/src/wx/timeline_dialog.h
+++ b/src/wx/timeline_dialog.h
@@ -33,7 +33,7 @@ public:
void set_selection (ContentList selection);
private:
- void film_changed (Film::Property);
+ void film_change (ChangeType type, Film::Property);
void tool_clicked (wxCommandEvent& id);
wxString bitmap_path (std::string name);