Ardour  9.0-pre0-582-g084a23a80d
rec_info_box.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Robin Gareus <robin@gareus.org>
3  * Copyright (C) 2021 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 #ifndef _rec_info_box_h_
21 #define _rec_info_box_h_
22 
23 #include "ardour/session_handle.h"
24 
25 #include "gtkmm2ext/cairo_widget.h"
26 
27 namespace ARDOUR {
28  class Route;
29 }
30 
32 {
33 public:
35 
36  virtual void set_session (ARDOUR::Session*);
37 
38 protected:
39  virtual void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*) = 0;
40  virtual void dpi_reset () {}
41 
44  virtual void update ();
45 
46  Glib::RefPtr<Pango::Layout> _layout_label;
47  Glib::RefPtr<Pango::Layout> _layout_value;
48  int _width;
49  int _height;
50 };
51 
53 {
54 public:
55  virtual void set_session (ARDOUR::Session*);
56 
57 protected:
58  void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
59  void dpi_reset ();
60  virtual void update ();
61 
62 private:
64  sigc::connection _rectime_connection;
65 };
66 
67 class XrunInfoBox : public RecInfoBox
68 {
69 public:
70  virtual void set_session (ARDOUR::Session*);
71  virtual void update ();
72 
73 protected:
74  void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
75  void dpi_reset ();
76 };
77 
78 class RemainInfoBox : public RecInfoBox
79 {
80 public:
81  virtual void set_session (ARDOUR::Session*);
82 
83 protected:
84  void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
85  void dpi_reset ();
86  virtual void update ();
87 
88 private:
91  sigc::connection _diskspace_connection;
92 };
93 
94 #endif
void render(Cairo::RefPtr< Cairo::Context > const &, cairo_rectangle_t *)
virtual void set_session(ARDOUR::Session *)
virtual void update()
sigc::connection _rectime_connection
Definition: rec_info_box.h:64
void rec_state_changed()
virtual void set_session(ARDOUR::Session *)
void on_size_allocate(Gtk::Allocation &)
This is a default handler for the signal signal_size_allocate().
virtual void dpi_reset()
Definition: rec_info_box.h:40
virtual void update()
Glib::RefPtr< Pango::Layout > _layout_label
Definition: rec_info_box.h:46
Glib::RefPtr< Pango::Layout > _layout_value
Definition: rec_info_box.h:47
virtual void render(Cairo::RefPtr< Cairo::Context > const &, cairo_rectangle_t *)=0
void on_size_request(Gtk::Requisition *)
This is a default handler for the signal signal_size_request().
virtual void set_session(ARDOUR::Session *)
uint32_t _rec_enabled_streams
Definition: rec_info_box.h:90
sigc::connection _diskspace_connection
Definition: rec_info_box.h:91
void render(Cairo::RefPtr< Cairo::Context > const &, cairo_rectangle_t *)
void dpi_reset()
void count_recenabled_streams(ARDOUR::Route &)
virtual void update()
void render(Cairo::RefPtr< Cairo::Context > const &, cairo_rectangle_t *)
virtual void update()
virtual void set_session(ARDOUR::Session *)
void dpi_reset()