#endif
-/* 3 hours in 640 pixels */
-double const ContentTimeline::_minimum_pixels_per_second = 640.0 / (60 * 60 * 3);
int const ContentTimeline::_minimum_pixels_per_track = 16;
ContentTimeline::ContentTimeline(wxWindow* parent, ContentPanel* cp, shared_ptr<Film> film, FilmViewer& viewer)
- : wxPanel (parent, wxID_ANY)
+ : Timeline(parent)
, _labels_canvas (new wxScrolledCanvas (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE))
, _main_canvas (new wxScrolledCanvas (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE))
, _content_panel (cp)
}
-void
-ContentTimeline::set_pixels_per_second(double pps)
-{
- _pixels_per_second = max (_minimum_pixels_per_second, pps);
-}
-
-
void
ContentTimeline::paint_labels()
{
#include "content_menu.h"
+#include "timeline.h"
#include "timeline_content_view.h"
#include "lib/film_property.h"
#include "lib/rect.h"
class TimelineTimeAxisView;
-class ContentTimeline : public wxPanel
+class ContentTimeline : public Timeline
{
public:
ContentTimeline(wxWindow *, ContentPanel *, std::shared_ptr<Film>, FilmViewer& viewer);
return _pixels_per_track;
}
- boost::optional<double> pixels_per_second () const {
- return _pixels_per_second;
- }
-
int tracks () const;
void set_snap (bool s) {
void recreate_views ();
void setup_scrollbars ();
void scrolled (wxScrollWinEvent& ev);
- void set_pixels_per_second (double pps);
void set_pixels_per_track (int h);
void zoom_all ();
void update_playhead ();
std::shared_ptr<TimelineReelsView> _reels_view;
std::shared_ptr<TimelineLabelsView> _labels_view;
int _tracks;
- boost::optional<double> _pixels_per_second;
bool _left_down;
wxPoint _down_point;
boost::optional<wxPoint> _zoom_point;
boost::optional<int> _last_mouse_wheel_x;
boost::optional<double> _last_mouse_wheel_time;
- static double const _minimum_pixels_per_second;
static int const _minimum_pixels_per_track;
boost::signals2::scoped_connection _film_changed_connection;
--- /dev/null
+/*
+ Copyright (C) 2023 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 "timeline.h"
+
+
+/* 3 hours in 640 pixels */
+double constexpr minimum_pixels_per_second = 640.0 / (60 * 60 * 3);
+
+
+Timeline::Timeline(wxWindow* parent)
+ : wxPanel(parent, wxID_ANY)
+{
+
+}
+
+
+void
+Timeline::set_pixels_per_second(double pps)
+{
+ _pixels_per_second = std::max(minimum_pixels_per_second, pps);
+}
+
+
--- /dev/null
+/*
+ Copyright (C) 2023 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/>.
+
+*/
+
+
+#ifndef DCPOMATIC_TIMELINE_H
+#define DCPOMATIC_TIMELINE_H
+
+
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
+#include <wx/wx.h>
+LIBDCP_ENABLE_WARNINGS
+#include <boost/optional.hpp>
+
+
+class Timeline : public wxPanel
+{
+public:
+ explicit Timeline(wxWindow* parent);
+
+ boost::optional<double> pixels_per_second() const {
+ return _pixels_per_second;
+ }
+
+
+protected:
+ void set_pixels_per_second(double pps);
+
+ boost::optional<double> _pixels_per_second;
+};
+
+
+#endif
time_picker.cc
timer_display.cc
timecode.cc
+ timeline.cc
timeline_atmos_content_view.cc
timeline_content_view.cc
timeline_dialog.cc