[Summary] Implementing TRACK Header and INSPECTOR UI

This commit is contained in:
VKamyshniy 2014-07-08 12:12:12 +03:00
parent 1e2dd01172
commit 9958f084e5
9 changed files with 44 additions and 239 deletions

View file

@ -94,12 +94,6 @@ AudioTimeAxisView::set_route (boost::shared_ptr<Route> rt)
ignore_toggle = false;
//if (is_audio_track()) {
// controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
//} else { // bus
// controls_ebox.set_name ("AudioBusControlsBaseUnselected");
//}
/* if set_state above didn't create a gain automation child, we need to make one */
if (automation_child (GainAutomation) == 0) {
create_automation_child (GainAutomation, false);
@ -111,7 +105,6 @@ AudioTimeAxisView::set_route (boost::shared_ptr<Route> rt)
}
/* map current state of the route */
processors_changed (RouteProcessorChange ());
reset_processor_automation_curves ();
ensure_pan_views (false);

View file

@ -182,77 +182,10 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
ARDOUR_UI::instance()->set_tip (name_label, _route->name());
ARDOUR_UI::instance()->set_tip (*level_meter, _route->name());
// namebx.set_size_request(18, 52);
// namebx.pack_start(name_label, true, false, 3);
// mon_in_box.pack_start(*monitor_input_button, true, false);
// btnbox.pack_start(mon_in_box, false, false, 1);
// mon_disk_box.pack_start(*monitor_disk_button, true, false);
// btnbox.pack_start(mon_disk_box, false, false, 1);
// recbox.pack_start(*rec_enable_button, true, false);
// btnbox.pack_start(recbox, false, false, 1);
// mutebox.pack_start(*mute_button, true, false);
// btnbox.pack_start(mutebox, false, false, 1);
// solobox.pack_start(*solo_button, true, false);
// btnbox.pack_start(solobox, false, false, 1);
rec_enable_button.set_corner_radius(2);
rec_enable_button.set_size_request(16, 16);
mute_button.set_corner_radius(2);
mute_button.set_size_request(16, 16);
solo_button.set_corner_radius(2);
solo_button.set_size_request(16, 16);
monitor_input_button.set_corner_radius(2);
monitor_input_button.set_size_request(16, 16);
monitor_disk_button.set_corner_radius(2);
monitor_disk_button.set_size_request(16, 16);
// mutebox.set_size_request(16, 16);
// solobox.set_size_request(16, 16);
// recbox.set_size_request(16, 16);
// mon_in_box.set_size_request(16, 16);
// mon_disk_box.set_size_request(16, 16);
// spacer.set_size_request(-1,0);
update_button_box();
update_name_box();
update_background (_route->meter_type());
// mtr_vbox.pack_start (peakbx, false, false);
// mtr_vbox.pack_start (meterbox, true, true);
// mtr_vbox.pack_start (spacer, false, false);
// mtr_container.add(mtr_vbox);
// mtr_hsep.set_size_request(-1,1);
// mtr_hsep.set_name("BlackSeparator");
// nfo_vbox.pack_start (mtr_hsep, false, false);
// nfo_vbox.pack_start (btnbox, false, false);
// nfo_vbox.pack_start (namebx, false, false);
// pack_start (mtr_container, true, true);
// pack_start (nfo_vbox, false, false);
// name_label.show();
// peak_display.show();
// peakbx.show();
// meter_ticks1_area.show();
// meter_ticks2_area.show();
// meterbox.show();
// spacer.show();
// level_meter->show();
// meter_align.show();
// peak_align.show();
// btnbox.show();
// mtr_vbox.show();
// mtr_container.show();
// mtr_hsep.show();
// nfo_vbox.show();
monitor_input_button.show();
monitor_disk_button.show();
@ -268,11 +201,6 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
meter_configuration_changed (_route->shared_peak_meter()->input_streams ());
// 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, &MeterStrip::meter_ticks1_expose));
// meter_ticks2_area.signal_expose_event().connect (sigc::mem_fun(*this, &MeterStrip::meter_ticks2_expose));
_route->DropReferences.connect (route_connections, invalidator (*this), boost::bind (&MeterStrip::self_delete, this), gui_context());
_route->PropertyChanged.connect (route_connections, invalidator (*this), boost::bind (&MeterStrip::strip_property_changed, this, _1), gui_context());
@ -340,32 +268,6 @@ MeterStrip::state_id() const
void
MeterStrip::set_button_names()
{
/*
mute_button.set_text (_("M"));
rec_enable_button.set_text ("");
rec_enable_button.set_image (::get_icon (X_("record_normal_red")));
if (_route && _route->solo_safe()) {
solo_button.set_visual_state (Gtkmm2ext::VisualState (solo_button.visual_state() | Gtkmm2ext::Insensitive));
} else {
solo_button.set_visual_state (Gtkmm2ext::VisualState (solo_button.visual_state() & ~Gtkmm2ext::Insensitive));
}
if (!Config->get_solo_control_is_listen_control()) {
solo_button.set_text (_("S"));
} else {
switch (Config->get_listen_position()) {
case AfterFaderListen:
solo_button.set_text (_("A"));
break;
case PreFaderListen:
solo_button.set_text (_("P"));
break;
}
}
monitor_input_button->set_text (_("I"));
monitor_disk_button->set_text (_("D"));
*/
}
void
@ -424,62 +326,22 @@ MeterStrip::meter_configuration_changed (ChanCount c)
if (boost::dynamic_pointer_cast<AudioTrack>(_route) == 0
&& boost::dynamic_pointer_cast<MidiTrack>(_route) == 0
) {
// meter_ticks1_area.set_name ("MyAudioBusMetricsLeft");
// meter_ticks2_area.set_name ("MyAudioBusMetricsRight");
_has_midi = false;
}
else if (type == (1 << DataType::AUDIO)) {
// meter_ticks1_area.set_name ("MyAudioTrackMetricsLeft");
// meter_ticks2_area.set_name ("MyAudioTrackMetricsRight");
_has_midi = false;
}
else if (type == (1 << DataType::MIDI)) {
// meter_ticks1_area.set_name ("MidiTrackMetricsLeft");
// meter_ticks2_area.set_name ("MidiTrackMetricsRight");
_has_midi = true;
} else {
// meter_ticks1_area.set_name ("AudioMidiTrackMetricsLeft");
// meter_ticks2_area.set_name ("AudioMidiTrackMetricsRight");
_has_midi = true;
}
// set_tick_bar(_tick_bar);
on_theme_changed();
if (old_has_midi != _has_midi) MetricChanged();
else ConfigurationChanged();
}
/*
void
MeterStrip::set_tick_bar (int m)
{
std::string n;
_tick_bar = m;
if (_tick_bar & 1) {
n = meter_ticks1_area.get_name();
if (n.substr(0,3) != "Bar") {
meter_ticks1_area.set_name("Bar" + n);
}
} else {
n = meter_ticks1_area.get_name();
if (n.substr(0,3) == "Bar") {
meter_ticks1_area.set_name(n.substr(3,-1));
}
}
if (_tick_bar & 2) {
n = meter_ticks2_area.get_name();
if (n.substr(0,3) != "Bar") {
meter_ticks2_area.set_name("Bar" + n);
}
} else {
n = meter_ticks2_area.get_name();
if (n.substr(0,3) == "Bar") {
meter_ticks2_area.set_name(n.substr(3,-1));
}
}
}
*/
void
MeterStrip::on_size_request (Gtk::Requisition* r)
{
@ -515,7 +377,6 @@ MeterStrip::on_size_allocate (Gtk::Allocation& a)
nh = 148;
break;
}
// namebx.set_size_request(18, nh);
if (_route) {
name_label.set_size_request(18, nh-2);
name_label.layout()->set_width((nh-4) * PANGO_SCALE);
@ -523,18 +384,6 @@ MeterStrip::on_size_allocate (Gtk::Allocation& a)
RouteUI::on_size_allocate(a);
}
/*
gint
MeterStrip::meter_metrics_expose (GdkEventExpose *ev)
{
if (_route) {
return meter_expose_metrics(ev, _route->meter_type(), _types, &meter_metric_area);
} else {
return meter_expose_metrics(ev, metric_type, _types, &meter_metric_area);
}
}
*/
void
MeterStrip::set_metric_mode (int metricmode, ARDOUR::MeterType mt)
{
@ -547,25 +396,20 @@ MeterStrip::set_metric_mode (int metricmode, ARDOUR::MeterType mt)
_types.clear ();
switch(metricmode) {
case 0:
// meter_metric_area.set_name ("MidiTrackMetricsLeft");
_types.push_back (DataType::MIDI);
break;
case 1:
// meter_metric_area.set_name ("AudioTrackMetricsLeft");
_types.push_back (DataType::AUDIO);
break;
case 2:
// meter_metric_area.set_name ("MidiTrackMetricsRight");
_types.push_back (DataType::MIDI);
break;
case 3:
default:
// meter_metric_area.set_name ("AudioTrackMetricsRight");
_types.push_back (DataType::AUDIO);
break;
}
update_background (mt);
// meter_metric_area.queue_draw ();
}
void

