summaryrefslogtreecommitdiff
path: root/gtk2_ardour/route_time_axis.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-08-10 01:22:45 +0000
committerDavid Robillard <d@drobilla.net>2006-08-10 01:22:45 +0000
commitab6f1ed9bafa869648b6e94ee5186ff317b32c3e (patch)
treed61dba7f9b6f1ae755803afc4b79bcff06a36005 /gtk2_ardour/route_time_axis.cc
parent38c7d34d8c449c7ce5f7da9575c24e60c6b31b1a (diff)
Merged with trunk R776
git-svn-id: svn://localhost/ardour2/branches/midi@777 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/route_time_axis.cc')
-rw-r--r--gtk2_ardour/route_time_axis.cc86
1 files changed, 64 insertions, 22 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index cb9883b8e6..82d5b53cba 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -29,6 +29,7 @@
#include <pbd/error.h>
#include <pbd/stl_delete.h>
#include <pbd/whitespace.h>
+#include <pbd/memento_command.h>
#include <gtkmm/menu.h>
#include <gtkmm/menuitem.h>
@@ -575,46 +576,88 @@ RouteTimeAxisView::set_height (TrackHeight h)
switch (height_style) {
case Largest:
xml_node->add_property ("track_height", "largest");
- show_name_entry ();
- hide_name_label ();
- controls_table.show_all();
break;
+
case Large:
xml_node->add_property ("track_height", "large");
- show_name_entry ();
- hide_name_label ();
- controls_table.show_all();
break;
+
case Larger:
xml_node->add_property ("track_height", "larger");
- show_name_entry ();
- hide_name_label ();
- controls_table.show_all();
break;
+
case Normal:
xml_node->add_property ("track_height", "normal");
+ break;
+
+ case Smaller:
+ xml_node->add_property ("track_height", "smaller");
+ break;
+
+ case Small:
+ xml_node->add_property ("track_height", "small");
+ break;
+ }
+
+ switch (height_style) {
+ case Largest:
+ case Large:
+ case Larger:
+ case Normal:
show_name_entry ();
hide_name_label ();
- controls_table.show_all();
+
+ mute_button->show_all();
+ solo_button->show_all();
+ if (rec_enable_button)
+ rec_enable_button->show_all();
+
+ edit_group_button.show_all();
+ hide_button.show_all();
+ visual_button.show_all();
+ size_button.show_all();
+ automation_button.show_all();
+
+ if (is_track() && track()->mode() == ARDOUR::Normal) {
+ playlist_button.show_all();
+ }
break;
+
case Smaller:
- xml_node->add_property ("track_height", "smaller");
- controls_table.show_all ();
show_name_entry ();
hide_name_label ();
+
+ mute_button->show_all();
+ solo_button->show_all();
+ if (rec_enable_button)
+ rec_enable_button->show_all();
+
edit_group_button.hide ();
hide_button.hide ();
visual_button.hide ();
size_button.hide ();
automation_button.hide ();
- playlist_button.hide ();
+
+ if (is_track() && track()->mode() == ARDOUR::Normal) {
+ playlist_button.hide ();
+ }
break;
+
case Small:
- xml_node->add_property ("track_height", "small");
- controls_table.hide_all ();
- controls_table.show ();
hide_name_entry ();
show_name_label ();
+
+ mute_button->hide();
+ solo_button->hide();
+ if (rec_enable_button)
+ rec_enable_button->hide();
+
+ edit_group_button.hide ();
+ hide_button.hide ();
+ visual_button.hide ();
+ size_button.hide ();
+ automation_button.hide ();
+ playlist_button.hide ();
name_label.set_text (_route->name());
break;
}
@@ -1008,12 +1051,12 @@ RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
}
}
+ XMLNode &before = playlist->get_state();
switch (op) {
case Cut:
- _session.add_undo (playlist->get_memento());
if ((what_we_got = playlist->cut (time)) != 0) {
editor.get_cut_buffer().add (what_we_got);
- _session.add_redo_no_execute (playlist->get_memento());
+ _session.add_command( new MementoCommand<Playlist>(*playlist, before, playlist->get_state()));
ret = true;
}
break;
@@ -1024,9 +1067,8 @@ RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
break;
case Clear:
- _session.add_undo (playlist->get_memento());
if ((what_we_got = playlist->cut (time)) != 0) {
- _session.add_redo_no_execute (playlist->get_memento());
+ _session.add_command( new MementoCommand<Playlist>(*playlist, before, playlist->get_state()));
what_we_got->unref ();
ret = true;
}
@@ -1055,9 +1097,9 @@ RouteTimeAxisView::paste (jack_nframes_t pos, float times, Selection& selection,
if (get_diskstream()->speed() != 1.0f)
pos = session_frame_to_track_frame(pos, get_diskstream()->speed() );
- _session.add_undo (playlist->get_memento());
+ XMLNode &before = playlist->get_state();
playlist->paste (**p, pos, times);
- _session.add_redo_no_execute (playlist->get_memento());
+ _session.add_command( new MementoCommand<Playlist>(*playlist, before, playlist->get_state()));
return true;
}