Merge branch 'master' of git.waves.com:waves/tracks

This commit is contained in:
nikolay 2014-06-25 16:29:03 +03:00
commit d5f09cc78a
24 changed files with 479 additions and 664 deletions

View file

@ -68,8 +68,8 @@
<Option name="meter fill: 7" value="FFA500ff"/>
<Option name="meter fill: 8" value="FF0000ff"/>
<Option name="meter fill: 9" value="FF0000ff"/>
<Option name="meter background: bottom" value="626262ff"/>
<Option name="meter background: top" value="626262ff"/>
<Option name="meter background: bottom" value="383838ff"/>
<Option name="meter background: top" value="383838ff"/>
<Option name="midi meter fill: 0" value="63ACF1ff"/>
<Option name="midi meter fill: 1" value="63ACF1ff"/>
<Option name="midi meter fill: 2" value="63ACF1ff"/>

View file

@ -219,7 +219,7 @@ ARDOUR_UI::set_session (Session *s)
editor_meter->set_meter (_session->master_out()->shared_peak_meter().get());
editor_meter->clear_meters();
editor_meter->set_type (_session->master_out()->meter_type());
editor_meter->setup_meters (30, 12, 6);
editor_meter->setup_meters (12, 6);
editor_meter->show();
meter_box.pack_start(*editor_meter);
}

View file

@ -45,6 +45,7 @@
#include "pbd/unknown_type.h"
#include "pbd/unwind.h"
#include "pbd/stacktrace.h"
#include "pbd/timersub.h"
#include <glibmm/miscutils.h>
#include <glibmm/uriutils.h>
@ -313,6 +314,7 @@ Editor::Editor ()
last_update_frame = 0;
pre_press_cursor = 0;
_drags = new DragManager (this);
lock_dialog = 0;
current_mixer_strip = 0;
tempo_lines = 0;
@ -1128,6 +1130,58 @@ Editor::on_realize ()
{
Window::on_realize ();
Realized ();
start_lock_event_timing ();
signal_event().connect (sigc::mem_fun (*this, &Editor::generic_event_handler));
}
void
Editor::start_lock_event_timing ()
{
/* check if we should lock the GUI every 30 seconds */
Glib::signal_timeout().connect (sigc::mem_fun (*this, &Editor::lock_timeout_callback), 30 * 1000);
}
bool
Editor::generic_event_handler (GdkEvent* ev)
{
switch (ev->type) {
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
case GDK_MOTION_NOTIFY:
case GDK_KEY_PRESS:
case GDK_KEY_RELEASE:
gettimeofday (&last_event_time, 0);
break;
default:
break;
}
return false;
}
bool
Editor::lock_timeout_callback ()
{
struct timeval now, delta;
const uint32_t lock_timeout_secs = 5; /* 2 minutes */
gettimeofday (&now, 0);
timersub (&now, &last_event_time, &delta);
if (delta.tv_sec > lock_timeout_secs) {
lock ();
/* don't call again. Returning false will effectively
disconnect us from the timer callback.
unlock() will call start_lock_event_timing() to get things
started again.
*/
return false;
}
return true;
}
void

View file

@ -1359,6 +1359,15 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
DragManager* _drags;
void escape ();
void lock ();
void unlock ();
/* This dialog must NOT forward events */
Gtk::Dialog *lock_dialog;
struct timeval last_event_time;
bool generic_event_handler (GdkEvent*);
bool lock_timeout_callback ();
void start_lock_event_timing ();
Gtk::Menu fade_context_menu;
void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);

View file

@ -57,6 +57,7 @@
#include "canvas/canvas.h"
#include "actions.h"
#include "ardour_ui.h"
#include "audio_region_view.h"
#include "audio_streamview.h"
@ -7060,3 +7061,49 @@ Editor::toggle_midi_input_active (bool flip_others)
_session->set_exclusive_input_active (rl, onoff, flip_others);
}
void
Editor::lock ()
{
if (!lock_dialog) {
/* the lock dialog must be a completely "vanilla" Dialog that does not forward
events in anyway. Using a class like ArdourDialog breaks this.
*/
lock_dialog = new Gtk::Dialog (string_compose (_("%1: Locked"), PROGRAM_NAME), true);
Gtk::Image* padlock = manage (new Gtk::Image (::get_icon ("padlock_closed")));
lock_dialog->get_vbox()->pack_start (*padlock);
ArdourButton* b = manage (new ArdourButton);
b->set_name ("lock button");
b->set_markup (string_compose ("<span size=\"large\" weight=\"bold\">%1</span>", _("Click to unlock")));
b->signal_clicked.connect (sigc::mem_fun (*this, &Editor::unlock));
lock_dialog->get_vbox()->pack_start (*b);
lock_dialog->get_vbox()->show_all ();
lock_dialog->set_size_request (200, 200);
}
#ifdef __APPLE__
/* The global menu bar continues to be accessible to applications
with modal dialogs, which means that we need to desensitize
all items in the menu bar. Since those items are really just
proxies for actions, that means disabling all actions.
*/
ActionManager::disable_all_actions ();
#endif
lock_dialog->present ();
}
void
Editor::unlock ()
{
lock_dialog->hide ();
#ifdef __APPLE__
ActionManager::pop_action_state ();
#endif
start_lock_event_timing ();
}

View file

