summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-04-18 21:29:48 +0000
committerCarl Hetherington <carl@carlh.net>2010-04-18 21:29:48 +0000
commit895bad1dcd817cb8ad32dc255a90271edd6659fb (patch)
tree1385c5880cd9958bb2c6d189b6ff13ae4c43be74 /gtk2_ardour
parentd9cac66b5d7f76a78b1ae1442a275516ef710bc9 (diff)
Make the session start/end location a single location (with start and end) rather than two separate ones. Fixes #1298.
git-svn-id: svn://localhost/ardour2/branches/3.0@6929 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor.cc10
-rw-r--r--gtk2_ardour/editor.h6
-rw-r--r--gtk2_ardour/editor_drag.cc8
-rw-r--r--gtk2_ardour/editor_markers.cc39
-rw-r--r--gtk2_ardour/location_ui.cc4
-rw-r--r--gtk2_ardour/marker.h4
-rw-r--r--gtk2_ardour/theme_manager.cc2
7 files changed, 43 insertions, 30 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index a2ba7891c8..69f7cb9287 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -344,7 +344,7 @@ Editor::Editor ()
editor_ruler_menu = 0;
no_ruler_shown_update = false;
marker_menu = 0;
- start_end_marker_menu = 0;
+ session_range_marker_menu = 0;
range_marker_menu = 0;
marker_menu_item = 0;
tm_marker_menu = 0;
@@ -1105,7 +1105,7 @@ Editor::set_session (Session *t)
_session->locations()->removed.connect (_session_connections, invalidator (*this), ui_bind (&Editor::location_gone, this, _1), gui_context());
_session->locations()->changed.connect (_session_connections, invalidator (*this), boost::bind (&Editor::refresh_location_display, this), gui_context());
_session->locations()->StateChanged.connect (_session_connections, invalidator (*this), ui_bind (&Editor::refresh_location_display_s, this, _1), gui_context());
- _session->locations()->end_location()->changed.connect (_session_connections, invalidator (*this), ui_bind (&Editor::end_location_changed, this, _1), gui_context());
+ _session->locations()->session_range_location()->changed.connect (_session_connections, invalidator (*this), ui_bind (&Editor::session_range_location_changed, this, _1), gui_context());
_session->history().Changed.connect (_session_connections, invalidator (*this), boost::bind (&Editor::history_changed, this), gui_context());
if (Profile->get_sae()) {
@@ -3886,11 +3886,11 @@ Editor::get_nudge_distance (nframes64_t pos, nframes64_t& next)
}
void
-Editor::end_location_changed (Location* location)
+Editor::session_range_location_changed (Location* location)
{
- ENSURE_GUI_THREAD (*this, &Editor::end_location_changed, location)
+ ENSURE_GUI_THREAD (*this, &Editor::session_range_location_changed, location)
//reset_scrolling_region ();
- nframes64_t session_span = location->start() + (nframes64_t) floorf (current_page_frames() * 0.10f);
+ nframes64_t const session_span = location->end() + (nframes64_t) floorf (current_page_frames() * 0.10f);
horizontal_adjustment.set_upper (session_span / frames_per_unit);
}
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 15cee99dde..0b8275e03b 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -977,7 +977,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void queue_visual_change_y (double);
void ensure_visual_change_idle_handler ();
- void end_location_changed (ARDOUR::Location*);
+ void session_range_location_changed (ARDOUR::Location*);
/* track views */
TrackViewList track_views;
@@ -1468,13 +1468,13 @@ public:
void transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
void build_range_marker_menu (bool loop_or_punch);
- void build_marker_menu (bool start_or_end);
+ void build_marker_menu (bool);
void build_tm_marker_menu ();
void build_new_transport_marker_menu ();
Gtk::Menu* tm_marker_menu;
Gtk::Menu* marker_menu;
- Gtk::Menu* start_end_marker_menu;
+ Gtk::Menu* session_range_marker_menu;
Gtk::Menu* range_marker_menu;
Gtk::Menu* transport_marker_menu;
Gtk::Menu* new_transport_marker_menu;
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 8b1ac1f016..8d6838eb76 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -2491,10 +2491,10 @@ MarkerDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
break;
}
- /* set up copies for us to manipulate during the drag */
+ /* Set up copies for us to manipulate during the drag */
for (MarkerSelection::iterator i = _editor->selection->markers.begin(); i != _editor->selection->markers.end(); ++i) {
- Location *l = _editor->find_location_from_marker (*i, is_start);
+ Location* l = _editor->find_location_from_marker (*i, is_start);
_copied_locations.push_back (new Location (*l));
}
}
@@ -2506,7 +2506,7 @@ MarkerDrag::motion (GdkEvent* event, bool)
bool is_start;
bool move_both = false;
Marker* marker;
- Location *real_location;
+ Location *real_location;
Location *copy_location = 0;
nframes64_t const newframe = adjusted_current_frame (event);
@@ -2592,7 +2592,7 @@ MarkerDrag::motion (GdkEvent* event, bool)
if (copy_location->is_mark()) {
- /* just move it */
+ /* now move it */
copy_location->set_start (copy_location->start() + f_delta);
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc
index 120a6371c0..81ad022ce0 100644
--- a/gtk2_ardour/editor_markers.cc
+++ b/gtk2_ardour/editor_markers.cc
@@ -101,6 +101,11 @@ Editor::add_new_location (Location *location)
lam->end = new Marker (*this, *transport_marker_group, color,
location->name(), Marker::PunchOut, location->end());
+ } else if (location->is_session_range()) {
+ // session range
+ lam->start = new Marker (*this, *marker_group, color, _("start"), Marker::Start, location->start());
+ lam->end = new Marker (*this, *marker_group, color, _("end"), Marker::End, location->end());
+
} else {
// range marker
if (location->is_cd_marker() && ruler_cd_marker_action->get_active()) {
@@ -110,7 +115,6 @@ Editor::add_new_location (Location *location)
location->name(), Marker::End, location->end());
}
else {
-
lam->start = new Marker (*this, *range_marker_group, color,
location->name(), Marker::Start, location->start());
lam->end = new Marker (*this, *range_marker_group, color,
@@ -155,7 +159,7 @@ Editor::location_changed (Location *location)
return;
}
- lam->set_name (location->name());
+ lam->set_name (location->name ());
lam->set_position (location->start(), location->end());
if (location->is_auto_loop()) {
@@ -365,8 +369,15 @@ Editor::LocationMarkers::show()
void
Editor::LocationMarkers::set_name (const string& str)
{
- start->set_name (str);
- if (end) { end->set_name (str); }
+ /* XXX: hack: don't change names of session start/end markers */
+
+ if (start->type() != Marker::Start) {
+ start->set_name (str);
+ }
+
+ if (end && end->type() != Marker::End) {
+ end->set_name (str);
+ }
}
void
@@ -510,12 +521,12 @@ Editor::marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
} else {
if (loc->is_mark()) {
- bool start_or_end = loc->is_start() || loc->is_end();
Menu *markerMenu;
- if (start_or_end) {
- if (start_end_marker_menu == 0)
+ if (loc->is_session_range ()) {
+ if (session_range_marker_menu == 0) {
build_marker_menu (true);
- markerMenu = start_end_marker_menu;
+ }
+ markerMenu = session_range_marker_menu;
} else {
if (marker_menu == 0)
build_marker_menu (false);
@@ -573,13 +584,13 @@ Editor::transport_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item*)
}
void
-Editor::build_marker_menu (bool start_or_end)
+Editor::build_marker_menu (bool session_range)
{
using namespace Menu_Helpers;
Menu *markerMenu = new Menu;
- if (start_or_end) {
- start_end_marker_menu = markerMenu;
+ if (session_range) {
+ session_range_marker_menu = markerMenu;
} else {
marker_menu = markerMenu;
}
@@ -595,7 +606,9 @@ Editor::build_marker_menu (bool start_or_end)
items.push_back (MenuElem (_("Create range to next marker"), sigc::mem_fun(*this, &Editor::marker_menu_range_to_next)));
items.push_back (MenuElem (_("Hide"), sigc::mem_fun(*this, &Editor::marker_menu_hide)));
- if (start_or_end) return;
+ if (session_range) {
+ return;
+ }
items.push_back (MenuElem (_("Rename"), sigc::mem_fun(*this, &Editor::marker_menu_rename)));
items.push_back (MenuElem (_("Lock"), sigc::bind (sigc::mem_fun(*this, &Editor::marker_menu_lock), true)));
items.push_back (MenuElem (_("Unlock"), sigc::bind (sigc::mem_fun(*this, &Editor::marker_menu_lock), false)));
@@ -1203,7 +1216,7 @@ Editor::goto_nth_marker (int n)
ordered.sort (cmp);
for (Locations::LocationList::iterator i = ordered.begin(); n >= 0 && i != ordered.end(); ++i) {
- if ((*i)->is_mark() && !(*i)->is_hidden() && !(*i)->is_start()) {
+ if ((*i)->is_mark() && !(*i)->is_hidden() && !(*i)->is_session_range()) {
if (n == 0) {
_session->request_locate ((*i)->start(), _session->transport_rolling());
break;
diff --git a/gtk2_ardour/location_ui.cc b/gtk2_ardour/location_ui.cc
index eebec3556e..f830d817a6 100644
--- a/gtk2_ardour/location_ui.cc
+++ b/gtk2_ardour/location_ui.cc
@@ -226,7 +226,7 @@ LocationEditRow::set_location (Location *loc)
item_table.attach (remove_button, 6, 7, 0, 1, FILL, FILL, 4, 0);
}
- if (location->is_end() || location->is_start()) {
+ if (location->is_session_range()) {
remove_button.set_sensitive (false);
}
@@ -671,7 +671,7 @@ LocationUI::do_location_remove (ARDOUR::Location *loc)
cannot be removed.
*/
- if (loc->is_end()) {
+ if (loc->is_session_range()) {
return FALSE;
}
diff --git a/gtk2_ardour/marker.h b/gtk2_ardour/marker.h
index 05db900c80..e9ff0501ed 100644
--- a/gtk2_ardour/marker.h
+++ b/gtk2_ardour/marker.h
@@ -45,8 +45,8 @@ class Marker : public sigc::trackable
Mark,
Tempo,
Meter,
- Start,
- End,
+ Start, ///< session start
+ End, ///< session end
LoopStart,
LoopEnd,
PunchIn,
diff --git a/gtk2_ardour/theme_manager.cc b/gtk2_ardour/theme_manager.cc
index 1e4e0aac3c..923e61fa4c 100644
--- a/gtk2_ardour/theme_manager.cc
+++ b/gtk2_ardour/theme_manager.cc
@@ -48,7 +48,7 @@ sigc::signal<void> ColorsChanged;
sigc::signal<void,uint32_t> ColorChanged;
ThemeManager::ThemeManager()
- : ArdourDialog (_("ThemeManager")),
+ : ArdourDialog (_("Theme Manager")),
dark_button (_("Dark Theme")),
light_button (_("Light Theme")),
reset_button (_("Restore Defaults"))