diff options
author | David Robillard <d@drobilla.net> | 2010-12-21 00:53:18 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-12-21 00:53:18 +0000 |
commit | 71986da212b641b53c4583d0dca02cc87c758291 (patch) | |
tree | d68378818beaef8e1eb6caf144d38c6549e73dd8 /libs | |
parent | 4e62adfe1a8e7b8158204ee6c0d1fe97c3fdca04 (diff) |
Only calculate length_beats from length (in frames) if length property (in frames) is given, but length_beats property is not.
git-svn-id: svn://localhost/ardour2/branches/3.0@8319 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/midi_region.h | 15 | ||||
-rw-r--r-- | libs/ardour/midi_diskstream.cc | 1 | ||||
-rw-r--r-- | libs/ardour/midi_region.cc | 2 |
3 files changed, 10 insertions, 8 deletions
diff --git a/libs/ardour/ardour/midi_region.h b/libs/ardour/ardour/midi_region.h index f5886698d5..edd9ef31e4 100644 --- a/libs/ardour/ardour/midi_region.h +++ b/libs/ardour/ardour/midi_region.h @@ -36,13 +36,14 @@ class XMLNode; namespace ARDOUR { - namespace Properties { - /* this is pseudo-property: nothing has this as an actual - property, but it allows us to signal changes to the - MidiModel used by the MidiRegion - */ - extern PBD::PropertyDescriptor<void*> midi_data; - } + namespace Properties { + /* this is pseudo-property: nothing has this as an actual + property, but it allows us to signal changes to the + MidiModel used by the MidiRegion + */ + extern PBD::PropertyDescriptor<void*> midi_data; + extern PBD::PropertyDescriptor<Evoral::MusicalTime> length_beats; + } } namespace ARDOUR { diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc index c3f85438db..0ec17bc3aa 100644 --- a/libs/ardour/midi_diskstream.cc +++ b/libs/ardour/midi_diskstream.cc @@ -1042,6 +1042,7 @@ MidiDiskstream::transport_stopped_wallclock (struct tm& /*when*/, time_t /*twhen /* start of this region is the offset between the start of its capture and the start of the whole pass */ plist.add (Properties::start, (*ci)->start - initial_capture); plist.add (Properties::length, (*ci)->frames); + plist.add (Properties::length_beats, converter.from((*ci)->frames)); plist.add (Properties::name, region_name); boost::shared_ptr<Region> rx (RegionFactory::create (srcs, plist)); diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index 5cd08d98d5..4b65e44e22 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -125,7 +125,7 @@ MidiRegion::clone () void MidiRegion::post_set (const PropertyChange& pc) { - if (pc.contains (Properties::length) || pc.contains (Properties::position)) { + if (pc.contains (Properties::length) && !pc.contains (Properties::length_beats)) { update_length_beats (); } } |