MIDI cut&paste round two (not done yet); a small region trim fix from lincoln s.

git-svn-id: svn://localhost/ardour2/branches/3.0@5517 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2009-08-13 01:57:03 +00:00
parent 677bb36f5c
commit 0178875021
13 changed files with 351 additions and 55 deletions

View file

@ -614,6 +614,9 @@ AudioRegionView::reset_fade_in_shape_width (nframes_t width)
fade_in_shape->property_points() = *points; fade_in_shape->property_points() = *points;
delete points; delete points;
/* ensure trim handle stays on top */
frame_handle_start->raise_to_top();
} }
void void
@ -702,6 +705,9 @@ AudioRegionView::reset_fade_out_shape_width (nframes_t width)
fade_out_shape->property_points() = *points; fade_out_shape->property_points() = *points;
delete points; delete points;
/* ensure trim handle stays on top */
frame_handle_end->raise_to_top();
} }
void void

View file

@ -4011,9 +4011,9 @@ Editor::cut_copy_points (CutCopyOp op)
void void
Editor::cut_copy_midi (CutCopyOp op) Editor::cut_copy_midi (CutCopyOp op)
{ {
cerr << "CCM: there are " << selection->midi.size() << " MRV's to work on\n"; cerr << "CCM: there are " << selection->midi_regions.size() << " MRV's to work on\n";
for (MidiSelection::iterator i = selection->midi.begin(); i != selection->midi.end(); ++i) { for (MidiRegionSelection::iterator i = selection->midi_regions.begin(); i != selection->midi_regions.end(); ++i) {
MidiRegionView* mrv = *i; MidiRegionView* mrv = *i;
mrv->cut_copy_clear (op); mrv->cut_copy_clear (op);
} }
@ -4318,8 +4318,14 @@ Editor::paste_internal (nframes64_t position, float times)
{ {
bool commit = false; bool commit = false;
if (cut_buffer->empty()) { if (internal_editing()) {
return; if (cut_buffer->midi_notes.empty()) {
return;
}
} else {
if (cut_buffer->empty()) {
return;
}
} }
if (position == max_frames) { if (position == max_frames) {
@ -4341,12 +4347,37 @@ Editor::paste_internal (nframes64_t position, float times)
ts.push_back (entered_track); ts.push_back (entered_track);
} }
cerr << "Paste into " << ts.size() << " tracks\n";
for (nth = 0, i = ts.begin(); i != ts.end(); ++i, ++nth) { for (nth = 0, i = ts.begin(); i != ts.end(); ++i, ++nth) {
/* undo/redo is handled by individual tracks */ /* undo/redo is handled by individual tracks/regions */
if ((*i)->paste (position, times, *cut_buffer, nth)) { if (internal_editing()) {
commit = true;
RegionSelection rs;
RegionSelection::iterator r;
MidiNoteSelection::iterator cb;
get_regions_at (rs, position, ts);
cerr << " We have " << cut_buffer->midi_notes.size() << " MIDI cut buffers\n";
for (cb = cut_buffer->midi_notes.begin(), r = rs.begin(); cb != cut_buffer->midi_notes.end() && r != rs.end(); ++r) {
MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (*r);
if (mrv) {
mrv->paste (position, **cb);
++cb;
}
}
} else {
if ((*i)->paste (position, times, *cut_buffer, nth)) {
commit = true;
}
} }
} }

View file

@ -0,0 +1,44 @@
/*
Copyright (C) 2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "midi_cut_buffer.h"
using namespace ARDOUR;
MidiCutBuffer::MidiCutBuffer (Session& s)
: AutomatableSequence<MidiModel::TimeType> (s, 0)
, _origin (0)
{
}
MidiCutBuffer::~MidiCutBuffer ()
{
}
void
MidiCutBuffer::set_origin (MidiCutBuffer::TimeType when)
{
_origin = when;
}
void
MidiCutBuffer::set (const Evoral::Sequence<MidiCutBuffer::TimeType>::Notes& notes)
{
set_notes (notes);
}

View file

@ -0,0 +1,45 @@
/*
Copyright (C) 2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __gtk_ardour_midi_cut_buffer_h__
#define __gtk_ardour_midi_cut_buffer_h__
#include "ardour/midi_model.h"
namespace ARDOUR {
class Session;
}
class MidiCutBuffer : public ARDOUR::AutomatableSequence<ARDOUR::MidiModel::TimeType>
{
public:
typedef ARDOUR::MidiModel::TimeType TimeType;
MidiCutBuffer (ARDOUR::Session&);
~MidiCutBuffer();
TimeType origin() const { return _origin; }
void set_origin (TimeType);
void set (const Evoral::Sequence<TimeType>::Notes&);
private:
TimeType _origin;
};
#endif /* __gtk_ardour_midi_cut_buffer_h__ */

View file

@ -47,6 +47,7 @@
#include "ghostregion.h" #include "ghostregion.h"
#include "gui_thread.h" #include "gui_thread.h"
#include "keyboard.h" #include "keyboard.h"
#include "midi_cut_buffer.h"
#include "midi_region_view.h" #include "midi_region_view.h"
#include "midi_streamview.h" #include "midi_streamview.h"
#include "midi_time_axis.h" #include "midi_time_axis.h"
@ -660,7 +661,6 @@ MidiRegionView::~MidiRegionView ()
} }
_selection.clear(); _selection.clear();
_cut_buffer.clear ();
clear_events(); clear_events();
delete _note_group; delete _note_group;
delete _delta_command; delete _delta_command;
@ -1669,17 +1669,25 @@ MidiRegionView::cut_copy_clear (Editing::CutCopyOp op)
return; return;
} }
_cut_buffer.clear (); PublicEditor& editor (trackview.editor());
switch (op) {
case Cut:
case Copy:
cerr << "Cut/Copy: get selection as CB\n";
editor.get_cut_buffer().add (selection_as_cut_buffer());
break;
default:
break;
}
start_delta_command(); start_delta_command();
for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) { for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) {
switch (op) { switch (op) {
case Copy: case Copy:
_cut_buffer.push_back (NoteType (*((*i)->note().get())));
break; break;
case Cut: case Cut:
_cut_buffer.push_back (NoteType (*(*i)->note().get()));
command_remove_note (*i); command_remove_note (*i);
break; break;
case Clear: case Clear:
@ -1690,3 +1698,33 @@ MidiRegionView::cut_copy_clear (Editing::CutCopyOp op)
apply_command(); apply_command();
} }
MidiCutBuffer*
MidiRegionView::selection_as_cut_buffer () const
{
Evoral::Sequence<MidiModel::TimeType>::Notes notes;
for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) {
notes.push_back (boost::shared_ptr<NoteType> (new NoteType (*((*i)->note().get()))));
}
/* sort them into time order */
sort (notes.begin(), notes.end(), Evoral::Sequence<MidiModel::TimeType>::note_time_comparator);
MidiCutBuffer* cb = new MidiCutBuffer (trackview.session());
cb->set (notes);
return cb;
}
void
MidiRegionView::paste (nframes64_t pos, const MidiCutBuffer& mcb)
{
MidiModel::DeltaCommand* cmd = _model->new_delta_command("paste");
for (Evoral::Sequence<MidiModel::TimeType>::Notes::const_iterator i = mcb.notes().begin(); i != mcb.notes().end(); ++i) {
cmd->add (boost::shared_ptr<NoteType> (new NoteType (*((*i).get()))));
}
_model->apply_command(trackview.session(), cmd);
}

