2 * Copyright (C) 2016 Robin Gareus <robin@gareus.org>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef __gtkardour_mini_timeline_h__
20 #define __gtkardour_mini_timeline_h__
25 #include "pbd/signals.h"
27 #include "ardour/ardour.h"
28 #include "ardour/session_handle.h"
30 #include "gtkmm2ext/cairo_widget.h"
31 #include "gtkmm2ext/utils.h"
33 #include "audio_clock.h"
39 class MiniTimeline : public CairoWidget, public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList
46 void set_session (ARDOUR::Session *);
49 void session_going_away ();
50 void super_rapid_update ();
52 void on_size_request (Gtk::Requisition*);
53 void on_style_changed (const Glib::RefPtr<Gtk::Style>&);
54 void on_name_changed ();
56 void parameter_changed (std::string const &);
58 void calculate_time_width ();
59 void update_minitimeline ();
60 void draw_dots (cairo_t*, int left, int right, int y);
61 int draw_mark (cairo_t*, int x0, int x1, int h, const std::string&);
63 void render (cairo_t*, cairo_rectangle_t*);
64 void format_time (framepos_t when);
66 bool on_button_release_event (GdkEventButton *ev);
67 bool on_scroll_event (GdkEventScroll*);
69 Glib::RefPtr<Pango::Layout> _layout;
70 sigc::connection super_rapid_connection;
71 PBD::ScopedConnectionList marker_connection;
72 PBD::ScopedConnection session_connection;
74 framepos_t _last_update_frame;
75 AudioClock::Mode _clock_mode;
80 JumpRange (int l, int r, framepos_t t)
81 : left (l), right (r), to (t) {}
87 typedef std::list <JumpRange> JumpList;