Mercurial > hg > svgui
changeset 1159:8a5f0c8d5608 3.0-integration
Merge from branch piper
author | Chris Cannam |
---|---|
date | Fri, 28 Oct 2016 15:20:58 +0100 |
parents | fc00a06feecd (current diff) 8e4b90aeefaa (diff) |
children | a429b2acb45d |
files | |
diffstat | 4 files changed, 182 insertions(+), 202 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/files.pri Fri Oct 28 15:20:58 2016 +0100 @@ -0,0 +1,161 @@ + +SVGUI_HEADERS += \ + layer/Colour3DPlotLayer.h \ + layer/Colour3DPlotRenderer.h \ + layer/ColourDatabase.h \ + layer/ColourMapper.h \ + layer/ColourScale.h \ + layer/ColourScaleLayer.h \ + layer/FlexiNoteLayer.h \ + layer/ImageLayer.h \ + layer/ImageRegionFinder.h \ + layer/Layer.h \ + layer/LayerFactory.h \ + layer/LayerGeometryProvider.h \ + layer/LinearNumericalScale.h \ + layer/LogNumericalScale.h \ + layer/LinearColourScale.h \ + layer/LogColourScale.h \ + layer/NoteLayer.h \ + layer/PaintAssistant.h \ + layer/PianoScale.h \ + layer/RegionLayer.h \ + layer/RenderTimer.h \ + layer/ScrollableImageCache.h \ + layer/ScrollableMagRangeCache.h \ + layer/SingleColourLayer.h \ + layer/SliceableLayer.h \ + layer/SliceLayer.h \ + layer/SpectrogramLayer.h \ + layer/SpectrumLayer.h \ + layer/TextLayer.h \ + layer/TimeInstantLayer.h \ + layer/TimeRulerLayer.h \ + layer/TimeValueLayer.h \ + layer/VerticalScaleLayer.h \ + layer/WaveformLayer.h \ + view/AlignmentView.h \ + view/Overview.h \ + view/Pane.h \ + view/PaneStack.h \ + view/View.h \ + view/ViewManager.h \ + view/ViewProxy.h \ + widgets/ActivityLog.h \ + widgets/AudioDial.h \ + widgets/ClickableLabel.h \ + widgets/ColourNameDialog.h \ + widgets/CommandHistory.h \ + widgets/CSVFormatDialog.h \ + widgets/Fader.h \ + widgets/InteractiveFileFinder.h \ + widgets/IconLoader.h \ + widgets/ImageDialog.h \ + widgets/ItemEditDialog.h \ + widgets/KeyReference.h \ + widgets/LabelCounterInputDialog.h \ + widgets/LayerTree.h \ + widgets/LayerTreeDialog.h \ + widgets/LEDButton.h \ + widgets/LevelPanToolButton.h \ + widgets/LevelPanWidget.h \ + widgets/ListInputDialog.h \ + widgets/MIDIFileImportDialog.h \ + widgets/ModelDataTableDialog.h \ + widgets/NotifyingCheckBox.h \ + widgets/NotifyingComboBox.h \ + widgets/NotifyingPushButton.h \ + widgets/NotifyingTabBar.h \ + widgets/Panner.h \ + widgets/PluginParameterBox.h \ + widgets/PluginParameterDialog.h \ + widgets/ProgressDialog.h \ + widgets/PropertyBox.h \ + widgets/PropertyStack.h \ + widgets/RangeInputDialog.h \ + widgets/SelectableLabel.h \ + widgets/SubdividingMenu.h \ + widgets/TextAbbrev.h \ + widgets/Thumbwheel.h \ + widgets/TipDialog.h \ + widgets/TransformFinder.h \ + widgets/UnitConverter.h \ + widgets/WindowShapePreview.h \ + widgets/WindowTypeSelector.h + +SVGUI_SOURCES += \ + layer/Colour3DPlotLayer.cpp \ + layer/Colour3DPlotRenderer.cpp \ + layer/ColourDatabase.cpp \ + layer/ColourMapper.cpp \ + layer/ColourScale.cpp \ + layer/FlexiNoteLayer.cpp \ + layer/ImageLayer.cpp \ + layer/ImageRegionFinder.cpp \ + layer/Layer.cpp \ + layer/LayerFactory.cpp \ + layer/LinearNumericalScale.cpp \ + layer/LogNumericalScale.cpp \ + layer/LinearColourScale.cpp \ + layer/LogColourScale.cpp \ + layer/NoteLayer.cpp \ + layer/PaintAssistant.cpp \ + layer/PianoScale.cpp \ + layer/RegionLayer.cpp \ + layer/ScrollableImageCache.cpp \ + layer/ScrollableMagRangeCache.cpp \ + layer/SingleColourLayer.cpp \ + layer/SliceLayer.cpp \ + layer/SpectrogramLayer.cpp \ + layer/SpectrumLayer.cpp \ + layer/TextLayer.cpp \ + layer/TimeInstantLayer.cpp \ + layer/TimeRulerLayer.cpp \ + layer/TimeValueLayer.cpp \ + layer/WaveformLayer.cpp \ + view/AlignmentView.cpp \ + view/Overview.cpp \ + view/Pane.cpp \ + view/PaneStack.cpp \ + view/View.cpp \ + view/ViewManager.cpp \ + widgets/ActivityLog.cpp \ + widgets/AudioDial.cpp \ + widgets/ColourNameDialog.cpp \ + widgets/CommandHistory.cpp \ + widgets/CSVFormatDialog.cpp \ + widgets/Fader.cpp \ + widgets/InteractiveFileFinder.cpp \ + widgets/IconLoader.cpp \ + widgets/ImageDialog.cpp \ + widgets/ItemEditDialog.cpp \ + widgets/KeyReference.cpp \ + widgets/LabelCounterInputDialog.cpp \ + widgets/LayerTree.cpp \ + widgets/LayerTreeDialog.cpp \ + widgets/LEDButton.cpp \ + widgets/LevelPanToolButton.cpp \ + widgets/LevelPanWidget.cpp \ + widgets/ListInputDialog.cpp \ + widgets/MIDIFileImportDialog.cpp \ + widgets/ModelDataTableDialog.cpp \ + widgets/NotifyingCheckBox.cpp \ + widgets/NotifyingComboBox.cpp \ + widgets/NotifyingPushButton.cpp \ + widgets/NotifyingTabBar.cpp \ + widgets/Panner.cpp \ + widgets/PluginParameterBox.cpp \ + widgets/PluginParameterDialog.cpp \ + widgets/ProgressDialog.cpp \ + widgets/PropertyBox.cpp \ + widgets/PropertyStack.cpp \ + widgets/RangeInputDialog.cpp \ + widgets/SelectableLabel.cpp \ + widgets/SubdividingMenu.cpp \ + widgets/TextAbbrev.cpp \ + widgets/Thumbwheel.cpp \ + widgets/TipDialog.cpp \ + widgets/TransformFinder.cpp \ + widgets/UnitConverter.cpp \ + widgets/WindowShapePreview.cpp \ + widgets/WindowTypeSelector.cpp
--- a/svgui.pro Thu Oct 20 11:20:27 2016 +0100 +++ b/svgui.pro Fri Oct 28 15:20:58 2016 +0100 @@ -2,38 +2,10 @@ TEMPLATE = lib INCLUDEPATH += ../vamp-plugin-sdk -DEFINES += HAVE_VAMP HAVE_VAMPHOSTSDK exists(config.pri) { include(config.pri) } -!exists(config.pri) { - - CONFIG += release - DEFINES += NDEBUG BUILD_RELEASE NO_TIMING - - win32-g++ { - INCLUDEPATH += ../sv-dependency-builds/win32-mingw/include - LIBS += -L../sv-dependency-builds/win32-mingw/lib - } - win32-msvc* { - # We actually expect MSVC to be used only for 64-bit builds, - # though the qmake spec is still called win32-msvc* - INCLUDEPATH += ../sv-dependency-builds/win64-msvc/include - LIBS += -L../sv-dependency-builds/win64-msvc/lib - } - macx* { - INCLUDEPATH += ../sv-dependency-builds/osx/include - LIBS += -L../sv-dependency-builds/osx/lib - } - - DEFINES += HAVE_BZ2 HAVE_FFTW3 HAVE_FFTW3F HAVE_SNDFILE HAVE_SAMPLERATE HAVE_RUBBERBAND HAVE_LIBLO HAVE_MAD HAVE_ID3TAG - - win32-msvc* { - DEFINES += NOMINMAX _USE_MATH_DEFINES - DEFINES -= HAVE_LIBLO - } -} CONFIG += staticlib qt thread warn_on stl rtti exceptions c++11 QT += network xml gui widgets svg @@ -45,163 +17,7 @@ OBJECTS_DIR = o MOC_DIR = o -HEADERS += layer/Colour3DPlotLayer.h \ - layer/Colour3DPlotRenderer.h \ - layer/ColourDatabase.h \ - layer/ColourMapper.h \ - layer/ColourScale.h \ - layer/ColourScaleLayer.h \ - layer/FlexiNoteLayer.h \ - layer/ImageLayer.h \ - layer/ImageRegionFinder.h \ - layer/Layer.h \ - layer/LayerFactory.h \ - layer/LayerGeometryProvider.h \ - layer/LinearNumericalScale.h \ - layer/LogNumericalScale.h \ - layer/LinearColourScale.h \ - layer/LogColourScale.h \ - layer/NoteLayer.h \ - layer/PaintAssistant.h \ - layer/PianoScale.h \ - layer/RegionLayer.h \ - layer/RenderTimer.h \ - layer/ScrollableImageCache.h \ - layer/ScrollableMagRangeCache.h \ - layer/SingleColourLayer.h \ - layer/SliceableLayer.h \ - layer/SliceLayer.h \ - layer/SpectrogramLayer.h \ - layer/SpectrumLayer.h \ - layer/TextLayer.h \ - layer/TimeInstantLayer.h \ - layer/TimeRulerLayer.h \ - layer/TimeValueLayer.h \ - layer/VerticalScaleLayer.h \ - layer/WaveformLayer.h -SOURCES += layer/Colour3DPlotLayer.cpp \ - layer/Colour3DPlotRenderer.cpp \ - layer/ColourDatabase.cpp \ - layer/ColourMapper.cpp \ - layer/ColourScale.cpp \ - layer/FlexiNoteLayer.cpp \ - layer/ImageLayer.cpp \ - layer/ImageRegionFinder.cpp \ - layer/Layer.cpp \ - layer/LayerFactory.cpp \ - layer/LinearNumericalScale.cpp \ - layer/LogNumericalScale.cpp \ - layer/LinearColourScale.cpp \ - layer/LogColourScale.cpp \ - layer/NoteLayer.cpp \ - layer/PaintAssistant.cpp \ - layer/PianoScale.cpp \ - layer/RegionLayer.cpp \ - layer/ScrollableImageCache.cpp \ - layer/ScrollableMagRangeCache.cpp \ - layer/SingleColourLayer.cpp \ - layer/SliceLayer.cpp \ - layer/SpectrogramLayer.cpp \ - layer/SpectrumLayer.cpp \ - layer/TextLayer.cpp \ - layer/TimeInstantLayer.cpp \ - layer/TimeRulerLayer.cpp \ - layer/TimeValueLayer.cpp \ - layer/WaveformLayer.cpp +include(files.pri) -HEADERS += view/AlignmentView.h \ - view/Overview.h \ - view/Pane.h \ - view/PaneStack.h \ - view/View.h \ - view/ViewManager.h \ - view/ViewProxy.h - -SOURCES += view/AlignmentView.cpp \ - view/Overview.cpp \ - view/Pane.cpp \ - view/PaneStack.cpp \ - view/View.cpp \ - view/ViewManager.cpp - -HEADERS += widgets/ActivityLog.h \ - widgets/AudioDial.h \ - widgets/ClickableLabel.h \ - widgets/ColourNameDialog.h \ - widgets/CommandHistory.h \ - widgets/CSVFormatDialog.h \ - widgets/Fader.h \ - widgets/InteractiveFileFinder.h \ - widgets/IconLoader.h \ - widgets/ImageDialog.h \ - widgets/ItemEditDialog.h \ - widgets/KeyReference.h \ - widgets/LabelCounterInputDialog.h \ - widgets/LayerTree.h \ - widgets/LayerTreeDialog.h \ - widgets/LEDButton.h \ - widgets/LevelPanToolButton.h \ - widgets/LevelPanWidget.h \ - widgets/ListInputDialog.h \ - widgets/MIDIFileImportDialog.h \ - widgets/ModelDataTableDialog.h \ - widgets/NotifyingCheckBox.h \ - widgets/NotifyingComboBox.h \ - widgets/NotifyingPushButton.h \ - widgets/NotifyingTabBar.h \ - widgets/Panner.h \ - widgets/PluginParameterBox.h \ - widgets/PluginParameterDialog.h \ - widgets/ProgressDialog.h \ - widgets/PropertyBox.h \ - widgets/PropertyStack.h \ - widgets/RangeInputDialog.h \ - widgets/SelectableLabel.h \ - widgets/SubdividingMenu.h \ - widgets/TextAbbrev.h \ - widgets/Thumbwheel.h \ - widgets/TipDialog.h \ - widgets/TransformFinder.h \ - widgets/UnitConverter.h \ - widgets/WindowShapePreview.h \ - widgets/WindowTypeSelector.h -SOURCES += widgets/ActivityLog.cpp \ - widgets/AudioDial.cpp \ - widgets/ColourNameDialog.cpp \ - widgets/CommandHistory.cpp \ - widgets/CSVFormatDialog.cpp \ - widgets/Fader.cpp \ - widgets/InteractiveFileFinder.cpp \ - widgets/IconLoader.cpp \ - widgets/ImageDialog.cpp \ - widgets/ItemEditDialog.cpp \ - widgets/KeyReference.cpp \ - widgets/LabelCounterInputDialog.cpp \ - widgets/LayerTree.cpp \ - widgets/LayerTreeDialog.cpp \ - widgets/LEDButton.cpp \ - widgets/LevelPanToolButton.cpp \ - widgets/LevelPanWidget.cpp \ - widgets/ListInputDialog.cpp \ - widgets/MIDIFileImportDialog.cpp \ - widgets/ModelDataTableDialog.cpp \ - widgets/NotifyingCheckBox.cpp \ - widgets/NotifyingComboBox.cpp \ - widgets/NotifyingPushButton.cpp \ - widgets/NotifyingTabBar.cpp \ - widgets/Panner.cpp \ - widgets/PluginParameterBox.cpp \ - widgets/PluginParameterDialog.cpp \ - widgets/ProgressDialog.cpp \ - widgets/PropertyBox.cpp \ - widgets/PropertyStack.cpp \ - widgets/RangeInputDialog.cpp \ - widgets/SelectableLabel.cpp \ - widgets/SubdividingMenu.cpp \ - widgets/TextAbbrev.cpp \ - widgets/Thumbwheel.cpp \ - widgets/TipDialog.cpp \ - widgets/TransformFinder.cpp \ - widgets/UnitConverter.cpp \ - widgets/WindowShapePreview.cpp \ - widgets/WindowTypeSelector.cpp +HEADERS = $$(SVGUI_HEADERS) +SOURCES = $$(SVGUI_SOURCES)
--- a/widgets/UnitConverter.cpp Thu Oct 20 11:20:27 2016 +0100 +++ b/widgets/UnitConverter.cpp Fri Oct 28 15:20:58 2016 +0100 @@ -325,7 +325,7 @@ int note, octave; Pitch::getNoteAndOctaveForPitch(pitch, note, octave); - cerr << "pitch " << pitch << " note " << note << " octave " << octave << " cents " << cents << endl; +// cerr << "pitch " << pitch << " note " << note << " octave " << octave << " cents " << cents << endl; setTo(m_midi, pitch); setTo(m_cents, cents); @@ -387,7 +387,7 @@ double samples = m_samples->value(); double rate = getSampleRate(); - cerr << samples << " samples at rate " << rate << endl; +// cerr << samples << " samples at rate " << rate << endl; double sec = samples / rate; double hz = rate / samples;
--- a/widgets/WindowShapePreview.cpp Thu Oct 20 11:20:27 2016 +0100 +++ b/widgets/WindowShapePreview.cpp Fri Oct 28 15:20:58 2016 +0100 @@ -47,12 +47,17 @@ void WindowShapePreview::updateLabels() { - int step = 24; - float peak = 48; - int w = step * 4, h = 64; + float scaleRatio = float(QFontMetrics(font()).height()) / 14.f; + if (scaleRatio < 1.f) scaleRatio = 1.f; + + int step = int(24 * scaleRatio); + float peak = float(48 * scaleRatio); + + int w = step * 4, h = int((peak * 4) / 3); + WindowType type = m_windowType; Window<float> windower = Window<float>(type, step * 2); - + QPixmap timeLabel(w, h + 1); timeLabel.fill(Qt::white); QPainter timePainter(&timeLabel); @@ -68,7 +73,7 @@ path = QPainterPath(); - float *acc = new float(w); + float *acc = new float[w]; for (int i = 0; i < w; ++i) acc[i] = 0.f; for (int j = 0; j < 3; ++j) { for (int i = 0; i < step * 2; ++i) { @@ -105,7 +110,7 @@ timePainter.drawPath(path); QFont font; - font.setPixelSize(10); + font.setPixelSize(int(10 * scaleRatio)); font.setItalic(true); timePainter.setFont(font); QString label = tr("V / time"); @@ -114,9 +119,7 @@ m_windowTimeExampleLabel->setPixmap(timeLabel); - int fw = 100; - - QPixmap freqLabel(fw, h + 1); + QPixmap freqLabel(w, h + 1); freqLabel.fill(Qt::white); QPainter freqPainter(&freqLabel); path = QPainterPath(); @@ -161,7 +164,7 @@ // float ly = h - ((-80.f + -mindb) / maxval) * peak + 1; path.moveTo(0, float(h) - peak + 1); - path.lineTo(fw, float(h) - peak + 1); + path.lineTo(w, float(h) - peak + 1); freqPainter.setPen(Qt::gray); freqPainter.setRenderHint(QPainter::Antialiasing, true); @@ -178,14 +181,14 @@ float val = db + -mindb; if (val < 0) val = 0; float norm = val / maxval; - float x = (float(fw) / float(fftsize/2)) * float(i); + float x = (float(w) / float(fftsize/2)) * float(i); float y = float(h) - norm * peak + 1; if (i == 0) path.moveTo(x, y); else path.lineTo(x, y); } freqPainter.setRenderHint(QPainter::Antialiasing, true); - path.addRect(0, 0, fw, h + 1); + path.addRect(0, 0, w, h + 1); freqPainter.drawPath(path); fftf_free(input); @@ -193,7 +196,7 @@ freqPainter.setFont(font); label = tr("dB / freq"); - freqPainter.drawText(fw - freqPainter.fontMetrics().width(label) - 4, + freqPainter.drawText(w - freqPainter.fontMetrics().width(label) - 4, freqPainter.fontMetrics().ascent() + 1, label); m_windowFreqExampleLabel->setPixmap(freqLabel);