diff --git a/gtk2_ardour/actions.cc b/gtk2_ardour/actions.cc
index 07716acba1..3590952579 100644
--- a/gtk2_ardour/actions.cc
+++ b/gtk2_ardour/actions.cc
@@ -81,6 +81,8 @@ ActionManager::load_menus (const string& menus_file)
bool loaded = false;
+ std::cerr << "Load menus from " << ui_file << std::endl;
+
try {
ui_manager->add_ui_from_file (ui_file);
info << string_compose (_("Loading menus from %1"), ui_file) << endmsg;
diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in
index 77490b4db7..bc744da5b5 100644
--- a/gtk2_ardour/ardour.menus.in
+++ b/gtk2_ardour/ardour.menus.in
@@ -553,6 +553,7 @@
+
@@ -805,6 +806,7 @@
+
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index fcda3cf99c..0100322d85 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -343,6 +343,7 @@ Editor::Editor ()
, cd_mark_label (_("CD Markers"))
, section_mark_label (_("Arrangement"))
, cue_mark_label (_("Cue Markers"))
+ , scene_mark_label (_("Scenes"))
, videotl_label (_("Video Timeline"))
, videotl_group (0)
, _region_boundary_cache_dirty (true)
@@ -576,6 +577,13 @@ Editor::Editor ()
cue_mark_label.hide();
cue_mark_label.set_no_show_all();
+ scene_mark_label.set_name ("EditorRulerLabel");
+ scene_mark_label.set_size_request (-1, (int)timebar_height);
+ scene_mark_label.set_alignment (1.0, 0.5);
+ scene_mark_label.set_padding (5,0);
+ scene_mark_label.hide();
+ scene_mark_label.set_no_show_all();
+
videotl_bar_height = 4;
videotl_label.set_name ("EditorRulerLabel");
videotl_label.set_size_request (-1, (int)timebar_height * videotl_bar_height);
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 71aad5fb1e..bbc9300f97 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -939,6 +939,7 @@ private:
ArdourCanvas::Container* cd_marker_group;
ArdourCanvas::Container* section_marker_group;
ArdourCanvas::Container* cue_marker_group;
+ ArdourCanvas::Container* scene_marker_group;
/* parent for groups which themselves contain time markers */
ArdourCanvas::Container* _time_markers_group;
@@ -992,6 +993,7 @@ private:
Glib::RefPtr ruler_section_action;
Glib::RefPtr ruler_marker_action;
Glib::RefPtr ruler_cue_marker_action;
+ Glib::RefPtr ruler_scene_marker_action;
bool no_ruler_shown_update;
Gtk::Widget* ruler_grabbed_widget;
@@ -1083,6 +1085,7 @@ private:
ArdourCanvas::Rectangle* cd_marker_bar;
ArdourCanvas::Rectangle* section_marker_bar;
ArdourCanvas::Rectangle* cue_marker_bar;
+ ArdourCanvas::Rectangle* scene_marker_bar;
ArdourCanvas::Line* ruler_separator;
void toggle_cue_behavior ();
@@ -1099,6 +1102,7 @@ private:
Gtk::Label cd_mark_label;
Gtk::Label section_mark_label;
Gtk::Label cue_mark_label;
+ Gtk::Label scene_mark_label;
/* videtimline related actions */
Gtk::Label videotl_label;
@@ -1593,6 +1597,7 @@ private:
void clear_xrun_markers ();
void clear_ranges ();
void clear_cues ();
+ void clear_scenes ();
void clear_locations ();
void unhide_markers ();
void unhide_ranges ();
diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc
index dd3cae3681..1fa3cbeaa3 100644
--- a/gtk2_ardour/editor_actions.cc
+++ b/gtk2_ardour/editor_actions.cc
@@ -697,6 +697,7 @@ Editor::register_actions ()
ruler_cd_marker_action = Glib::RefPtr::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-cd-marker-ruler"), _("CD Markers"), sigc::mem_fun(*this, &Editor::toggle_ruler_visibility)));
ruler_section_action = Glib::RefPtr::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-arrangement-ruler"), _("Arrangement"), sigc::mem_fun(*this, &Editor::toggle_ruler_visibility)));
ruler_marker_action = Glib::RefPtr::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-marker-ruler"), _("Location Markers"), sigc::mem_fun(*this, &Editor::toggle_ruler_visibility)));
+ ruler_scene_marker_action = Glib::RefPtr::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-scene-marker-ruler"), _("Scene Markers"), sigc::mem_fun(*this, &Editor::toggle_ruler_visibility)));
ruler_cue_marker_action = Glib::RefPtr::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-cue-marker-ruler"), _("Cue Markers"), sigc::mem_fun(*this, &Editor::toggle_ruler_visibility)));
ActionManager::register_action (editor_menu_actions, X_("VideoMonitorMenu"), _("Video Monitor"));
@@ -727,6 +728,7 @@ Editor::register_actions ()
ruler_cd_marker_action->set_active (true);
ruler_marker_action->set_active (true);
ruler_cue_marker_action->set_active (true);
+ ruler_scene_marker_action->set_active (false);
ruler_video_action->set_active (false);
xjadeo_proc_action->set_active (false);
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc
index aca3932712..b4e357196a 100644
--- a/gtk2_ardour/editor_canvas.cc
+++ b/gtk2_ardour/editor_canvas.cc
@@ -173,6 +173,8 @@ Editor::initialize_canvas ()
CANVAS_DEBUG_NAME (section_marker_group, "Arranger marker group");
meter_group = new ArdourCanvas::Container (_time_markers_group, ArdourCanvas::Duple (0.0, (timebar_height * 5.0) + 1.0));
CANVAS_DEBUG_NAME (meter_group, "meter group");
+ scene_marker_group = new ArdourCanvas::Container (_time_markers_group, ArdourCanvas::Duple (0.0, (timebar_height * 5.0) + 1.0));
+ CANVAS_DEBUG_NAME (scene_marker_group, "scene marker_group");
float timebar_thickness = timebar_height; //was 4
float timebar_top = (timebar_height - timebar_thickness)/2;
@@ -207,6 +209,9 @@ Editor::initialize_canvas ()
cue_marker_bar = new ArdourCanvas::Rectangle (cue_marker_group, ArdourCanvas::Rect (0.0, timebar_top, ArdourCanvas::COORD_MAX, timebar_btm));
CANVAS_DEBUG_NAME (cue_marker_bar, "Cue Marker Bar");
+ scene_marker_bar = new ArdourCanvas::Rectangle (scene_marker_group, ArdourCanvas::Rect (0.0, timebar_top, ArdourCanvas::COORD_MAX, timebar_btm));
+ CANVAS_DEBUG_NAME (cue_marker_bar, "Scene Marker Bar");
+
ruler_separator = new ArdourCanvas::Line(_time_markers_group);
CANVAS_DEBUG_NAME (ruler_separator, "separator between ruler and main canvas");
ruler_separator->set (ArdourCanvas::Duple(0.0, 0.0), ArdourCanvas::Duple(ArdourCanvas::COORD_MAX, 0.0));
@@ -256,6 +261,7 @@ Editor::initialize_canvas ()
cd_marker_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), cd_marker_bar, CdMarkerBarItem, "cd marker bar"));
section_marker_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), section_marker_bar, SectionMarkerBarItem, "arrangement marker bar"));
cue_marker_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), cue_marker_bar, CueMarkerBarItem, "cd marker bar"));
+ scene_marker_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), scene_marker_bar, SceneMarkerBarItem, "scene marker bar"));
videotl_group->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_videotl_bar_event), videotl_group));
range_marker_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), range_marker_bar, RangeMarkerBarItem, "range marker bar"));
transport_marker_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), transport_marker_bar, TransportMarkerBarItem, "transport marker bar"));
@@ -1091,6 +1097,9 @@ Editor::color_handler()
section_marker_bar->set_fill_color (UIConfiguration::instance().color_mod ("arrangement marker bar", "marker bar"));
section_marker_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
+ scene_marker_bar->set_fill_color (UIConfiguration::instance().color_mod ("arrangement marker bar", "marker bar"));
+ scene_marker_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
+
cue_marker_bar->set_fill_color (UIConfiguration::instance().color_mod ("cd marker bar", "marker bar"));
cue_marker_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
@@ -1498,6 +1507,7 @@ Editor::which_canvas_cursor(ItemType type) const
case CdMarkerBarItem:
case SectionMarkerBarItem:
case CueMarkerBarItem:
+ case SceneMarkerBarItem:
case VideoBarItem:
case TransportMarkerBarItem:
case DropZoneItem:
diff --git a/gtk2_ardour/editor_items.h b/gtk2_ardour/editor_items.h
index 025d3b5e89..492b669398 100644
--- a/gtk2_ardour/editor_items.h
+++ b/gtk2_ardour/editor_items.h
@@ -27,11 +27,13 @@ enum ItemType {
WaveItem,
PlayheadCursorItem,
MarkerItem,
+ SceneMarkerItem,
MarkerBarItem,
RangeMarkerBarItem,
CdMarkerBarItem,
SectionMarkerBarItem,
CueMarkerBarItem,
+ SceneMarkerBarItem,
VideoBarItem,
TransportMarkerBarItem,
SelectionItem,
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc
index 72dbb637af..7c4eb510cf 100644
--- a/gtk2_ardour/editor_markers.cc
+++ b/gtk2_ardour/editor_markers.cc
@@ -145,6 +145,8 @@ Editor::add_new_location_internal (Location* location)
color = X_("location loop");
} else if (location->is_auto_punch()) {
color = X_("location punch");
+ } else if (location->is_scene()) {
+ color = X_("location scene");
} else {
color = X_("location range");
}
@@ -161,6 +163,9 @@ Editor::add_new_location_internal (Location* location)
} else if (location->is_section()) {
lam->start = new ArdourMarker (*this, *section_marker_group, color, location->name(), marker_type (location), location->start());
group = section_marker_group;
+ } else if (location->is_scene()) {
+ lam->start = new ArdourMarker (*this, *scene_marker_group, color, location->name(), marker_type (location), location->start());
+ group = scene_marker_group;
} else {
lam->start = new ArdourMarker (*this, *marker_group, color, location->name(), marker_type (location), location->start());
group = marker_group;
@@ -514,6 +519,8 @@ void Editor::ensure_marker_updated (LocationMarkers* lam, Location* location)
{
if (location->is_cd_marker()) {
reparent_location_markers (lam, cd_marker_group);
+ } else if (location->is_scene()) {
+ reparent_location_markers (lam, scene_marker_group);
} else if (location->is_section()) {
reparent_location_markers (lam, section_marker_group);
} else if (location->is_cue_marker()) {
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index 1affc81086..9be55817b7 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -775,6 +775,9 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
}
}
return true;
+ case SceneMarkerItem:
+ _drags->set (new MarkerDrag (this, item), event);
+ return true;
case TempoMarkerItem:
if (ArdourKeyboard::indicates_constraint (event->button.state)) {
@@ -1731,6 +1734,10 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
marker_context_menu (&event->button, item);
break;
+ case SceneMarkerItem:
+ marker_context_menu (&event->button, item);
+ break;
+
case TempoMarkerItem:
case MeterMarkerItem:
case BBTMarkerItem:
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 4b2e60a78f..b34abaa469 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -2683,6 +2683,22 @@ Editor::clear_cues ()
}
}
+void
+Editor::clear_scenes ()
+{
+ begin_reversible_command (_("clear locations"));
+
+ XMLNode &before = _session->locations()->get_state();
+ if (_session->locations()->clear_scene_markers (0, max_samplepos)) {
+ XMLNode &after = _session->locations()->get_state();
+ _session->add_command(new MementoCommand(*(_session->locations()), &before, &after));
+
+ commit_reversible_command ();
+ } else {
+ abort_reversible_command ();
+ }
+}
+
void
Editor::clear_locations ()
{
diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc
index 9893373d00..79f85fb691 100644
--- a/gtk2_ardour/editor_rulers.cc
+++ b/gtk2_ardour/editor_rulers.cc
@@ -180,6 +180,7 @@ Editor::initialize_rulers ()
lab_children.push_back (Element(cd_mark_label, PACK_SHRINK, PACK_START));
lab_children.push_back (Element(mark_label, PACK_SHRINK, PACK_START));
lab_children.push_back (Element(cue_mark_label, PACK_SHRINK, PACK_START));
+ lab_children.push_back (Element(scene_mark_label, PACK_SHRINK, PACK_START));
lab_children.push_back (Element(section_mark_label, PACK_SHRINK, PACK_START));
lab_children.push_back (Element(videotl_label, PACK_SHRINK, PACK_START));
@@ -257,6 +258,10 @@ Editor::popup_ruler_menu (timepos_t const & where, ItemType t)
}
break;
+ case SceneMarkerBarItem:
+ ruler_items.push_back (MenuElem (_("Delete all Scenes"), sigc::mem_fun (*this, &Editor::clear_scenes)));
+ break;
+
case TempoBarItem:
case TempoCurveItem:
ruler_items.push_back (MenuElem (_("Add New Tempo"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_add_new_tempo_event), where)));
@@ -673,7 +678,26 @@ Editor::update_ruler_visibility ()
cue_mark_label.hide();
}
- if (ruler_section_action->get_active()) {
+ if (ruler_scene_marker_action->get_active()) {
+ old_unit_pos = scene_marker_group->position().y;
+ if (tbpos != old_unit_pos) {
+ scene_marker_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
+ }
+ scene_marker_group->show();
+ scene_mark_label.show();
+
+ scene_marker_bar->set_outline(false);
+
+ tbpos += timebar_height;
+ tbgpos += timebar_height;
+ visible_timebars++;
+ update_marker_display();
+ } else {
+ scene_marker_group->hide ();
+ scene_mark_label.hide ();
+ }
+
+ if (!Profile->get_livetrax() && ruler_section_action->get_active()) {
old_unit_pos = section_marker_group->position().y;
if (tbpos != old_unit_pos) {
section_marker_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
diff --git a/gtk2_ardour/enums.cc b/gtk2_ardour/enums.cc
index 59595b10b1..30f1158cc4 100644
--- a/gtk2_ardour/enums.cc
+++ b/gtk2_ardour/enums.cc
@@ -152,11 +152,13 @@ setup_gtk_ardour_enums ()
REGISTER_ENUM (StreamItem);
REGISTER_ENUM (PlayheadCursorItem);
REGISTER_ENUM (MarkerItem);
+ REGISTER_ENUM (SceneMarkerItem);
REGISTER_ENUM (MarkerBarItem);
REGISTER_ENUM (RangeMarkerBarItem);
REGISTER_ENUM (CdMarkerBarItem);
REGISTER_ENUM (SectionMarkerBarItem);
REGISTER_ENUM (CueMarkerBarItem);
+ REGISTER_ENUM (SceneMarkerBarItem);
REGISTER_ENUM (VideoBarItem);
REGISTER_ENUM (TransportMarkerBarItem);
REGISTER_ENUM (SelectionItem);