diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-26 16:40:56 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-26 16:40:56 +0000 |
commit | 1770e3eaacb4b1e57bd1c354c47293be11b3b986 (patch) | |
tree | 074f8976d21b21075de44ee19e93e60282d24ede /gtk2_ardour | |
parent | 3daa1bcdf11332ffcaa9c4ff4d0c0322a5077d11 (diff) |
remove silly buffer stats output; apply MIDI control patch (#2655) from dhess; switch ctrl/alt for drag-selection-as-region (work ongoing); various scons cleanups; remove some dead code from editor
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@6798 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 70 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui.h | 13 | ||||
-rw-r--r-- | gtk2_ardour/editor.cc | 59 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/editor_mouse.cc | 18 | ||||
-rw-r--r-- | gtk2_ardour/public_editor.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/time_axis_view.cc | 2 |
7 files changed, 29 insertions, 141 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index d9a7fd4595..a0cbfb91de 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -66,6 +66,7 @@ #include <ardour/recent_sessions.h> #include <ardour/port.h> #include <ardour/audio_track.h> +#include <ardour/control_protocol_manager.h> typedef uint64_t microseconds_t; @@ -927,8 +928,6 @@ ARDOUR_UI::update_buffer_load () c = session->capture_load (); p = session->playback_load (); - push_buffer_stats (c, p); - snprintf (buf, sizeof (buf), _("Buffers p:%" PRIu32 "%% c:%" PRIu32 "%%"), session->playback_load(), session->capture_load()); buffer_load_label.set_text (buf); @@ -2710,6 +2709,20 @@ ARDOUR_UI::load_session (const Glib::ustring& path, const Glib::ustring& snap_na goto out; } + /* Now the session been created, add the transport controls */ + new_session->add_controllable(&roll_controllable); + new_session->add_controllable(&stop_controllable); + new_session->add_controllable(&goto_start_controllable); + new_session->add_controllable(&goto_end_controllable); + new_session->add_controllable(&auto_loop_controllable); + new_session->add_controllable(&play_selection_controllable); + new_session->add_controllable(&rec_controllable); + + /* Once the transport controlls have been added, the ControlProtocolManager + is okay to instantiate the various protocols. */ + BootMessage (_("Reset Control Protocols")); + ControlProtocolManager::instance().set_session (*new_session); + connect_to_session (new_session); Config->set_current_owner (ConfigVariableBase::Interface); @@ -3272,62 +3285,11 @@ What you would like to do?\n")); } void -ARDOUR_UI::push_buffer_stats (uint32_t capture, uint32_t playback) -{ - time_t now; - time (&now); - - while (disk_buffer_stats.size() > 60) { - disk_buffer_stats.pop_front (); - } - - disk_buffer_stats.push_back (DiskBufferStat (now, capture, playback)); -} - -void -ARDOUR_UI::write_buffer_stats () -{ - std::ofstream fout; - struct tm tm; - char buf[64]; - char path[PATH_MAX+1]; int fd; - - strcpy (path, "ardourBufferingXXXXXX"); - - if ((fd = mkstemp (path )) < 0) { - cerr << X_("cannot find temporary name for ardour buffer stats") << endl; - return; - } - - fout.open (path); - close (fd); - - if (!fout) { - cerr << string_compose (X_("cannot open file %1 for ardour buffer stats"), path) << endl; - return; - } - - for (list<DiskBufferStat>::iterator i = disk_buffer_stats.begin(); i != disk_buffer_stats.end(); ++i) { - localtime_r (&(*i).when, &tm); - strftime (buf, sizeof (buf), "%T", &tm); - fout << buf << ' ' << (*i).capture << ' ' << (*i).playback << endl; - } - - disk_buffer_stats.clear (); - - fout.close (); - - cerr << "buffering statistics can be found in: " << path << endl; -} - -void ARDOUR_UI::disk_overrun_handler () { ENSURE_GUI_THREAD (mem_fun(*this, &ARDOUR_UI::disk_overrun_handler)); - write_buffer_stats (); - if (!have_disk_speed_dialog_displayed) { have_disk_speed_dialog_displayed = true; MessageDialog* msg = new MessageDialog (*editor, _("\ @@ -3347,8 +3309,6 @@ ARDOUR_UI::disk_underrun_handler () ENSURE_GUI_THREAD (mem_fun(*this, &ARDOUR_UI::disk_underrun_handler)); - write_buffer_stats (); - if (!have_disk_speed_dialog_displayed) { have_disk_speed_dialog_displayed = true; MessageDialog* msg = new MessageDialog (*editor, diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 6e0889db9a..8c84e331e5 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -659,19 +659,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI ARDOUR::microseconds_t last_peak_grab; ARDOUR::microseconds_t last_shuttle_request; - struct DiskBufferStat { - time_t when; - uint32_t capture; - uint32_t playback; - - DiskBufferStat (time_t w, uint32_t c, uint32_t p) - : when (w), capture (c), playback (p) {} - }; - - std::list<DiskBufferStat> disk_buffer_stats; - void push_buffer_stats (uint32_t, uint32_t); - void write_buffer_stats (); - bool have_disk_speed_dialog_displayed; void disk_speed_dialog_gone (int ignored_response, Gtk::MessageDialog*); void disk_overrun_handler (); diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 525ab9c7e6..80d3659370 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -4946,65 +4946,6 @@ Editor::first_idle () _have_idled = true; } -void -Editor::start_resize_line_ops () -{ -#if 0 - old_resize_line_y = -1; - resize_line_y = -1; - need_resize_line = true; -#endif -} - -void -Editor::end_resize_line_ops () -{ -#if 0 - need_resize_line = false; - - if (old_resize_line_y >= 0) { - Gdk::Rectangle r (0, old_resize_line_y, (int) canvas_width, 3); - Glib::RefPtr<Gdk::Window> win = get_window(); - cerr << "Final invalidation at " << old_resize_line_y << endl; - win->invalidate_rect (r, false); - } -#endif -} - -void -Editor::queue_draw_resize_line (int at) -{ -#if 0 - Glib::RefPtr<Gdk::Window> win = get_window(); - - resize_line_y = at; - - if (win && canvas_width) { - - int controls_width = controls_layout.get_width(); - int xroot, discard; - - controls_layout.get_window()->get_origin (xroot, discard); - - if (old_resize_line_y >= 0) { - - /* redraw where it used to be */ - - - Gdk::Rectangle r (0, old_resize_line_y - 1, controls_width + (int) canvas_width, 3); - win->invalidate_rect (r, true); - cerr << "invalidate " << xroot << "," << old_resize_line_y - 1 << ' ' - << controls_width + canvas_width << " x 3\n"; - } - - /* draw where it is */ - - Gdk::Rectangle r (0, at - 1, controls_width + (int) canvas_width, 3); - win->invalidate_rect (r, true); - } -#endif -} - bool Editor::on_expose_event (GdkEventExpose* ev) { diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 7ecab10283..eaa52398d2 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -403,10 +403,6 @@ class Editor : public PublicEditor void goto_visual_state (uint32_t); void save_visual_state (uint32_t); - void queue_draw_resize_line (int at); - void start_resize_line_ops (); - void end_resize_line_ops (); - protected: void map_transport_state (); void map_position_change (nframes64_t); diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index c239a98d52..363dbd3b03 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -620,10 +620,10 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp case SelectionItem: if (Keyboard::modifier_state_contains - (event->button.state, Keyboard::ModifierMask(Keyboard::SecondaryModifier))) { + (event->button.state, Keyboard::ModifierMask(Keyboard::PrimaryModifier))) { // contains and not equals because I can't use alt as a modifier alone. start_selection_grab (item, event); - } else if (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) { + } else if (Keyboard::modifier_state_equals (event->button.state, Keyboard::SecondaryModifier)) { /* grab selection for moving */ start_selection_op (item, event, SelectionMove); } else { @@ -3981,6 +3981,8 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event drag_info.x_constrained = !drag_info.x_constrained; } + cerr << "drag done, copy ? " << drag_info.copy << " x-const ? " << drag_info.x_constrained << endl; + if (drag_info.copy) { if (drag_info.x_constrained) { op_string = _("fixed time region copy"); @@ -4019,8 +4021,10 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event ++i; continue; } + + cerr << "drag delta = " << drag_delta << " rpos was " << rv->region()->position() << endl; - if (changed_position && !drag_info.x_constrained) { + if (changed_position && !drag_info.x_constrained && (mouse_mode != MouseRange)) { where = rv->region()->position() - drag_delta; } else { where = rv->region()->position(); @@ -4055,6 +4059,8 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event session->add_command (new MementoCommand<Playlist>(*to_playlist, &to_playlist->get_state(), 0)); } + cerr << "Adding region @ " << new_region->position() << " at " << where << endl; + to_playlist->add_region (new_region, where); c.disconnect (); @@ -4118,7 +4124,9 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event insert_result = modified_playlists.insert (from_playlist); if (insert_result.second) { - session->add_command (new MementoCommand<Playlist>(*from_playlist, &from_playlist->get_state(), 0)); + if (mouse_mode != MouseRange) { + session->add_command (new MementoCommand<Playlist>(*from_playlist, &from_playlist->get_state(), 0)); + } } from_playlist->remove_region ((rv->region())); @@ -4386,6 +4394,8 @@ Editor::start_selection_grab (ArdourCanvas::Item* item, GdkEvent* event) return; } + cerr << "got " << new_regions.size() << " regions in selection grab\n"; + /* XXX fix me one day to use all new regions */ boost::shared_ptr<Region> region (new_regions.front()); diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 737ae75f6f..690c0a235b 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -221,10 +221,6 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway virtual bool canvas_markerview_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*) = 0; virtual bool canvas_markerview_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*) = 0; - virtual void queue_draw_resize_line (int at) = 0; - virtual void start_resize_line_ops () = 0; - virtual void end_resize_line_ops () = 0; - static const int window_border_width; static const int container_border_width; static const int vertical_spacing; diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 69f3e376ed..c0b6a697ad 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -1210,7 +1210,6 @@ TimeAxisView::resizer_button_press (GdkEventButton* event) { resize_drag_start = event->y_root; resize_idle_target = current_height(); - editor.start_resize_line_ops (); if (resizer_motion_signal) { resizer_motion_signal.disconnect (); } @@ -1222,7 +1221,6 @@ bool TimeAxisView::resizer_button_release (GdkEventButton* ev) { resize_drag_start = -1; - editor.end_resize_line_ops (); resizer_motion_signal.disconnect (); return true; } |