13
0

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
This commit is contained in:
David Robillard 2010-12-21 00:53:18 +00:00
parent 4e62adfe1a
commit 71986da212
3 changed files with 10 additions and 8 deletions

View File

@ -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 {

View File

@ -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));

View File

@ -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 ();
}
}