*/
+#ifdef WAF_BUILD
+#include "gtk2ardour-config.h"
+#endif
+
#include <glibmm/miscutils.h>
#include <gtkmm2ext/utils.h>
#include <gtkmm2ext/window_title.h>
#include "pbd/enumwriter.h"
-#include "editor.h"
-#include "mixer_strip.h"
+#include "actions.h"
#include "ardour_ui.h"
-#include "selection.h"
#include "audio_time_axis.h"
-#include "actions.h"
+#include "automation_time_axis.h"
+#include "editor.h"
#include "editor_routes.h"
#include "editor_route_groups.h"
#include "editor_regions.h"
#include "gui_thread.h"
+#include "midi_time_axis.h"
+#include "mixer_strip.h"
+#include "selection.h"
#include "i18n.h"
if (current_mixer_strip->get_parent() == 0) {
global_hpacker.pack_start (*current_mixer_strip, Gtk::PACK_SHRINK );
global_hpacker.reorder_child (*current_mixer_strip, 0);
- current_mixer_strip->show_all ();
+ current_mixer_strip->show ();
}
} else {
_session,
false);
current_mixer_strip->Hiding.connect (sigc::mem_fun(*this, &Editor::current_mixer_strip_hidden));
+ current_mixer_strip->WidthChanged.connect (sigc::mem_fun (*this, &Editor::mixer_strip_width_changed));
#ifdef GTKOSX
current_mixer_strip->WidthChanged.connect (sigc::mem_fun(*this, &Editor::ensure_all_elements_drawn));
void
Editor::set_selected_mixer_strip (TimeAxisView& view)
{
- RouteTimeAxisView* at;
-
- if (!_session || (at = dynamic_cast<RouteTimeAxisView*>(&view)) == 0) {
+ if (!_session) {
return;
}
create_editor_mixer ();
}
- /* might be nothing to do */
- if (current_mixer_strip->route() == at->route()) {
- return;
- }
+ // if this is an automation track, then we shold the mixer strip should
+ // show the parent
- current_mixer_strip->set_route (at->route());
- current_mixer_strip->set_width_enum (editor_mixer_strip_width, (void*) this);
-}
+ boost::shared_ptr<ARDOUR::Route> route;
+ AutomationTimeAxisView* atv;
+
+ if ((atv = dynamic_cast<AutomationTimeAxisView*>(&view)) != 0) {
-void
-Editor::current_mixer_strip_hidden ()
-{
- for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
+ AudioTimeAxisView *parent = dynamic_cast<AudioTimeAxisView*>(view.get_parent());
- RouteTimeAxisView* tmp;
+ if (parent) {
+ route = parent->route ();
+ }
- if ((tmp = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
- if (tmp->route() == current_mixer_strip->route()) {
- (*i)->set_selected (false);
- break;
+ } else {
+
+ AudioTimeAxisView* at = dynamic_cast<AudioTimeAxisView*> (&view);
+
+ if (at) {
+ route = at->route();
+ } else {
+ MidiTimeAxisView* mt = dynamic_cast<MidiTimeAxisView*> (&view);
+ if (mt) {
+ route = mt->route();
}
}
}
+
+ if (current_mixer_strip->route() == route) {
+ return;
+ }
+
+ if (route) {
+ current_mixer_strip->set_route (route);
+ current_mixer_strip->set_width_enum (editor_mixer_strip_width, (void*) this);
+ }
+}
+void
+Editor::current_mixer_strip_hidden ()
+{
Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (X_("Editor"), X_("show-editor-mixer"));
if (act) {
Glib::RefPtr<Gtk::ToggleAction> tact = Glib::RefPtr<Gtk::ToggleAction>::cast_dynamic(act);
Editor::maybe_add_mixer_strip_width (XMLNode& node)
{
if (current_mixer_strip) {
- node.add_property ("mixer-width", enum_2_string (current_mixer_strip->get_width_enum()));
+ node.add_property ("mixer-width", enum_2_string (editor_mixer_strip_width));
}
}
+void
+Editor::mixer_strip_width_changed ()
+{
+#ifdef GTKOSX
+ ensure_all_elements_drawn ();
+#endif
+
+ editor_mixer_strip_width = current_mixer_strip->get_width_enum ();
+}