Ardour  9.0-pre0-582-g084a23a80d
mini_timeline.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2017 Robin Gareus <robin@gareus.org>
3  * Copyright (C) 2016-2018 Ben Loftis <ben@harrisonconsoles.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #pragma once
21 
22 #include <list>
23 #include <pangomm.h>
24 
25 #include "pbd/signals.h"
26 
27 #include "ardour/ardour.h"
28 #include "ardour/types.h"
29 #include "ardour/session_handle.h"
30 
31 #include "gtkmm2ext/cairo_widget.h"
32 #include "gtkmm2ext/utils.h"
33 
34 #include "audio_clock.h"
35 
36 namespace ARDOUR {
37  class Session;
38 }
39 
40 namespace Gtk {
41  class Menu;
42 }
43 
45 {
46 
47 public:
50 
52 
53 private:
56 
59  void dpi_changed ();
60  void set_colors ();
61  void parameter_changed (std::string const &);
62 
66  void draw_dots (cairo_t*, int left, int right, int y, Gtkmm2ext::Color);
67  int draw_mark (cairo_t*, int x0, int x1, const std::string&, bool& prelight);
68  int draw_cue (cairo_t*, int x0, int next_cue_left_edge, int tl_width, int cue_index, bool& prelight);
69  int draw_edge (cairo_t*, int x0, int x1, bool left, const std::string&, bool& prelight);
70 
71  void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
72  void format_time (samplepos_t when);
73 
79 
82 
83  Glib::RefPtr<Pango::Layout> _layout;
84  sigc::connection super_rapid_connection;
88 
93 
94  int _n_labels;
99 
102 
104 
105  uint32_t _phead_color;
106 
107  struct JumpRange {
108  JumpRange (int l, int r, samplepos_t t, bool p = false)
109  : left (l), right (r), to (t), prelight (p) {}
110  int left;
111  int right;
113  bool prelight;
114  };
115 
116  typedef std::list <JumpRange> JumpList;
118 };
119 
void set_span(ARDOUR::samplecnt_t)
bool on_leave_notify_event(GdkEventCrossing *)
This is a default handler for the signal signal_leave_notify_event().
Gtk::Menu * _minitl_context_menu
uint32_t _phead_color
double _px_per_sample
Definition: mini_timeline.h:95
bool on_motion_notify_event(GdkEventMotion *)
This is a default handler for the signal signal_motion_notify_event().
void update_minitimeline()
bool on_button_press_event(GdkEventButton *)
This is a default handler for the signal signal_button_press_event().
void on_size_allocate(Gtk::Allocation &)
This is a default handler for the signal signal_size_allocate().
void draw_dots(cairo_t *, int left, int right, int y, Gtkmm2ext::Color)
PBD::ScopedConnectionList session_connection
Definition: mini_timeline.h:87
void render(Cairo::RefPtr< Cairo::Context > const &, cairo_rectangle_t *)
void super_rapid_update()
int draw_cue(cairo_t *, int x0, int next_cue_left_edge, int tl_width, int cue_index, bool &prelight)
void calculate_time_spacing()
void on_size_request(Gtk::Requisition *)
This is a default handler for the signal signal_size_request().
ARDOUR::samplecnt_t _time_span_samples
Definition: mini_timeline.h:97
void set_session(ARDOUR::Session *)
ARDOUR::samplecnt_t _time_granularity
Definition: mini_timeline.h:96
void format_time(samplepos_t when)
void dpi_changed()
JumpList _jumplist
void calculate_time_width()
sigc::connection super_rapid_connection
Definition: mini_timeline.h:84
PBD::ScopedConnectionList marker_connection
Definition: mini_timeline.h:85
int draw_mark(cairo_t *, int x0, int x1, const std::string &, bool &prelight)
Glib::RefPtr< Pango::Layout > _layout
Definition: mini_timeline.h:83
std::list< JumpRange > JumpList
PBD::ScopedConnectionList tempo_map_connection
Definition: mini_timeline.h:86
void parameter_changed(std::string const &)
bool on_scroll_event(GdkEventScroll *)
This is a default handler for the signal signal_scroll_event().
bool on_button_release_event(GdkEventButton *)
This is a default handler for the signal signal_button_release_event().
void set_colors()
AudioClock::Mode _clock_mode
Definition: mini_timeline.h:90
samplepos_t _last_update_sample
Definition: mini_timeline.h:89
int draw_edge(cairo_t *, int x0, int x1, bool left, const std::string &, bool &prelight)
void build_minitl_context_menu()
void session_going_away()
Temporal::samplecnt_t samplecnt_t
Temporal::samplepos_t samplepos_t
Definition: ardour_ui.h:188
uint32_t Color
Definition: colors.h:33
JumpRange(int l, int r, samplepos_t t, bool p=false)