comparison layer/SpectrumLayer.cpp @ 1417:2487521e857b

Merge
author Chris Cannam
date Wed, 23 Jan 2019 14:44:16 +0000
parents c8a6fd3f9dff
children f2525e6cbdf1
comparison
equal deleted inserted replaced
1416:d794630429a7 1417:2487521e857b
31 #include <QPainter> 31 #include <QPainter>
32 #include <QTextStream> 32 #include <QTextStream>
33 33
34 34
35 SpectrumLayer::SpectrumLayer() : 35 SpectrumLayer::SpectrumLayer() :
36 m_originModel(0), 36 m_originModel(nullptr),
37 m_channel(-1), 37 m_channel(-1),
38 m_channelSet(false), 38 m_channelSet(false),
39 m_windowSize(4096), 39 m_windowSize(4096),
40 m_windowType(HanningWindow), 40 m_windowType(HanningWindow),
41 m_windowHopLevel(3), 41 m_windowHopLevel(3),
57 SpectrumLayer::~SpectrumLayer() 57 SpectrumLayer::~SpectrumLayer()
58 { 58 {
59 Model *m = const_cast<Model *> 59 Model *m = const_cast<Model *>
60 (static_cast<const Model *>(m_sliceableModel)); 60 (static_cast<const Model *>(m_sliceableModel));
61 if (m) m->aboutToDelete(); 61 if (m) m->aboutToDelete();
62 m_sliceableModel = 0; 62 m_sliceableModel = nullptr;
63 delete m; 63 delete m;
64 } 64 }
65 65
66 void 66 void
67 SpectrumLayer::setModel(DenseTimeValueModel *model) 67 SpectrumLayer::setModel(DenseTimeValueModel *model)
74 74
75 if (m_sliceableModel) { 75 if (m_sliceableModel) {
76 Model *m = const_cast<Model *> 76 Model *m = const_cast<Model *>
77 (static_cast<const Model *>(m_sliceableModel)); 77 (static_cast<const Model *>(m_sliceableModel));
78 m->aboutToDelete(); 78 m->aboutToDelete();
79 setSliceableModel(0); 79 setSliceableModel(nullptr);
80 delete m; 80 delete m;
81 } 81 }
82 82
83 m_newFFTNeeded = true; 83 m_newFFTNeeded = true;
84 84
106 { 106 {
107 if (m_sliceableModel) { 107 if (m_sliceableModel) {
108 Model *m = const_cast<Model *> 108 Model *m = const_cast<Model *>
109 (static_cast<const Model *>(m_sliceableModel)); 109 (static_cast<const Model *>(m_sliceableModel));
110 m->aboutToDelete(); 110 m->aboutToDelete();
111 setSliceableModel(0); 111 setSliceableModel(nullptr);
112 delete m; 112 delete m;
113 } 113 }
114 114
115 if (!m_originModel) { 115 if (!m_originModel) {
116 return; 116 return;