#include "midi_time_axis.h"
#include "mixer_strip.h"
#include "route_sorter.h"
+#include "tooltips.h"
#include "utils.h"
#include "i18n.h"
, _no_redisplay (false)
, _adding_routes (false)
, _route_deletion_in_progress (false)
+ , _redisplay_on_resume (false)
, _redisplay_active (0)
, _queue_tv_update (0)
, _menu (0)
, old_focus (0)
, selection_countdown (0)
- , name_editable (0)
+ , name_editable (0)
{
static const int column_width = 22;
for (int i = 0; ci[i].index >= 0; ++i) {
col = _display.get_column (ci[i].index);
l = manage (new Label (ci[i].label));
- ARDOUR_UI::instance()->set_tip (*l, ci[i].tooltip);
+ set_tooltip (*l, ci[i].tooltip);
col->set_widget (*l);
l->show ();
}
if (_session) {
_session->SoloChanged.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::solo_changed_so_update_mute, this), gui_context());
_session->RecordStateChanged.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_rec_display, this), gui_context());
+
+ /* TODO: check if these needs to be tied in with DisplaySuspender
+ * Given that the UI is single-threaded and DisplaySuspender is only used
+ * in loops in the UI thread all should be fine.
+ */
+ _session->BatchUpdateStart.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::suspend_redisplay, this), gui_context());
+ _session->BatchUpdateEnd.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::resume_redisplay, this), gui_context());
}
}
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (tv);
if (rtv) {
- rtv->route()->set_solo_isolated (!rtv->route()->solo_isolated(), this);
+ rtv->route()->set_solo_isolated (!rtv->route()->solo_isolated(), Controllable::UseGroup);
}
}
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (tv);
if (rtv) {
- rtv->route()->set_solo_safe (!rtv->route()->solo_safe(), this);
+ rtv->route()->set_solo_safe (!rtv->route()->solo_safe(), Controllable::UseGroup);
}
}
items.push_back (MenuElem (_("Hide All Audio Busses"), sigc::mem_fun (*this, &EditorRoutes::hide_all_audiobus)));
items.push_back (MenuElem (_("Show All Midi Tracks"), sigc::mem_fun (*this, &EditorRoutes::show_all_miditracks)));
items.push_back (MenuElem (_("Hide All Midi Tracks"), sigc::mem_fun (*this, &EditorRoutes::hide_all_miditracks)));
- items.push_back (MenuElem (_("Show Tracks With Regions Under Playhead"), sigc::mem_fun (*this, &EditorRoutes::show_tracks_with_regions_at_playhead)));
+ items.push_back (MenuElem (_("Only Show Tracks with Regions Under Playhead"), sigc::mem_fun (*this, &EditorRoutes::show_tracks_with_regions_at_playhead)));
}
void
}
bool visible = tv->marked_for_display ();
-
+
/* show or hide the TimeAxisView */
if (visible) {
position += tv->show_at (position, n, &_editor->edit_controls_vbox);
void
EditorRoutes::redisplay ()
{
- if (_no_redisplay || !_session || _session->deletion_in_progress()) {
+ if (!_session || _session->deletion_in_progress()) {
+ return;
+ }
+
+ if (_no_redisplay) {
+ _redisplay_on_resume = true;
return;
}
// model deprecated g_atomic_int_exchange_and_add(, 1)
- g_atomic_int_inc(&_redisplay_active);
- if (!g_atomic_int_compare_and_exchange (&_redisplay_active, 1, 1)) {
+ g_atomic_int_inc(const_cast<gint*>(&_redisplay_active));
+ if (!g_atomic_int_compare_and_exchange (const_cast<gint*>(&_redisplay_active), 1, 1)) {
return;
}
redisplay_real ();
- while (!g_atomic_int_compare_and_exchange (&_redisplay_active, 1, 0)) {
- g_atomic_int_set(&_redisplay_active, 1);
+ while (!g_atomic_int_compare_and_exchange (const_cast<gint*>(&_redisplay_active), 1, 0)) {
+ g_atomic_int_set(const_cast<gint*>(&_redisplay_active), 1);
redisplay_real ();
}
}
}
(*x)->route()->mute_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_mute_display, this), gui_context());
- (*x)->route()->solo_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_solo_display, this, _1), gui_context());
- (*x)->route()->listen_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_solo_display, this, _1), gui_context());
+ (*x)->route()->solo_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_solo_display, this), gui_context());
+ (*x)->route()->listen_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_solo_display, this), gui_context());
(*x)->route()->solo_isolated_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_solo_isolate_display, this), gui_context());
(*x)->route()->solo_safe_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_solo_safe_display, this), gui_context());
(*x)->route()->active_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_active_display, this), gui_context ());
update_rec_display ();
update_mute_display ();
- update_solo_display (true);
+ update_solo_display ();
update_solo_isolate_display ();
update_solo_safe_display ();
update_input_active_display ();
void
EditorRoutes::update_active_display ()
{
- if (g_atomic_int_compare_and_exchange (&_queue_tv_update, 0, 1)) {
+ if (g_atomic_int_compare_and_exchange (const_cast<gint*>(&_queue_tv_update), 0, 1)) {
Glib::signal_idle().connect (sigc::mem_fun (*this, &EditorRoutes::idle_update_mute_rec_solo_etc));
}
}
for (ri = rows.begin(); ri != rows.end(); ++ri) {
/* skip two special values */
-
+
if (rid == Route::MasterBusRemoteControlID) {
rid++;
}
-
+
if (rid == Route::MonitorBusRemoteControlID) {
rid++;
}
if ((atv = dynamic_cast<AudioTimeAxisView*>(tv)) != 0) {
switch (tracks) {
case 0:
+ atv->set_marked_for_display (yn);
(*i)[_columns.visible] = yn;
break;
case 1:
if (atv->is_audio_track()) {
+ atv->set_marked_for_display (yn);
(*i)[_columns.visible] = yn;
}
break;
case 2:
if (!atv->is_audio_track()) {
+ atv->set_marked_for_display (yn);
(*i)[_columns.visible] = yn;
}
break;
else if ((mtv = dynamic_cast<MidiTimeAxisView*>(tv)) != 0) {
switch (tracks) {
case 0:
+ mtv->set_marked_for_display (yn);
(*i)[_columns.visible] = yn;
break;
case 3:
if (mtv->is_midi_track()) {
+ mtv->set_marked_for_display (yn);
(*i)[_columns.visible] = yn;
}
break;
}
RouteList r (*_session->get_routes());
-
+
r.sort (EditorOrderRouteSorter ());
_editor->add_routes (r);
}
void
EditorRoutes::update_rec_display ()
{
- if (g_atomic_int_compare_and_exchange (&_queue_tv_update, 0, 1)) {
+ if (g_atomic_int_compare_and_exchange (const_cast<gint*>(&_queue_tv_update), 0, 1)) {
Glib::signal_idle().connect (sigc::mem_fun (*this, &EditorRoutes::idle_update_mute_rec_solo_etc));
}
}
bool
EditorRoutes::idle_update_mute_rec_solo_etc()
{
- g_atomic_int_set (&_queue_tv_update, 0);
+ g_atomic_int_set (const_cast<gint*>(&_queue_tv_update), 0);
TreeModel::Children rows = _model->children();
TreeModel::Children::iterator i;
(*i)[_columns.active] = route->active ();
if (boost::dynamic_pointer_cast<Track> (route)) {
boost::shared_ptr<MidiTrack> mt = boost::dynamic_pointer_cast<MidiTrack> (route);
-
+
if (route->record_enabled()) {
if (_session->record_status() == Session::Recording) {
(*i)[_columns.rec_state] = 1;
} else {
(*i)[_columns.rec_state] = 0;
}
-
+
(*i)[_columns.name_editable] = !route->record_enabled ();
}
}
void
EditorRoutes::update_mute_display ()
{
- if (g_atomic_int_compare_and_exchange (&_queue_tv_update, 0, 1)) {
+ if (g_atomic_int_compare_and_exchange (const_cast<gint*>(&_queue_tv_update), 0, 1)) {
Glib::signal_idle().connect (sigc::mem_fun (*this, &EditorRoutes::idle_update_mute_rec_solo_etc));
}
}
void
-EditorRoutes::update_solo_display (bool /* selfsoloed */)
+EditorRoutes::update_solo_display ()
{
- if (g_atomic_int_compare_and_exchange (&_queue_tv_update, 0, 1)) {
+ if (g_atomic_int_compare_and_exchange (const_cast<gint*>(&_queue_tv_update), 0, 1)) {
Glib::signal_idle().connect (sigc::mem_fun (*this, &EditorRoutes::idle_update_mute_rec_solo_etc));
}
}
void
EditorRoutes::update_solo_isolate_display ()
{
- if (g_atomic_int_compare_and_exchange (&_queue_tv_update, 0, 1)) {
+ if (g_atomic_int_compare_and_exchange (const_cast<gint*>(&_queue_tv_update), 0, 1)) {
Glib::signal_idle().connect (sigc::mem_fun (*this, &EditorRoutes::idle_update_mute_rec_solo_etc));
}
}
void
EditorRoutes::update_solo_safe_display ()
{
- if (g_atomic_int_compare_and_exchange (&_queue_tv_update, 0, 1)) {
+ if (g_atomic_int_compare_and_exchange (const_cast<gint*>(&_queue_tv_update), 0, 1)) {
Glib::signal_idle().connect (sigc::mem_fun (*this, &EditorRoutes::idle_update_mute_rec_solo_etc));
}
}
TreeModel::Children rows = _model->children ();
for (TreeModel::Children::iterator i = rows.begin(); i != rows.end(); ++i) {
TimeAxisView* tv = (*i)[_columns.tv];
- (*i)[_columns.visible] = (show.find (tv) != show.end());
+ bool to_show = (show.find (tv) != show.end());
+
+ tv->set_marked_for_display (to_show);
+ (*i)[_columns.visible] = to_show;
}
+
+ /* force route order keys catch up with visibility changes
+ */
+
+ sync_order_keys_from_treeview ();
}