Dont move track backgrounds, so that they no longer disappear at high zooms, SAE version uses shift button1 to solo additional tracks in not latched solo mode.

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4089 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Nick Mainsbridge 2008-11-03 21:29:35 +00:00
parent ab795db913
commit a6d1b90b33
12 changed files with 52 additions and 17 deletions

View File

@ -489,6 +489,7 @@ AudioTimeAxisView::toggle_gain_track ()
if (showit) {
gain_track->set_marked_for_display (true);
gain_track->canvas_display->show();
gain_track->canvas_background->show();
gain_track->get_state_node()->add_property ("shown", X_("yes"));
} else {
gain_track->set_marked_for_display (false);
@ -525,6 +526,7 @@ AudioTimeAxisView::toggle_pan_track ()
if (showit) {
pan_track->set_marked_for_display (true);
pan_track->canvas_display->show();
pan_track->canvas_background->show();
pan_track->get_state_node()->add_property ("shown", X_("yes"));
} else {
pan_track->set_marked_for_display (false);

View File

@ -70,10 +70,10 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
ignore_state_request = false;
first_call_to_set_height = true;
base_rect = new SimpleRect(*canvas_display);
base_rect = new SimpleRect(*canvas_background);
base_rect->property_x1() = 0.0;
base_rect->property_y1() = 0.0;
base_rect->property_x2() = editor.frame_to_pixel (max_frames);
base_rect->property_x2() = editor.get_physical_screen_width();
base_rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_AutomationTrackOutline.get();
/* outline ends and bottom */
base_rect->property_outline_what() = (guint32) (0x1|0x2|0x8);

View File

@ -1287,16 +1287,16 @@ Editor::connect_to_session (Session *t)
redisplay_named_selections ();
redisplay_snapshots ();
restore_ruler_visibility ();
//tempo_map_changed (Change (0));
session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks);
initial_route_list_display ();
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
(static_cast<TimeAxisView*>(*i))->set_samples_per_unit (frames_per_unit);
}
restore_ruler_visibility ();
//tempo_map_changed (Change (0));
session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks);
start_scrolling ();
/* don't show master bus in a new session */

View File

@ -317,6 +317,7 @@ class Editor : public PublicEditor
void toggle_measure_visibility ();
void toggle_logo_visibility ();
double get_physical_screen_width () const { return physical_screen_width; };
double physical_screen_width;
double physical_screen_height;
@ -630,6 +631,7 @@ class Editor : public PublicEditor
ArdourCanvas::Group* transport_marker_bar_group;
ArdourCanvas::Group* cd_marker_bar_group;
ArdourCanvas::Group* _background_group;
/*
The _master_group is the group containing all items
that require horizontal scrolling..
@ -720,6 +722,7 @@ class Editor : public PublicEditor
static const double timebar_height;
guint32 visible_timebars;
gdouble canvas_timebars_vsize;
gdouble get_canvas_timebars_vsize () const { return canvas_timebars_vsize; }
Gtk::Menu *editor_ruler_menu;
ArdourCanvas::SimpleRect* tempo_bar;
@ -848,6 +851,8 @@ class Editor : public PublicEditor
sigc::connection control_scroll_connection;
gdouble get_trackview_group_vertical_offset () const { return vertical_adjustment.get_value () - canvas_timebars_vsize;}
ArdourCanvas::Group* get_background_group () const { return _background_group; }
ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
double last_trackview_group_vertical_offset;
void tie_vertical_scrolling ();

View File

@ -132,7 +132,7 @@ Editor::initialize_canvas ()
// logo_item->property_width_set() = true;
logo_item->show ();
}
_background_group = new ArdourCanvas::Group (*track_canvas->root());
_master_group = new ArdourCanvas::Group (*track_canvas->root());
transport_loop_range_rect = new ArdourCanvas::SimpleRect (*_master_group, 0.0, 0.0, 0.0, physical_screen_height);
@ -828,6 +828,7 @@ Editor::scroll_canvas_horizontally ()
_master_group->move (-x_delta, 0);
timebar_group->move (-x_delta, 0);
cursor_group->move (-x_delta, 0);
update_fixed_rulers ();
redisplay_tempo (true);
@ -851,6 +852,7 @@ Editor::scroll_canvas_vertically ()
y_delta = last_trackview_group_vertical_offset - get_trackview_group_vertical_offset ();
_trackview_group->move (0, y_delta);
_background_group->move (0, y_delta);
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
(*i)->clip_to_viewport ();

View File

@ -147,6 +147,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
virtual void toggle_follow_playhead () = 0;
virtual bool follow_playhead() const = 0;
virtual bool dragging_playhead() const = 0;
virtual double get_physical_screen_width() const = 0;
virtual void ensure_float (Gtk::Window&) = 0;
virtual void show_window () = 0;
virtual TrackViewList* get_valid_views (TimeAxisView*, ARDOUR::RouteGroup* grp = 0) = 0;
@ -225,6 +226,8 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
static const int horizontal_spacing;
virtual gdouble get_trackview_group_vertical_offset () const = 0;
virtual gdouble get_canvas_timebars_vsize () const = 0;
virtual ArdourCanvas::Group* get_background_group () const = 0;
virtual ArdourCanvas::Group* get_trackview_group () const = 0;
static PublicEditor* _instance;

View File

@ -1828,6 +1828,7 @@ RouteTimeAxisView::redirect_menu_item_toggled (RouteTimeAxisView::RedirectAutoma
if (showit) {
ran->view->set_marked_for_display (true);
ran->view->canvas_display->show();
ran->view->canvas_background->show();
} else {
rai->redirect->mark_automation_visible (ran->what, true);
ran->view->set_marked_for_display (false);

View File

@ -39,6 +39,7 @@
#include <ardour/audioengine.h>
#include <ardour/audio_track.h>
#include <ardour/audio_diskstream.h>
#include <ardour/profile.h>
#include "i18n.h"
using namespace sigc;
@ -292,7 +293,7 @@ RouteUI::solo_press(GdkEventButton* ev)
if (!ignore_toggle) {
if (Keyboard::is_context_menu_event (ev)) {
if (solo_menu == 0) {
build_solo_menu ();
}
@ -342,8 +343,17 @@ RouteUI::solo_press(GdkEventButton* ev)
// shift-click: set this route to solo safe
_route->set_solo_safe (!_route->solo_safe(), this);
wait_for_release = false;
if (Profile->get_sae() && ev->button == 1) {
// button 1 and shift-click: disables solo_latched for this click
if (!Config->get_solo_latched ()) {
Config->set_solo_latched (true);
reversibly_apply_route_boolean ("solo change", &Route::set_solo, !_route->soloed(), this);
Config->set_solo_latched (false);
}
} else {
_route->set_solo_safe (!_route->solo_safe(), this);
wait_for_release = false;
}
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
@ -444,6 +454,7 @@ RouteUI::rec_enable_release (GdkEventButton* ev)
void
RouteUI::solo_changed(void* src)
{
Gtkmm2ext::UI::instance()->call_slot (mem_fun (*this, &RouteUI::update_solo_display));
}

View File

@ -47,6 +47,7 @@ using namespace Editing;
StreamView::StreamView (RouteTimeAxisView& tv)
: _trackview (tv)
, _background_group(new ArdourCanvas::Group(*_trackview.canvas_background))
, canvas_group(new ArdourCanvas::Group(*_trackview.canvas_display))
, _samples_per_unit(_trackview.editor.get_current_zoom())
, rec_updating(false)
@ -57,10 +58,10 @@ StreamView::StreamView (RouteTimeAxisView& tv)
{
/* set_position() will position the group */
canvas_rect = new ArdourCanvas::SimpleRect (*canvas_group);
canvas_rect = new ArdourCanvas::SimpleRect (*_background_group);
canvas_rect->property_x1() = 0.0;
canvas_rect->property_y1() = 0.0;
canvas_rect->property_x2() = _trackview.editor.frame_to_pixel (max_frames - 1);
canvas_rect->property_x2() = _trackview.editor.get_physical_screen_width();
canvas_rect->property_y2() = (double) tv.current_height();
canvas_rect->property_outline_what() = (guint32) (0x1|0x2|0x8); // outline ends and bottom
@ -285,10 +286,8 @@ StreamView::region_layered (RegionView* rv)
/* don't ever leave it at the bottom, since then it doesn't
get events - the parent group does instead ...
we need to raise it above the streamview's
canvas_rect, hence the layer+1 here
*/
rv->get_canvas_group()->raise (rv->region()->layer() + 1);
rv->get_canvas_group()->raise (rv->region()->layer());
}
void

