summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/editor_drag.cc2
-rw-r--r--gtk2_ardour/midi_region_view.cc5
-rw-r--r--libs/ardour/ardour/midi_region.h9
-rw-r--r--libs/ardour/ardour/region.h4
-rw-r--r--libs/ardour/midi_region.cc17
-rw-r--r--libs/ardour/region.cc27
-rw-r--r--libs/evoral/evoral/Event.hpp3
-rw-r--r--libs/evoral/evoral/Sequence.hpp2
-rw-r--r--libs/evoral/src/Event.cpp14
-rw-r--r--libs/evoral/src/Sequence.cpp20
-rw-r--r--libs/fst/vstwin.c1
11 files changed, 21 insertions, 83 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index daebea1cfe..fb3ef58802 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -1533,7 +1533,6 @@ TrimDrag::start_grab (GdkEvent* event, Gdk::Cursor*)
framepos_t const pf = adjusted_current_frame (event);
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
- /* Move the contents of the region around without changing the region bounds */
_operation = ContentsTrim;
Drag::start_grab (event, _editor->cursors()->trimmer);
} else {
@@ -1724,7 +1723,6 @@ TrimDrag::finished (GdkEvent* event, bool movement_occurred)
if (_operation == StartTrim) {
i->view->trim_front_ending ();
}
-
i->view->region()->resume_property_changes ();
}
}
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc
index 40dbd15037..cdfc1cbc3a 100644
--- a/gtk2_ardour/midi_region_view.cc
+++ b/gtk2_ardour/midi_region_view.cc
@@ -3246,9 +3246,4 @@ MidiRegionView::trim_front_ending ()
_note_group->reparent (*group);
delete _temporary_note_group;
_temporary_note_group = 0;
-
- if (_region->start() < 0) {
- /* Trim drag made start time -ve; fix this */
- midi_region()->fix_negative_start ();
- }
}
diff --git a/libs/ardour/ardour/midi_region.h b/libs/ardour/ardour/midi_region.h
index dae984c331..853272d349 100644
--- a/libs/ardour/ardour/midi_region.h
+++ b/libs/ardour/ardour/midi_region.h
@@ -107,20 +107,13 @@ class MidiRegion : public Region
boost::shared_ptr<MidiModel> model() { return midi_source()->model(); }
boost::shared_ptr<const MidiModel> model() const { return midi_source()->model(); }
- void fix_negative_start ();
-
- protected:
-
- virtual bool can_trim_start_before_source_start () const {
- return true;
- }
-
private:
friend class RegionFactory;
MidiRegion (const SourceList&);
MidiRegion (boost::shared_ptr<const MidiRegion>, frameoffset_t offset = 0, bool offset_relative = true);
+ private:
framecnt_t _read_at (const SourceList&, Evoral::EventSink<framepos_t>& dst,
framepos_t position,
framecnt_t dur,
diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h
index ed4923bc40..3ad61919b1 100644
--- a/libs/ardour/ardour/region.h
+++ b/libs/ardour/ardour/region.h
@@ -315,10 +315,6 @@ class Region
/** Constructor for derived types only */
Region (Session& s, framepos_t start, framecnt_t length, const std::string& name, DataType);
- virtual bool can_trim_start_before_source_start () const {
- return false;
- }
-
protected:
void send_change (const PBD::PropertyChange&);
void mid_thaw (const PBD::PropertyChange&);
diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc
index 74276ff5b6..f9fb791bad 100644
--- a/libs/ardour/midi_region.cc
+++ b/libs/ardour/midi_region.cc
@@ -121,7 +121,7 @@ MidiRegion::set_position_internal (framepos_t pos, bool allow_bbt_recompute)
BeatsFramesConverter old_converter(_session.tempo_map(), _position - _start);
double length_beats = old_converter.from(_length);
- Region::set_position_internal (pos, allow_bbt_recompute);
+ Region::set_position_internal(pos, allow_bbt_recompute);
BeatsFramesConverter new_converter(_session.tempo_map(), pos - _start);
@@ -306,22 +306,9 @@ MidiRegion::model_automation_state_changed (Evoral::Parameter const & p)
}
/* the source will have an iterator into the model, and that iterator will have been set up
- for a given set of filtered_parameters, so now that we've changed that list we must invalidate
+ for a given set of filtered_paramters, so now that we've changed that list we must invalidate
the iterator.
*/
Glib::Mutex::Lock lm (midi_source(0)->mutex());
midi_source(0)->invalidate ();
}
-
-/** This is called when a trim drag has resulted in a -ve _start time for this region.
- * Fix it up by adding some empty space to the source.
- */
-void
-MidiRegion::fix_negative_start ()
-{
- BeatsFramesConverter c (_session.tempo_map(), _position);
-
- MidiModel::WriteLock lock (model()->edit_lock ());
- model()->insert_silence_at_start (c.from (-_start));
- _start = 0;
-}
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc
index 585689a656..5c25d34c60 100644
--- a/libs/ardour/region.cc
+++ b/libs/ardour/region.cc
@@ -732,7 +732,13 @@ Region::trim_start (framepos_t new_position, void */*src*/)
return;
}
framepos_t new_start;
- frameoffset_t const start_shift = new_position - _position;
+ frameoffset_t start_shift;
+
+ if (new_position > _position) {
+ start_shift = new_position - _position;
+ } else {
+ start_shift = -(_position - new_position);
+ }
if (start_shift > 0) {
@@ -753,7 +759,6 @@ Region::trim_start (framepos_t new_position, void */*src*/)
} else {
new_start = _start + start_shift;
}
-
} else {
return;
}
@@ -808,10 +813,9 @@ Region::modify_front (framepos_t new_position, bool reset_fade, void *src)
framecnt_t newlen = 0;
framepos_t delta = 0;
- if (!can_trim_start_before_source_start ()) {
- /* can't trim it back past where source position zero is located */
- new_position = max (new_position, source_zero);
- }
+ /* can't trim it back passed where source position zero is located */
+
+ new_position = max (new_position, source_zero);
if (new_position > _position) {
newlen = _length - (new_position - _position);
@@ -883,13 +887,18 @@ Region::trim_to (framepos_t position, framecnt_t length, void *src)
void
Region::trim_to_internal (framepos_t position, framecnt_t length, void */*src*/)
{
+ frameoffset_t start_shift;
framepos_t new_start;
if (locked()) {
return;
}
- frameoffset_t const start_shift = position - _position;
+ if (position > _position) {
+ start_shift = position - _position;
+ } else {
+ start_shift = -(_position - position);
+ }
if (start_shift > 0) {
@@ -901,7 +910,7 @@ Region::trim_to_internal (framepos_t position, framecnt_t length, void */*src*/)
} else if (start_shift < 0) {
- if (_start < -start_shift && !can_trim_start_before_source_start ()) {
+ if (_start < -start_shift) {
new_start = 0;
} else {
new_start = _start + start_shift;
@@ -1600,7 +1609,7 @@ Region::can_trim () const
ct = CanTrim (ct | FrontTrimLater | EndTrimEarlier);
- if (start() != 0 || can_trim_start_before_source_start ()) {
+ if (start() != 0) {
ct = CanTrim (ct | FrontTrimEarlier);
}
diff --git a/libs/evoral/evoral/Event.hpp b/libs/evoral/evoral/Event.hpp
index 873572e77c..2410b3684a 100644
--- a/libs/evoral/evoral/Event.hpp
+++ b/libs/evoral/evoral/Event.hpp
@@ -170,9 +170,6 @@ struct Event {
inline const uint8_t* buffer() const { return _buf; }
inline uint8_t*& buffer() { return _buf; }
- void set_time (Time);
- void set_original_time (Time);
-
inline event_id_t id() const { return _id; }
inline void set_id (event_id_t n) { _id = n; }
diff --git a/libs/evoral/evoral/Sequence.hpp b/libs/evoral/evoral/Sequence.hpp
index 56903f582b..7675aeeb4e 100644
--- a/libs/evoral/evoral/Sequence.hpp
+++ b/libs/evoral/evoral/Sequence.hpp
@@ -173,8 +173,6 @@ public:
void set_notes (const Sequence<Time>::Notes& n);
- void insert_silence_at_start (Time);
-
typedef std::vector< boost::shared_ptr< Event<Time> > > SysExes;
inline SysExes& sysexes() { return _sysexes; }
inline const SysExes& sysexes() const { return _sysexes; }
diff --git a/libs/evoral/src/Event.cpp b/libs/evoral/src/Event.cpp
index 783634ff24..930a18e77b 100644
--- a/libs/evoral/src/Event.cpp
+++ b/libs/evoral/src/Event.cpp
@@ -90,20 +90,6 @@ Event<Timestamp>::~Event() {
}
}
-template<typename Timestamp>
-void
-Event<Timestamp>::set_time (Timestamp t)
-{
- _nominal_time = t;
-}
-
-template<typename Timestamp>
-void
-Event<Timestamp>::set_original_time (Timestamp t)
-{
- _original_time = t;
-}
-
#endif // EVORAL_EVENT_ALLOC
template class Event<Evoral::MusicalTime>;
diff --git a/libs/evoral/src/Sequence.cpp b/libs/evoral/src/Sequence.cpp
index c8791d2158..5c6f492a36 100644
--- a/libs/evoral/src/Sequence.cpp
+++ b/libs/evoral/src/Sequence.cpp
@@ -1076,26 +1076,6 @@ Sequence<Time>::control_list_marked_dirty ()
set_edited (true);
}
-template<typename Time>
-void
-Sequence<Time>::insert_silence_at_start (Time t)
-{
- for (typename Notes::iterator i = _notes.begin(); i != _notes.end(); ++i) {
- (*i)->set_time ((*i)->time() + t);
- }
-
- for (typename SysExes::iterator i = _sysexes.begin (); i != _sysexes.end(); ++i) {
- (*i)->set_time ((*i)->time() + t);
- (*i)->set_original_time ((*i)->original_time() + t);
- }
-
- for (typename Controls::iterator i = _controls.begin(); i != _controls.end(); ++i) {
- i->second->list()->shift (0, t);
- }
-
- _edited = true;
-}
-
template class Sequence<Evoral::MusicalTime>;
} // namespace Evoral
diff --git a/libs/fst/vstwin.c b/libs/fst/vstwin.c
index 847ca19f1a..007a825d53 100644
--- a/libs/fst/vstwin.c
+++ b/libs/fst/vstwin.c
@@ -179,7 +179,6 @@ again:
/* did it work? */
fst->current_program = fst->plugin->dispatcher (fst->plugin, 3, /* effGetProgram */ 0, 0, NULL, 0);
fst->want_program = -1;
- printf("old-style leaves CP=%d\n", fst->current_program);
}
if (fst->want_chunk == 1) {