X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor_audiotrack.cc;h=323562c278864f78ddf51902a6e9be7d699549a5;hb=62c4e88a9d8f4a7b019243fe9a10830b1da0150c;hp=43f63eed7901abfc2fa1cc96008d6233e0264308;hpb=b42213bb04031b954eda4f9b39c5f183bfb96ede;p=ardour.git diff --git a/gtk2_ardour/editor_audiotrack.cc b/gtk2_ardour/editor_audiotrack.cc index 43f63eed79..323562c278 100644 --- a/gtk2_ardour/editor_audiotrack.cc +++ b/gtk2_ardour/editor_audiotrack.cc @@ -1,106 +1,46 @@ /* - Copyright (C) 2000-2007 Paul Davis + * Copyright (C) 2006-2012 David Robillard + * Copyright (C) 2007-2016 Paul Davis + * Copyright (C) 2009-2010 Carl Hetherington + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "ardour/rc_configuration.h" + +#include "canvas/canvas.h" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include -#include - -#include "ardour_ui.h" #include "editor.h" #include "editing.h" #include "audio_time_axis.h" #include "route_time_axis.h" #include "audio_region_view.h" #include "selection.h" +#include "ui_config.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace ARDOUR; using namespace PBD; void -Editor::set_loop_from_selection (bool play) -{ - if (session == 0 || selection->time.empty()) { - return; - } - - nframes_t start = selection->time[clicked_selection].start; - nframes_t end = selection->time[clicked_selection].end; - - set_loop_range (start, end, _("set loop range from selection")); - - if (play) { - session->request_play_loop (true); - session->request_locate (start, true); - } -} - -void -Editor::set_punch_from_selection () -{ - if (session == 0 || selection->time.empty()) { - return; - } - - nframes_t start = selection->time[clicked_selection].start; - nframes_t end = selection->time[clicked_selection].end; - - set_punch_range (start, end, _("set punch range from selection")); -} - -void -Editor::set_show_waveforms (bool yn) -{ - AudioTimeAxisView* atv; - - if (_show_waveforms != yn) { - _show_waveforms = yn; - for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { - if ((atv = dynamic_cast(*i)) != 0) { - atv->set_show_waveforms (yn); - } - } - } -} - -void -Editor::set_show_waveforms_recording (bool yn) -{ - AudioTimeAxisView* atv; - - if (_show_waveforms_recording != yn) { - _show_waveforms_recording = yn; - for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { - if ((atv = dynamic_cast(*i)) != 0) { - atv->set_show_waveforms_recording (yn); - } - } - } -} - -gint -Editor::start_updating () +Editor::start_updating_meters () { RouteTimeAxisView* rtv; - //cerr << "Editor::start_updating () called" << endl;//DEBUG - if (is_mapped() && session) { + if (contents().is_mapped() && _session) { for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { if ((rtv = dynamic_cast(*i)) != 0) { rtv->reset_meter (); @@ -108,53 +48,35 @@ Editor::start_updating () } } - if (!meters_running) { - fast_screen_update_connection = ARDOUR_UI::SuperRapidScreenUpdate.connect (mem_fun(*this, &Editor::fast_update_strips)); - meters_running = true; - } - return 0; + meters_running = true; } -gint -Editor::stop_updating () +void +Editor::stop_updating_meters () { RouteTimeAxisView* rtv; - + meters_running = false; - fast_screen_update_connection.disconnect(); - //cerr << "Editor::stop_updating () called" << endl;//DEBUG - if (is_mapped() && session) { + + if (contents().is_mapped() && _session) { for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { if ((rtv = dynamic_cast(*i)) != 0) { rtv->hide_meter (); } } } - - return 0; } void Editor::toggle_meter_updating() { - if (Config->get_show_track_meters()) { - start_updating(); + DisplaySuspender ds; + if (UIConfiguration::instance().get_show_track_meters()) { + start_updating_meters (); } else { - stop_updating (); + stop_updating_meters (); } -} - -void -Editor::fast_update_strips () -{ - RouteTimeAxisView* rtv; - if (is_mapped() && session) { - for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { - if ((rtv = dynamic_cast(*i)) != 0) { - rtv->fast_update (); - } - } - } + track_canvas_viewport_allocate (_track_canvas->get_allocation()); }