@ -61,16 +61,25 @@ using namespace std;
using Gtkmm2ext::Keyboard;
using namespace ArdourMeter;
GainMeterBase::GainMeterBase (Session* s, bool horizontal, int fader_length, int fader_girth)
: gain_adjustment (gain_to_slider_position_with_max (1.0, Config->get_max_gain()), 0.0, 1.0, 0.01, 0.1)
, gain_automation_style_button ("")
, gain_automation_state_button ("")
, _data_type (DataType::AUDIO)
, gain_slider(0)
GainMeter::GainMeter (Session* s, const std::string& layout_script_file)
: Gtk::VBox ()
, WavesUI (layout_script_file, *this)
, gain_slider (get_fader ("gain_slider"))
, gain_adjustment (get_adjustment ("gain_adjustment"))
, gain_display_home (get_box ("gain_display_home"))
, peak_display_button (get_waves_button ("peak_display_button"))
, level_meter_home (get_box ("level_meter_home"))
, level_meter (_session)
, _data_type (DataType::AUDIO)
{
using namespace Menu_Helpers;
//gain_adjustment (gain_to_slider_position_with_max (1.0, Config->get_max_gain()), 0.0, 1.0, 0.01, 0.1)
gain_adjustment.set_value (gain_to_slider_position_with_max (1.0, Config->get_max_gain()));
gain_adjustment.set_lower (0.0);
gain_adjustment.set_upper (1.0);
gain_adjustment.set_step_increment (0.01);
gain_adjustment.set_page_increment (0.1);
set_session (s);
ignore_toggle = false;
@ -78,46 +87,25 @@ GainMeterBase::GainMeterBase (Session* s, bool horizontal, int fader_length, int
next_release_selects = false;
_width = Wide;
gain_slider = manage (new Fader (gain_adjustment,
"slider_controller_fader.png",
"slider_controller_fader_handle.png",
"slider_controller_fader_handle.png",
10, 187, 10, 0));
level_meter_home.pack_start(level_meter);
level_meter.ButtonPress.connect_same_thread (_level_meter_connection, boost::bind (&GainMeter::level_meter_button_press, this, _1));
level_meter = new LevelMeterHBox(_session);
gain_slider.signal_button_press_event().connect (sigc::mem_fun(*this, &GainMeter::gain_slider_button_press), false);
gain_slider.signal_button_release_event().connect (sigc::mem_fun(*this, &GainMeter::gain_slider_button_release), false);
level_meter->ButtonPress.connect_same_thread (_level_meter_connection, boost::bind (&GainMeterBase::level_meter_button_press, this, _1));
meter_metric_area.signal_button_press_event().connect (sigc::mem_fun (*this, &GainMeterBase::level_meter_button_press));
meter_metric_area.add_events (Gdk::BUTTON_PRESS_MASK);
gain_display_entry.set_name ("MixerStripGainDisplay");
set_size_request_to_display_given_text (gain_display_entry, "-80.g", 2, 6); /* note the descender */
gain_display_entry.signal_activate().connect (sigc::mem_fun (*this, &GainMeter::gain_activated));
gain_display_entry.signal_focus_in_event().connect (sigc::mem_fun (*this, &GainMeter::gain_focused), false);
gain_display_entry.signal_focus_out_event().connect (sigc::mem_fun (*this, &GainMeter::gain_focused), false);
gain_display_entry.set_alignment(1.0);
gain_slider->signal_button_press_event().connect (sigc::mem_fun(*this, &GainMeter::gain_slider_button_press), false);
gain_slider->signal_button_release_event().connect (sigc::mem_fun(*this, &GainMeter::gain_slider_button_release), false);
gain_slider->set_name ("GainFader");
gain_display.set_name ("MixerStripGainDisplay");
set_size_request_to_display_given_text (gain_display, "-80.g", 2, 6); /* note the descender */
gain_display.signal_activate().connect (sigc::mem_fun (*this, &GainMeter::gain_activated));
gain_display.signal_focus_in_event().connect (sigc::mem_fun (*this, &GainMeter::gain_focused), false);
gain_display.signal_focus_out_event().connect (sigc::mem_fun (*this, &GainMeter::gain_focused), false);
gain_display.set_alignment(1.0);
peak_display.set_name ("MixerStripPeakDisplay");
set_size_request_to_display_given_text (peak_display, "-80.g", 2, 6); /* note the descender */
peak_display_button.set_name ("MixerStripPeakDisplay");
set_size_request_to_display_given_text (peak_display_button, "-80.g", 2, 6); /* note the descender */
max_peak = minus_infinity();
peak_display.set_label (_("-inf"));
peak_display.unset_flags (Gtk::CAN_FOCUS);
peak_display_button.set_text (_("-inf"));
peak_display_button.unset_flags (Gtk::CAN_FOCUS);
gain_automation_style_button.set_name ("mixer strip button");
gain_automation_state_button.set_name ("mixer strip button");
ARDOUR_UI::instance()->set_tip (gain_automation_state_button, _("Fader automation mode"));
ARDOUR_UI::instance()->set_tip (gain_automation_style_button, _("Fader automation type"));
gain_automation_style_button.unset_flags (Gtk::CAN_FOCUS);
gain_automation_state_button.unset_flags (Gtk::CAN_FOCUS);
gain_automation_state_button.set_size_request(15, 15);
gain_automation_style_button.set_size_request(15, 15);
gain_astyle_menu.items().push_back (MenuElem (_("Trim")));
gain_astyle_menu.items().push_back (MenuElem (_("Abs")));
@ -125,37 +113,33 @@ GainMeterBase::GainMeterBase (Session* s, bool horizontal, int fader_length, int
gain_astate_menu.set_name ("ArdourContextMenu");
gain_astyle_menu.set_name ("ArdourContextMenu");
gain_adjustment.signal_value_changed().connect (sigc::mem_fun(*this, &GainMeterBase::gain_adjusted));
peak_display.signal_button_release_event().connect (sigc::mem_fun(*this, &GainMeterBase::peak_button_release), false);
gain_display.signal_key_press_event().connect (sigc::mem_fun(*this, &GainMeterBase::gain_key_press), false);
gain_adjustment.signal_value_changed().connect (sigc::mem_fun(*this, &GainMeter::gain_adjusted));
peak_display_button.signal_button_release_event().connect (sigc::mem_fun(*this, &GainMeter::peak_button_release), false);
gain_display_entry.signal_key_press_event().connect (sigc::mem_fun(*this, &GainMeter::gain_key_press), false);
ResetAllPeakDisplays.connect (sigc::mem_fun(*this, &GainMeterBase::reset_peak_display));
ResetRoutePeakDisplays.connect (sigc::mem_fun(*this, &GainMeterBase::reset_route_peak_display));
ResetGroupPeakDisplays.connect (sigc::mem_fun(*this, &GainMeterBase::reset_group_peak_display));
RedrawMetrics.connect (sigc::mem_fun(*this, &GainMeterBase::redraw_metrics));
ResetAllPeakDisplays.connect (sigc::mem_fun(*this, &GainMeter::reset_peak_display));
ResetRoutePeakDisplays.connect (sigc::mem_fun(*this, &GainMeter::reset_route_peak_display));
ResetGroupPeakDisplays.connect (sigc::mem_fun(*this, &GainMeter::reset_group_peak_display));
RedrawMetrics.connect (sigc::mem_fun(*this, &GainMeter::redraw_metrics));
UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &GainMeterBase::on_theme_changed));
ColorsChanged.connect (sigc::bind(sigc::mem_fun (*this, &GainMeterBase::color_handler), false));
DPIReset.connect (sigc::bind(sigc::mem_fun (*this, &GainMeterBase::color_handler), true));
// PBD::ScopedConnection _config_connection;
// Config->ParameterChanged.connect ( _config_connection, MISSING_INVALIDATOR, boost::bind(&GainMeterBase::set_flat_buttons, this, _1), gui_context() );
UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &GainMeter::on_theme_changed));
ColorsChanged.connect (sigc::bind(sigc::mem_fun (*this, &GainMeter::color_handler), false));
DPIReset.connect (sigc::bind(sigc::mem_fun (*this, &GainMeter::color_handler), true));
}
void
GainMeterBase::set_flat_buttons ()
GainMeter::set_flat_buttons ()
{
// gain_slider->set_flat_buttons( ARDOUR_UI::config()->flat_buttons.get() );
}
GainMeterBase::~GainMeterBase ()
GainMeter::~GainMeter ()
{
delete meter_menu;
delete level_meter;
}
void
GainMeterBase::set_controls (boost::shared_ptr<Route> r,
GainMeter::set_controls (boost::shared_ptr<Route> r,
boost::shared_ptr<PeakMeter> pm,
boost::shared_ptr<Amp> amp)
{
@ -163,8 +147,8 @@ GainMeterBase::set_controls (boost::shared_ptr<Route> r,
model_connections.drop_connections ();
if (!pm && !amp) {
level_meter->set_meter (0);
gain_slider->set_controllable (boost::shared_ptr<PBD::Controllable>());
level_meter.set_meter (0);
gain_slider.set_controllable (boost::shared_ptr<PBD::Controllable>());
_meter.reset ();
_amp.reset ();
_route.reset ();
@ -175,12 +159,12 @@ GainMeterBase::set_controls (boost::shared_ptr<Route> r,
_amp = amp;
_route = r;
level_meter->set_meter (pm.get());
gain_slider->set_controllable (amp->gain_control());
level_meter.set_meter (pm.get());
gain_slider.set_controllable (amp->gain_control());
if (amp) {
amp->ConfigurationChanged.connect (
model_connections, invalidator (*this), boost::bind (&GainMeterBase::setup_gain_adjustment, this), gui_context ()
model_connections, invalidator (*this), boost::bind (&GainMeter::setup_gain_adjustment, this), gui_context ()
);
}
@ -205,26 +189,44 @@ GainMeterBase::set_controls (boost::shared_ptr<Route> r,
sigc::bind (sigc::mem_fun (*(amp.get()), &Automatable::set_parameter_automation_state),
Evoral::Parameter(GainAutomation), (AutoState) Touch)));
connections.push_back (gain_automation_style_button.signal_button_press_event().connect (sigc::mem_fun(*this, &GainMeterBase::gain_automation_style_button_event), false));
connections.push_back (gain_automation_state_button.signal_button_press_event().connect (sigc::mem_fun(*this, &GainMeterBase::gain_automation_state_button_event), false));
boost::shared_ptr<AutomationControl> gc = amp->gain_control();
gc->alist()->automation_state_changed.connect (model_connections, invalidator (*this), boost::bind (&GainMeter::gain_automation_state_changed, this), gui_context());
gc->alist()->automation_style_changed.connect (model_connections, invalidator (*this), boost::bind (&GainMeter::gain_automation_style_changed, this), gui_context());
gain_automation_state_changed ();
}
amp->gain_control()->Changed.connect (model_connections, invalidator (*this), boost::bind (&GainMeterBase::gain_changed, this), gui_context());
amp->gain_control()->Changed.connect (model_connections, invalidator (*this), boost::bind (&GainMeter::gain_changed, this), gui_context());
gain_changed ();
show_gain ();
update_gain_sensitive ();
//
if (_meter) {
_meter->ConfigurationChanged.connect (
model_connections, invalidator (*this), boost::bind (&GainMeter::meter_configuration_changed, this, _1), gui_context()
);
_meter->TypeChanged.connect (
model_connections, invalidator (*this), boost::bind (&GainMeter::meter_type_changed, this, _1), gui_context()
);
meter_configuration_changed (_meter->input_streams ());
}
if (_route) {
_route->active_changed.connect (model_connections, invalidator (*this), boost::bind (&GainMeter::route_active_changed, this), gui_context ());
}
/*
if we have a non-hidden route (ie. we're not the click or the auditioner),
pack some route-dependent stuff.
*/
setup_meters ();
}
void
GainMeterBase::setup_gain_adjustment ()
GainMeter::setup_gain_adjustment ()
{
if (!_amp) {
return;
@ -242,14 +244,14 @@ GainMeterBase::setup_gain_adjustment ()
gain_adjustment.set_upper (1.0);
gain_adjustment.set_step_increment (0.01);
gain_adjustment.set_page_increment (0.1);
gain_slider->set_default_value (gain_to_slider_position (1));
gain_slider.set_default_value (gain_to_slider_position (1));
} else {
_data_type = DataType::MIDI;
gain_adjustment.set_lower (0.0);
gain_adjustment.set_upper (2.0);
gain_adjustment.set_step_increment (1.0/128.0);
gain_adjustment.set_page_increment (10.0/128.0);
gain_slider->set_default_value (1.0);
gain_slider.set_default_value (1.0);
}
ignore_toggle = false;
@ -259,20 +261,14 @@ GainMeterBase::setup_gain_adjustment ()
_previous_amp_output_streams = _amp->output_streams ();
}
void
GainMeterBase::hide_all_meters ()
{
level_meter->hide_meters();
}
void
GainMeter::hide_all_meters ()
{
GainMeterBase::hide_all_meters ();
level_meter.hide_meters();
}
void
GainMeterBase::setup_meters (int len)
GainMeter::setup_meters (int len)
{
int meter_width = 5;
uint32_t meter_channels = 0;
@ -284,53 +280,28 @@ GainMeterBase::setup_meters (int len)
switch (_width) {
case Wide:
//meter_ticks1_area.show();
//meter_ticks2_area.show();
meter_metric_area.show();
if (meter_channels == 1) {
meter_width = 10;
meter_width = 6;
}
break;
case Narrow:
if (meter_channels > 1) {
meter_width = 4;
meter_width = 5;
}
//meter_ticks1_area.hide();
//meter_ticks2_area.hide();
meter_metric_area.hide();
break;
}
level_meter->setup_meters(len, meter_width);
}
void
GainMeterBase::set_type (MeterType t)
{
level_meter->set_type(t);
}
void
GainMeter::setup_meters (int len)
{
switch (_width) {
case Wide:
hbox.set_homogeneous(true);
break;
case Narrow:
hbox.set_homogeneous(false);
break;
}
GainMeterBase::setup_meters (len);
level_meter.setup_meters (meter_width, meter_width);
}
void
GainMeter::set_type (MeterType t)
{
GainMeterBase::set_type (t);
level_meter.set_type(t);
}
bool
GainMeterBase::gain_key_press (GdkEventKey* ev)
GainMeter::gain_key_press (GdkEventKey* ev)
{
if (key_is_legal_for_numeric_entry (ev->keyval)) {
/* drop through to normal handling */
@ -341,7 +312,7 @@ GainMeterBase::gain_key_press (GdkEventKey* ev)
}
bool
GainMeterBase::peak_button_release (GdkEventButton* ev)
GainMeter::peak_button_release (GdkEventButton* ev)
{
/* reset peak label */
@ -359,17 +330,17 @@ GainMeterBase::peak_button_release (GdkEventButton* ev)
}
void
GainMeterBase::reset_peak_display ()
GainMeter::reset_peak_display ()
{
_meter->reset_max();
level_meter->clear_meters();
level_meter.clear_meters();
max_peak = -INFINITY;
peak_display.set_label (_("-inf"));
peak_display.set_name ("MixerStripPeakDisplay");
peak_display_button.set_text (_("-inf"));
peak_display_button.set_name ("MixerStripPeakDisplay");
}
void
GainMeterBase::reset_route_peak_display (Route* route)
GainMeter::reset_route_peak_display (Route* route)
{
if (_route && _route.get() == route) {
reset_peak_display ();
@ -377,7 +348,7 @@ GainMeterBase::reset_route_peak_display (Route* route)
}
void
GainMeterBase::reset_group_peak_display (RouteGroup* group)
GainMeter::reset_group_peak_display (RouteGroup* group)
{
if (_route && group == _route->route_group()) {
reset_peak_display ();
@ -385,7 +356,7 @@ GainMeterBase::reset_group_peak_display (RouteGroup* group)
}
void
GainMeterBase::popup_meter_menu (GdkEventButton *ev)
GainMeter::popup_meter_menu (GdkEventButton *ev)
{
using namespace Menu_Helpers;
@ -406,18 +377,18 @@ GainMeterBase::popup_meter_menu (GdkEventButton *ev)
}
bool
GainMeterBase::gain_focused (GdkEventFocus* ev)
GainMeter::gain_focused (GdkEventFocus* ev)
{
if (ev->in) {
gain_display.select_region (0, -1);
gain_display_entry.select_region (0, -1);
} else {
gain_display.select_region (0, 0);
gain_display_entry.select_region (0, 0);
}
return false;
}
void
GainMeterBase::gain_activated ()
GainMeter::gain_activated ()
{
float f;
@ -427,7 +398,7 @@ GainMeterBase::gain_activated ()
// we will honor them.
PBD::LocaleGuard lg ("");
if (sscanf (gain_display.get_text().c_str(), "%f", &f) != 1) {
if (sscanf (gain_display_entry.get_text().c_str(), "%f", &f) != 1) {
return;
}
}
@ -441,8 +412,8 @@ GainMeterBase::gain_activated ()
_amp->set_gain (f, this);
}
if (gain_display.has_focus()) {
Gtk::Widget* w = gain_display.get_toplevel();
if (gain_display_entry.has_focus()) {
Gtk::Widget* w = gain_display_entry.get_toplevel();
if (w) {
Gtk::Window* win = dynamic_cast<Gtk::Window*> (w);
@ -460,7 +431,7 @@ GainMeterBase::gain_activated ()
}
void
GainMeterBase::show_gain ()
GainMeter::show_gain ()
{
char buf[32];
@ -479,11 +450,11 @@ GainMeterBase::show_gain ()
break;
}
gain_display.set_text (buf);
gain_display_entry.set_text (buf);
}
void
GainMeterBase::gain_adjusted ()
GainMeter::gain_adjusted ()
{
gain_t value;
@ -507,7 +478,7 @@ GainMeterBase::gain_adjusted ()
}
void
GainMeterBase::effective_gain_display ()
GainMeter::effective_gain_display ()
{
float value = 0.0;
@ -528,33 +499,22 @@ GainMeterBase::effective_gain_display ()
}
void
GainMeterBase::gain_changed ()
GainMeter::gain_changed ()
{
Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&GainMeterBase::effective_gain_display, this));
Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&GainMeter::effective_gain_display, this));
}
void
GainMeterBase::set_meter_strip_name (const char * name)
GainMeter::set_fader_name (const char * name)
{
char tmp[256];
meter_metric_area.set_name (name);
sprintf(tmp, "Mark%sLeft", name);
meter_ticks1_area.set_name (tmp);
sprintf(tmp, "Mark%sRight", name);
meter_ticks2_area.set_name (tmp);
// gain_slider.set_name (name);
}
void
GainMeterBase::set_fader_name (const char * name)
{
gain_slider->set_name (name);
}
void
GainMeterBase::update_gain_sensitive ()
GainMeter::update_gain_sensitive ()
{
bool x = !(_amp->gain_control()->alist()->automation_state() & Play);
gain_slider->set_sensitive (x);
gain_slider.set_sensitive (x);
}
static MeterPoint
@ -587,7 +547,7 @@ next_meter_point (MeterPoint mp)
}
gint
GainMeterBase::meter_press(GdkEventButton* ev)
GainMeter::meter_press(GdkEventButton* ev)
{
wait_for_release = false;
@ -620,7 +580,7 @@ GainMeterBase::meter_press(GdkEventButton* ev)
/* Primary+Tertiary-click applies change to all routes */
_session->foreach_route (this, &GainMeterBase::set_meter_point, next_meter_point (_route->meter_point()));
_session->foreach_route (this, &GainMeter::set_meter_point, next_meter_point (_route->meter_point()));
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
@ -650,7 +610,7 @@ GainMeterBase::meter_press(GdkEventButton* ev)
}
gint
GainMeterBase::meter_release(GdkEventButton*)
GainMeter::meter_release(GdkEventButton*)
{
if (!ignore_toggle) {
if (wait_for_release) {
@ -666,13 +626,13 @@ GainMeterBase::meter_release(GdkEventButton*)
}
void
GainMeterBase::set_meter_point (Route& route, MeterPoint mp)
GainMeter::set_meter_point (Route& route, MeterPoint mp)
{
route.set_meter_point (mp);
}
void
GainMeterBase::set_route_group_meter_point (Route& route, MeterPoint mp)
GainMeter::set_route_group_meter_point (Route& route, MeterPoint mp)
{
RouteGroup* route_group;
@ -684,7 +644,7 @@ GainMeterBase::set_route_group_meter_point (Route& route, MeterPoint mp)
}
void
GainMeterBase::meter_point_clicked ()
GainMeter::meter_point_clicked ()
{
if (_route) {
/* WHAT? */
@ -692,7 +652,7 @@ GainMeterBase::meter_point_clicked ()
}
bool
GainMeterBase::gain_slider_button_press (GdkEventButton* ev)
GainMeter::gain_slider_button_press (GdkEventButton* ev)
{
switch (ev->type) {
case GDK_BUTTON_PRESS:
@ -706,61 +666,26 @@ GainMeterBase::gain_slider_button_press (GdkEventButton* ev)
}
bool
GainMeterBase::gain_slider_button_release (GdkEventButton*)
GainMeter::gain_slider_button_release (GdkEventButton*)
{
_amp->gain_control()->stop_touch (false, _amp->session().transport_frame());
return false;
}
gint
GainMeterBase::gain_automation_state_button_event (GdkEventButton *ev)
{
if (ev->type == GDK_BUTTON_RELEASE) {
return TRUE;
}
switch (ev->button) {
case 1:
gain_astate_menu.popup (1, ev->time);
break;
default:
break;
}
return TRUE;
}
gint
GainMeterBase::gain_automation_style_button_event (GdkEventButton *ev)
{
if (ev->type == GDK_BUTTON_RELEASE) {
return TRUE;
}
switch (ev->button) {
case 1:
gain_astyle_menu.popup (1, ev->time);
break;
default:
break;
}
return TRUE;
}
string
GainMeterBase::astate_string (AutoState state)
GainMeter::astate_string (AutoState state)
{
return _astate_string (state, false);
}
string
GainMeterBase::short_astate_string (AutoState state)
GainMeter::short_astate_string (AutoState state)
{
return _astate_string (state, true);
}
string
GainMeterBase::_astate_string (AutoState state, bool shrt)
GainMeter::_astate_string (AutoState state, bool shrt)
{
string sstr;
@ -783,19 +708,19 @@ GainMeterBase::_astate_string (AutoState state, bool shrt)
}
string
GainMeterBase::astyle_string (AutoStyle style)
GainMeter::astyle_string (AutoStyle style)
{
return _astyle_string (style, false);
}
string
GainMeterBase::short_astyle_string (AutoStyle style)
GainMeter::short_astyle_string (AutoStyle style)
{
return _astyle_string (style, true);
}
string
GainMeterBase::_astyle_string (AutoStyle style, bool shrt)
GainMeter::_astyle_string (AutoStyle style, bool shrt)
{
if (style & Trim) {
return _("Trim");
@ -807,266 +732,69 @@ GainMeterBase::_astyle_string (AutoStyle style, bool shrt)
}
void
GainMeterBase::gain_automation_style_changed ()
{
switch (_width) {
case Wide:
gain_automation_style_button.set_text (astyle_string(_amp->gain_control()->alist()->automation_style()));
break;
case Narrow:
gain_automation_style_button.set_text (short_astyle_string(_amp->gain_control()->alist()->automation_style()));
break;
}
}
void
GainMeterBase::gain_automation_state_changed ()
{
ENSURE_GUI_THREAD (*this, &GainMeterBase::gain_automation_state_changed)
bool x;
switch (_width) {
case Wide:
gain_automation_state_button.set_text (astate_string(_amp->gain_control()->alist()->automation_state()));
break;
case Narrow:
gain_automation_state_button.set_text (short_astate_string(_amp->gain_control()->alist()->automation_state()));
break;
}
x = (_amp->gain_control()->alist()->automation_state() != ARDOUR::Off);
if (gain_automation_state_button.get_active() != x) {
ignore_toggle = true;
gain_automation_state_button.set_active (x);
ignore_toggle = false;
}
update_gain_sensitive ();
/* start watching automation so that things move */
gain_watching.disconnect();
if (x) {
gain_watching = ARDOUR_UI::RapidScreenUpdate.connect (sigc::mem_fun (*this, &GainMeterBase::effective_gain_display));
}
}
void
GainMeterBase::update_meters()
GainMeter::update_meters()
{
char buf[32];
float mpeak = level_meter->update_meters();
float mpeak = level_meter.update_meters();
if (mpeak > max_peak) {
max_peak = mpeak;
if (mpeak <= -200.0f) {
peak_display.set_label (_("-inf"));
peak_display_button.set_text (_("-inf"));
} else {
snprintf (buf, sizeof(buf), "%.1f", mpeak);
peak_display.set_label (buf);
peak_display_button.set_text (buf);
}
}
if (mpeak >= Config->get_meter_peak()) {
peak_display.set_name ("MixerStripPeakDisplayPeak");
peak_display_button.set_name ("MixerStripPeakDisplayPeak");
}
}
void GainMeterBase::color_handler(bool /*dpi*/)
void GainMeter::color_handler(bool /*dpi*/)
{
setup_meters();
}
void
GainMeterBase::set_width (Width w, int len)
GainMeter::set_width (Width w, int len)
{
_width = w;
int meter_width = 5;
if (_width == Wide && _route && _route->shared_peak_meter()->input_streams().n_total() == 1) {
meter_width = 10;
}
level_meter->setup_meters(len, meter_width);
level_meter.setup_meters(meter_width, meter_width);
}
void
GainMeterBase::on_theme_changed()
GainMeter::on_theme_changed()
{
}
void
GainMeterBase::redraw_metrics()
GainMeter::redraw_metrics()
{
meter_metric_area.queue_draw ();
meter_ticks1_area.queue_draw ();
meter_ticks2_area.queue_draw ();
}
GainMeter::GainMeter (Session* s, int fader_length)
: GainMeterBase (s, false, fader_length, 24)
, gain_display_box(true, 0)
, hbox(true, 2)
{
if (gain_display.get_parent()) {
gain_display.get_parent()->remove (gain_display);
}
gain_display_box.pack_start (gain_display, true, true);
if (peak_display.get_parent()) {
peak_display.get_parent()->remove (gain_display);
}
gain_display_box.pack_start (peak_display, true, true);
meter_metric_area.set_name ("AudioTrackMetrics");
meter_metric_area.set_size_request(24, -1);
gain_automation_style_button.set_name ("mixer strip button");
gain_automation_state_button.set_name ("mixer strip button");
ARDOUR_UI::instance()->set_tip (gain_automation_state_button, _("Fader automation mode"));
ARDOUR_UI::instance()->set_tip (gain_automation_style_button, _("Fader automation type"));
gain_automation_style_button.unset_flags (Gtk::CAN_FOCUS);
gain_automation_state_button.unset_flags (Gtk::CAN_FOCUS);
gain_automation_state_button.set_size_request(15, 15);
gain_automation_style_button.set_size_request(15, 15);
fader_vbox = manage (new Gtk::VBox());
fader_vbox->set_spacing (0);
fader_vbox->pack_start (*gain_slider, true, true);
fader_alignment.set (0.5, 0.5, 0.0, 1.0);
fader_alignment.add (*fader_vbox);
hbox.pack_start (fader_alignment, true, true);
set_spacing (2);
pack_start (gain_display_box, Gtk::PACK_SHRINK);
pack_start (hbox, Gtk::PACK_SHRINK);
meter_alignment.set (0.5, 0.5, 0.0, 1.0);
meter_alignment.add (*level_meter);
meter_metric_area.signal_expose_event().connect (
sigc::mem_fun(*this, &GainMeter::meter_metrics_expose));
meter_ticks1_area.set_size_request(3,-1);
meter_ticks2_area.set_size_request(3,-1);
meter_ticks1_area.signal_expose_event().connect (
sigc::mem_fun(*this, &GainMeter::meter_ticks1_expose));
meter_ticks2_area.signal_expose_event().connect (
sigc::mem_fun(*this, &GainMeter::meter_ticks2_expose));
meter_hbox.pack_start (meter_ticks1_area, false, false);
meter_hbox.pack_start (meter_alignment, false, false);
meter_hbox.pack_start (meter_ticks2_area, false, false);
meter_hbox.pack_start (meter_metric_area, false, false);
}
GainMeter::~GainMeter () { }
void
GainMeter::set_controls (boost::shared_ptr<Route> r,
boost::shared_ptr<PeakMeter> meter,
boost::shared_ptr<Amp> amp)
{
if (meter_hbox.get_parent()) {
hbox.remove (meter_hbox);
}
// if (gain_automation_state_button.get_parent()) {
// fader_vbox->remove (gain_automation_state_button);
// }
GainMeterBase::set_controls (r, meter, amp);
if (_meter) {
_meter->ConfigurationChanged.connect (
model_connections, invalidator (*this), boost::bind (&GainMeter::meter_configuration_changed, this, _1), gui_context()
);
_meter->TypeChanged.connect (
model_connections, invalidator (*this), boost::bind (&GainMeter::meter_type_changed, this, _1), gui_context()
);
meter_configuration_changed (_meter->input_streams ());
}
if (_route) {
_route->active_changed.connect (model_connections, invalidator (*this), boost::bind (&GainMeter::route_active_changed, this), gui_context ());
}
/*
if we have a non-hidden route (ie. we're not the click or the auditioner),
pack some route-dependent stuff.
*/
hbox.pack_start (meter_hbox, true, true);
// if (r && !r->is_auditioner()) {
// fader_vbox->pack_start (gain_automation_state_button, false, false, 0);
// }
hbox.show_all ();
setup_meters ();
}
int
GainMeter::get_gm_width ()
{
//rework it
Gtk::Requisition sz;
int min_w = 0;
sz.width = 0;
meter_metric_area.size_request (sz);
min_w += sz.width;
level_meter->size_request (sz);
level_meter.size_request (sz);
min_w += sz.width;
fader_alignment.size_request (sz);
if (_width == Wide)
return max(sz.width * 2, min_w * 2) + 6;
else
return sz.width + min_w + 6;
}
gint
GainMeter::meter_metrics_expose (GdkEventExpose *ev)
{
if (!_route) {
if (_types.empty()) { _types.push_back(DataType::AUDIO); }
return meter_expose_metrics(ev, MeterPeak, _types, &meter_metric_area);
}
return meter_expose_metrics(ev, _route->meter_type(), _types, &meter_metric_area);
}
gint
GainMeter::meter_ticks1_expose (GdkEventExpose *ev)
{
if (!_route) {
if (_types.empty()) { _types.push_back(DataType::AUDIO); }
return meter_expose_ticks(ev, MeterPeak, _types, &meter_ticks1_area);
}
return meter_expose_ticks(ev, _route->meter_type(), _types, &meter_ticks1_area);
}
gint
GainMeter::meter_ticks2_expose (GdkEventExpose *ev)
{
if (!_route) {
if (_types.empty()) { _types.push_back(DataType::AUDIO); }
return meter_expose_ticks(ev, MeterPeak, _types, &meter_ticks2_area);
}
return meter_expose_ticks(ev, _route->meter_type(), _types, &meter_ticks2_area);
gain_slider.size_request (sz);
return sz.width + min_w + 6;
}
boost::shared_ptr<PBD::Controllable>
GainMeterBase::get_controllable()
GainMeter::get_controllable()
{
if (_amp) {
return _amp->gain_control();
@ -1076,7 +804,7 @@ GainMeterBase::get_controllable()
}
bool
GainMeterBase::level_meter_button_press (GdkEventButton* ev)
GainMeter::level_meter_button_press (GdkEventButton* ev)
{
return LevelMeterButtonPress (ev); /* EMIT SIGNAL */
}
@ -1094,40 +822,6 @@ GainMeter::meter_configuration_changed (ChanCount c)
}
}
if (_route
&& boost::dynamic_pointer_cast<AudioTrack>(_route) == 0
&& boost::dynamic_pointer_cast<MidiTrack>(_route) == 0
) {
if (_route->active()) {
set_meter_strip_name ("AudioBusMetrics");
} else {
set_meter_strip_name ("AudioBusMetricsInactive");
}
}
else if (
(type == (1 << DataType::MIDI))
|| (_route && boost::dynamic_pointer_cast<MidiTrack>(_route))
) {
if (!_route || _route->active()) {
set_meter_strip_name ("MidiTrackMetrics");
} else {
set_meter_strip_name ("MidiTrackMetricsInactive");
}
}
else if (type == (1 << DataType::AUDIO)) {
if (!_route || _route->active()) {
set_meter_strip_name ("AudioTrackMetrics");
} else {
set_meter_strip_name ("AudioTrackMetricsInactive");
}
} else {
if (!_route || _route->active()) {
set_meter_strip_name ("AudioMidiTrackMetrics");
} else {
set_meter_strip_name ("AudioMidiTrackMetricsInactive");
}
}
setup_meters();
meter_clear_pattern_cache(4);
}

View file

@ -44,6 +44,7 @@
#include "gtkmm2ext/focus_entry.h"
#include "gtkmm2ext/fader.h"
#include "waves_ui.h"
#include "enums.h"
#include "level_meter.h"
@ -64,11 +65,11 @@ namespace Gtk {
class Menu;
}
class GainMeterBase : virtual public sigc::trackable, ARDOUR::SessionHandlePtr
class GainMeter : virtual public sigc::trackable, ARDOUR::SessionHandlePtr, public Gtk::VBox, public WavesUI
{
public:
GainMeterBase (ARDOUR::Session*, bool horizontal, int, int);
virtual ~GainMeterBase ();
GainMeter (ARDOUR::Session*, const std::string& layout_script_file);
virtual ~GainMeter ();
virtual void set_controls (boost::shared_ptr<ARDOUR::Route> route,
boost::shared_ptr<ARDOUR::PeakMeter> meter,
@ -79,7 +80,6 @@ class GainMeterBase : virtual public sigc::trackable, ARDOUR::SessionHandlePtr
void effective_gain_display ();
void set_width (Width, int len=0);
void set_meter_strip_name (const char * name);
void set_fader_name (const char * name);
void set_flat_buttons ();
@ -89,14 +89,19 @@ class GainMeterBase : virtual public sigc::trackable, ARDOUR::SessionHandlePtr
boost::shared_ptr<PBD::Controllable> get_controllable();
LevelMeterHBox& get_level_meter() const { return *level_meter; }
Gtkmm2ext::Fader& get_gain_slider() const { return *gain_slider; }
LevelMeterHBox& get_level_meter() { return level_meter; }
Gtkmm2ext::Fader& get_gain_slider() { return gain_slider; }
/** Emitted in the GUI thread when a button is pressed over the level meter;
* return true if the event is handled.
*/
PBD::Signal1<bool, GdkEventButton *> LevelMeterButtonPress;
//
int get_gm_width ();
void route_active_changed ();
protected:
friend class MixerStrip;
@ -111,31 +116,20 @@ class GainMeterBase : virtual public sigc::trackable, ARDOUR::SessionHandlePtr
bool ignore_toggle;
bool next_release_selects;
Gtkmm2ext::Fader *gain_slider;
Gtk::Adjustment gain_adjustment;
Gtkmm2ext::FocusEntry gain_display;
Gtk::Button peak_display;
Gtk::DrawingArea meter_metric_area;
Gtk::DrawingArea meter_ticks1_area;
Gtk::DrawingArea meter_ticks2_area;
LevelMeterHBox *level_meter;
Gtkmm2ext::Fader& gain_slider;
Gtk::Adjustment& gain_adjustment;
Gtk::Box& gain_display_home;
Gtkmm2ext::FocusEntry gain_display_entry;
WavesButton& peak_display_button;
Gtk::Box& level_meter_home;
LevelMeterHBox level_meter;
sigc::connection gain_watching;
ArdourButton gain_automation_style_button;
ArdourButton gain_automation_state_button;
Gtk::Menu gain_astate_menu;
Gtk::Menu gain_astyle_menu;
gint gain_automation_style_button_event (GdkEventButton *);
gint gain_automation_state_button_event (GdkEventButton *);
gint pan_automation_style_button_event (GdkEventButton *);
gint pan_automation_state_button_event (GdkEventButton *);
void gain_automation_state_changed();
void gain_automation_style_changed();
void setup_gain_adjustment ();
std::string astate_string (ARDOUR::AutoState);
@ -196,42 +190,11 @@ private:
bool level_meter_button_press (GdkEventButton *);
PBD::ScopedConnection _level_meter_connection;
};
class GainMeter : public GainMeterBase, public Gtk::VBox
{
public:
GainMeter (ARDOUR::Session*, int);
virtual ~GainMeter ();
virtual void set_controls (boost::shared_ptr<ARDOUR::Route> route,
boost::shared_ptr<ARDOUR::PeakMeter> meter,
boost::shared_ptr<ARDOUR::Amp> amp);
int get_gm_width ();
void setup_meters (int len=0);
void set_type (ARDOUR::MeterType);
void route_active_changed ();
protected:
void hide_all_meters ();
gint meter_metrics_expose (GdkEventExpose *);
gint meter_ticks1_expose (GdkEventExpose *);
gint meter_ticks2_expose (GdkEventExpose *);
private:
//
void meter_configuration_changed (ARDOUR::ChanCount);
void meter_type_changed (ARDOUR::MeterType);
Gtk::HBox gain_display_box;
Gtk::HBox fader_box;
Gtk::VBox* fader_vbox;
Gtk::HBox hbox;
Gtk::HBox meter_hbox;
Gtk::Alignment fader_alignment;
Gtk::Alignment meter_alignment;
std::vector<ARDOUR::DataType> _types;
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View file

@ -188,11 +188,11 @@ LevelMeterBase::parameter_changed (string p)
}
else if (p == "meter-line-up-level") {
color_changed = true;
setup_meters (meter_length, regular_meter_width, thin_meter_width);
_setup_meters ();
}
else if (p == "meter-style-led") {
color_changed = true;
setup_meters (meter_length, regular_meter_width, thin_meter_width);
_setup_meters ();
}
else if (p == "meter-peak") {
vector<MeterInfo>::iterator i;
@ -208,7 +208,7 @@ void
LevelMeterBase::configuration_changed (ChanCount /*in*/, ChanCount /*out*/)
{
color_changed = true;
setup_meters (meter_length, regular_meter_width, thin_meter_width);
_setup_meters ();
}
void
@ -216,7 +216,7 @@ LevelMeterBase::meter_type_changed (MeterType t)
{
meter_type = t;
color_changed = true;
setup_meters (meter_length, regular_meter_width, thin_meter_width);
_setup_meters ();
MeterTypeChanged(t);
}
@ -232,7 +232,7 @@ LevelMeterBase::hide_all_meters ()
}
void
LevelMeterBase::setup_meters (int len, int initial_width, int thin_width)
LevelMeterBase::_setup_meters ()
{
hide_all_meters ();
@ -242,9 +242,6 @@ LevelMeterBase::setup_meters (int len, int initial_width, int thin_width)
int32_t nmidi = _meter->input_streams().n_midi();
uint32_t nmeters = _meter->input_streams().n_total();
regular_meter_width = initial_width;
thin_meter_width = thin_width;
meter_length = len;
guint16 width;
@ -262,7 +259,7 @@ LevelMeterBase::setup_meters (int len, int initial_width, int thin_width)
meters.push_back (MeterInfo());
}
//cerr << "LevelMeterBase::setup_meters() called color_changed = " << color_changed << " colors: " << endl;//DEBUG
//cerr << "LevelMeterBase::_setup_meters() called color_changed = " << color_changed << " colors: " << endl;//DEBUG
for (int32_t n = nmeters-1; nmeters && n >= 0 ; --n) {
uint32_t c[10];
@ -394,20 +391,22 @@ LevelMeterBase::setup_meters (int len, int initial_width, int thin_width)
}
}
}
if (meters[n].width != width || meters[n].length != len || color_changed || meter_type != visible_meter_type) {
if (meters[n].width != width || meters[n].length != meter_length || color_changed || meter_type != visible_meter_type) {
bool hl = meters[n].meter ? meters[n].meter->get_highlight() : false;
meters[n].packed = false;
delete meters[n].meter;
meters[n].meter = new FastMeter ((uint32_t) floor (Config->get_meter_hold()), width, _meter_orientation, len,
std::cout << "\n\n\n b[0]=" << std::hex << b[0] << std::dec;
meters[n].meter = new FastMeter ((uint32_t) floor (Config->get_meter_hold()), width, _meter_orientation, meter_length,
c[0], c[1], c[2], c[3], c[4],
c[5], c[6], c[7], c[8], c[9],
b[0], b[1], b[2], b[3],
stp[0], stp[1], stp[2], stp[3],
styleflags
);
meters[n].meter->set_highlight(hl);
meters[n].width = width;
meters[n].length = len;
meters[n].length = meter_length;
meters[n].meter->add_events (Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK);
meters[n].meter->signal_button_press_event().connect (sigc::mem_fun (*this, &LevelMeterBase::meter_button_press));
meters[n].meter->signal_button_release_event().connect (sigc::mem_fun (*this, &LevelMeterBase::meter_button_release));
@ -468,7 +467,7 @@ void
LevelMeterBase::color_handler ()
{
color_changed = true;
setup_meters (meter_length, regular_meter_width, thin_meter_width);
_setup_meters ();
}
LevelMeterHBox::LevelMeterHBox(Session* s)
@ -478,9 +477,19 @@ LevelMeterHBox::LevelMeterHBox(Session* s)
show();
}
LevelMeterHBox::~LevelMeterHBox() {}
void
LevelMeterHBox::setup_meters (int width /* =3 */, int thin /* = 2 */)
{
Gtk::Requisition sz;
size_request (sz);
meter_length = sz.height;
regular_meter_width = width;
thin_meter_width = thin;
_setup_meters ();
}
void
LevelMeterHBox::mtr_pack(Gtk::Widget &w) {
pack_end (w, false, false);
@ -500,6 +509,17 @@ LevelMeterVBox::LevelMeterVBox(Session* s)
}
LevelMeterVBox::~LevelMeterVBox() {}
void
LevelMeterVBox::setup_meters (int width /* =3 */, int thin /* = 2 */)
{
Gtk::Requisition sz;
size_request (sz);
meter_length = sz.width;
regular_meter_width = width;
thin_meter_width = thin;
_setup_meters ();
}
void
LevelMeterVBox::mtr_pack(Gtk::Widget &w) {
pack_end (w, false, false);

View file

@ -64,7 +64,7 @@ class LevelMeterBase : public ARDOUR::SessionHandlePtr
void update_meters_falloff ();
void clear_meters (bool reset_highlight = true);
void hide_meters ();
void setup_meters (int len=0, int width=3, int thin=2);
virtual void setup_meters (int width=3, int thin=2) = 0;
void set_type (ARDOUR::MeterType);
ARDOUR::MeterType get_type () { return meter_type; }
@ -74,9 +74,14 @@ class LevelMeterBase : public ARDOUR::SessionHandlePtr
PBD::Signal1<bool, GdkEventButton *> ButtonRelease;
PBD::Signal1<void, ARDOUR::MeterType> MeterTypeChanged;
protected:
protected:
virtual void mtr_pack(Gtk::Widget &w) = 0;
virtual void mtr_remove(Gtk::Widget &w) = 0;
void _setup_meters ();
guint16 regular_meter_width;
int meter_length;
guint16 thin_meter_width;
private:
PBD::EventLoop::InvalidationRecord* parent_invalidator;
@ -101,9 +106,6 @@ class LevelMeterBase : public ARDOUR::SessionHandlePtr
}
};
guint16 regular_meter_width;
int meter_length;
guint16 thin_meter_width;
std::vector<MeterInfo> meters;
float max_peak;
ARDOUR::MeterType meter_type;
@ -132,8 +134,9 @@ class LevelMeterHBox : public LevelMeterBase, public Gtk::HBox
public:
LevelMeterHBox (ARDOUR::Session*);
~LevelMeterHBox();
virtual void setup_meters (int width=3, int thin=2);
protected:
protected:
void mtr_pack(Gtk::Widget &w);
void mtr_remove(Gtk::Widget &w);
};
@ -143,6 +146,7 @@ class LevelMeterVBox : public LevelMeterBase, public Gtk::VBox
public:
LevelMeterVBox (ARDOUR::Session*);
~LevelMeterVBox();
virtual void setup_meters (int width=3, int thin=2);
protected:
void mtr_pack(Gtk::Widget &w);

View file

@ -138,7 +138,7 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
level_meter->set_meter (_route->shared_peak_meter().get());
level_meter->clear_meters();
level_meter->set_type (_route->meter_type());
level_meter->setup_meters (220, meter_width, 6);
level_meter->setup_meters (meter_width, 6);
level_meter->ButtonRelease.connect_same_thread (level_meter_connection, boost::bind (&MeterStrip::level_meter_button_release, this, _1));
level_meter->MeterTypeChanged.connect_same_thread (level_meter_connection, boost::bind (&MeterStrip::meter_type_changed, this, _1));
@ -393,7 +393,7 @@ MeterStrip::on_theme_changed()
if (_route->shared_peak_meter()->input_streams().n_total() == 1) {
meter_width = 12;
}
level_meter->setup_meters (220, meter_width, 6);
level_meter->setup_meters (meter_width, 6);
}
}

View file

@ -85,7 +85,7 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session* sess, bool in_mixer)
, _mixer(mx)
, _mixer_owned (in_mixer)
, processor_box (sess, boost::bind (&MixerStrip::plugin_selector, this), mx.selection(), this, in_mixer)
, gpm (sess, 250)
, gpm (sess, "inspector_gain_meter.xml")
, panners (sess)
, button_size_group (Gtk::SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL))
, button_table (1, 1)
@ -94,7 +94,6 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session* sess, bool in_mixer)
, middle_button_table (4, 1)
, bottom_button_table (1, 2)
, auto_n_io_table(7,1)
, meter_point_button (_("pre"))
, midi_input_enable_button (0)
, _comment_button (_("Comments"))
, _visibility (X_("mixer-strip-visibility"))
@ -116,14 +115,13 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session* sess, boost::shared_ptr<Route> rt
, _mixer(mx)
, _mixer_owned (in_mixer)
, processor_box (sess, boost::bind (&MixerStrip::plugin_selector, this), mx.selection(), this, in_mixer)
, gpm (sess, 250)
, gpm (sess, "inspector_gain_meter.xml")
, panners (sess)
, button_size_group (Gtk::SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL))
, button_table (1, 1)
, middle_button_table (4, 1)
, bottom_button_table (1, 2)
, auto_n_io_table(7,1)
, meter_point_button (_("pre"))
, midi_input_enable_button (0)
, _comment_button (_("Comments"))
, _visibility (X_("mixer-strip-visibility"))
@ -154,33 +152,6 @@ MixerStrip::init ()
t += string_compose (_("\n%1-%2-click to toggle the width of all strips."), Keyboard::primary_modifier_name(), Keyboard::tertiary_modifier_name ());
}
input_button.set_text (_("Input"));
input_button.set_name ("mixer strip button");
input_button.set_size_request (-1, 20);
input_button_box.pack_start (input_button, true, true);
output_button.set_text (_("Output"));
output_button.set_name ("mixer strip button");
Gtkmm2ext::set_size_request_to_display_given_text (output_button, longest_label.c_str(), 4, 4);
automation_label.set_name("meterbridge label");
automation_label.set_text(_("AUTOMATION"));
io_label.set_name("meterbridge label");
io_label.set_text(_("I/O"));
ARDOUR_UI::instance()->set_tip (&meter_point_button, _("Click to select metering point"), "");
meter_point_button.set_name ("mixer strip button");
/* TRANSLATORS: this string should be longest of the strings
used to describe meter points. In english, it's "input".
*/
set_size_request_to_display_given_text (meter_point_button, _("tupni"), 5, 5);
middle_button_table.attach (meter_point_button, 0, 1, 0, 1);
meter_point_button.signal_button_press_event().connect (sigc::mem_fun (gpm, &GainMeter::meter_press), false);
meter_point_button.signal_button_release_event().connect (sigc::mem_fun (gpm, &GainMeter::meter_release), false);
top_button_table.set_homogeneous (true);
top_button_table.set_spacings (2);
top_button_table.attach (*monitor_input_button, 1, 2, 0, 1);// 0, 1, 0, 1);
@ -199,10 +170,6 @@ MixerStrip::init ()
name_button.add_elements ( ArdourButton::Inset );
top_button_table.attach (name_button, 0, 2, 2, 3);
auto_n_io_table.attach (automation_label, 0, 1, 0, 1);
automation_label.show();
auto_n_io_table.attach (io_label, 0, 1, 3, 4);
io_label.show();
auto_n_io_table.attach (input_button_box, 0, 1, 4, 5);
@ -212,7 +179,6 @@ MixerStrip::init ()
auto_n_io_table.set_spacings (2);
auto_n_io_table.set_homogeneous (true);
auto_n_io_table.attach (gpm.gain_automation_state_button, 0, 1, 1, 2);
name_button.set_name ("mixer strip button");
name_button.set_text (" "); /* non empty text, forces creation of the layout */
@ -253,7 +219,6 @@ MixerStrip::init ()
global_vpacker.pack_start (middle_button_table, Gtk::PACK_SHRINK);
global_vpacker.pack_start (top_button_table, Gtk::PACK_SHRINK);
global_vpacker.pack_start (bottom_button_table, Gtk::PACK_SHRINK);
auto_n_io_table.attach (output_button, 0, 1, 5, 6);
global_vpacker.pack_start (_comment_button, Gtk::PACK_SHRINK);
global_frame.add (global_vpacker);
@ -273,9 +238,6 @@ MixerStrip::init ()
_session->engine().Stopped.connect (*this, invalidator (*this), boost::bind (&MixerStrip::engine_stopped, this), gui_context());
_session->engine().Running.connect (*this, invalidator (*this), boost::bind (&MixerStrip::engine_running, this), gui_context());
input_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::input_press), false);
output_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::output_press), false);
/* ditto for this button and busses */
name_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::name_button_button_press), false);
@ -318,7 +280,6 @@ MixerStrip::init ()
//_visibility.add (solo_isolated_led, X_("SoloIsolated"), _("Solo Isolated"), true, boost::bind (&MixerStrip::override_solo_visibility, this));
_visibility.add (&_comment_button, X_("Comments"), _("Comments"));
_visibility.add (&group_button, X_("Group"), _("Group"));
_visibility.add (&meter_point_button, X_("MeterPoint"), _("Meter Point"));
parameter_changed (X_("mixer-strip-visibility"));
@ -371,18 +332,18 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
table
*/
if (gpm.peak_display.get_parent()) {
gpm.peak_display.get_parent()->remove (gpm.peak_display);
if (gpm.peak_display_button.get_parent()) {
gpm.peak_display_button.get_parent()->remove (gpm.peak_display_button);
}
if (gpm.gain_display.get_parent()) {
gpm.gain_display.get_parent()->remove (gpm.gain_display);
if (gpm.gain_display_entry.get_parent()) {
gpm.gain_display_entry.get_parent()->remove (gpm.gain_display_entry);
}
gpm.set_type (rt->meter_type());
middle_button_table.attach (gpm.peak_display,0,1,1,2, EXPAND|FILL, EXPAND);
middle_button_table.attach (gpm.peak_display_button,0,1,1,2, EXPAND|FILL, EXPAND);
middle_button_table.attach (gpm,0,1,2,3);
middle_button_table.attach (gpm.gain_display,0,1,3,4);
middle_button_table.attach (gpm.gain_display_entry,0,1,3,4);
if (solo_button->get_parent()) {
top_button_table.remove (*solo_button);
@ -471,8 +432,6 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
}
}
meter_point_button.set_text (meter_point_string (_route->meter_point()));
delete route_ops_menu;
route_ops_menu = 0;
@ -528,8 +487,8 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
}
gpm.reset_peak_display ();
gpm.gain_display.show ();
gpm.peak_display.show ();
gpm.gain_display_entry.show ();
gpm.peak_display_button.show ();
//width_button.show();
width_hide_box.show();
@ -541,13 +500,10 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
auto_n_io_table.show();
bottom_button_table.show();
gpm.show_all ();
meter_point_button.show();
input_button_box.show_all();
output_button.show();
name_button.show();
_comment_button.show();
group_button.show();
gpm.gain_automation_state_button.show();
parameter_changed ("mixer-strip-visibility");
@ -593,11 +549,6 @@ MixerStrip::set_width_enum (Width w, void* owner)
show_sends_button->layout()->set_alignment (Pango::ALIGN_CENTER);
}
gpm.gain_automation_style_button.set_text (
gpm.astyle_string(gain_automation->automation_style()));
gpm.gain_automation_state_button.set_text (
gpm.astate_string(gain_automation->automation_state()));
if (_route->panner()) {
((Gtk::Label*)panners.pan_automation_style_button.get_child())->set_text (
panners.astyle_string(_route->panner()->automation_style()));
@ -616,10 +567,6 @@ MixerStrip::set_width_enum (Width w, void* owner)
show_sends_button->set_text (_("Snd"));
}
gpm.gain_automation_style_button.set_text (
gpm.short_astyle_string(gain_automation->automation_style()));
gpm.gain_automation_state_button.set_text (
gpm.short_astate_string(gain_automation->automation_state()));
gain_meter().setup_meters (); // recalc meter width
if (_route->panner()) {
@ -1165,12 +1112,6 @@ MixerStrip::update_io_button (boost::shared_ptr<ARDOUR::Route> route, Width widt
tooltip_cstr = new char[tooltip.str().size() + 1];
strcpy(tooltip_cstr, tooltip.str().c_str());
if (for_input) {
ARDOUR_UI::instance()->set_tip (&input_button, tooltip_cstr, "");
} else {
ARDOUR_UI::instance()->set_tip (&output_button, tooltip_cstr, "");
}
if (each_io_has_one_connection) {
if (total_connection_count == ardour_connection_count) {
// all connections are to the same track in ardour
@ -1212,12 +1153,6 @@ MixerStrip::update_io_button (boost::shared_ptr<ARDOUR::Route> route, Width widt
label_string = label.str().substr(0, 3);
break;
}
if (for_input) {
input_button.set_text (label_string);
} else {
output_button.set_text (label_string);
}
}
void
@ -1767,7 +1702,6 @@ MixerStrip::meter_point_string (MeterPoint mp)
void
MixerStrip::meter_changed ()
{
meter_point_button.set_text (meter_point_string (_route->meter_point()));
gpm.setup_meters ();
// reset peak when meter point changes
gpm.reset_peak_display();
@ -1804,11 +1738,8 @@ MixerStrip::drop_send ()
}
send_gone_connection.disconnect ();
input_button.set_sensitive (true);
output_button.set_sensitive (true);
group_button.set_sensitive (true);
set_invert_sensitive (true);
meter_point_button.set_sensitive (true);
mute_button->set_sensitive (true);
solo_button->set_sensitive (true);
rec_enable_button->set_sensitive (true);
@ -1850,10 +1781,8 @@ MixerStrip::show_send (boost::shared_ptr<Send> send)
panner_ui().setup_pan ();
panner_ui().show_all ();
input_button.set_sensitive (false);
group_button.set_sensitive (false);
set_invert_sensitive (false);
meter_point_button.set_sensitive (false);
mute_button->set_sensitive (false);
solo_button->set_sensitive (false);
rec_enable_button->set_sensitive (false);
@ -1863,10 +1792,6 @@ MixerStrip::show_send (boost::shared_ptr<Send> send)
//monitor_disk_button->set_sensitive (false);
_comment_button.set_sensitive (false);
if (boost::dynamic_pointer_cast<InternalSend>(send)) {
output_button.set_sensitive (false);
}
reset_strip_style ();
}
@ -1952,12 +1877,6 @@ MixerStrip::set_button_names ()
//solo_safe_led->set_text (_("L"));
break;
}
if (_route) {
meter_point_button.set_text (meter_point_string (_route->meter_point()));
} else {
meter_point_button.set_text ("");
}
}
PluginSelector*

