mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-06 21:55:43 +01:00
make feature lines (rhythm ferret etc) scale with zoom; hide them whenever RF hides
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3143 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
b0ccb3d4d4
commit
fb6565456e
7 changed files with 71 additions and 19 deletions
|
|
@ -159,6 +159,7 @@ class Editor : public PublicEditor
|
|||
void connect_to_image_compositor() ;
|
||||
void scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item) ;
|
||||
TimeAxisView* get_named_time_axis(const std::string & name) ;
|
||||
void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>);
|
||||
|
||||
void consider_auditioning (boost::shared_ptr<ARDOUR::Region>);
|
||||
void hide_a_region (boost::shared_ptr<ARDOUR::Region>);
|
||||
|
|
|
|||
|
|
@ -566,3 +566,11 @@ Editor::route_list_display_drag_data_received (const RefPtr<Gdk::DragContext>& c
|
|||
cerr << "some other kind of drag\n";
|
||||
context->drag_finish (true, false, time);
|
||||
}
|
||||
|
||||
void
|
||||
Editor::foreach_time_axis_view (sigc::slot<void,TimeAxisView&> theslot)
|
||||
{
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
theslot (**i);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,6 +161,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
|
|||
virtual void toggle_meter_updating() = 0;
|
||||
virtual void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret) = 0;
|
||||
virtual void mouse_add_new_marker (nframes_t where, bool is_cd=false, bool is_xrun=false) = 0;
|
||||
virtual void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>) = 0;
|
||||
|
||||
sigc::signal<void> ZoomFocusChanged;
|
||||
sigc::signal<void> ZoomChanged;
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ RhythmFerret::run_analysis ()
|
|||
}
|
||||
|
||||
for (RegionSelection::iterator i = regions.begin(); i != regions.end(); ++i) {
|
||||
(*i)->get_time_axis_view().show_temporary_lines (current_results);
|
||||
(*i)->get_time_axis_view().show_feature_lines (current_results);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -269,7 +269,7 @@ RhythmFerret::do_split_action ()
|
|||
tmp = i;
|
||||
++tmp;
|
||||
|
||||
(*i)->get_time_axis_view().hide_temporary_lines ();
|
||||
(*i)->get_time_axis_view().hide_feature_lines ();
|
||||
|
||||
editor.split_region_at_points ((*i)->region(), current_results, false);
|
||||
|
||||
|
|
@ -286,3 +286,16 @@ RhythmFerret::set_session (Session* s)
|
|||
ArdourDialog::set_session (s);
|
||||
current_results.clear ();
|
||||
}
|
||||
|
||||
static void hide_time_axis_features (TimeAxisView& tav)
|
||||
{
|
||||
tav.hide_feature_lines ();
|
||||
}
|
||||
|
||||
void
|
||||
RhythmFerret::on_hide ()
|
||||
{
|
||||
editor.foreach_time_axis_view (sigc::ptr_fun (hide_time_axis_features));
|
||||
ArdourDialog::on_hide ();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@ class RhythmFerret : public ArdourDialog {
|
|||
~RhythmFerret ();
|
||||
|
||||
void set_session (ARDOUR::Session*);
|
||||
|
||||
protected:
|
||||
void on_hide ();
|
||||
|
||||
private:
|
||||
PublicEditor& editor;
|
||||
|
|
|
|||
|
|
@ -171,6 +171,10 @@ TimeAxisView::~TimeAxisView()
|
|||
delete (*i)->end_trim;
|
||||
}
|
||||
|
||||
for (list<SimpleLine*>::iterator i = feature_lines.begin(); i != feature_lines.end(); ++i) {
|
||||
delete (*i);
|
||||
}
|
||||
|
||||
if (selection_group) {
|
||||
delete selection_group;
|
||||
selection_group = 0;
|
||||
|
|
@ -618,6 +622,14 @@ TimeAxisView::build_display_menu ()
|
|||
void
|
||||
TimeAxisView::set_samples_per_unit (double spu)
|
||||
{
|
||||
AnalysisFeatureList::const_iterator i;
|
||||
list<ArdourCanvas::SimpleLine*>::iterator l;
|
||||
|
||||
for (i = analysis_features.begin(), l = feature_lines.begin(); i != analysis_features.end() && l != feature_lines.end(); ++i, ++l) {
|
||||
(*l)->property_x1() = editor.frame_to_pixel (*i);
|
||||
(*l)->property_x2() = editor.frame_to_pixel (*i);
|
||||
}
|
||||
|
||||
for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
|
||||
(*i)->set_samples_per_unit (spu);
|
||||
}
|
||||
|
|
@ -1113,35 +1125,47 @@ TimeAxisView::covers_y_position (double y)
|
|||
}
|
||||
|
||||
void
|
||||
TimeAxisView::show_temporary_lines (const AnalysisFeatureList& pos)
|
||||
TimeAxisView::show_feature_lines (const AnalysisFeatureList& pos)
|
||||
{
|
||||
while (temp_lines.size()< pos.size()) {
|
||||
analysis_features = pos;
|
||||
reshow_feature_lines ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TimeAxisView::hide_feature_lines ()
|
||||
{
|
||||
list<ArdourCanvas::SimpleLine*>::iterator l;
|
||||
|
||||
for (l = feature_lines.begin(); l != feature_lines.end(); ++l) {
|
||||
(*l)->hide();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
TimeAxisView::reshow_feature_lines ()
|
||||
{
|
||||
while (feature_lines.size()< analysis_features.size()) {
|
||||
ArdourCanvas::SimpleLine* l = new ArdourCanvas::SimpleLine (*canvas_display);
|
||||
l->property_color_rgba() = (guint) ARDOUR_UI::config()->canvasvar_ZeroLine.get();
|
||||
l->property_y1() = 0;
|
||||
l->property_y2() = height;
|
||||
temp_lines.push_back (l);
|
||||
feature_lines.push_back (l);
|
||||
}
|
||||
|
||||
while (temp_lines.size() > pos.size()) {
|
||||
ArdourCanvas::SimpleLine *line = temp_lines.back();
|
||||
temp_lines.pop_back ();
|
||||
while (feature_lines.size() > analysis_features.size()) {
|
||||
ArdourCanvas::SimpleLine *line = feature_lines.back();
|
||||
feature_lines.pop_back ();
|
||||
delete line;
|
||||
}
|
||||
|
||||
AnalysisFeatureList::const_iterator i;
|
||||
list<ArdourCanvas::SimpleLine*>::iterator l;
|
||||
|
||||
for (i = pos.begin(), l = temp_lines.begin(); i != pos.end() && l != temp_lines.end(); ++i, ++l) {
|
||||
for (i = analysis_features.begin(), l = feature_lines.begin(); i != analysis_features.end() && l != feature_lines.end(); ++i, ++l) {
|
||||
(*l)->property_x1() = editor.frame_to_pixel (*i);
|
||||
(*l)->property_x2() = editor.frame_to_pixel (*i);
|
||||
(*l)->show ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
TimeAxisView::hide_temporary_lines ()
|
||||
{
|
||||
for (list<ArdourCanvas::SimpleLine*>::iterator l = temp_lines.begin(); l != temp_lines.end(); ++l) {
|
||||
(*l)->hide ();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -176,8 +176,8 @@ class TimeAxisView : public virtual AxisView
|
|||
virtual ARDOUR::RouteGroup* edit_group() const { return 0; }
|
||||
virtual boost::shared_ptr<ARDOUR::Playlist> playlist() const { return boost::shared_ptr<ARDOUR::Playlist> (); }
|
||||
|
||||
virtual void show_temporary_lines (const ARDOUR::AnalysisFeatureList&);
|
||||
virtual void hide_temporary_lines ();
|
||||
virtual void show_feature_lines (const ARDOUR::AnalysisFeatureList&);
|
||||
virtual void hide_feature_lines ();
|
||||
|
||||
virtual void set_samples_per_unit (double);
|
||||
virtual void show_selection (TimeSelection&);
|
||||
|
|
@ -332,7 +332,9 @@ class TimeAxisView : public virtual AxisView
|
|||
void set_height_pixels (uint32_t h);
|
||||
void color_handler ();
|
||||
|
||||
list<ArdourCanvas::SimpleLine*> temp_lines;
|
||||
list<ArdourCanvas::SimpleLine*> feature_lines;
|
||||
ARDOUR::AnalysisFeatureList analysis_features;
|
||||
void reshow_feature_lines ();
|
||||
|
||||
}; /* class TimeAxisView */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue