comparison layer/Colour3DPlotExporter.h @ 1556:ac8da42674ff spectrogram-export

Handle peaks
author Chris Cannam
date Tue, 07 Jan 2020 11:18:57 +0000
parents a0b2f3b4dd2f
children d6f9fac336b3
comparison
equal deleted inserted replaced
1555:745be36202aa 1556:ac8da42674ff
37 37
38 /** Selection of bins to include in the export. */ 38 /** Selection of bins to include in the export. */
39 BinDisplay binDisplay; 39 BinDisplay binDisplay;
40 }; 40 };
41 41
42 Colour3DPlotExporter(Sources sources, Parameters parameters) : 42 Colour3DPlotExporter(Sources sources, Parameters parameters);
43 m_sources(sources), 43 ~Colour3DPlotExporter();
44 m_params(parameters)
45 { }
46 44
47 void discardSources() { 45 void discardSources();
48 QMutexLocker locker(&m_mutex);
49 m_sources.verticalBinLayer = nullptr;
50 m_sources.source = {};
51 m_sources.fft = {};
52 m_sources.provider = nullptr;
53 }
54 46
55 QString toDelimitedDataString(QString, DataExportOptions, 47 QString toDelimitedDataString(QString, DataExportOptions,
56 sv_frame_t, sv_frame_t) const override; 48 sv_frame_t, sv_frame_t) const override;
57 49
50
51 // Further Model methods that we just delegate
52
53 bool isOK() const override {
54 if (auto model = ModelById::get(m_sources.source)) {
55 return model->isOK();
56 }
57 return false;
58 }
59
60 sv_frame_t getStartFrame() const override {
61 if (auto model = ModelById::get(m_sources.source)) {
62 return model->getStartFrame();
63 }
64 return 0;
65 }
66
67 sv_frame_t getTrueEndFrame() const override {
68 if (auto model = ModelById::get(m_sources.source)) {
69 return model->getTrueEndFrame();
70 }
71 return 0;
72 }
73
74 sv_samplerate_t getSampleRate() const override {
75 if (auto model = ModelById::get(m_sources.source)) {
76 return model->getSampleRate();
77 }
78 return 0;
79 }
80
81 QString getTypeName() const override {
82 if (auto model = ModelById::get(m_sources.source)) {
83 return model->getTypeName();
84 }
85 return "(exporter)"; // internal fallback, no translation needed
86 }
87
88 int getCompletion() const override {
89 if (auto model = ModelById::get(m_sources.source)) {
90 return model->getCompletion();
91 }
92 return 0;
93 }
94
58 private: 95 private:
59 Sources m_sources; 96 Sources m_sources;
60 Parameters m_params; 97 Parameters m_params;
61 }; 98 };
62 99