View file

@ -175,16 +175,8 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
Gtk::Table bottom_button_table;
Gtk::Table auto_n_io_table;
Gtk::Label automation_label;
Gtk::Label io_label;
ArdourButton meter_point_button;
void meter_changed ();
ArdourButton input_button;
ArdourButton output_button;
ArdourButton* midi_input_enable_button;
Gtk::HBox input_button_box;

View file

@ -37,7 +37,7 @@ using namespace PBD;
ReturnUI::ReturnUI (Gtk::Window* parent, boost::shared_ptr<Return> r, Session* session)
:_return (r)
, _gpm (session, 250)
, _gpm (session, "inspector_gain_meter.xml")
{
_gpm.set_controls (boost::shared_ptr<Route>(), r->meter(), r->amp());

View file

@ -104,7 +104,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, ArdourCan
, playlist_action_menu (0)
, mode_menu (0)
, color_mode_menu (0)
, gm (sess, true, 125, 18)
, gm (sess, "inspector_gain_meter.xml")
, _ignore_set_layer_display (false)
{
}
@ -124,7 +124,7 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt)
}
gm.set_controls (_route, _route->shared_peak_meter(), _route->amp());
gm.get_level_meter().set_no_show_all();
gm.get_level_meter().setup_meters(50, meter_width);
gm.get_level_meter().setup_meters(meter_width);
gm.update_gain_sensitive ();
string str = gui_property ("height");
@ -846,7 +846,7 @@ RouteTimeAxisView::set_height (uint32_t h)
if (_route && _route->shared_peak_meter()->input_streams().n_total() == 1) {
meter_width = 6;
}
gm.get_level_meter().setup_meters (gmlen, meter_width);
gm.get_level_meter().setup_meters (meter_width);
TimeAxisView::set_height (h);
@ -2239,7 +2239,7 @@ RouteTimeAxisView::reset_meter ()
if (_route && _route->shared_peak_meter()->input_streams().n_total() == 1) {
meter_width = 6;
}
gm.get_level_meter().setup_meters (height - 9, meter_width);
gm.get_level_meter().setup_meters (meter_width);
} else {
hide_meter ();
}

