diff options
author | nick_m <mainsbridge@gmail.com> | 2016-06-16 00:18:27 +1000 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-07-10 02:18:36 +1000 |
commit | 94e0a15325278ec26dbeba4990a0e883db859338 (patch) | |
tree | e4d97368112f92ba8a66c673b68c68f7a76b025a /libs/ardour/ardour | |
parent | 2d5238d87581bc0ff9dcaaa8aad9e255b5d9c370 (diff) |
Exact beat - provide audio->music mapping for region split.
- for those not in the know, this series provides a way to
remove the temporal distortion introduced when using an
audio frame-based gui for music-locked objects.
In short, the gui uses an audio frame representation to move
objects. It displays the object using frame_at_beat(), quantizing
the time value to audio frames. This is fine until the user selects
that frame but expects it to be interpreted as a beat.
Thus beat_at_frame() would not produce the user-expected beat
(temporal quantization error of up to 0.5 audio samples).
This is one method of mapping audio time to music time accurately.
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/audioregion.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/midi_region.h | 8 | ||||
-rw-r--r-- | libs/ardour/ardour/playlist.h | 6 | ||||
-rw-r--r-- | libs/ardour/ardour/region.h | 12 | ||||
-rw-r--r-- | libs/ardour/ardour/region_factory.h | 4 |
5 files changed, 16 insertions, 16 deletions
diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h index 2d74d91482..bed64615b5 100644 --- a/libs/ardour/ardour/audioregion.h +++ b/libs/ardour/ardour/audioregion.h @@ -180,7 +180,7 @@ class LIBARDOUR_API AudioRegion : public Region AudioRegion (boost::shared_ptr<AudioSource>); AudioRegion (const SourceList &); AudioRegion (boost::shared_ptr<const AudioRegion>); - AudioRegion (boost::shared_ptr<const AudioRegion>, frameoffset_t offset); + AudioRegion (boost::shared_ptr<const AudioRegion>, frameoffset_t offset, const int32_t& sub_num); AudioRegion (boost::shared_ptr<const AudioRegion>, const SourceList&); AudioRegion (SourceList &); diff --git a/libs/ardour/ardour/midi_region.h b/libs/ardour/ardour/midi_region.h index 3a097c907e..9de79a9513 100644 --- a/libs/ardour/ardour/midi_region.h +++ b/libs/ardour/ardour/midi_region.h @@ -115,7 +115,7 @@ class LIBARDOUR_API MidiRegion : public Region MidiRegion (const SourceList&); MidiRegion (boost::shared_ptr<const MidiRegion>); - MidiRegion (boost::shared_ptr<const MidiRegion>, frameoffset_t offset); + MidiRegion (boost::shared_ptr<const MidiRegion>, frameoffset_t offset, const int32_t& sub_num = 0); framecnt_t _read_at (const SourceList&, Evoral::EventSink<framepos_t>& dst, framepos_t position, @@ -131,11 +131,11 @@ class LIBARDOUR_API MidiRegion : public Region void recompute_at_start (); void recompute_at_end (); - void set_position_internal (framepos_t pos, bool allow_bbt_recompute); - void set_length_internal (framecnt_t len); + void set_position_internal (framepos_t pos, bool allow_bbt_recompute, const int32_t& sub_num); + void set_length_internal (framecnt_t len, const int32_t& sub_num); void set_start_internal (framecnt_t, const int32_t& sub_num); void trim_to_internal (framepos_t position, framecnt_t length, const int32_t& sub_num); - void update_length_beats (); + void update_length_beats (const int32_t& sub_num); void model_changed (); void model_automation_state_changed (Evoral::Parameter const &); diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h index 7b19a08f6a..0a5f5e4ddc 100644 --- a/libs/ardour/ardour/playlist.h +++ b/libs/ardour/ardour/playlist.h @@ -134,8 +134,8 @@ public: void get_region_list_equivalent_regions (boost::shared_ptr<Region>, std::vector<boost::shared_ptr<Region> >&); void get_source_equivalent_regions (boost::shared_ptr<Region>, std::vector<boost::shared_ptr<Region> >&); void replace_region (boost::shared_ptr<Region> old, boost::shared_ptr<Region> newr, framepos_t pos); - void split_region (boost::shared_ptr<Region>, framepos_t position); - void split (framepos_t at); + void split_region (boost::shared_ptr<Region>, framepos_t position, const int32_t& sub_num); + void split (framepos_t at, const int32_t& sub_num); void shift (framepos_t at, frameoffset_t distance, bool move_intersected, bool ignore_music_glue); void partition (framepos_t start, framepos_t end, bool cut = false); void duplicate (boost::shared_ptr<Region>, framepos_t position, float times); @@ -380,7 +380,7 @@ public: void begin_undo (); void end_undo (); - void _split_region (boost::shared_ptr<Region>, framepos_t position); + void _split_region (boost::shared_ptr<Region>, framepos_t position, const int32_t& sub_num); typedef std::pair<boost::shared_ptr<Region>, boost::shared_ptr<Region> > TwoRegions; diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index e0dd159ce5..ec4f559a87 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -171,9 +171,9 @@ class LIBARDOUR_API Region Trimmable::CanTrim can_trim () const; PositionLockStyle position_lock_style () const { return _position_lock_style; } - double beat () { return _beat; } + double beat () const { return _beat; } void set_position_lock_style (PositionLockStyle ps); - void recompute_position_from_lock_style (); + void recompute_position_from_lock_style (const int32_t& sub_num); void suspend_property_changes (); @@ -205,7 +205,7 @@ class LIBARDOUR_API Region /* EDITING OPERATIONS */ - void set_length (framecnt_t); + void set_length (framecnt_t, const int32_t& sub_num); void set_start (framepos_t); void set_position (framepos_t, int32_t sub_num = 0); void set_initial_position (framepos_t); @@ -339,7 +339,7 @@ class LIBARDOUR_API Region Region (boost::shared_ptr<const Region>); /** Construct a region from another region, at an offset within that region */ - Region (boost::shared_ptr<const Region>, frameoffset_t start_offset); + Region (boost::shared_ptr<const Region>, frameoffset_t start_offset, const int32_t& sub_num); /** Construct a region as a copy of another region, but with different sources */ Region (boost::shared_ptr<const Region>, const SourceList&); @@ -356,8 +356,8 @@ class LIBARDOUR_API Region void send_change (const PBD::PropertyChange&); virtual int _set_state (const XMLNode&, int version, PBD::PropertyChange& what_changed, bool send_signal); void post_set (const PBD::PropertyChange&); - virtual void set_position_internal (framepos_t pos, bool allow_bbt_recompute); - virtual void set_length_internal (framecnt_t); + virtual void set_position_internal (framepos_t pos, bool allow_bbt_recompute, const int32_t& sub_num); + virtual void set_length_internal (framecnt_t, const int32_t& sub_num); virtual void set_start_internal (framecnt_t, const int32_t& sub_num = 0); bool verify_start_and_length (framepos_t, framecnt_t&); void first_edit (); diff --git a/libs/ardour/ardour/region_factory.h b/libs/ardour/ardour/region_factory.h index 08d9affc91..e331de2b00 100644 --- a/libs/ardour/ardour/region_factory.h +++ b/libs/ardour/ardour/region_factory.h @@ -59,7 +59,7 @@ public: static PBD::Signal1<void,boost::shared_ptr<Region> > CheckNewRegion; /** create a "pure copy" of Region @param other */ - static boost::shared_ptr<Region> create (boost::shared_ptr<const Region> other, bool announce = false); + static boost::shared_ptr<Region> create (boost::shared_ptr<const Region> other, bool announce = false, const int32_t& sub_num = 0); /** create a region from a single Source */ static boost::shared_ptr<Region> create (boost::shared_ptr<Source>, @@ -73,7 +73,7 @@ public: const PBD::PropertyList&, bool announce = true); /** create a copy of @param other starting at @param offset within @param other */ static boost::shared_ptr<Region> create (boost::shared_ptr<Region> other, frameoffset_t offset, - const PBD::PropertyList&, bool announce = true); + const PBD::PropertyList&, bool announce = true, const int32_t& sub_num = 0); /** create a "copy" of @param other but using a different set of sources @param srcs */ static boost::shared_ptr<Region> create (boost::shared_ptr<Region> other, const SourceList& srcs, const PBD::PropertyList&, bool announce = true); |