# HG changeset patch # User Chris Cannam # Date 1578654753 0 # Node ID 62b7699e5bfeccc4787b3dd994cf0228a0e5f25e # Parent 563bab925c9b79c8decdec86fde38c2e48b33b69 Add option to export timestamp column diff -r 563bab925c9b -r 62b7699e5bfe layer/Colour3DPlotExporter.cpp --- a/layer/Colour3DPlotExporter.cpp Thu Jan 09 14:35:55 2020 +0000 +++ b/layer/Colour3DPlotExporter.cpp Fri Jan 10 11:12:33 2020 +0000 @@ -127,6 +127,18 @@ QStringList list; + switch (m_params.timestampFormat) { + case TimestampFormat::None: + break; + case TimestampFormat::Frames: + list << QString("%1").arg(fr); + break; + case TimestampFormat::Seconds: + list << QString("%1").arg(RealTime::frame2RealTime + (fr, model->getSampleRate()).toDouble()); + break; + } + if (binDisplay == BinDisplay::PeakFrequencies) { FFTModel::PeakSet peaks = fftModel->getPeakFrequencies diff -r 563bab925c9b -r 62b7699e5bfe layer/Colour3DPlotExporter.h --- a/layer/Colour3DPlotExporter.h Thu Jan 09 14:35:55 2020 +0000 +++ b/layer/Colour3DPlotExporter.h Fri Jan 10 11:12:33 2020 +0000 @@ -31,13 +31,20 @@ const LayerGeometryProvider *provider; // optionally }; + enum class TimestampFormat { + None, + Seconds, + Frames + }; + struct Parameters { Parameters() : binDisplay(BinDisplay::AllBins), scaleFactor(1.0), threshold(0.0), gain(1.0), - normalization(ColumnNormalization::None) { } + normalization(ColumnNormalization::None), + timestampFormat(TimestampFormat::None) { } /** Selection of bins to include in the export. */ BinDisplay binDisplay; @@ -63,6 +70,10 @@ * calculate thresholding level. The exported values are * un-normalized. */ ColumnNormalization normalization; + + /** Format to use for the timestamp column. If None, no + * timestamp column will be included. */ + TimestampFormat timestampFormat; }; Colour3DPlotExporter(Sources sources, Parameters parameters);