View file

@ -287,7 +287,7 @@ protected:
void post_construct ();
GainMeterBase gm;
GainMeter gm;
XMLNode* underlay_xml_node;
bool set_underlay_state();

View file

@ -38,7 +38,7 @@ using namespace PBD;
SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session* session)
: _send (s)
, _gpm (session, 250)
, _gpm (session, "inspector_gain_meter.xml")
, _panners (session)
{
assert (_send);

View file

@ -823,7 +823,7 @@ SoundFileBrowser::add_gain_meter ()
{
delete gm;
gm = new GainMeter (_session, 250);
gm = new GainMeter (_session, "inspector_gain_meter.xml");
boost::shared_ptr<Route> r = _session->the_auditioner ();

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<GainSlider>
<Button id="peak_display_button"
width="96" height="20" />
<Layout bgnormal="#383838" width="96"
height="220">
<Adjustment id="gain_adjustment"
minvalue="0"
maxvalue="1"/>
<VBox id="level_meter_home"
x="0"
y="18"
width="42"
height="187"/>
<Fader id="gain_slider"
adjustment="gain_adjustment"
facesource="slider_controller_fader.png"
handlesource="slider_controller_fader_handle.png"
activehandlesource="slider_controller_fader_handle.png"
minposx="10"
minposy="187"
maxposx="10"
maxposy="0"
x="44"
y="18"/>
<icon source="inspector_background.png" x="60"/>
</Layout>
<VBox id="gain_display_home"/>
</GainSlider>

View file

@ -21,8 +21,11 @@
#include <vector>
#include <string>
#include <list>
#include <stack>
#include <stdint.h>
#include <boost/shared_ptr.hpp>
#include <gtk/gtkaccelmap.h>
#include <gtk/gtkuimanager.h>
#include <gtk/gtkactiongroup.h>
@ -232,6 +235,81 @@ ActionManager::get_all_actions (vector<string>& names, vector<string>& paths, ve
}
}
struct ActionState {
GtkAction* action;
bool sensitive;
ActionState (GtkAction* a, bool s) : action (a), sensitive (s) {}
};
typedef std::vector<ActionState> ActionStates;
static std::stack<boost::shared_ptr<ActionStates> > state_stack;
static boost::shared_ptr<ActionStates>
get_action_state ()
{
boost::shared_ptr<ActionStates> state = boost::shared_ptr<ActionStates>(new ActionStates);
/* the C++ API for functions used here appears to be broken in
gtkmm2.6, so we fall back to the C level.
*/
GList* list = gtk_ui_manager_get_action_groups (ActionManager::ui_manager->gobj());
GList* node;
GList* acts;
for (node = list; node; node = g_list_next (node)) {
GtkActionGroup* group = (GtkActionGroup*) node->data;
/* first pass: collect them all */
typedef std::list<Glib::RefPtr<Gtk::Action> > action_list;
action_list the_acts;
for (acts = gtk_action_group_list_actions (group); acts; acts = g_list_next (acts)) {
GtkAction* action = (GtkAction*) acts->data;
state->push_back (ActionState (action, gtk_action_get_sensitive (action)));
}
}
return state;
}
void
ActionManager::push_action_state ()
{
state_stack.push (get_action_state());
}
void
ActionManager::pop_action_state ()
{
if (state_stack.empty()) {
warning << string_compose (_("programming error: %1"), X_("ActionManager::pop_action_state called with empty stack")) << endmsg;
return;
}
boost::shared_ptr<ActionStates> as = state_stack.top ();
state_stack.pop ();
for (ActionStates::iterator i = as->begin(); i != as->end(); ++i) {
gtk_action_set_sensitive ((*i).action, (*i).sensitive);
}
}
void
ActionManager::disable_all_actions ()
{
push_action_state ();
boost::shared_ptr<ActionStates> as = state_stack.top ();
for (ActionStates::iterator i = as->begin(); i != as->end(); ++i) {
gtk_action_set_sensitive ((*i).action, false);
}
}
void
ActionManager::add_action_group (RefPtr<ActionGroup> grp)
{

View file

@ -101,8 +101,8 @@ FastMeter::FastMeter (long hold, unsigned long dimen, Orientation o, int len,
set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
pixrect.x = 1;
pixrect.y = 1;
pixrect.x = 0;
pixrect.y = 0;
if (!len) {
len = 250;
@ -110,21 +110,21 @@ FastMeter::FastMeter (long hold, unsigned long dimen, Orientation o, int len,
if (orientation == Vertical) {
pixheight = len;
pixwidth = dimen;
fgpattern = request_vertical_meter(pixwidth + 2, pixheight + 2, _clr, _stp, _styleflags);
bgpattern = request_vertical_background (pixwidth + 2, pixheight + 2, _bgc, false);
fgpattern = request_vertical_meter(pixwidth, pixheight, _clr, _stp, _styleflags);
bgpattern = request_vertical_background (pixwidth, pixheight, _bgc, false);
} else {
pixheight = dimen;
pixwidth = len;
fgpattern = request_horizontal_meter(pixwidth + 2, pixheight + 2, _clr, _stp, _styleflags);
bgpattern = request_horizontal_background (pixwidth + 2, pixheight + 2, _bgc, false);
fgpattern = request_horizontal_meter(pixwidth, pixheight, _clr, _stp, _styleflags);
bgpattern = request_horizontal_background (pixwidth, pixheight, _bgc, false);
}
pixrect.width = pixwidth;
pixrect.height = pixheight;
request_width = pixrect.width + 2;
request_height= pixrect.height + 2;
request_width = pixrect.width;
request_height= pixrect.height;
clear ();
}
@ -500,8 +500,8 @@ FastMeter::vertical_size_allocate (Gtk::Allocation &alloc)
if (pixheight != h) {
fgpattern = request_vertical_meter (request_width, h, _clr, _stp, _styleflags);
bgpattern = request_vertical_background (request_width, h, highlight ? _bgh : _bgc, highlight);
pixheight = h - 2;
pixwidth = request_width - 2;
pixheight = h;
pixwidth = request_width;
}
DrawingArea::on_size_allocate (alloc);
@ -525,8 +525,8 @@ FastMeter::horizontal_size_allocate (Gtk::Allocation &alloc)
if (pixwidth != w) {
fgpattern = request_horizontal_meter (w, request_height, _clr, _stp, _styleflags);
bgpattern = request_horizontal_background (w, request_height, highlight ? _bgh : _bgc, highlight);
pixwidth = w - 2;
pixheight = request_height - 2;
pixwidth = w;
pixheight = request_height;
}
DrawingArea::on_size_allocate (alloc);
@ -555,9 +555,9 @@ FastMeter::vertical_expose (GdkEventExpose* ev)
cairo_rectangle (cr, ev->area.x, ev->area.y, ev->area.width, ev->area.height);
cairo_clip (cr);
cairo_set_source_rgb (cr, 0, 0, 0); // black
rounded_rectangle (cr, 0, 0, pixwidth + 2, pixheight + 2, 2);
cairo_stroke (cr);
//cairo_set_source_rgb (cr, 0, 0, 0); // black
//rounded_rectangle (cr, 0, 0, pixwidth + 2, pixheight + 2, 2);
//cairo_stroke (cr);
top_of_meter = (gint) floor (pixheight * current_level);
@ -565,22 +565,23 @@ FastMeter::vertical_expose (GdkEventExpose* ev)
*/
pixrect.height = top_of_meter;
pixrect.y = 1 + pixheight - top_of_meter;
pixrect.y = pixheight - top_of_meter;
background.x = 1;
background.y = 1;
background.x = 0;
background.y = 0;
background.width = pixrect.width;
background.height = pixheight - top_of_meter;
/*
if (gdk_rectangle_intersect (&background, &ev->area, &intersection)) {
cairo_set_source (cr, bgpattern->cobj());
cairo_rectangle (cr, intersection.x, intersection.y, intersection.width, intersection.height);
cairo_fill (cr);
}
*/
if (gdk_rectangle_intersect (&pixrect, &ev->area, &intersection)) {
// draw the part of the meter image that we need. the area we draw is bounded "in reverse" (top->bottom)
cairo_set_source (cr, fgpattern->cobj());
//cairo_set_source (cr, fgpattern->cobj());
cairo_set_source_rgba (cr, 0.69, 0.69, 0.69, 1);
cairo_rectangle (cr, intersection.x, intersection.y, intersection.width, intersection.height);
cairo_fill (cr);
}
@ -588,13 +589,13 @@ FastMeter::vertical_expose (GdkEventExpose* ev)
// draw peak bar
if (hold_state) {
last_peak_rect.x = 1;
last_peak_rect.x = 0;
last_peak_rect.width = pixwidth;
last_peak_rect.y = max(1, 1 + pixheight - (gint) floor (pixheight * current_peak));
last_peak_rect.y = max(0, pixheight - (gint) floor (pixheight * current_peak));
if (bright_hold || (_styleflags & 2)) {
last_peak_rect.height = max(0, min(3, pixheight - last_peak_rect.y - 1 ));
last_peak_rect.height = max(0, min(3, pixheight - last_peak_rect.y ));
} else {
last_peak_rect.height = max(0, min(2, pixheight - last_peak_rect.y - 1 ));
last_peak_rect.height = max(0, min(2, pixheight - last_peak_rect.y ));
}
cairo_set_source (cr, fgpattern->cobj());
@ -629,9 +630,9 @@ FastMeter::horizontal_expose (GdkEventExpose* ev)
cairo_rectangle (cr, ev->area.x, ev->area.y, ev->area.width, ev->area.height);
cairo_clip (cr);
cairo_set_source_rgb (cr, 0, 0, 0); // black
rounded_rectangle (cr, 0, 0, pixwidth + 2, pixheight + 2, 2);
cairo_stroke (cr);
//cairo_set_source_rgb (cr, 0, 0, 0); // black
//rounded_rectangle (cr, 0, 0, pixwidth + 2, pixheight + 2, 2);
//cairo_stroke (cr);
right_of_meter = (gint) floor (pixwidth * current_level);
@ -742,10 +743,10 @@ FastMeter::queue_vertical_redraw (const Glib::RefPtr<Gdk::Window>& win, float ol
gint new_top = (gint) floor (pixheight * current_level);
rect.x = 1;
rect.x = 0;
rect.width = pixwidth;
rect.height = new_top;
rect.y = 1 + pixheight - new_top;
rect.y = pixheight - new_top;
if (current_level > old_level) {
/* colored/pixbuf got larger, just draw the new section */

View file

@ -91,6 +91,11 @@ namespace ActionManager {
LIBGTKMM2EXT_API extern void check_toggleaction (std::string);
LIBGTKMM2EXT_API extern void uncheck_toggleaction (std::string);
LIBGTKMM2EXT_API extern void set_toggleaction_state (std::string, bool);
LIBGTKMM2EXT_API extern void push_action_state ();
LIBGTKMM2EXT_API extern void pop_action_state ();
LIBGTKMM2EXT_API extern void disable_all_actions ();
};
#endif /* __libgtkmm2ext_actions_h__ */