Mercurial > hg > sonic-visualiser
comparison document/SVFileReader.cpp @ 174:aaf806ce329a
* Fix #1757772 tempo, dynamic related plug-ins bug -- make auto-align
only auto-align if there is a unit involved
* Fix #1755366 text layer bug in retrieved session
* Fix input model selection in plugin parameter dialog (was being ignored)
* Use lighter background than the standard widget one for panes (assuming the
widget background is light but not white) -- similarly darker if dark
* Fix colour reference counting in loaded session in SingleColourLayer
* Reset overview pane colour when switching dark background on or off
author | Chris Cannam |
---|---|
date | Tue, 14 Aug 2007 13:58:53 +0000 |
parents | 102317ae3970 |
children | ebd906049fb6 |
comparison
equal
deleted
inserted
replaced
173:102317ae3970 | 174:aaf806ce329a |
---|---|
810 { | 810 { |
811 bool ok = false; | 811 bool ok = false; |
812 | 812 |
813 READ_MANDATORY(int, frame, toInt); | 813 READ_MANDATORY(int, frame, toInt); |
814 | 814 |
815 // std::cerr << "SVFileReader::addPointToDataset: frame = " << frame << std::endl; | |
816 | |
815 SparseOneDimensionalModel *sodm = dynamic_cast<SparseOneDimensionalModel *> | 817 SparseOneDimensionalModel *sodm = dynamic_cast<SparseOneDimensionalModel *> |
816 (m_currentDataset); | 818 (m_currentDataset); |
817 | 819 |
818 if (sodm) { | 820 if (sodm) { |
821 // std::cerr << "Current dataset is a sparse one dimensional model" << std::endl; | |
819 QString label = attributes.value("label"); | 822 QString label = attributes.value("label"); |
820 sodm->addPoint(SparseOneDimensionalModel::Point(frame, label)); | 823 sodm->addPoint(SparseOneDimensionalModel::Point(frame, label)); |
821 return true; | 824 return true; |
822 } | 825 } |
823 | 826 |
824 SparseTimeValueModel *stvm = dynamic_cast<SparseTimeValueModel *> | 827 SparseTimeValueModel *stvm = dynamic_cast<SparseTimeValueModel *> |
825 (m_currentDataset); | 828 (m_currentDataset); |
826 | 829 |
827 if (stvm) { | 830 if (stvm) { |
831 // std::cerr << "Current dataset is a sparse time-value model" << std::endl; | |
828 float value = 0.0; | 832 float value = 0.0; |
829 value = attributes.value("value").trimmed().toFloat(&ok); | 833 value = attributes.value("value").trimmed().toFloat(&ok); |
830 QString label = attributes.value("label"); | 834 QString label = attributes.value("label"); |
831 stvm->addPoint(SparseTimeValueModel::Point(frame, value, label)); | 835 stvm->addPoint(SparseTimeValueModel::Point(frame, value, label)); |
832 return ok; | 836 return ok; |
833 } | 837 } |
834 | 838 |
835 NoteModel *nm = dynamic_cast<NoteModel *>(m_currentDataset); | 839 NoteModel *nm = dynamic_cast<NoteModel *>(m_currentDataset); |
836 | 840 |
837 if (nm) { | 841 if (nm) { |
842 // std::cerr << "Current dataset is a note model" << std::endl; | |
838 float value = 0.0; | 843 float value = 0.0; |
839 value = attributes.value("value").trimmed().toFloat(&ok); | 844 value = attributes.value("value").trimmed().toFloat(&ok); |
840 size_t duration = 0; | 845 size_t duration = 0; |
841 duration = attributes.value("duration").trimmed().toUInt(&ok); | 846 duration = attributes.value("duration").trimmed().toUInt(&ok); |
842 QString label = attributes.value("label"); | 847 QString label = attributes.value("label"); |
845 } | 850 } |
846 | 851 |
847 TextModel *tm = dynamic_cast<TextModel *>(m_currentDataset); | 852 TextModel *tm = dynamic_cast<TextModel *>(m_currentDataset); |
848 | 853 |
849 if (tm) { | 854 if (tm) { |
855 // std::cerr << "Current dataset is a text model" << std::endl; | |
850 float height = 0.0; | 856 float height = 0.0; |
851 height = attributes.value("height").trimmed().toFloat(&ok); | 857 height = attributes.value("height").trimmed().toFloat(&ok); |
852 QString label = attributes.value("label"); | 858 QString label = attributes.value("label"); |
859 // std::cerr << "SVFileReader::addPointToDataset: TextModel: frame = " << frame << ", height = " << height << ", label = " << label.toStdString() << ", ok = " << ok << std::endl; | |
853 tm->addPoint(TextModel::Point(frame, height, label)); | 860 tm->addPoint(TextModel::Point(frame, height, label)); |
854 return ok; | 861 return ok; |
855 } | 862 } |
856 | 863 |
857 std::cerr << "WARNING: SV-XML: Point element found in non-point dataset" << std::endl; | 864 std::cerr << "WARNING: SV-XML: Point element found in non-point dataset" << std::endl; |