summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-22 16:23:23 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-22 16:23:23 +0100
commit8349f0c97d98c0b7550ff4c76ad25f8f06270d6a (patch)
treebf441e13142b2810ac4e46cf94d4204ec4e037d5 /src/wx
parent75712cfaf2a8ec8904d7d9552c542a2245bbbc17 (diff)
Basics of front-end 3D (as far as viewer, at least).
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/audio_mapping_view.cc4
-rw-r--r--src/wx/film_editor.cc20
-rw-r--r--src/wx/film_editor.h2
-rw-r--r--src/wx/film_viewer.cc10
-rw-r--r--src/wx/film_viewer.h2
-rw-r--r--src/wx/video_panel.cc5
6 files changed, 33 insertions, 10 deletions
diff --git a/src/wx/audio_mapping_view.cc b/src/wx/audio_mapping_view.cc
index 45d11cf80..f5d0ecae2 100644
--- a/src/wx/audio_mapping_view.cc
+++ b/src/wx/audio_mapping_view.cc
@@ -109,15 +109,12 @@ AudioMappingView::left_click (wxGridEvent& ev)
}
if (_grid->GetCellValue (ev.GetRow(), ev.GetCol()) == wxT("1")) {
- cout << "set " << ev.GetRow() << " " << ev.GetCol() << " to 0.\n";
_grid->SetCellValue (ev.GetRow(), ev.GetCol(), wxT("0"));
} else {
- cout << "set " << ev.GetRow() << " " << ev.GetCol() << " to 1.\n";
_grid->SetCellValue (ev.GetRow(), ev.GetCol(), wxT("1"));
}
_map = AudioMapping (_map.content_channels ());
- cout << "was: " << _map.dcp_to_content(libdcp::CENTRE).size() << "\n";
for (int i = 0; i < _grid->GetNumberRows(); ++i) {
for (int j = 1; j < _grid->GetNumberCols(); ++j) {
@@ -127,7 +124,6 @@ AudioMappingView::left_click (wxGridEvent& ev)
}
}
- cout << "changed: " << _map.dcp_to_content(libdcp::CENTRE).size() << "\n";
Changed (_map);
}
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc
index 39935927f..048791a10 100644
--- a/src/wx/film_editor.cc
+++ b/src/wx/film_editor.cc
@@ -151,6 +151,10 @@ FilmEditor::make_dcp_panel ()
grid->Add (_dcp_audio_channels, wxGBPosition (r, 1));
++r;
+ _dcp_3d = new wxCheckBox (_dcp_panel, wxID_ANY, _("3D"));
+ grid->Add (_dcp_3d, wxGBPosition (r, 0), wxGBSpan (1, 2));
+ ++r;
+
add_label_to_grid_bag_sizer (grid, _dcp_panel, _("Resolution"), true, wxGBPosition (r, 0));
_dcp_resolution = new wxChoice (_dcp_panel, wxID_ANY);
grid->Add (_dcp_resolution, wxGBPosition (r, 1));
@@ -219,6 +223,7 @@ FilmEditor::connect_to_widgets ()
_j2k_bandwidth->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::j2k_bandwidth_changed), 0, this);
_dcp_resolution->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::dcp_resolution_changed), 0, this);
_sequence_video->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::sequence_video_changed), 0, this);
+ _dcp_3d->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&FilmEditor::dcp_3d_changed, this));
}
void
@@ -403,6 +408,9 @@ FilmEditor::film_changed (Film::Property p)
case Film::SEQUENCE_VIDEO:
checked_set (_sequence_video, _film->sequence_video ());
break;
+ case Film::DCP_3D:
+ checked_set (_dcp_3d, _film->dcp_3d ());
+ break;
}
}
@@ -521,6 +529,7 @@ FilmEditor::set_film (shared_ptr<Film> f)
film_changed (Film::DCP_VIDEO_FRAME_RATE);
film_changed (Film::DCP_AUDIO_CHANNELS);
film_changed (Film::SEQUENCE_VIDEO);
+ film_changed (Film::DCP_3D);
if (!_film->content().empty ()) {
set_selection (_film->content().front ());
@@ -549,6 +558,7 @@ FilmEditor::set_general_sensitivity (bool s)
_sequence_video->Enable (s);
_dcp_resolution->Enable (s);
_scaler->Enable (s);
+ _dcp_3d->Enable (s);
/* Set the panels in the content notebook */
for (list<FilmEditorPanel*>::iterator i = _panels.begin(); i != _panels.end(); ++i) {
@@ -824,3 +834,13 @@ FilmEditor::content_right_click (wxListEvent& ev)
cl.push_back (selected_content ());
_menu.popup (cl, ev.GetPoint ());
}
+
+void
+FilmEditor::dcp_3d_changed ()
+{
+ if (!_film) {
+ return;
+ }
+
+ _film->set_dcp_3d (_dcp_3d->GetValue ());
+}
diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h
index 66913643e..9a9ba2906 100644
--- a/src/wx/film_editor.h
+++ b/src/wx/film_editor.h
@@ -89,6 +89,7 @@ private:
void dcp_resolution_changed (wxCommandEvent &);
void sequence_video_changed (wxCommandEvent &);
void content_right_click (wxListEvent &);
+ void dcp_3d_changed ();
/* Handle changes to the model */
void film_changed (Film::Property);
@@ -135,6 +136,7 @@ private:
wxChoice* _dcp_frame_rate;
wxSpinCtrl* _dcp_audio_channels;
wxButton* _best_dcp_frame_rate;
+ wxCheckBox* _dcp_3d;
wxChoice* _dcp_resolution;
ContentMenu _menu;
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 42654bde5..b9d554c68 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -131,7 +131,7 @@ FilmViewer::set_film (shared_ptr<Film> f)
_player = f->make_player ();
_player->disable_audio ();
- _player->Video.connect (boost::bind (&FilmViewer::process_video, this, _1, _3));
+ _player->Video.connect (boost::bind (&FilmViewer::process_video, this, _1, _2, _4));
_player->Changed.connect (boost::bind (&FilmViewer::player_changed, this, _1));
calculate_sizes ();
@@ -280,8 +280,12 @@ FilmViewer::check_play_state ()
}
void
-FilmViewer::process_video (shared_ptr<const Image> image, Time t)
+FilmViewer::process_video (shared_ptr<const Image> image, Eyes eyes, Time t)
{
+ if (eyes == EYES_RIGHT) {
+ return;
+ }
+
if (_got_frame) {
/* This is an additional frame emitted by a single pass. Store it. */
_queue.push_front (make_pair (image, t));
@@ -332,7 +336,7 @@ FilmViewer::fetch_next_frame ()
_got_frame = false;
if (!_queue.empty ()) {
- process_video (_queue.back().first, _queue.back().second);
+ process_video (_queue.back().first, EYES_BOTH, _queue.back().second);
_queue.pop_back ();
} else {
try {
diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h
index b45e53d31..af58b5467 100644
--- a/src/wx/film_viewer.h
+++ b/src/wx/film_viewer.h
@@ -58,7 +58,7 @@ private:
void slider_moved (wxScrollEvent &);
void play_clicked (wxCommandEvent &);
void timer (wxTimerEvent &);
- void process_video (boost::shared_ptr<const Image>, Time);
+ void process_video (boost::shared_ptr<const Image>, Eyes, Time);
void calculate_sizes ();
void check_play_state ();
void fetch_current_frame_again ();
diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc
index e08edfa5a..ce0c869ff 100644
--- a/src/wx/video_panel.cc
+++ b/src/wx/video_panel.cc
@@ -28,6 +28,7 @@
using std::vector;
using std::string;
using std::pair;
+using std::cout;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
using boost::bind;
@@ -103,7 +104,7 @@ VideoPanel::VideoPanel (FilmEditor* e)
_frame_type->Append (_("2D"));
_frame_type->Append (_("3D left/right"));
- _frame_type->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, bind (&VideoPanel::frame_type_changed, this));
+ _frame_type->Bind (wxEVT_COMMAND_CHOICE_SELECTED, bind (&VideoPanel::frame_type_changed, this));
_left_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (VideoPanel::left_crop_changed), 0, this);
_right_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (VideoPanel::right_crop_changed), 0, this);
_top_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (VideoPanel::top_crop_changed), 0, this);
@@ -180,7 +181,7 @@ VideoPanel::film_content_changed (shared_ptr<Content> c, int property)
shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (c);
if (property == VideoContentProperty::VIDEO_FRAME_TYPE) {
- checked_set (_frame_type, vc->video_frame_type ());
+ checked_set (_frame_type, vc ? vc->video_frame_type () : VIDEO_FRAME_TYPE_2D);
} else if (property == VideoContentProperty::VIDEO_CROP) {
checked_set (_left_crop, vc ? vc->crop().left : 0);
checked_set (_right_crop, vc ? vc->crop().right : 0);