summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-11-07 02:42:27 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-11-07 02:42:27 +0000
commit8e73c9ee80c260c58698894332f08769e9f1ac22 (patch)
treef5882e1353eecbe3e82243b19a953d205581dc93 /gtk2_ardour
parent3069423106e9901ccad74624ad30756dd8338a36 (diff)
patch to prevent (mostly) CD marker being set for the start of the session
git-svn-id: svn://localhost/ardour2/trunk@2601 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_canvas.cc2
-rw-r--r--gtk2_ardour/editor_mouse.cc15
-rw-r--r--gtk2_ardour/location_ui.cc92
-rw-r--r--gtk2_ardour/main.cc2
4 files changed, 71 insertions, 40 deletions
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc
index fbd4f13f02..d75384e253 100644
--- a/gtk2_ardour/editor_canvas.cc
+++ b/gtk2_ardour/editor_canvas.cc
@@ -706,6 +706,8 @@ Editor::left_track_canvas (GdkEventCrossing *ev)
void
Editor::canvas_horizontally_scrolled ()
{
+ cerr << "chs\n";
+
/* this is the core function that controls horizontal scrolling of the canvas. it is called
whenever the horizontal_adjustment emits its "value_changed" signal. it typically executes in an
idle handler, which is important because tempo_map_changed() should issue redraws immediately
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index dc961f51ea..8efce4daac 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -549,8 +549,7 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
return true;
case MarkerItem:
- if (Keyboard::modifier_state_equals (event->button.state,
- Keyboard::ModifierMask(Keyboard::Control|Keyboard::Shift))) {
+ if (Keyboard::modifier_state_equals (event->button.state, Keyboard::ModifierMask(Keyboard::Control|Keyboard::Shift))) {
hide_marker (item, event);
} else {
start_marker_grab (item, event);
@@ -2162,14 +2161,16 @@ Editor::start_marker_grab (ArdourCanvas::Item* item, GdkEvent* event)
if (location->is_mark()) {
marker_drag_line->show();
marker_drag_line->raise_to_top();
- }
- else {
+ } else {
range_marker_drag_rect->show();
range_marker_drag_rect->raise_to_top();
}
-
- if (is_start) show_verbose_time_cursor (location->start(), 10);
- else show_verbose_time_cursor (location->end(), 10);
+
+ if (is_start) {
+ show_verbose_time_cursor (location->start(), 10);
+ } else {
+ show_verbose_time_cursor (location->end(), 10);
+ }
}
void
diff --git a/gtk2_ardour/location_ui.cc b/gtk2_ardour/location_ui.cc
index faf986a2d1..e306110f15 100644
--- a/gtk2_ardour/location_ui.cc
+++ b/gtk2_ardour/location_ui.cc
@@ -256,6 +256,13 @@ LocationEditRow::set_location (Location *loc)
cd_check_button.set_active (location->is_cd_marker());
cd_check_button.show();
+
+ if (location->start() == session->current_start_frame()) {
+ cd_check_button.set_sensitive (false);
+ } else {
+ cd_check_button.set_sensitive (true);
+ }
+
hide_check_button.show();
}
@@ -277,12 +284,14 @@ LocationEditRow::set_location (Location *loc)
end_go_button.show();
end_clock.show();
length_clock.show();
- }
- else {
+
+ } else {
+
end_set_button.hide();
end_go_button.hide();
end_clock.hide();
length_clock.hide();
+
}
start_changed_connection = location->start_changed.connect (mem_fun(*this, &LocationEditRow::start_changed));
@@ -290,7 +299,6 @@ LocationEditRow::set_location (Location *loc)
name_changed_connection = location->name_changed.connect (mem_fun(*this, &LocationEditRow::name_changed));
changed_connection = location->changed.connect (mem_fun(*this, &LocationEditRow::location_changed));
flags_changed_connection = location->FlagsChanged.connect (mem_fun(*this, &LocationEditRow::flags_changed));
-
}
void
@@ -405,44 +413,56 @@ LocationEditRow::clock_changed (LocationPart part)
void
LocationEditRow::cd_toggled ()
{
+ if (i_am_the_modifier || !location) {
+ return;
+ }
+
+ if (cd_check_button.get_active() == location->is_cd_marker()) {
+ return;
+ }
+
+ if (cd_check_button.get_active()) {
+ if (location->start() <= session->current_start_frame()) {
+ error << _("You cannot put a CD marker at the start of the session") << endmsg;
+ cd_check_button.set_active (false);
+ return;
+ }
+ }
- if (i_am_the_modifier || !location) return;
location->set_cd (cd_check_button.get_active(), this);
if (location->is_cd_marker() && !(location->is_mark())) {
- if (location->cd_info.find("isrc") != location->cd_info.end()) {
- isrc_entry.set_text(location->cd_info["isrc"]);
- }
- if (location->cd_info.find("performer") != location->cd_info.end()) {
- performer_entry.set_text(location->cd_info["performer"]);
- }
- if (location->cd_info.find("composer") != location->cd_info.end()) {
- composer_entry.set_text(location->cd_info["composer"]);
- }
- if (location->cd_info.find("scms") != location->cd_info.end()) {
- scms_check_button.set_active(true);
- }
- if (location->cd_info.find("preemph") != location->cd_info.end()) {
- preemph_check_button.set_active(true);
- }
-
- if(!cd_track_details_hbox.get_parent()) {
- item_table.attach (cd_track_details_hbox, 1, 8, 1, 2, FILL | EXPAND, FILL, 4, 0);
- }
- // item_table.resize(2, 7);
- cd_track_details_hbox.show_all();
-
+ if (location->cd_info.find("isrc") != location->cd_info.end()) {
+ isrc_entry.set_text(location->cd_info["isrc"]);
+ }
+ if (location->cd_info.find("performer") != location->cd_info.end()) {
+ performer_entry.set_text(location->cd_info["performer"]);
+ }
+ if (location->cd_info.find("composer") != location->cd_info.end()) {
+ composer_entry.set_text(location->cd_info["composer"]);
+ }
+ if (location->cd_info.find("scms") != location->cd_info.end()) {
+ scms_check_button.set_active(true);
+ }
+ if (location->cd_info.find("preemph") != location->cd_info.end()) {
+ preemph_check_button.set_active(true);
+ }
+
+ if (!cd_track_details_hbox.get_parent()) {
+ item_table.attach (cd_track_details_hbox, 1, 8, 1, 2, FILL | EXPAND, FILL, 4, 0);
+ }
+ // item_table.resize(2, 7);
+ cd_track_details_hbox.show_all();
+
} else if (cd_track_details_hbox.get_parent()){
-
- item_table.remove (cd_track_details_hbox);
- // item_table.resize(1, 7);
- redraw_ranges(); /* EMIT_SIGNAL */
+
+ item_table.remove (cd_track_details_hbox);
+ // item_table.resize(1, 7);
+ redraw_ranges(); /* EMIT_SIGNAL */
}
-
}
-
void
LocationEditRow::hide_toggled ()
{
@@ -506,13 +526,19 @@ void
LocationEditRow::start_changed (ARDOUR::Location *loc)
{
ENSURE_GUI_THREAD(bind (mem_fun(*this, &LocationEditRow::start_changed), loc));
-
+
if (!location) return;
// update end and length
i_am_the_modifier++;
start_clock.set (location->start());
+
+ if (location->start() == session->current_start_frame()) {
+ cd_check_button.set_sensitive (false);
+ } else {
+ cd_check_button.set_sensitive (true);
+ }
i_am_the_modifier--;
}
diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc
index 32e14420ff..fc2492a7a1 100644
--- a/gtk2_ardour/main.cc
+++ b/gtk2_ardour/main.cc
@@ -314,6 +314,8 @@ int main (int argc, char *argv[])
ui->set_keybindings_path (keybindings_path);
}
+ gdk_window_set_debug_updates (true);
+
ui->run (text_receiver);
ui = 0;