mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
meterbridge: add rec-enable btn & prepare metric/tick separation
This commit is contained in:
parent
c23a537b61
commit
917e3522d0
2 changed files with 42 additions and 2 deletions
|
|
@ -51,12 +51,16 @@ using namespace std;
|
||||||
PBD::Signal1<void,MeterStrip*> MeterStrip::CatchDeletion;
|
PBD::Signal1<void,MeterStrip*> MeterStrip::CatchDeletion;
|
||||||
|
|
||||||
MeterStrip::MetricPatterns MeterStrip::metric_patterns;
|
MeterStrip::MetricPatterns MeterStrip::metric_patterns;
|
||||||
|
MeterStrip::TickPatterns MeterStrip::tick_patterns;
|
||||||
|
|
||||||
MeterStrip::MeterStrip (Meterbridge& mtr, Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
|
MeterStrip::MeterStrip (Meterbridge& mtr, Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
|
||||||
: _route(rt)
|
: AxisView(sess)
|
||||||
|
, RouteUI(sess)
|
||||||
|
, _route(rt)
|
||||||
, style_changed (false)
|
, style_changed (false)
|
||||||
{
|
{
|
||||||
set_spacing(2);
|
set_spacing(2);
|
||||||
|
RouteUI::set_route (rt);
|
||||||
|
|
||||||
int meter_width = 6;
|
int meter_width = 6;
|
||||||
if (_route->shared_peak_meter()->input_streams().n_total() == 1) {
|
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
|
#endif
|
||||||
label.set_size_request(12, 36);
|
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(*meter_align, true, true);
|
||||||
|
pack_start (*btnbox, false, false);
|
||||||
pack_start (label, false, false);
|
pack_start (label, false, false);
|
||||||
|
|
||||||
meter_metric_area.show();
|
meter_metric_area.show();
|
||||||
level_meter->show();
|
level_meter->show();
|
||||||
meter_align->show();
|
meter_align->show();
|
||||||
|
btnbox->show();
|
||||||
label.show();
|
label.show();
|
||||||
|
|
||||||
_route->shared_peak_meter()->ConfigurationChanged.connect (
|
_route->shared_peak_meter()->ConfigurationChanged.connect (
|
||||||
|
|
@ -126,6 +136,24 @@ MeterStrip::self_delete ()
|
||||||
delete this;
|
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
|
void
|
||||||
MeterStrip::strip_property_changed (const PropertyChange& what_changed)
|
MeterStrip::strip_property_changed (const PropertyChange& what_changed)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#include "ardour/types.h"
|
#include "ardour/types.h"
|
||||||
#include "ardour/ardour.h"
|
#include "ardour/ardour.h"
|
||||||
|
#include "route_ui.h"
|
||||||
|
|
||||||
#include "level_meter.h"
|
#include "level_meter.h"
|
||||||
|
|
||||||
|
|
@ -42,7 +43,7 @@ namespace Gtk {
|
||||||
|
|
||||||
class Meterbridge;
|
class Meterbridge;
|
||||||
|
|
||||||
class MeterStrip : public Gtk::VBox
|
class MeterStrip : public Gtk::VBox, public RouteUI
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MeterStrip (Meterbridge&, ARDOUR::Session*, boost::shared_ptr<ARDOUR::Route>);
|
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;
|
typedef std::map<std::string,cairo_pattern_t*> MetricPatterns;
|
||||||
static MetricPatterns metric_patterns;
|
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>);
|
static cairo_pattern_t* render_metrics (Gtk::Widget &, std::vector<ARDOUR::DataType>);
|
||||||
|
|
||||||
void on_theme_changed ();
|
void on_theme_changed ();
|
||||||
|
|
@ -71,9 +76,16 @@ class MeterStrip : public Gtk::VBox
|
||||||
void on_size_allocate (Gtk::Allocation&);
|
void on_size_allocate (Gtk::Allocation&);
|
||||||
void on_size_request (Gtk::Requisition*);
|
void on_size_request (Gtk::Requisition*);
|
||||||
|
|
||||||
|
/* route UI */
|
||||||
|
void update_rec_display ();
|
||||||
|
std::string state_id() const;
|
||||||
|
void set_button_names ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Gtk::HBox meterbox;
|
||||||
Gtk::Label label;
|
Gtk::Label label;
|
||||||
Gtk::DrawingArea meter_metric_area;
|
Gtk::DrawingArea meter_metric_area;
|
||||||
|
Gtk::DrawingArea meter_tick_area;
|
||||||
std::vector<ARDOUR::DataType> _types;
|
std::vector<ARDOUR::DataType> _types;
|
||||||
|
|
||||||
LevelMeter *level_meter;
|
LevelMeter *level_meter;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue