2016-07-01 Carl Hetherington <cth@carlh.net>
- * Add move-to-position dialog when clicking on the preview timecode.
+ * Add move-to-position dialogs when clicking on the preview timecode
+ or frame number.
2016-06-29 Carl Hetherington <cth@carlh.net>
* @brief A wx widget to view a preview of a Film.
*/
+#include "film_viewer.h"
+#include "playhead_to_timecode_dialog.h"
+#include "playhead_to_frame_dialog.h"
+#include "wx_util.h"
#include "lib/film.h"
#include "lib/ratio.h"
#include "lib/util.h"
#include "lib/video_decoder.h"
#include "lib/timer.h"
#include "lib/log.h"
-#include "film_viewer.h"
-#include "playhead_to_timecode_dialog.h"
-#include "wx_util.h"
extern "C" {
#include <libavutil/pixfmt.h>
}
_timer.Bind (wxEVT_TIMER, boost::bind (&FilmViewer::timer, this));
_back_button->Bind (wxEVT_LEFT_DOWN, boost::bind (&FilmViewer::back_clicked, this, _1));
_forward_button->Bind (wxEVT_LEFT_DOWN, boost::bind (&FilmViewer::forward_clicked, this, _1));
+ _frame_number->Bind (wxEVT_LEFT_DOWN, boost::bind (&FilmViewer::frame_number_clicked, this));
_timecode->Bind (wxEVT_LEFT_DOWN, boost::bind (&FilmViewer::timecode_clicked, this));
set_film (shared_ptr<Film> ());
}
dialog->Destroy ();
}
+
+void
+FilmViewer::frame_number_clicked ()
+{
+ PlayheadToFrameDialog* dialog = new PlayheadToFrameDialog (this, _film->video_frame_rate ());
+ if (dialog->ShowModal() == wxID_OK) {
+ go_to (dialog->get ());
+ }
+ dialog->Destroy ();
+}
void film_changed (Film::Property);
DCPTime nudge_amount (wxMouseEvent &);
void timecode_clicked ();
+ void frame_number_clicked ();
void go_to (DCPTime t);
boost::shared_ptr<Film> _film;
--- /dev/null
+/*
+ Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "playhead_to_frame_dialog.h"
+#include "lib/raw_convert.h"
+
+PlayheadToFrameDialog::PlayheadToFrameDialog (wxWindow* parent, int fps)
+ : TableDialog (parent, _("Move to frame"), 2, 1, true)
+ , _fps (fps)
+{
+ add (_("Go to"), true);
+ _frame = add (new wxTextCtrl (this, wxID_ANY, wxT ("")));
+
+ layout ();
+}
+
+DCPTime
+PlayheadToFrameDialog::get () const
+{
+ return DCPTime::from_frames (raw_convert<Frame> (wx_to_std (_frame->GetValue ())) - 1, _fps);
+}
--- /dev/null
+/*
+ Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "table_dialog.h"
+#include "timecode.h"
+
+class PlayheadToFrameDialog : public TableDialog
+{
+public:
+ PlayheadToFrameDialog (wxWindow* parent, int fps);
+
+ DCPTime get () const;
+
+private:
+ wxTextCtrl* _frame;
+ int _fps;
+};
move_to_dialog.cc
new_film_dialog.cc
playhead_to_timecode_dialog.cc
+ playhead_to_frame_dialog.cc
repeat_dialog.cc
report_problem_dialog.cc
rgba_colour_picker.cc