Fix some unused parameter warnings.
[ardour.git] / gtk2_ardour / visual_time_axis.cc
index fc71795a7100b8bd91208352261b9e3b5bb187ba..2b811e6c58491f49a7c142b3ad46b7bb3e83bf01 100644 (file)
@@ -15,7 +15,6 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #include <cstdlib>
@@ -24,9 +23,9 @@
 #include <string>
 #include <vector>
 
-#include <pbd/error.h>
-#include <pbd/stl_delete.h>
-#include <pbd/whitespace.h>
+#include "pbd/error.h"
+#include "pbd/stl_delete.h"
+#include "pbd/whitespace.h"
 
 #include <gtkmm2ext/utils.h>
 #include <gtkmm2ext/selector.h>
 #include <gtkmm2ext/stop_signal.h>
 #include <gtkmm2ext/choice.h>
 
-#include <ardour/session.h>
-#include <ardour/utils.h>
-#include <ardour/insert.h>
-#include <ardour/location.h>
+#include "ardour/session.h"
+#include "ardour/utils.h"
+#include "ardour/processor.h"
+#include "ardour/location.h"
 
 #include "ardour_ui.h"
 #include "public_editor.h"
@@ -75,7 +74,6 @@ VisualTimeAxis::VisualTimeAxis(const string & name, PublicEditor& ed, ARDOUR::Se
 {
        time_axis_name = name ;
        _color = unique_random_color() ;
-       _marked_for_display = true;
        
        name_entry.signal_activate().connect(mem_fun(*this, &VisualTimeAxis::name_entry_changed)) ;
        name_entry.signal_button_press_event().connect(mem_fun(*this, &VisualTimeAxis::name_entry_button_press_handler)) ;
@@ -102,7 +100,7 @@ VisualTimeAxis::VisualTimeAxis(const string & name, PublicEditor& ed, ARDOUR::Se
        hide_button.unset_flags(Gtk::CAN_FOCUS) ;
        visual_button.unset_flags(Gtk::CAN_FOCUS) ;
        
-       set_height(Normal) ;
+       set_height (hNormal) ;
 }
 
 /**
@@ -145,39 +143,25 @@ VisualTimeAxis::name() const
 /**
  * Sets the height of this TrackView to one of the defined TrackHeghts
  *
- * @param h the TrackHeight value to set
+ * @param h 
  */
 void
-VisualTimeAxis::set_height(TrackHeight h)
+VisualTimeAxis::set_height(uint32_t h)
 {
-       TimeAxisView::set_height(h) ;
+       TimeAxisView::set_height(h);
        
-       switch (height)
-       {
-               case Largest:
-               case Large:
-               case Larger:
-               case Normal:
-               {
-                       hide_name_label ();
-                       show_name_entry ();
-                       other_button_hbox.show_all() ;
-                       break;
-               }
-               case Smaller:
-               {
-                       hide_name_label ();
-                       show_name_entry ();
-                       other_button_hbox.hide_all() ;
-                       break;
-               }
-               case Small:
-               {
-                       hide_name_entry ();
-                       show_name_label ();
-                       other_button_hbox.hide_all() ;
-               }
-               break;
+       if (h >= hNormal) {
+               hide_name_label ();
+               show_name_entry ();
+               other_button_hbox.show_all() ;
+       } else if (h >= hSmaller) {
+               hide_name_label ();
+               show_name_entry ();
+               other_button_hbox.hide_all() ;
+       } else if (h >= hSmall) {
+               hide_name_entry ();
+               show_name_label ();
+               other_button_hbox.hide_all() ;
        }
 }
 
@@ -199,7 +183,12 @@ VisualTimeAxis::visual_click()
 void
 VisualTimeAxis::hide_click()
 {
+       // LAME fix for hide_button display refresh
+       hide_button.set_sensitive(false);
+       
        editor.hide_track_in_display (*this);
+       
+       hide_button.set_sensitive(true);
 }
 
 
@@ -370,17 +359,17 @@ VisualTimeAxis::name_entry_changed()
                return;
        }
 
+       strip_whitespace_edges(x);
+
        if (x.length() == 0) {
                name_entry.set_text (time_axis_name);
                return;
        }
 
-       strip_whitespace_edges(x);
-
        if (!editor.get_named_time_axis(x)) {
                set_time_axis_name(x, this);
        } else {
-               ARDOUR_UI::instance()->popup_error (_("a track already exists with that name"));
+               ARDOUR_UI::instance()->popup_error (_("A track already exists with that name"));
                name_entry.set_text(time_axis_name);
        }
 }