View File

@ -72,6 +72,7 @@ public:
virtual int set_samples_per_unit (gdouble spp);
gdouble get_samples_per_unit () { return _samples_per_unit; }
ArdourCanvas::Group* background_group() { return _background_group; }
ArdourCanvas::Group* canvas_item() { return canvas_group; }
enum ColorTarget {
@ -123,6 +124,7 @@ protected:
RouteTimeAxisView& _trackview;
ArdourCanvas::Group* _background_group;
ArdourCanvas::Group* canvas_group;
ArdourCanvas::SimpleRect* canvas_rect; /* frame around the whole thing */

View File

@ -78,9 +78,9 @@ TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisVie
compute_controls_size_info ();
need_size_info = false;
}
canvas_background = new Group (*ed.get_background_group (), 0.0, 0.0);
canvas_display = new Group (*ed.get_trackview_group (), 0.0, 0.0);
selection_group = new Group (*canvas_display);
selection_group->hide();
@ -197,6 +197,11 @@ TimeAxisView::~TimeAxisView()
selection_group = 0;
}
if (canvas_background) {
delete canvas_background;
canvas_background = 0;
}
if (canvas_display) {
delete canvas_display;
canvas_display = 0;
@ -223,11 +228,14 @@ TimeAxisView::show_at (double y, int& nth, VBox *parent)
if (y_position != y) {
canvas_display->property_y () = y;
canvas_background->property_y () = y + editor.get_canvas_timebars_vsize();
canvas_background->move (0.0, 0.0);
/* silly canvas */
canvas_display->move (0.0, 0.0);
y_position = y;
}
canvas_background->raise_to_top ();
canvas_display->raise_to_top ();
if (_marked_for_display) {
@ -328,6 +336,7 @@ TimeAxisView::hide ()
}
canvas_display->hide();
canvas_background->hide();
controls_frame.hide ();
if (control_parent) {

View File

@ -103,6 +103,7 @@ class TimeAxisView : public virtual AxisView, public Stateful
uint32_t current_height() const { return height; }
ArdourCanvas::Group *canvas_background;
ArdourCanvas::Group *canvas_display;
Gtk::VBox *control_parent;