mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 00:34:59 +01:00
Allow to switch master-meter type in the toolbar-meter
This commit is contained in:
parent
d0286d3df1
commit
a1a2e088a5
3 changed files with 57 additions and 1 deletions
|
|
@ -152,6 +152,7 @@ typedef uint64_t microseconds_t;
|
|||
#include "missing_plugin_dialog.h"
|
||||
#include "mixer_ui.h"
|
||||
#include "meterbridge.h"
|
||||
#include "meter_patterns.h"
|
||||
#include "mouse_cursors.h"
|
||||
#include "nsm.h"
|
||||
#include "opts.h"
|
||||
|
|
@ -291,6 +292,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
|
|||
, error_alert_button ( ArdourButton::just_led_default_elements )
|
||||
, editor_meter(0)
|
||||
, editor_meter_peak_display()
|
||||
, _suspend_editor_meter_callbacks (false)
|
||||
, _numpad_locate_happening (false)
|
||||
, _session_is_new (false)
|
||||
, last_key_press_time (0)
|
||||
|
|
@ -5294,6 +5296,52 @@ ARDOUR_UI::session_format_mismatch (std::string xml_path, std::string backup_pat
|
|||
msg.run ();
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::add_editor_meter_type_item (Menu_Helpers::MenuList& items, RadioMenuItem::Group& group, string const & name, MeterType type)
|
||||
{
|
||||
using namespace Menu_Helpers;
|
||||
|
||||
items.push_back (RadioMenuElem (group, name, sigc::bind (sigc::mem_fun (editor_meter, &LevelMeterHBox::set_meter_type), type)));
|
||||
RadioMenuItem* i = dynamic_cast<RadioMenuItem *> (&items.back ());
|
||||
i->set_active (editor_meter->meter_type () == type);
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::popup_editor_meter_menu (GdkEventButton* ev)
|
||||
{
|
||||
using namespace Gtk::Menu_Helpers;
|
||||
|
||||
Gtk::Menu* m = manage (new Menu);
|
||||
MenuList& items = m->items ();
|
||||
|
||||
RadioMenuItem::Group group;
|
||||
|
||||
_suspend_editor_meter_callbacks = true;
|
||||
add_editor_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterPeak), MeterPeak);
|
||||
add_editor_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterPeak0dB), MeterPeak0dB);
|
||||
add_editor_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterKrms), MeterKrms);
|
||||
add_editor_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterIEC1DIN), MeterIEC1DIN);
|
||||
add_editor_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterIEC1NOR), MeterIEC1NOR);
|
||||
add_editor_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterIEC2BBC), MeterIEC2BBC);
|
||||
add_editor_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterIEC2EBU), MeterIEC2EBU);
|
||||
add_editor_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterK20), MeterK20);
|
||||
add_editor_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterK14), MeterK14);
|
||||
add_editor_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterK12), MeterK12);
|
||||
add_editor_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterVU), MeterVU);
|
||||
|
||||
m->popup (ev->button, ev->time);
|
||||
_suspend_editor_meter_callbacks = false;
|
||||
}
|
||||
|
||||
bool
|
||||
ARDOUR_UI::editor_meter_button_press (GdkEventButton* ev)
|
||||
{
|
||||
if (ev->button == 3 && editor_meter) {
|
||||
popup_editor_meter_menu (ev);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::reset_peak_display ()
|
||||
|
|
|
|||
|
|
@ -565,6 +565,11 @@ private:
|
|||
ArdourButton editor_meter_peak_display;
|
||||
bool editor_meter_peak_button_release (GdkEventButton*);
|
||||
|
||||
bool editor_meter_button_press (GdkEventButton* ev);
|
||||
void popup_editor_meter_menu (GdkEventButton* ev);
|
||||
void add_editor_meter_type_item (Gtk::Menu_Helpers::MenuList&, Gtk::RadioMenuItem::Group&, std::string const &, ARDOUR::MeterType);
|
||||
bool _suspend_editor_meter_callbacks;
|
||||
|
||||
void blink_handler (bool);
|
||||
sigc::connection blink_connection;
|
||||
|
||||
|
|
@ -835,6 +840,7 @@ private:
|
|||
|
||||
PBD::ScopedConnectionList forever_connections;
|
||||
PBD::ScopedConnection halt_connection;
|
||||
PBD::ScopedConnection editor_meter_connection;
|
||||
|
||||
void step_edit_status_change (bool);
|
||||
|
||||
|
|
|
|||
|
|
@ -224,10 +224,12 @@ ARDOUR_UI::set_session (Session *s)
|
|||
editor_meter = new LevelMeterHBox(_session);
|
||||
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->set_meter_type (_session->master_out()->meter_type());
|
||||
editor_meter->setup_meters (30, 10, 6);
|
||||
editor_meter->show();
|
||||
meter_box.pack_start(*editor_meter);
|
||||
|
||||
editor_meter->ButtonPress.connect_same_thread (editor_meter_connection, boost::bind (&ARDOUR_UI::editor_meter_button_press, this, _1));
|
||||
}
|
||||
|
||||
ArdourMeter::ResetAllPeakDisplays.connect (sigc::mem_fun(*this, &ARDOUR_UI::reset_peak_display));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue