Mercurial > hg > svgui
comparison layer/LayerFactory.cpp @ 1423:62e908518c71 single-point
Update to Event api in place of Clipboard points
author | Chris Cannam |
---|---|
date | Fri, 08 Mar 2019 13:37:30 +0000 |
parents | c8a6fd3f9dff |
children | e1a08da75427 |
comparison
equal
deleted
inserted
replaced
1422:6f51297a0250 | 1423:62e908518c71 |
---|---|
542 } | 542 } |
543 | 543 |
544 LayerFactory::LayerType | 544 LayerFactory::LayerType |
545 LayerFactory::getLayerTypeForClipboardContents(const Clipboard &clip) | 545 LayerFactory::getLayerTypeForClipboardContents(const Clipboard &clip) |
546 { | 546 { |
547 const Clipboard::PointList &contents = clip.getPoints(); | 547 const EventVector &contents = clip.getPoints(); |
548 | 548 |
549 bool haveFrame = false; | |
550 bool haveValue = false; | 549 bool haveValue = false; |
551 bool haveDuration = false; | 550 bool haveDuration = false; |
552 bool haveLevel = false; | 551 bool haveLevel = false; |
553 | 552 |
554 for (Clipboard::PointList::const_iterator i = contents.begin(); | 553 for (EventVector::const_iterator i = contents.begin(); |
555 i != contents.end(); ++i) { | 554 i != contents.end(); ++i) { |
556 if (i->haveFrame()) haveFrame = true; | 555 if (i->hasValue()) haveValue = true; |
557 if (i->haveValue()) haveValue = true; | 556 if (i->hasDuration()) haveDuration = true; |
558 if (i->haveDuration()) haveDuration = true; | 557 if (i->hasLevel()) haveLevel = true; |
559 if (i->haveLevel()) haveLevel = true; | 558 } |
560 } | 559 |
561 | 560 if (haveValue && haveDuration && haveLevel) return Notes; |
562 if (haveFrame && haveValue && haveDuration && haveLevel) return Notes; | 561 if (haveValue && haveDuration) return Regions; |
563 if (haveFrame && haveValue && haveDuration) return Regions; | 562 if (haveValue) return TimeValues; |
564 if (haveFrame && haveValue) return TimeValues; | |
565 return TimeInstants; | 563 return TimeInstants; |
566 } | 564 } |
567 | 565 |