fixes from Carl H for a couple of buglets

git-svn-id: svn://localhost/ardour2/trunk@1575 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis
2007-03-12 14:24:05 +00:00
parent a74b374024
commit 84af9f18eb
5 changed files with 25 additions and 20 deletions

View File

@@ -107,21 +107,13 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
_route->panner().Changed.connect (mem_fun(*this, &AudioTimeAxisView::update_pans));
if (is_audio_track()) {
update_control_names ();
controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
controls_base_selected_name = "AudioTrackControlsBaseSelected";
controls_base_unselected_name = "AudioTrackControlsBaseUnselected";
if (is_audio_track()) {
/* ask for notifications of any new RegionViews */
_view->RegionViewAdded.connect (mem_fun(*this, &AudioTimeAxisView::region_view_added));
_view->attach ();
} else { /* bus */
controls_ebox.set_name ("AudioBusControlsBaseUnselected");
controls_base_selected_name = "AudioBusControlsBaseSelected";
controls_base_unselected_name = "AudioBusControlsBaseUnselected";
}
post_construct ();
@@ -621,7 +613,19 @@ void
AudioTimeAxisView::route_active_changed ()
{
RouteTimeAxisView::route_active_changed ();
update_control_names ();
}
/**
* Set up the names of the controls so that they are coloured
* correctly depending on whether this route is inactive or
* selected.
*/
void
AudioTimeAxisView::update_control_names ()
{
if (is_audio_track()) {
if (_route->active()) {
controls_ebox.set_name ("AudioTrackControlsBaseUnselected");

View File

@@ -114,6 +114,7 @@ class AudioTimeAxisView : public RouteTimeAxisView
void pan_hidden ();
void update_pans ();
void update_control_names ();
AutomationTimeAxisView* gain_track;
AutomationTimeAxisView* pan_track;

View File

@@ -105,11 +105,11 @@ GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s)
gain_display_box.pack_start (gain_display, true, true);
peak_display.set_name ("MixerStripPeakDisplay");
peak_display.set_has_frame (false);
peak_display.set_editable (false);
// peak_display.set_has_frame (false);
// peak_display.set_editable (false);
set_size_request_to_display_given_text (peak_display, "-80.g", 2, 6); /* note the descender */
max_peak = minus_infinity();
peak_display.set_text (_("-inf"));
peak_display.set_label (_("-inf"));
peak_display.unset_flags (Gtk::CAN_FOCUS);
meter_metric_area.set_name ("MeterMetricsStrip");
@@ -327,10 +327,10 @@ GainMeter::update_meters ()
max_peak = mpeak;
/* set peak display */
if (max_peak <= -200.0f) {
peak_display.set_text (_("-inf"));
peak_display.set_label (_("-inf"));
} else {
snprintf (buf, sizeof(buf), "%.1f", max_peak);
peak_display.set_text (buf);
peak_display.set_label (buf);
}
if (max_peak >= 0.0f) {
@@ -494,7 +494,7 @@ GainMeter::reset_peak_display ()
}
max_peak = -INFINITY;
peak_display.set_text (_("-Inf"));
peak_display.set_label (_("-Inf"));
peak_display.set_name ("MixerStripPeakDisplay");
}
@@ -516,7 +516,7 @@ GainMeter::meter_button_release (GdkEventButton* ev, uint32_t which)
case 1:
meters[which].meter->clear();
max_peak = minus_infinity();
peak_display.set_text (_("-inf"));
peak_display.set_label (_("-inf"));
peak_display.set_name ("MixerStripPeakDisplay");
break;

View File

@@ -86,7 +86,7 @@ class GainMeter : public Gtk::VBox
Gtkmm2ext::VSliderController *gain_slider;
Gtk::Adjustment gain_adjustment;
Gtkmm2ext::FocusEntry gain_display;
Gtk::Entry peak_display;
Gtk::Button peak_display;
Gtk::HBox gain_display_box;
Gtk::HBox fader_box;
Gtk::DrawingArea meter_metric_area;

View File

@@ -246,14 +246,14 @@ TimeAxisView::controls_ebox_scroll (GdkEventScroll* ev)
switch (ev->direction) {
case GDK_SCROLL_UP:
if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) {
step_height (true);
step_height (false);
return true;
}
break;
case GDK_SCROLL_DOWN:
if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) {
step_height (false);
step_height (true);
return true;
}
break;