_region.note_left (this);
break;
+ case GDK_MOTION_NOTIFY:
+ double ix, iy;
+ ix = ev->motion.x;
+ iy = ev->motion.y;
+ _item->w2i (ix, iy);
+ cerr << "note motion at " << ix << ',' << iy << endl;
+ break;
+
case GDK_BUTTON_PRESS:
if (ev->button.button == 3 && Keyboard::no_modifiers_active (ev->button.state)) {
show_channel_selector();
}
}
- assert (!v.empty ());
+ /* the list of views can be empty at this point if this is a region list-insert drag
+ */
for (list<RegionView*>::const_iterator i = v.begin(); i != v.end(); ++i) {
_views.push_back (DraggingView (*i, this));
MidiRegionView* mrv = dynamic_cast<MidiRegionView*>(rv);
const boost::shared_ptr<const Region> original = rv->region();
- boost::shared_ptr<Region> region_copy = RegionFactory::create (original);
+ boost::shared_ptr<Region> region_copy = RegionFactory::create (original, true);
region_copy->set_position (original->position(), this);
RegionView* nrv;
/* insert into new playlist */
RegionView* new_view = insert_region_into_playlist (
- RegionFactory::create (rv->region ()), dest_rtv, dest_layer, where, modified_playlists
+ RegionFactory::create (rv->region (), true), dest_rtv, dest_layer, where, modified_playlists
);
if (new_view == 0) {
begin_reversible_command (_("insert dragged region"));
playlist->clear_changes ();
- playlist->add_region (RegionFactory::create (region), where, 1.0);
+ playlist->add_region (RegionFactory::create (region, true), where, 1.0);
_session->add_command(new StatefulDiffCommand (playlist));
commit_reversible_command ();
}
begin_reversible_command (_("insert region"));
playlist->clear_changes ();
- playlist->add_region ((RegionFactory::create (region)), get_preferred_edit_position(), times);
+ playlist->add_region ((RegionFactory::create (region, true)), get_preferred_edit_position(), times);
_session->add_command(new StatefulDiffCommand (playlist));
commit_reversible_command ();
}
}
pl->clear_changes ();
- pl->add_region (RegionFactory::create (region), region->last_frame(), times);
+ pl->add_region (RegionFactory::create (region, true), region->last_frame(), times);
_session->add_command (new StatefulDiffCommand (pl));
}
}
playlist->clear_changes ();
- playlist->add_region (RegionFactory::create (region), start, times);
+ playlist->add_region (RegionFactory::create (region, true), start, times);
_session->add_command (new StatefulDiffCommand (playlist));
}
#include "pbd/basename.h"
#include "pbd/enumwriter.h"
-#include "pbd/stacktrace.h"
#include "ardour/audioregion.h"
#include "ardour/audiofilesource.h"
our_interests.add (ARDOUR::Properties::opaque);
our_interests.add (ARDOUR::Properties::fade_in);
our_interests.add (ARDOUR::Properties::fade_out);
+
+ if (last_row != NULL){
+
+ TreeModel::iterator j = _model->get_iter (last_row.get_path());
+ boost::shared_ptr<Region> c = (*j)[_columns.region];
+
+ if (c == r) {
+ populate_row (r, (*j));
+
+ if (what_changed.contains (ARDOUR::Properties::hidden)) {
+ redisplay ();
+ }
+
+ return;
+ }
+ }
+
if (what_changed.contains (our_interests)) {
/* find the region in our model and update its row */
TreeModel::Children rows = _model->children ();
TreeModel::iterator i = rows.begin ();
+
while (i != rows.end ()) {
+
TreeModel::Children children = (*i)->children ();
TreeModel::iterator j = children.begin ();
+
while (j != children.end()) {
+
boost::shared_ptr<Region> c = (*j)[_columns.region];
+
if (c == r) {
+ last_row = TreeRowReference(_model, TreePath(j));
break;
}
++j;
++i;
}
-
}
if (what_changed.contains (ARDOUR::Properties::hidden)) {
boost::shared_ptr<Region> region = (*iter)[_columns.region];
// they could have clicked on a row that is just a placeholder, like "Hidden"
-
if (region) {
+
+ cerr << "Selected region has use count "
+ << _session->playlists->region_use_count (region)
+ << endl;
if (region->automatic()) {
void
EditorRegions::set_selected (RegionSelection& regions)
{
+ TreeModel::Children rows = _model->children();
+
for (RegionSelection::iterator iter = regions.begin(); iter != regions.end(); ++iter) {
TreeModel::iterator i;
- TreeModel::Children rows = _model->children();
+
boost::shared_ptr<Region> r ((*iter)->region());
for (i = rows.begin(); i != rows.end(); ++i) {
}
}
}
+
return false;
}
insert_into_tmp_regionlist (i->second);
}
- stacktrace (cerr, 22);
- cerr << "Redisplay with " << tmp_region_list.size() << " regions\n";
-
for (list<boost::shared_ptr<Region> >::iterator r = tmp_region_list.begin(); r != tmp_region_list.end(); ++r) {
add_region (*r);
}
void reset_sort_type (Editing::RegionListSortType, bool);
void set_selected (RegionSelection &);
void selection_mapover (sigc::slot<void,boost::shared_ptr<ARDOUR::Region> >);
+
boost::shared_ptr<ARDOUR::Region> get_dragged_region ();
boost::shared_ptr<ARDOUR::Region> get_single_selection ();
+
Editing::RegionListSortType sort_type () const {
return _sort_type;
}
+
void redisplay ();
void suspend_redisplay () {
_no_redisplay = true;
}
+
void resume_redisplay () {
_no_redisplay = false;
redisplay ();
};
Columns _columns;
+
+ Gtk::TreeModel::RowReference last_row;
void region_changed (boost::shared_ptr<ARDOUR::Region>, PBD::PropertyChange const &);
void selection_changed ();
+
sigc::connection _change_connection;
+
bool set_selected_in_subrow (boost::shared_ptr<ARDOUR::Region>, Gtk::TreeModel::Row const &, int);
bool selection_filter (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool yn);
+
void name_edit (const std::string&, const std::string&);
void locked_changed (std::string const &);
void glued_changed (std::string const &);
trackview.editor().hide_verbose_canvas_cursor ();
}
+void
+MidiRegionView::note_motion (float fraction)
+{
+ cerr << "Now at " << fraction << " within note\n";
+}
+
void
MidiRegionView::switch_source(boost::shared_ptr<Source> src)
{
void note_entered(ArdourCanvas::CanvasNoteEvent* ev);
void note_left(ArdourCanvas::CanvasNoteEvent* ev);
+ void note_motion (float fraction);
void unique_select(ArdourCanvas::CanvasNoteEvent* ev);
void note_selected(ArdourCanvas::CanvasNoteEvent* ev, bool add, bool extend=false);
void note_deselected(ArdourCanvas::CanvasNoteEvent* ev);