meterbridge: add rec-enable btn & prepare metric/tick separation

This commit is contained in:
Robin Gareus 2013-06-28 23:09:39 +02:00
parent c23a537b61
commit 917e3522d0
2 changed files with 42 additions and 2 deletions

View File

@ -51,12 +51,16 @@ using namespace std;
PBD::Signal1<void,MeterStrip*> MeterStrip::CatchDeletion;
MeterStrip::MetricPatterns MeterStrip::metric_patterns;
MeterStrip::TickPatterns MeterStrip::tick_patterns;
MeterStrip::MeterStrip (Meterbridge& mtr, Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
: _route(rt)
: AxisView(sess)
, RouteUI(sess)
, _route(rt)
, style_changed (false)
{
set_spacing(2);
RouteUI::set_route (rt);
int meter_width = 6;
if (_route->shared_peak_meter()->input_streams().n_total() == 1) {
@ -91,12 +95,18 @@ MeterStrip::MeterStrip (Meterbridge& mtr, Session* sess, boost::shared_ptr<ARDOU
#endif
label.set_size_request(12, 36);
Gtk::HBox* btnbox = Gtk::manage (new Gtk::HBox());
btnbox->pack_start(*rec_enable_button, true, false);
btnbox->set_size_request(-1, 16);
pack_start(*meter_align, true, true);
pack_start (*btnbox, false, false);
pack_start (label, false, false);
meter_metric_area.show();
level_meter->show();
meter_align->show();
btnbox->show();
label.show();
_route->shared_peak_meter()->ConfigurationChanged.connect (
@ -126,6 +136,24 @@ MeterStrip::self_delete ()
delete this;
}
void
MeterStrip::update_rec_display ()
{
RouteUI::update_rec_display ();
}
std::string
MeterStrip::state_id() const
{
return string_compose ("mtrs %1", _route->id().to_s());
}
void
MeterStrip::set_button_names()
{
rec_enable_button->set_text (_("R"));
}
void
MeterStrip::strip_property_changed (const PropertyChange& what_changed)
{

View File

@ -28,6 +28,7 @@
#include "ardour/types.h"
#include "ardour/ardour.h"
#include "route_ui.h"
#include "level_meter.h"
@ -42,7 +43,7 @@ namespace Gtk {
class Meterbridge;
class MeterStrip : public Gtk::VBox
class MeterStrip : public Gtk::VBox, public RouteUI
{
public:
MeterStrip (Meterbridge&, ARDOUR::Session*, boost::shared_ptr<ARDOUR::Route>);
@ -63,6 +64,10 @@ class MeterStrip : public Gtk::VBox
typedef std::map<std::string,cairo_pattern_t*> MetricPatterns;
static MetricPatterns metric_patterns;
typedef std::map<std::string,cairo_pattern_t*> TickPatterns;
static TickPatterns tick_patterns;
static cairo_pattern_t* render_metrics (Gtk::Widget &, std::vector<ARDOUR::DataType>);
void on_theme_changed ();
@ -71,9 +76,16 @@ class MeterStrip : public Gtk::VBox
void on_size_allocate (Gtk::Allocation&);
void on_size_request (Gtk::Requisition*);
/* route UI */
void update_rec_display ();
std::string state_id() const;
void set_button_names ();
private:
Gtk::HBox meterbox;
Gtk::Label label;
Gtk::DrawingArea meter_metric_area;
Gtk::DrawingArea meter_tick_area;
std::vector<ARDOUR::DataType> _types;
LevelMeter *level_meter;