Mercurial > hg > svgui
comparison layer/LayerFactory.cpp @ 360:d58701996fae
* Update remaining editable layers to support proper realignment on copy/paste
* Permit pasting when no suitable layer is current: create a new layer on paste
* Add preference for showing the splash screen or not
* Rename spectrogram smoothing prefs (partly following Craig's suggestions)
author | Chris Cannam |
---|---|
date | Wed, 06 Feb 2008 14:15:09 +0000 |
parents | 369a197737c7 |
children | 96e4d7b9e165 |
comparison
equal
deleted
inserted
replaced
359:020c485aa7e0 | 360:d58701996fae |
---|---|
25 #include "ImageLayer.h" | 25 #include "ImageLayer.h" |
26 #include "Colour3DPlotLayer.h" | 26 #include "Colour3DPlotLayer.h" |
27 #include "SpectrumLayer.h" | 27 #include "SpectrumLayer.h" |
28 #include "SliceLayer.h" | 28 #include "SliceLayer.h" |
29 #include "SliceableLayer.h" | 29 #include "SliceableLayer.h" |
30 | |
31 #include "base/Clipboard.h" | |
30 | 32 |
31 #include "data/model/RangeSummarisableTimeValueModel.h" | 33 #include "data/model/RangeSummarisableTimeValueModel.h" |
32 #include "data/model/DenseTimeValueModel.h" | 34 #include "data/model/DenseTimeValueModel.h" |
33 #include "data/model/SparseOneDimensionalModel.h" | 35 #include "data/model/SparseOneDimensionalModel.h" |
34 #include "data/model/SparseTimeValueModel.h" | 36 #include "data/model/SparseTimeValueModel.h" |
480 } | 482 } |
481 | 483 |
482 settings.endGroup(); | 484 settings.endGroup(); |
483 } | 485 } |
484 | 486 |
487 LayerFactory::LayerType | |
488 LayerFactory::getLayerTypeForClipboardContents(const Clipboard &clip) | |
489 { | |
490 const Clipboard::PointList &contents = clip.getPoints(); | |
491 | |
492 bool haveFrame = false; | |
493 bool haveValue = false; | |
494 bool haveDuration = false; | |
495 | |
496 for (Clipboard::PointList::const_iterator i = contents.begin(); | |
497 i != contents.end(); ++i) { | |
498 if (i->haveFrame()) haveFrame = true; | |
499 if (i->haveValue()) haveValue = true; | |
500 if (i->haveDuration()) haveDuration = true; | |
501 } | |
502 | |
503 if (haveFrame && haveValue && haveDuration) return Notes; | |
504 if (haveFrame && haveValue) return TimeValues; | |
505 return TimeInstants; | |
506 } | |
507 |