View file

@ -699,22 +699,8 @@ RouteTimeAxisView::set_track_mode (TrackMode mode, bool apply_to_selection)
}
track()->set_mode (mode);
rec_enable_button.remove ();
//switch (mode) {
//case ARDOUR::NonLayered:
//case ARDOUR::Normal:
// rec_enable_button.set_image (::get_icon (X_("record_normal_red")));
// rec_enable_button.set_text (string());
// break;
//case ARDOUR::Destructive:
// rec_enable_button.set_image (::get_icon (X_("record_tape_red")));
// rec_enable_button.set_text (string());
// break;
//}
rec_enable_button.show_all ();
rec_enable_button.show ();
}
}
@ -814,7 +800,6 @@ RouteTimeAxisView::set_height (uint32_t h)
reset_meter();
// gm.get_gain_slider().hide();
mute_button.show();
if (!_route || _route->is_monitor()) {
solo_button.hide();
@ -826,14 +811,9 @@ RouteTimeAxisView::set_height (uint32_t h)
route_group_button.show();
automation_button.show();
//if (is_track() && track()->mode() == ARDOUR::Normal) {
// playlist_button.show();
//}
} else {
reset_meter();
// gm.get_gain_slider().hide();
mute_button.show();
if (!_route || _route->is_monitor()) {
solo_button.hide();
@ -844,10 +824,6 @@ RouteTimeAxisView::set_height (uint32_t h)
route_group_button.hide ();
automation_button.hide ();
//if (is_track() && track()->mode() == ARDOUR::Normal) {
// playlist_button.hide ();
//}
}
if (height_changed && !no_redraw) {
@ -2351,27 +2327,6 @@ RouteTimeAxisView::remove_underlay (StreamView* v)
void
RouteTimeAxisView::set_button_names ()
{
//if (_route && _route->solo_safe()) {
// solo_button.set_visual_state (Gtkmm2ext::VisualState (solo_button.visual_state() | Gtkmm2ext::Insensitive));
//} else {
// solo_button.set_visual_state (Gtkmm2ext::VisualState (solo_button.visual_state() & ~Gtkmm2ext::Insensitive));
//}
//if (Config->get_solo_control_is_listen_control()) {
// switch (Config->get_listen_position()) {
// case AfterFaderListen:
// solo_button.set_text (_("A"));
// ARDOUR_UI::instance()->set_tip (*solo_button, _("After-fade listen (AFL)"));
// break;
// case PreFaderListen:
// solo_button.set_text (_("P"));
// ARDOUR_UI::instance()->set_tip (*solo_button, _("Pre-fade listen (PFL)"));
// break;
// }
//} else {
// solo_button.set_text (_("s"));
// ARDOUR_UI::instance()->set_tip (*solo_button, _("Solo"));
//}
//mute_button->set_text (_("m"));
}
Gtk::CheckMenuItem*

View file

@ -396,15 +396,10 @@ RouteUI::solo_press(GdkEventButton* ev)
if (!_i_am_the_modifier) {
if (Keyboard::is_context_menu_event (ev)) {
/*
if (! (solo_isolated_led && solo_isolated_led->is_visible()) ||
! (solo_safe_led && solo_safe_led->is_visible())) {
if (solo_menu == 0) {
build_solo_menu ();
}
solo_menu->popup (1, ev->time);
if (solo_menu == 0) {
build_solo_menu ();
}
*/
solo_menu->popup (1, ev->time);
} else {
if (Keyboard::is_button2_event (ev)) {
// Primary-button2 click is the midi binding click
@ -1158,24 +1153,20 @@ RouteUI::build_solo_menu (void)
solo_menu->set_name ("ArdourContextMenu");
MenuList& items = solo_menu->items();
Gtk::CheckMenuItem* check;
/*
check = new Gtk::CheckMenuItem(_("Solo Isolate"));
check->set_active (_route->solo_isolated());
check->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_solo_isolated), check));
items.push_back (CheckMenuElem(*check));
solo_isolated_check = dynamic_cast<Gtk::CheckMenuItem*>(&items.back());
solo_isolated_check = dynamic_cast<Gtk::CheckMenuItem*>(&items.back());
check->show_all();
*/
check = new Gtk::CheckMenuItem(_("Solo Safe"));
check->set_active (_route->solo_safe());
check->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_solo_safe), check));
items.push_back (CheckMenuElem(*check));
solo_safe_check = dynamic_cast<Gtk::CheckMenuItem*>(&items.back());
solo_safe_check = dynamic_cast<Gtk::CheckMenuItem*>(&items.back());
check->show_all();
//items.push_back (SeparatorElem());
// items.push_back (MenuElem (_("MIDI Bind"), sigc::mem_fun (*mute_button, &BindableToggleButton::midi_learn)));
}
void

View file

@ -65,6 +65,7 @@
height="19"
normalicon="time_axis_solo"
activeicon="time_axis_solo_active"
implicitactiveicon="time_axis_solo_safe"
prelighticon="time_axis_solo_prelight"/>
<EventBox height="1" bgnormal="#000000" bgactive="#000000"/>
</VBox>
@ -76,6 +77,7 @@
height="19"
normalicon="time_axis_mute"
activeicon="time_axis_mute_active"
implicitactiveicon="time_axis_mute_implicit"
prelighticon="time_axis_mute_prelight"/>
<EventBox height="1" bgnormal="#000000" bgactive="#000000"/>
</VBox>

View file

@ -129,12 +129,14 @@
height="20"
normalicon="inspector_mute"
activeicon="inspector_mute_active"
implicitactiveicon="inspector_mute_implicit"
prelighticon="inspector_mute_prelight"/>
<iconbutton id="solo_button"
width="47"
height="20"
normalicon="inspector_solo"
activeicon="inspector_solo_active"
implicitactiveicon="inspector_solo_safe"
prelighticon="inspector_solo_prelight"/>
</HBox>
<Button id="name_button"

View file

@ -72,7 +72,7 @@ WavesIconButton::render (cairo_t* cr)
}
Glib::RefPtr<Gtk::Style> style = get_style();
/*
Gdk::Color bgcolor = style->get_bg ((get_state() == Gtk::STATE_INSENSITIVE) ? Gtk::STATE_INSENSITIVE :
(_hovering ?
(_pushed ?
@ -80,16 +80,21 @@ WavesIconButton::render (cairo_t* cr)
Gtk::STATE_PRELIGHT ) :
(get_active() ?
Gtk::STATE_ACTIVE :
Gtk::STATE_NORMAL)));
Gtk::STATE_NORMAL)));*/
Glib::RefPtr<Gdk::Pixbuf> pixbuf = (get_state() == Gtk::STATE_INSENSITIVE) ? (_inactive_pixbuf ? _inactive_pixbuf : _normal_pixbuf) :
(_hovering ?
(_pushed ?
(_active_pixbuf ? _active_pixbuf : _normal_pixbuf) :
(_prelight_pixbuf ? _prelight_pixbuf : _normal_pixbuf)) :
(get_active() ?
(_active_pixbuf ? _active_pixbuf : _normal_pixbuf) :
_normal_pixbuf));
Glib::RefPtr<Gdk::Pixbuf> pixbuf = ((CairoWidget::active_state() == Gtkmm2ext::ImplicitActive) ? _implicit_active_pixbuf : Glib::RefPtr<Gdk::Pixbuf>(0));
if (pixbuf == 0) {
pixbuf = (get_state() == Gtk::STATE_INSENSITIVE) ?
(_inactive_pixbuf ? _inactive_pixbuf : _normal_pixbuf) :
(_hovering ?
(_pushed ?
(_active_pixbuf ? _active_pixbuf : _normal_pixbuf) :
(_prelight_pixbuf ? _prelight_pixbuf : _normal_pixbuf)) :
(get_active() ?
(_active_pixbuf ? _active_pixbuf : _normal_pixbuf) :
_normal_pixbuf));
}
if ((_left_border_width != 0) ||
(_top_border_width != 0) ||
@ -130,6 +135,13 @@ WavesIconButton::set_active_image (const RefPtr<Gdk::Pixbuf>& img)
queue_draw ();
}
void
WavesIconButton::set_implicit_active_image (const RefPtr<Gdk::Pixbuf>& img)
{
_implicit_active_pixbuf = img;
queue_draw ();
}
void
WavesIconButton::set_inactive_image (const RefPtr<Gdk::Pixbuf>& img)
{

View file

@ -29,6 +29,7 @@ class WavesIconButton : public WavesButton
void set_normal_image (const Glib::RefPtr<Gdk::Pixbuf>& img);
void set_active_image (const Glib::RefPtr<Gdk::Pixbuf>& img);
void set_implicit_active_image (const Glib::RefPtr<Gdk::Pixbuf>& img);
void set_inactive_image (const Glib::RefPtr<Gdk::Pixbuf>& img);
void set_prelight_image (const Glib::RefPtr<Gdk::Pixbuf>& img);
@ -38,6 +39,7 @@ class WavesIconButton : public WavesButton
private:
Glib::RefPtr<Gdk::Pixbuf> _normal_pixbuf;
Glib::RefPtr<Gdk::Pixbuf> _active_pixbuf;
Glib::RefPtr<Gdk::Pixbuf> _implicit_active_pixbuf;
Glib::RefPtr<Gdk::Pixbuf> _inactive_pixbuf;
Glib::RefPtr<Gdk::Pixbuf> _prelight_pixbuf;
};

View file

@ -418,19 +418,23 @@ WavesUI::set_attributes (Gtk::Widget& widget, const XMLNode& definition, const X
if (iconbutton) {
property = xml_property (definition, "normalicon", styles, "");
if (!property.empty ()) {
iconbutton->set_normal_image(get_icon(property.c_str()));
iconbutton->set_normal_image (get_icon (property.c_str ()));
}
property = xml_property (definition, "activeicon", styles, "");
if (!property.empty ()) {
iconbutton->set_active_image(get_icon(property.c_str()));
iconbutton->set_active_image (get_icon (property.c_str ()));
}
property = xml_property (definition, "prelighticon", styles, "");
if (!property.empty ()) {
iconbutton->set_prelight_image(get_icon(property.c_str()));
iconbutton->set_prelight_image (get_icon (property.c_str ()));
}
property = xml_property (definition, "inactiveicon", styles, "");
if (!property.empty ()) {
iconbutton->set_inactive_image(get_icon(property.c_str()));
iconbutton->set_inactive_image (get_icon (property.c_str ()));
}
property = xml_property (definition, "implicitactiveicon", styles, "");
if (!property.empty ()) {
iconbutton->set_implicit_active_image (get_icon (property.c_str ()));
}
}