View file

@ -57,6 +57,7 @@ class MidiTimeAxisView;
class GhostRegion; class GhostRegion;
class AutomationTimeAxisView; class AutomationTimeAxisView;
class AutomationRegionView; class AutomationRegionView;
class MidiCutBuffer;
class MidiRegionView : public RegionView class MidiRegionView : public RegionView
{ {
@ -100,6 +101,7 @@ class MidiRegionView : public RegionView
void resolve_note(uint8_t note_num, double end_time); void resolve_note(uint8_t note_num, double end_time);
void cut_copy_clear (Editing::CutCopyOp); void cut_copy_clear (Editing::CutCopyOp);
void paste (nframes64_t pos, const MidiCutBuffer&);
struct PCEvent { struct PCEvent {
PCEvent(double a_time, uint8_t a_value, uint8_t a_channel) PCEvent(double a_time, uint8_t a_value, uint8_t a_channel)
@ -256,21 +258,24 @@ class MidiRegionView : public RegionView
/** Convert a timestamp in frames to beats (both relative to region start) */ /** Convert a timestamp in frames to beats (both relative to region start) */
double frames_to_beats(nframes64_t beats) const; double frames_to_beats(nframes64_t beats) const;
/** Return the current selection as a MidiModel or null if there is no selection */
ARDOUR::MidiModel* selection_as_model () const;
protected: protected:
/** Allows derived types to specify their visibility requirements /** Allows derived types to specify their visibility requirements
* to the TimeAxisViewItem parent class. * to the TimeAxisViewItem parent class.
*/ */
MidiRegionView (ArdourCanvas::Group *, MidiRegionView (ArdourCanvas::Group *,
RouteTimeAxisView&, RouteTimeAxisView&,
boost::shared_ptr<ARDOUR::MidiRegion>, boost::shared_ptr<ARDOUR::MidiRegion>,
double samples_per_unit, double samples_per_unit,
Gdk::Color& basic_color, Gdk::Color& basic_color,
TimeAxisViewItem::Visibility); TimeAxisViewItem::Visibility);
void region_resized (ARDOUR::Change); void region_resized (ARDOUR::Change);
void set_flags (XMLNode *); void set_flags (XMLNode *);
void store_flags (); void store_flags ();
void reset_width_dependent_items (double pixel_width); void reset_width_dependent_items (double pixel_width);
@ -333,9 +338,8 @@ class MidiRegionView : public RegionView
typedef std::set<ArdourCanvas::CanvasNoteEvent*> Selection; typedef std::set<ArdourCanvas::CanvasNoteEvent*> Selection;
/// Currently selected CanvasNoteEvents /// Currently selected CanvasNoteEvents
Selection _selection; Selection _selection;
/// the cut buffer for this region view
typedef std::list<NoteType> CutBuffer; MidiCutBuffer* selection_as_cut_buffer () const;
CutBuffer _cut_buffer;
/** New notes (created in the current command) which should be selected /** New notes (created in the current command) which should be selected
* when they appear after the command is applied. */ * when they appear after the command is applied. */

View file

@ -23,7 +23,9 @@
#include <list> #include <list>
class MidiRegionView; class MidiRegionView;
class MidiCutBuffer;
struct MidiSelection : std::list<MidiRegionView*> {}; struct MidiRegionSelection : std::list<MidiRegionView*> {};
struct MidiNoteSelection : std::list<MidiCutBuffer*> {};
#endif /* __ardour_gtk_midi_selection_h__ */ #endif /* __ardour_gtk_midi_selection_h__ */

View file

@ -1462,8 +1462,9 @@ RouteTimeAxisView::paste (nframes_t pos, float times, Selection& selection, size
return false; return false;
} }
if (get_diskstream()->speed() != 1.0f) if (get_diskstream()->speed() != 1.0f) {
pos = session_frame_to_track_frame(pos, get_diskstream()->speed() ); pos = session_frame_to_track_frame(pos, get_diskstream()->speed() );
}
XMLNode &before = playlist->get_state(); XMLNode &before = playlist->get_state();
playlist->paste (*p, pos, times); playlist->paste (*p, pos, times);

View file

@ -53,7 +53,8 @@ Selection::operator= (const Selection& other)
tracks = other.tracks; tracks = other.tracks;
time = other.time; time = other.time;
lines = other.lines; lines = other.lines;
midi = other.midi; midi_regions = other.midi_regions;
midi_notes = other.midi_notes;
} }
return *this; return *this;
} }
@ -68,7 +69,8 @@ operator== (const Selection& a, const Selection& b)
a.time == b.time && a.time == b.time &&
a.lines == b.lines && a.lines == b.lines &&
a.playlists == b.playlists && a.playlists == b.playlists &&
a.midi == b.midi; a.midi_notes == b.midi_notes &&
a.midi_regions == b.midi_regions;
} }
/** Clear everything from the Selection */ /** Clear everything from the Selection */
@ -81,7 +83,8 @@ Selection::clear ()
clear_lines(); clear_lines();
clear_time (); clear_time ();
clear_playlists (); clear_playlists ();
clear_midi (); clear_midi_notes ();
clear_midi_regions ();
} }
void void
@ -113,11 +116,20 @@ Selection::clear_tracks ()
} }
void void
Selection::clear_midi () Selection::clear_midi_notes ()
{ {
if (!midi.empty()) { if (!midi_notes.empty()) {
midi.clear (); midi_notes.clear ();
MidiChanged (); MidiNotesChanged ();
}
}
void
Selection::clear_midi_regions ()
{
if (!midi_regions.empty()) {
midi_regions.clear ();
MidiRegionsChanged ();
} }
} }
@ -185,7 +197,7 @@ void
Selection::toggle (const list<TimeAxisView*>& track_list) Selection::toggle (const list<TimeAxisView*>& track_list)
{ {
for (list<TimeAxisView*>::const_iterator i = track_list.begin(); i != track_list.end(); ++i) { for (list<TimeAxisView*>::const_iterator i = track_list.begin(); i != track_list.end(); ++i) {
toggle ( (*i) ); toggle ((*i));
} }
} }
@ -205,6 +217,29 @@ Selection::toggle (TimeAxisView* track)
TracksChanged(); TracksChanged();
} }
void
Selection::toggle (const MidiNoteSelection& midi_note_list)
{
for (MidiNoteSelection::const_iterator i = midi_note_list.begin(); i != midi_note_list.end(); ++i) {
toggle ((*i));
}
}
void
Selection::toggle (MidiCutBuffer* midi)
{
MidiNoteSelection::iterator i;
if ((i = find (midi_notes.begin(), midi_notes.end(), midi)) == midi_notes.end()) {
midi_notes.push_back (midi);
} else {
midi_notes.erase (i);
}
MidiNotesChanged();
}
void void
Selection::toggle (RegionView* r) Selection::toggle (RegionView* r)
{ {
@ -222,15 +257,15 @@ Selection::toggle (RegionView* r)
void void
Selection::toggle (MidiRegionView* mrv) Selection::toggle (MidiRegionView* mrv)
{ {
MidiSelection::iterator i; MidiRegionSelection::iterator i;
if ((i = find (midi.begin(), midi.end(), mrv)) == midi.end()) { if ((i = find (midi_regions.begin(), midi_regions.end(), mrv)) == midi_regions.end()) {
add (mrv); add (mrv);
} else { } else {
midi.erase (i); midi_regions.erase (i);
} }
MidiChanged (); MidiRegionsChanged ();
} }
void void
@ -319,6 +354,27 @@ Selection::add (TimeAxisView* track)
} }
} }
void
Selection::add (const MidiNoteSelection& midi_list)
{
const MidiNoteSelection::const_iterator b = midi_list.begin();
const MidiNoteSelection::const_iterator e = midi_list.end();
if (!midi_list.empty()) {
midi_notes.insert (midi_notes.end(), b, e);
MidiNotesChanged ();
}
}
void
Selection::add (MidiCutBuffer* midi)
{
if (find (midi_notes.begin(), midi_notes.end(), midi) == midi_notes.end()) {
midi_notes.push_back (midi);
MidiNotesChanged ();
}
}
void void
Selection::add (vector<RegionView*>& v) Selection::add (vector<RegionView*>& v)
{ {
@ -378,15 +434,15 @@ Selection::add (RegionView* r)
void void
Selection::add (MidiRegionView* mrv) Selection::add (MidiRegionView* mrv)
{ {
if (find (midi.begin(), midi.end(), mrv) == midi.end()) { if (find (midi_regions.begin(), midi_regions.end(), mrv) == midi_regions.end()) {
midi.push_back (mrv); midi_regions.push_back (mrv);
/* XXX should we do this? */ /* XXX should we do this? */
#if 0 #if 0
if (Config->get_link_region_and_track_selection()) { if (Config->get_link_region_and_track_selection()) {
add (&mrv->get_trackview()); add (&mrv->get_trackview());
} }
#endif #endif
MidiChanged (); MidiRegionsChanged ();
} }
} }
@ -472,6 +528,37 @@ Selection::remove (const list<TimeAxisView*>& track_list)
} }
} }
void
Selection::remove (const MidiNoteSelection& midi_list)
{
bool changed = false;
for (MidiNoteSelection::const_iterator i = midi_list.begin(); i != midi_list.end(); ++i) {
MidiNoteSelection::iterator x;
if ((x = find (midi_notes.begin(), midi_notes.end(), (*i))) != midi_notes.end()) {
midi_notes.erase (x);
changed = true;
}
}
if (changed) {
MidiNotesChanged();
}
}
void
Selection::remove (MidiCutBuffer* midi)
{
MidiNoteSelection::iterator x;
if ((x = find (midi_notes.begin(), midi_notes.end(), midi)) != midi_notes.end()) {
midi_notes.erase (x);
MidiNotesChanged ();
}
}
void void
Selection::remove (boost::shared_ptr<Playlist> track) Selection::remove (boost::shared_ptr<Playlist> track)
{ {
@ -517,11 +604,11 @@ Selection::remove (RegionView* r)
void void
Selection::remove (MidiRegionView* mrv) Selection::remove (MidiRegionView* mrv)
{ {
MidiSelection::iterator x; MidiRegionSelection::iterator x;
if ((x = find (midi.begin(), midi.end(), mrv)) != midi.end()) { if ((x = find (midi_regions.begin(), midi_regions.end(), mrv)) != midi_regions.end()) {
midi.erase (x); midi_regions.erase (x);
MidiChanged (); MidiRegionsChanged ();
} }
#if 0 #if 0
@ -579,6 +666,13 @@ Selection::set (const list<TimeAxisView*>& track_list)
add (track_list); add (track_list);
} }
void
Selection::set (const MidiNoteSelection& midi_list)
{
clear_midi_notes ();
add (midi_list);
}
void void
Selection::set (boost::shared_ptr<Playlist> playlist) Selection::set (boost::shared_ptr<Playlist> playlist)
{ {
@ -604,7 +698,7 @@ Selection::set (const RegionSelection& rs)
void void
Selection::set (MidiRegionView* mrv) Selection::set (MidiRegionView* mrv)
{ {
clear_midi (); clear_midi_regions ();
add (mrv); add (mrv);
} }
@ -690,17 +784,28 @@ Selection::selected (RegionView* rv)
} }
bool bool
Selection::empty () Selection::empty (bool internal_selection)
{ {
return regions.empty () && bool object_level_empty = regions.empty () &&
tracks.empty () && tracks.empty () &&
points.empty () && points.empty () &&
playlists.empty () && playlists.empty () &&
lines.empty () && lines.empty () &&
time.empty () && time.empty () &&
playlists.empty () && playlists.empty () &&
markers.empty() markers.empty() &&
midi_regions.empty()
; ;
if (!internal_selection) {
return object_level_empty;
}
/* this is intended to really only apply when using a Selection
as a cut buffer.
*/
return object_level_empty && midi_notes.empty();
} }
void void

View file

@ -79,7 +79,8 @@ class Selection : public sigc::trackable
PlaylistSelection playlists; PlaylistSelection playlists;
PointSelection points; PointSelection points;
MarkerSelection markers; MarkerSelection markers;
MidiSelection midi; MidiRegionSelection midi_regions;
MidiNoteSelection midi_notes;
Selection (PublicEditor const * e) : editor (e), next_time_id (0) { Selection (PublicEditor const * e) : editor (e), next_time_id (0) {
clear(); clear();
@ -94,10 +95,11 @@ class Selection : public sigc::trackable
sigc::signal<void> PlaylistsChanged; sigc::signal<void> PlaylistsChanged;
sigc::signal<void> PointsChanged; sigc::signal<void> PointsChanged;
sigc::signal<void> MarkersChanged; sigc::signal<void> MarkersChanged;
sigc::signal<void> MidiChanged; sigc::signal<void> MidiNotesChanged;
sigc::signal<void> MidiRegionsChanged;
void clear (); void clear ();
bool empty(); bool empty (bool internal_selection = false);
void dump_region_layers(); void dump_region_layers();
@ -111,6 +113,7 @@ class Selection : public sigc::trackable
void set (TimeAxisView*); void set (TimeAxisView*);
void set (const std::list<TimeAxisView*>&); void set (const std::list<TimeAxisView*>&);
void set (const MidiNoteSelection&);
void set (RegionView*, bool also_clear_tracks = true); void set (RegionView*, bool also_clear_tracks = true);
void set (MidiRegionView*); void set (MidiRegionView*);
void set (std::vector<RegionView*>&); void set (std::vector<RegionView*>&);
@ -124,8 +127,10 @@ class Selection : public sigc::trackable
void toggle (TimeAxisView*); void toggle (TimeAxisView*);
void toggle (const std::list<TimeAxisView*>&); void toggle (const std::list<TimeAxisView*>&);
void toggle (const MidiNoteSelection&);
void toggle (RegionView*); void toggle (RegionView*);
void toggle (MidiRegionView*); void toggle (MidiRegionView*);
void toggle (MidiCutBuffer*);
void toggle (std::vector<RegionView*>&); void toggle (std::vector<RegionView*>&);
long toggle (nframes_t, nframes_t); long toggle (nframes_t, nframes_t);
void toggle (ARDOUR::AutomationList*); void toggle (ARDOUR::AutomationList*);
@ -136,8 +141,10 @@ class Selection : public sigc::trackable
void add (TimeAxisView*); void add (TimeAxisView*);
void add (const std::list<TimeAxisView*>&); void add (const std::list<TimeAxisView*>&);
void add (const MidiNoteSelection&);
void add (RegionView*); void add (RegionView*);
void add (MidiRegionView*); void add (MidiRegionView*);
void add (MidiCutBuffer*);
void add (std::vector<RegionView*>&); void add (std::vector<RegionView*>&);
long add (nframes_t, nframes_t); long add (nframes_t, nframes_t);
void add (boost::shared_ptr<Evoral::ControlList>); void add (boost::shared_ptr<Evoral::ControlList>);
@ -148,8 +155,10 @@ class Selection : public sigc::trackable
void add (const RegionSelection&); void add (const RegionSelection&);
void remove (TimeAxisView*); void remove (TimeAxisView*);
void remove (const std::list<TimeAxisView*>&); void remove (const std::list<TimeAxisView*>&);
void remove (const MidiNoteSelection&);
void remove (RegionView*); void remove (RegionView*);
void remove (MidiRegionView*); void remove (MidiRegionView*);
void remove (MidiCutBuffer*);
void remove (uint32_t selection_id); void remove (uint32_t selection_id);
void remove (nframes_t, nframes_t); void remove (nframes_t, nframes_t);
void remove (boost::shared_ptr<ARDOUR::AutomationList>); void remove (boost::shared_ptr<ARDOUR::AutomationList>);
@ -167,7 +176,8 @@ class Selection : public sigc::trackable
void clear_playlists (); void clear_playlists ();
void clear_points (); void clear_points ();
void clear_markers (); void clear_markers ();
void clear_midi (); void clear_midi_notes ();
void clear_midi_regions ();
void foreach_region (void (ARDOUR::Region::*method)(void)); void foreach_region (void (ARDOUR::Region::*method)(void));
void foreach_regionview (void (RegionView::*method)(void)); void foreach_regionview (void (RegionView::*method)(void));

View file

@ -126,6 +126,7 @@ gtk2_ardour_sources = [
'main.cc', 'main.cc',
'marker.cc', 'marker.cc',
'midi_channel_selector.cc', 'midi_channel_selector.cc',
'midi_cut_buffer.cc',
'midi_port_dialog.cc', 'midi_port_dialog.cc',
'midi_region_view.cc', 'midi_region_view.cc',
'midi_scroomer.cc', 'midi_scroomer.cc',

View file

@ -104,6 +104,8 @@ public:
inline Notes& notes() { return _notes; } inline Notes& notes() { return _notes; }
inline const Notes& notes() const { return _notes; } inline const Notes& notes() const { return _notes; }
void set_notes (const std::vector<boost::shared_ptr<Note<Time> > >&);
typedef std::vector< boost::shared_ptr< Event<Time> > > SysExes; typedef std::vector< boost::shared_ptr< Event<Time> > > SysExes;
inline SysExes& sysexes() { return _sysexes; } inline SysExes& sysexes() { return _sysexes; }
inline const SysExes& sysexes() const { return _sysexes; } inline const SysExes& sysexes() const { return _sysexes; }

View file

@ -780,6 +780,13 @@ Sequence<Time>::remove_note_unlocked(const boost::shared_ptr< const Note<Time> >
} }
} }
template<typename Time>
void
Sequence<Time>::set_notes (const Sequence<Time>::Notes& n)
{
_notes = n;
}
template class Sequence<double>; template class Sequence<double>;
} // namespace Evoral } // namespace Evoral