mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-28 09:27:39 +01:00
make dynamic track resizing "work" again; colinf's patch for operations on multiple selected regions from the region context menu
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3495 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
4c00b9a98a
commit
f509da7043
5 changed files with 67 additions and 19 deletions
|
|
@ -344,6 +344,7 @@ Editor::Editor ()
|
|||
resize_line_y = 0;
|
||||
old_resize_line_y = -1;
|
||||
no_region_list_redisplay = false;
|
||||
resize_idle_id = -1;
|
||||
|
||||
_scrubbing = false;
|
||||
scrubbing_direction = 0;
|
||||
|
|
@ -1873,6 +1874,16 @@ Editor::add_region_context_items (AudioStreamView* sv, boost::shared_ptr<Region>
|
|||
fooc.block (false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// multiple regions selected
|
||||
// how should these act?
|
||||
// here they toggle the property of all selected regions
|
||||
|
||||
items.push_back (MenuElem (_("Lock"), mem_fun(*this, &Editor::toggle_region_lock)));
|
||||
items.push_back (MenuElem (_("Mute"), mem_fun(*this, &Editor::toggle_region_mute)));
|
||||
if (!Profile->get_sae()) {
|
||||
items.push_back (MenuElem (_("Opaque"), mem_fun(*this, &Editor::toggle_region_opaque)));
|
||||
}
|
||||
}
|
||||
|
||||
items.push_back (CheckMenuElem (_("Original position"), mem_fun(*this, &Editor::naturalize)));
|
||||
|
|
@ -4712,14 +4723,17 @@ Editor::first_idle ()
|
|||
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) {
|
||||
|
|
@ -4728,11 +4742,13 @@ Editor::end_resize_line_ops ()
|
|||
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;
|
||||
|
|
@ -4760,6 +4776,7 @@ Editor::queue_draw_resize_line (int at)
|
|||
Gdk::Rectangle r (xroot, at - 1, controls_width + (int) canvas_width, 3);
|
||||
win->invalidate_rect (r, true);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -4774,6 +4791,7 @@ Editor::on_expose_event (GdkEventExpose* ev)
|
|||
*/
|
||||
bool ret = Window::on_expose_event (ev);
|
||||
|
||||
#if 0
|
||||
if (need_resize_line) {
|
||||
|
||||
int xroot, yroot, discard;
|
||||
|
|
@ -4831,5 +4849,40 @@ Editor::on_expose_event (GdkEventExpose* ev)
|
|||
}
|
||||
|
||||
//cerr << "--- editor expose\n";
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_idle_resizer (gpointer arg)
|
||||
{
|
||||
return ((Editor*)arg)->idle_resize ();
|
||||
}
|
||||
|
||||
void
|
||||
Editor::add_to_idle_resize (TimeAxisView* view, uint32_t h)
|
||||
{
|
||||
if (resize_idle_id < 0) {
|
||||
resize_idle_id = g_idle_add (_idle_resizer, this);
|
||||
}
|
||||
|
||||
resize_idle_target = h;
|
||||
|
||||
pending_resizes.push_back (view);
|
||||
|
||||
if (!selection->tracks.empty()) {
|
||||
pending_resizes.insert (pending_resizes.end(), selection->tracks.begin(), selection->tracks.end());
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
Editor::idle_resize ()
|
||||
{
|
||||
for (vector<TimeAxisView*>::iterator i = pending_resizes.begin(); i != pending_resizes.end(); ++i) {
|
||||
(*i)->idle_resize (resize_idle_target);
|
||||
}
|
||||
pending_resizes.clear();
|
||||
resize_idle_id = -1;
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,6 +160,7 @@ class Editor : public PublicEditor
|
|||
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 add_to_idle_resize (TimeAxisView*, uint32_t);
|
||||
|
||||
void consider_auditioning (boost::shared_ptr<ARDOUR::Region>);
|
||||
void hide_a_region (boost::shared_ptr<ARDOUR::Region>);
|
||||
|
|
@ -2155,6 +2156,11 @@ public:
|
|||
void waveform_scale_chosen (Editing::WaveformScale);
|
||||
|
||||
bool _have_idled;
|
||||
int resize_idle_id;
|
||||
int32_t resize_idle_target;
|
||||
bool idle_resize();
|
||||
friend gboolean _idle_resize (gpointer);
|
||||
std::vector<TimeAxisView*> pending_resizes;
|
||||
};
|
||||
|
||||
#endif /* __ardour_editor_h__ */
|
||||
|
|
|
|||
|
|
@ -167,6 +167,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
|
|||
virtual void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret) = 0;
|
||||
virtual void mouse_add_new_marker (nframes64_t where, bool is_cd=false, bool is_xrun=false) = 0;
|
||||
virtual void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>) = 0;
|
||||
virtual void add_to_idle_resize (TimeAxisView*,uint32_t) = 0;
|
||||
|
||||
sigc::signal<void> ZoomFocusChanged;
|
||||
sigc::signal<void> ZoomChanged;
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@ TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisVie
|
|||
last_name_entry_key_press_event = 0;
|
||||
name_packing = NamePackingBits (0);
|
||||
resize_drag_start = -1;
|
||||
resize_idle_id = -1;
|
||||
|
||||
/*
|
||||
Create the standard LHS Controls
|
||||
|
|
@ -349,7 +348,7 @@ TimeAxisView::hide ()
|
|||
void
|
||||
TimeAxisView::step_height (bool bigger)
|
||||
{
|
||||
static const int step = 20;
|
||||
static const uint32_t step = 20;
|
||||
|
||||
if (bigger) {
|
||||
set_height (height + step);
|
||||
|
|
@ -1201,18 +1200,10 @@ TimeAxisView::resizer_button_release (GdkEventButton* ev)
|
|||
return true;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_idle_resizer (gpointer arg)
|
||||
void
|
||||
TimeAxisView::idle_resize (uint32_t h)
|
||||
{
|
||||
return ((TimeAxisView*)arg)->idle_resize ();
|
||||
}
|
||||
|
||||
bool
|
||||
TimeAxisView::idle_resize ()
|
||||
{
|
||||
set_height (resize_idle_target);
|
||||
resize_idle_id = -1;
|
||||
return false;
|
||||
set_height (h);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -1233,10 +1224,8 @@ TimeAxisView::resizer_motion (GdkEventMotion* ev)
|
|||
|
||||
resize_idle_target = std::max (resize_idle_target - delta, (int) hSmall);
|
||||
|
||||
if (resize_idle_id < 0) {
|
||||
// resize_idle_id = g_idle_add (_idle_resizer, this);
|
||||
}
|
||||
|
||||
editor.add_to_idle_resize (this, resize_idle_target);
|
||||
|
||||
resize_drag_start = ev->y_root;
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -125,8 +125,7 @@ class TimeAxisView : public virtual AxisView, public Stateful
|
|||
|
||||
double resize_drag_start;
|
||||
int32_t resize_idle_target;
|
||||
int32_t resize_idle_id;
|
||||
bool idle_resize();
|
||||
void idle_resize (uint32_t);
|
||||
|
||||
void hide_name_label ();
|
||||
void hide_name_entry ();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue