mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
Fix audio region copy-drag, partially fix MIDI region copy-drag (thanks torbenh).
git-svn-id: svn://localhost/ardour2/branches/3.0@3809 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
6f4daaae0a
commit
abf64beac6
4 changed files with 59 additions and 12 deletions
|
|
@ -62,8 +62,8 @@ class AudioRegionView : public RegionView
|
|||
bool recording,
|
||||
TimeAxisViewItem::Visibility);
|
||||
|
||||
AudioRegionView (const AudioRegionView& other);
|
||||
AudioRegionView (const AudioRegionView& other, boost::shared_ptr<ARDOUR::AudioRegion>);
|
||||
AudioRegionView (const AudioRegionView& other);
|
||||
AudioRegionView (const AudioRegionView& other, boost::shared_ptr<ARDOUR::AudioRegion>);
|
||||
|
||||
~AudioRegionView ();
|
||||
|
||||
|
|
|
|||
|
|
@ -3329,21 +3329,24 @@ Editor::possibly_copy_regions_during_grab (GdkEvent* event)
|
|||
RegionView* nrv;
|
||||
|
||||
rv = (*i);
|
||||
|
||||
AudioRegionView* arv = dynamic_cast<AudioRegionView*>(rv);
|
||||
MidiRegionView* mrv = dynamic_cast<MidiRegionView*>(rv);
|
||||
|
||||
if (arv) {
|
||||
nrv = new AudioRegionView (*arv);
|
||||
} else if (mrv) {
|
||||
nrv = new MidiRegionView (*mrv);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
const boost::shared_ptr<const Region> original = rv->region();
|
||||
boost::shared_ptr<Region> region_copy = RegionFactory::create (original);
|
||||
|
||||
if (arv) {
|
||||
boost::shared_ptr<AudioRegion> audioregion_copy
|
||||
= boost::dynamic_pointer_cast<AudioRegion>(region_copy);
|
||||
nrv = new AudioRegionView (*arv, audioregion_copy);
|
||||
} else if (mrv) {
|
||||
boost::shared_ptr<MidiRegion> midiregion_copy
|
||||
= boost::dynamic_pointer_cast<MidiRegion>(region_copy);
|
||||
nrv = new MidiRegionView (*mrv, midiregion_copy);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
nrv->get_canvas_group()->show ();
|
||||
new_regionviews.push_back (nrv);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,6 +91,47 @@ MidiRegionView::MidiRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &
|
|||
_note_group->raise_to_top();
|
||||
}
|
||||
|
||||
|
||||
MidiRegionView::MidiRegionView (const MidiRegionView& other)
|
||||
: RegionView (other)
|
||||
, _force_channel(-1)
|
||||
, _last_channel_selection(0xFFFF)
|
||||
, _default_note_length(0.0)
|
||||
, _active_notes(0)
|
||||
, _note_group(new ArdourCanvas::Group(*get_canvas_group()))
|
||||
, _delta_command(NULL)
|
||||
, _mouse_state(None)
|
||||
, _pressed_button(0)
|
||||
{
|
||||
Gdk::Color c;
|
||||
int r,g,b,a;
|
||||
|
||||
UINT_TO_RGBA (other.fill_color, &r, &g, &b, &a);
|
||||
c.set_rgb_p (r/255.0, g/255.0, b/255.0);
|
||||
|
||||
init (c, false);
|
||||
}
|
||||
|
||||
MidiRegionView::MidiRegionView (const MidiRegionView& other, boost::shared_ptr<MidiRegion> other_region)
|
||||
: RegionView (other, boost::shared_ptr<Region> (other_region))
|
||||
, _force_channel(-1)
|
||||
, _last_channel_selection(0xFFFF)
|
||||
, _default_note_length(0.0)
|
||||
, _active_notes(0)
|
||||
, _note_group(new ArdourCanvas::Group(*get_canvas_group()))
|
||||
, _delta_command(NULL)
|
||||
, _mouse_state(None)
|
||||
, _pressed_button(0)
|
||||
{
|
||||
Gdk::Color c;
|
||||
int r,g,b,a;
|
||||
|
||||
UINT_TO_RGBA (other.fill_color, &r, &g, &b, &a);
|
||||
c.set_rgb_p (r/255.0, g/255.0, b/255.0);
|
||||
|
||||
init (c, true);
|
||||
}
|
||||
|
||||
void
|
||||
MidiRegionView::init (Gdk::Color& basic_color, bool wfd)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -57,6 +57,9 @@ class MidiRegionView : public RegionView
|
|||
boost::shared_ptr<ARDOUR::MidiRegion>,
|
||||
double initial_samples_per_unit,
|
||||
Gdk::Color& basic_color);
|
||||
|
||||
MidiRegionView (const MidiRegionView& other);
|
||||
MidiRegionView (const MidiRegionView& other, boost::shared_ptr<ARDOUR::MidiRegion>);
|
||||
|
||||
~MidiRegionView ();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue