Mercurial > hg > svgui
changeset 663:1a0fdad4af4d tonioni
Merge from the default branch
author | Chris Cannam |
---|---|
date | Fri, 12 Jul 2013 13:25:22 +0100 |
parents | 8663a831838f (current diff) 7cb6112c59ca (diff) |
children | 123ebecd12e6 |
files | svgui.pro view/Pane.cpp view/ViewManager.cpp |
diffstat | 23 files changed, 383 insertions(+), 273 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Thu Jun 20 13:47:36 2013 +0100 +++ b/.hgtags Fri Jul 12 13:25:22 2013 +0100 @@ -24,3 +24,6 @@ c9d6cf9c51c8e15a06fa1f5c1678d0331dc837cb sv_v1.8 3803f6dcf361c9ec82badb20e3ca9f5c712c5d2f sv_v1.9 ea786e8bd931243adc95a040988edd0d6b5bbc0a sv_v2.0 +c6d705bf1672f2cd7f3d4cfe46aa3db6062c004c sv_v2.1 +c6d705bf1672f2cd7f3d4cfe46aa3db6062c004c sv_v2.1 +77fa3fdbfc7e2b9f96eac6524d48294fb47760c3 sv_v2.1
--- a/acinclude.m4 Thu Jun 20 13:47:36 2013 +0100 +++ b/acinclude.m4 Fri Jul 12 13:25:22 2013 +0100 @@ -66,7 +66,7 @@ AC_REQUIRE([AC_PROG_CXX]) if test x$QMAKE = x ; then - AC_CHECK_PROG(QMAKE, qmake-qt4, $QTDIR/bin/qmake-qt4,,$QTDIR/bin/) + AC_CHECK_PROG(QMAKE, qmake-qt5, $QTDIR/bin/qmake-qt5,,$QTDIR/bin/) fi if test x$QMAKE = x ; then AC_CHECK_PROG(QMAKE, qmake, $QTDIR/bin/qmake,,$QTDIR/bin/) @@ -75,16 +75,16 @@ AC_CHECK_PROG(QMAKE, qmake.exe, $QTDIR/bin/qmake.exe,,$QTDIR/bin/) fi if test x$QMAKE = x ; then - AC_CHECK_PROG(QMAKE, qmake-qt4, qmake-qt4,,$PATH) + AC_CHECK_PROG(QMAKE, qmake-qt5, qmake-qt5,,$PATH) fi if test x$QMAKE = x ; then AC_CHECK_PROG(QMAKE, qmake, qmake,,$PATH) fi if test x$QMAKE = x ; then AC_MSG_ERROR([ -Failed to find the required qmake-qt4 or qmake program. Please -ensure you have the necessary Qt4 development files installed, and -if necessary set QTDIR to the location of your Qt4 installation. +Failed to find the required qmake-qt5 or qmake program. Please +ensure you have the necessary Qt5 development files installed, and +if necessary set QTDIR to the location of your Qt5 installation. ]) fi @@ -98,11 +98,11 @@ # QMAKE_VERSION_OUTPUT=`$QMAKE -v` case "$QMAKE_VERSION_OUTPUT" in - *2.*4.*) ;; + *5.*) ;; *) AC_MSG_WARN([ *** The version of qmake found in "$QMAKE" looks like it might be - from the wrong version of Qt (Qt4 is required). Please check - that this is the correct version of qmake for Qt4 builds. + from the wrong version of Qt (Qt5 is required). Please check + that this is the correct version of qmake for Qt5 builds. ]) esac
--- a/configure Thu Jun 20 13:47:36 2013 +0100 +++ b/configure Fri Jul 12 13:25:22 2013 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for SVgui 1.8. +# Generated by GNU Autoconf 2.69 for SVgui 2.1. # # Report bugs to <cannam@all-day-breakfast.com>. # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='SVgui' PACKAGE_TARNAME='svgui' -PACKAGE_VERSION='1.8' -PACKAGE_STRING='SVgui 1.8' +PACKAGE_VERSION='2.1' +PACKAGE_STRING='SVgui 2.1' PACKAGE_BUGREPORT='cannam@all-day-breakfast.com' PACKAGE_URL='' @@ -1319,7 +1319,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures SVgui 1.8 to adapt to many kinds of systems. +\`configure' configures SVgui 2.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1380,7 +1380,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of SVgui 1.8:";; + short | recursive ) echo "Configuration of SVgui 2.1:";; esac cat <<\_ACEOF @@ -1525,7 +1525,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -SVgui configure 1.8 +SVgui configure 2.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1865,7 +1865,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by SVgui $as_me 1.8, which was +It was created by SVgui $as_me 2.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3957,8 +3957,8 @@ if test x$QMAKE = x ; then - # Extract the first word of "qmake-qt4", so it can be a program name with args. -set dummy qmake-qt4; ac_word=$2 + # Extract the first word of "qmake-qt5", so it can be a program name with args. +set dummy qmake-qt5; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_QMAKE+:} false; then : @@ -3974,7 +3974,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_QMAKE="$QTDIR/bin/qmake-qt4" + ac_cv_prog_QMAKE="$QTDIR/bin/qmake-qt5" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -4074,8 +4074,8 @@ fi if test x$QMAKE = x ; then - # Extract the first word of "qmake-qt4", so it can be a program name with args. -set dummy qmake-qt4; ac_word=$2 + # Extract the first word of "qmake-qt5", so it can be a program name with args. +set dummy qmake-qt5; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_QMAKE+:} false; then : @@ -4091,7 +4091,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_QMAKE="qmake-qt4" + ac_cv_prog_QMAKE="qmake-qt5" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -4153,9 +4153,9 @@ fi if test x$QMAKE = x ; then as_fn_error $? " -Failed to find the required qmake-qt4 or qmake program. Please -ensure you have the necessary Qt4 development files installed, and -if necessary set QTDIR to the location of your Qt4 installation. +Failed to find the required qmake-qt5 or qmake program. Please +ensure you have the necessary Qt5 development files installed, and +if necessary set QTDIR to the location of your Qt5 installation. " "$LINENO" 5 fi @@ -4169,16 +4169,16 @@ # QMAKE_VERSION_OUTPUT=`$QMAKE -v` case "$QMAKE_VERSION_OUTPUT" in - *2.*4.*) ;; + *5.*) ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** The version of qmake found in \"$QMAKE\" looks like it might be - from the wrong version of Qt (Qt4 is required). Please check - that this is the correct version of qmake for Qt4 builds. + from the wrong version of Qt (Qt5 is required). Please check + that this is the correct version of qmake for Qt5 builds. " >&5 $as_echo "$as_me: WARNING: *** The version of qmake found in \"$QMAKE\" looks like it might be - from the wrong version of Qt (Qt4 is required). Please check - that this is the correct version of qmake for Qt4 builds. + from the wrong version of Qt (Qt5 is required). Please check + that this is the correct version of qmake for Qt5 builds. " >&2;} esac @@ -5158,10 +5158,10 @@ SV_MODULE_MODULE=vamphostsdk -SV_MODULE_VERSION_TEST="vamp-hostsdk >= 2.3.1" +SV_MODULE_VERSION_TEST="vamp-hostsdk >= 2.5" SV_MODULE_HEADER=vamp-hostsdk/PluginLoader.h SV_MODULE_LIB=vamp-hostsdk -SV_MODULE_FUNC=libvamphostsdk_v_2_3_1_present +SV_MODULE_FUNC=libvamphostsdk_v_2_5_present SV_MODULE_HAVE=HAVE_$(echo vamphostsdk | tr 'a-z' 'A-Z') SV_MODULE_FAILED=1 if test -n "$vamphostsdk_LIBS" ; then @@ -7417,7 +7417,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by SVgui $as_me 1.8, which was +This file was extended by SVgui $as_me 2.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7470,7 +7470,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -SVgui config.status 1.8 +SVgui config.status 2.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -8044,7 +8044,7 @@ fi -if ! $QMAKE -r; then +if ! $QMAKE -r svgui.pro; then as_fn_error $? "qmake failed: Command was \"$QMAKE -r\"" "$LINENO" 5 fi @@ -8056,7 +8056,7 @@ The file config.pri contains the configuration settings for qmake. If you want to adjust these by hand, edit config.pri -and run \"qmake -r\" again to regenerate the Makefile. +and run \"$QMAKE -r\" again to regenerate the Makefile. " >&5 $as_echo "$as_me: @@ -8066,5 +8066,5 @@ The file config.pri contains the configuration settings for qmake. If you want to adjust these by hand, edit config.pri -and run \"qmake -r\" again to regenerate the Makefile. +and run \"$QMAKE -r\" again to regenerate the Makefile. " >&6;}
--- a/configure.ac Thu Jun 20 13:47:36 2013 +0100 +++ b/configure.ac Fri Jul 12 13:25:22 2013 +0100 @@ -1,5 +1,5 @@ -AC_INIT(SVgui, 1.8, cannam@all-day-breakfast.com) +AC_INIT([SVgui], [2.1], cannam@all-day-breakfast.com) AC_CONFIG_SRCDIR(widgets/Fader.h) @@ -80,7 +80,7 @@ SV_MODULE_REQUIRED([sndfile],[sndfile >= 1.0.16],[sndfile.h],[sndfile],[sf_open]) SV_MODULE_REQUIRED([samplerate],[samplerate >= 0.1.2],[samplerate.h],[samplerate],[src_new]) SV_MODULE_REQUIRED([vamp],[vamp >= 2.1],[vamp/vamp.h],[],[]) -SV_MODULE_REQUIRED([vamphostsdk],[vamp-hostsdk >= 2.3.1],[vamp-hostsdk/PluginLoader.h],[vamp-hostsdk],[libvamphostsdk_v_2_3_1_present]) +SV_MODULE_REQUIRED([vamphostsdk],[vamp-hostsdk >= 2.5],[vamp-hostsdk/PluginLoader.h],[vamp-hostsdk],[libvamphostsdk_v_2_5_present]) SV_MODULE_REQUIRED([rubberband],[rubberband],[rubberband/RubberBandStretcher.h],[rubberband],[rubberband_new]) SV_MODULE_OPTIONAL([liblo],[],[lo/lo.h],[lo],[lo_address_new]) @@ -114,7 +114,7 @@ AC_OUTPUT -if ! $QMAKE -r; then +if ! $QMAKE -r svgui.pro; then AC_MSG_ERROR([qmake failed: Command was "$QMAKE -r"]) fi @@ -126,5 +126,5 @@ The file config.pri contains the configuration settings for qmake. If you want to adjust these by hand, edit config.pri -and run "qmake -r" again to regenerate the Makefile. +and run "$QMAKE -r" again to regenerate the Makefile. ])
--- a/layer/Colour3DPlotLayer.cpp Thu Jun 20 13:47:36 2013 +0100 +++ b/layer/Colour3DPlotLayer.cpp Fri Jul 12 13:25:22 2013 +0100 @@ -952,13 +952,13 @@ if (!m_cache) { m_cache = new QImage (cacheWidth, cacheHeight, QImage::Format_Indexed8); - m_cache->setNumColors(256); +// No longer exists in Qt5: m_cache->setNumColors(256); m_cache->fill(0); if (!m_normalizeVisibleArea) { m_peaksCache = new QImage (cacheWidth / m_peakResolution + 1, cacheHeight, QImage::Format_Indexed8); - m_peaksCache->setNumColors(256); +// No longer exists in Qt5: m_peaksCache->setNumColors(256); m_peaksCache->fill(0); } else if (m_peaksCache) { delete m_peaksCache;
--- a/layer/SpectrogramLayer.cpp Thu Jun 20 13:47:36 2013 +0100 +++ b/layer/SpectrogramLayer.cpp Fri Jul 12 13:25:22 2013 +0100 @@ -2293,7 +2293,7 @@ if (m_colourScale == PhaseColourScale) usePeaksCache = false; } - m_drawBuffer.setNumColors(256); +// No longer exists in Qt5: m_drawBuffer.setNumColors(256); for (int pixel = 0; pixel < 256; ++pixel) { m_drawBuffer.setColor(pixel, m_palette.getColour(pixel).rgb()); }
--- a/layer/TimeValueLayer.cpp Thu Jun 20 13:47:36 2013 +0100 +++ b/layer/TimeValueLayer.cpp Fri Jul 12 13:25:22 2013 +0100 @@ -81,7 +81,7 @@ } #ifdef DEBUG_TIME_VALUE_LAYER - SVDEBUG << "TimeValueLayer::setModel(" << model << ")" << endl; + std::cerr << "TimeValueLayer::setModel(" << model << ")" << std::endl; #endif emit modelReplaced(); @@ -328,6 +328,11 @@ max = std::max(fabsf(min), fabsf(max)); min = -max; } + +#ifdef DEBUG_TIME_VALUE_LAYER + std::cerr << "TimeValueLayer::getValueExtents: min = " << min << ", max = " << max << std::endl; +#endif + return true; } @@ -350,7 +355,7 @@ } #ifdef DEBUG_TIME_VALUE_LAYER - SVDEBUG << "TimeValueLayer::getDisplayExtents: min = " << min << ", max = " << max << endl; + std::cerr << "TimeValueLayer::getDisplayExtents: min = " << min << ", max = " << max << std::endl; #endif return true; @@ -373,7 +378,7 @@ m_scaleMaximum = max; #ifdef DEBUG_TIME_VALUE_LAYER - SVDEBUG << "TimeValueLayer::setDisplayExtents: min = " << min << ", max = " << max << endl; + std::cerr << "TimeValueLayer::setDisplayExtents: min = " << min << ", max = " << max << std::endl; #endif emit layerParametersChanged(); @@ -405,7 +410,7 @@ int nr = mapper->getPositionForValue(dmax - dmin); #ifdef DEBUG_TIME_VALUE_LAYER - SVDEBUG << "TimeValueLayer::getCurrentVerticalZoomStep: dmin = " << dmin << ", dmax = " << dmax << ", nr = " << nr << endl; + std::cerr << "TimeValueLayer::getCurrentVerticalZoomStep: dmin = " << dmin << ", dmax = " << dmax << ", nr = " << nr << std::endl; #endif delete mapper; @@ -460,7 +465,7 @@ } #ifdef DEBUG_TIME_VALUE_LAYER - SVDEBUG << "TimeValueLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << newdist << ")" << endl; + std::cerr << "TimeValueLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << newdist << ")" << std::endl; #endif setDisplayExtents(newmin, newmax); @@ -512,6 +517,8 @@ if (prevPoints.empty()) { usePoints = nextPoints; + } else if (nextPoints.empty()) { + // stick with prevPoints } else if (long(prevPoints.begin()->frame) < v->getStartFrame() && !(nextPoints.begin()->frame > v->getEndFrame())) { usePoints = nextPoints; @@ -524,7 +531,7 @@ int fuzz = 2; int px = v->getXForFrame(usePoints.begin()->frame); if ((px > x && px - x > fuzz) || - (px < x && x - px > fuzz + 1)) { + (px < x && x - px > fuzz + 3)) { usePoints.clear(); } } @@ -756,14 +763,29 @@ } else { getDisplayExtents(min, max); - + if (m_verticalScale == LogScale) { LogRange::mapRange(min, max); log = true; } } - if (max == min) max = min + 1.0; +#ifdef DEBUG_TIME_VALUE_LAYER + std::cerr << "TimeValueLayer::getScaleExtents: min = " << min << ", max = " << max << std::endl; +#endif + + if (max == min) { + max = max + 0.5; + min = min - 0.5; + } else { + float margin = (max - min) / 10.0; + max = max + margin; + min = min - margin; + } + +#ifdef DEBUG_TIME_VALUE_LAYER + std::cerr << "TimeValueLayer::getScaleExtents: min = " << min << ", max = " << max << " (after adjustment)" << std::endl; +#endif } int @@ -828,8 +850,8 @@ } #ifdef DEBUG_TIME_VALUE_LAYER - SVDEBUG << "TimeValueLayer::getColourForValue: min " << min << ", max " - << max << ", log " << log << ", value " << val << endl; + std::cerr << "TimeValueLayer::getColourForValue: min " << min << ", max " + << max << ", log " << log << ", value " << val << std::endl; #endif QColor solid = ColourMapper(m_colourMap, min, max).map(val); @@ -872,8 +894,8 @@ paint.setBrush(brushColour); #ifdef DEBUG_TIME_VALUE_LAYER - SVDEBUG << "TimeValueLayer::paint: resolution is " - << m_model->getResolution() << " frames" << endl; + std::cerr << "TimeValueLayer::paint: resolution is " + << m_model->getResolution() << " frames" << std::endl; #endif float min = m_model->getValueMinimum(); @@ -899,6 +921,12 @@ v->getXForFrame(frame0 + m_model->getResolution()) - v->getXForFrame(frame0); + if (m_plotStyle == PlotStems) { + if (w < 2) w = 2; + } else { + if (w < 1) w = 1; + } + paint.save(); QPainterPath path; @@ -944,7 +972,7 @@ if (m_plotStyle != PlotSegmentation) { textY = y - paint.fontMetrics().height() - + paint.fontMetrics().ascent(); + + paint.fontMetrics().ascent() - 1; if (textY < paint.fontMetrics().ascent() + 1) { textY = paint.fontMetrics().ascent() + 1; } @@ -971,8 +999,6 @@ // std::cout << "frame = " << p.frame << ", x = " << x << ", haveNext = " << haveNext // << ", nx = " << nx << std::endl; - if (w < 1) w = 1; - if (m_plotStyle == PlotDiscreteCurves) { paint.setPen(QPen(getBaseQColor(), 3)); paint.setBrush(Qt::NoBrush); @@ -1005,30 +1031,36 @@ } } + bool illuminate = false; + if (illuminateFrame == p.frame) { - //!!! aside from the problem of choosing a colour, it'd be - //better to save the highlighted rects and draw them at - //the end perhaps - - //!!! not equipped to illuminate the right section in line - //or curve mode + // not equipped to illuminate the right section in line + // or curve mode if (m_plotStyle != PlotCurve && m_plotStyle != PlotDiscreteCurves && m_plotStyle != PlotLines) { - paint.setPen(getForegroundQColor(v)); - } - } + illuminate = true; + } + } if (m_plotStyle != PlotLines && m_plotStyle != PlotCurve && m_plotStyle != PlotDiscreteCurves && m_plotStyle != PlotSegmentation) { + if (illuminate) { + paint.save(); + paint.setPen(getForegroundQColor(v)); + paint.setBrush(getForegroundQColor(v)); + } if (m_plotStyle != PlotStems || w > 1) { paint.drawRect(x, y - 1, w, 2); } + if (illuminate) { + paint.restore(); + } } if (m_plotStyle == PlotConnectedPoints || @@ -1050,7 +1082,6 @@ if (pointCount == 0) { path.moveTo(x + w/2, y); } - ++pointCount; // paint.drawLine(x + w/2, y, nx + w/2, ny); path.lineTo(nx + w/2, ny); @@ -1074,7 +1105,6 @@ if (pointCount == 0 || gap) { path.moveTo((x0 + x1) / 2, (y0 + y1) / 2); } - ++pointCount; if (nx - x > 5) { path.cubicTo(x0, y0, @@ -1094,14 +1124,14 @@ if (m_plotStyle == PlotSegmentation) { #ifdef DEBUG_TIME_VALUE_LAYER - SVDEBUG << "drawing rect" << endl; + std::cerr << "drawing rect" << std::endl; #endif if (nx <= x) continue; paint.setPen(QPen(getForegroundQColor(v), 2)); - if (illuminateFrame != p.frame) { + if (!illuminate) { if (!m_drawSegmentDivisions || nx < x + 5 || x >= v->width() - 1) { @@ -1112,14 +1142,33 @@ paint.drawRect(x, -1, nx - x, v->height() + 1); } - if (p.label != "") { - if (!haveNext || nx > x + 6 + paint.fontMetrics().width(p.label)) { - v->drawVisibleText(paint, x + 5, textY, p.label, View::OutlinedText); -// paint.drawText(x + 5, textY, p.label); + QString label = p.label; + bool italic = false; + + if (label == "" && + (m_plotStyle == PlotPoints || + m_plotStyle == PlotSegmentation || + m_plotStyle == PlotConnectedPoints)) { + char lc[20]; + snprintf(lc, 20, "%.3g", p.value); + label = lc; + italic = true; + } + + if (label != "") { + bool haveRoom = nx > x + 6 + paint.fontMetrics().width(label); + if (haveRoom || + (!haveNext && + (pointCount == 0 || !italic))) { + v->drawVisibleText(paint, x + 5, textY, label, + italic ? + View::OutlinedItalicText : + View::OutlinedText); } } prevFrame = p.frame; + ++pointCount; } if ((m_plotStyle == PlotCurve || m_plotStyle == PlotDiscreteCurves || @@ -1281,7 +1330,7 @@ TimeValueLayer::drawStart(View *v, QMouseEvent *e) { #ifdef DEBUG_TIME_VALUE_LAYER - SVDEBUG << "TimeValueLayer::drawStart(" << e->x() << "," << e->y() << ")" << endl; + std::cerr << "TimeValueLayer::drawStart(" << e->x() << "," << e->y() << ")" << std::endl; #endif if (!m_model) return; @@ -1301,7 +1350,7 @@ i != points.end(); ++i) { if (((i->frame / resolution) * resolution) != frame) { #ifdef DEBUG_TIME_VALUE_LAYER - SVDEBUG << "ignoring out-of-range frame at " << i->frame << endl; + std::cerr << "ignoring out-of-range frame at " << i->frame << std::endl; #endif continue; } @@ -1331,7 +1380,7 @@ TimeValueLayer::drawDrag(View *v, QMouseEvent *e) { #ifdef DEBUG_TIME_VALUE_LAYER - SVDEBUG << "TimeValueLayer::drawDrag(" << e->x() << "," << e->y() << ")" << endl; + std::cerr << "TimeValueLayer::drawDrag(" << e->x() << "," << e->y() << ")" << std::endl; #endif if (!m_model || !m_editing) return; @@ -1357,18 +1406,18 @@ if (i->frame == m_editingPoint.frame && i->value == m_editingPoint.value) { #ifdef DEBUG_TIME_VALUE_LAYER - SVDEBUG << "ignoring current editing point at " << i->frame << ", " << i->value << endl; + std::cerr << "ignoring current editing point at " << i->frame << ", " << i->value << std::endl; #endif continue; } if (((i->frame / resolution) * resolution) != frame) { #ifdef DEBUG_TIME_VALUE_LAYER - SVDEBUG << "ignoring out-of-range frame at " << i->frame << endl; + std::cerr << "ignoring out-of-range frame at " << i->frame << std::endl; #endif continue; } #ifdef DEBUG_TIME_VALUE_LAYER - SVDEBUG << "adjusting to new point at " << i->frame << ", " << i->value << endl; + std::cerr << "adjusting to new point at " << i->frame << ", " << i->value << std::endl; #endif m_editingPoint = *i; m_originalPoint = m_editingPoint; @@ -1393,7 +1442,7 @@ TimeValueLayer::drawEnd(View *, QMouseEvent *) { #ifdef DEBUG_TIME_VALUE_LAYER - SVDEBUG << "TimeValueLayer::drawEnd" << endl; + std::cerr << "TimeValueLayer::drawEnd" << std::endl; #endif if (!m_model || !m_editing) return; finish(m_editingCommand); @@ -1450,7 +1499,7 @@ TimeValueLayer::editStart(View *v, QMouseEvent *e) { #ifdef DEBUG_TIME_VALUE_LAYER - SVDEBUG << "TimeValueLayer::editStart(" << e->x() << "," << e->y() << ")" << endl; + std::cerr << "TimeValueLayer::editStart(" << e->x() << "," << e->y() << ")" << std::endl; #endif if (!m_model) return; @@ -1473,7 +1522,7 @@ TimeValueLayer::editDrag(View *v, QMouseEvent *e) { #ifdef DEBUG_TIME_VALUE_LAYER - SVDEBUG << "TimeValueLayer::editDrag(" << e->x() << "," << e->y() << ")" << endl; + std::cerr << "TimeValueLayer::editDrag(" << e->x() << "," << e->y() << ")" << std::endl; #endif if (!m_model || !m_editing) return; @@ -1499,7 +1548,7 @@ TimeValueLayer::editEnd(View *, QMouseEvent *) { #ifdef DEBUG_TIME_VALUE_LAYER - SVDEBUG << "TimeValueLayer::editEnd" << endl; + std::cerr << "TimeValueLayer::editEnd" << std::endl; #endif if (!m_model || !m_editing) return; @@ -1791,7 +1840,7 @@ if (generation == Labeller::ValueFromCyclicalCounter || generation == Labeller::ValueFromTwoLevelCounter) { - int cycleSize = QInputDialog::getInteger + int cycleSize = QInputDialog::getInt (0, tr("Select cycle size"), tr("Cycle size:"), 4, 2, 16, 1); labeller.setCounterCycleSize(cycleSize); @@ -1839,9 +1888,9 @@ newPoint.value = i->getValue(); } else { #ifdef DEBUG_TIME_VALUE_LAYER - SVDEBUG << "Setting value on point at " << newPoint.frame << " from labeller"; + std::cerr << "Setting value on point at " << newPoint.frame << " from labeller"; if (i == points.begin()) { - SVDEBUG << ", no prev point" << endl; + std::cerr << ", no prev point" << std::endl; } else { std::cerr << ", prev point is at " << prevPoint.frame << std::endl; }
--- a/svgui.pro Thu Jun 20 13:47:36 2013 +0100 +++ b/svgui.pro Fri Jul 12 13:25:22 2013 +0100 @@ -1,143 +1,157 @@ - -TEMPLATE = lib - -include(config.pri) - -CONFIG += staticlib qt thread warn_on stl rtti exceptions -QT += network xml gui - -TARGET = svgui - -DEPENDPATH += . ../svcore -INCLUDEPATH += . ../svcore -OBJECTS_DIR = o -MOC_DIR = o - -HEADERS += layer/Colour3DPlotLayer.h \ - layer/ColourDatabase.h \ - layer/ColourMapper.h \ - layer/ImageLayer.h \ - layer/ImageRegionFinder.h \ - layer/Layer.h \ - layer/LayerFactory.h \ - layer/NoteLayer.h \ - layer/FlexiNoteLayer.h \ - layer/PaintAssistant.h \ - layer/RegionLayer.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/WaveformLayer.h -SOURCES += layer/Colour3DPlotLayer.cpp \ - layer/ColourDatabase.cpp \ - layer/ColourMapper.cpp \ - layer/ImageLayer.cpp \ - layer/ImageRegionFinder.cpp \ - layer/Layer.cpp \ - layer/LayerFactory.cpp \ - layer/NoteLayer.cpp \ - layer/FlexiNoteLayer.cpp \ - layer/PaintAssistant.cpp \ - layer/RegionLayer.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 - -HEADERS += view/Overview.h \ - view/Pane.h \ - view/PaneStack.h \ - view/View.h \ - view/ViewManager.h -SOURCES += 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/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/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/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/WindowShapePreview.cpp \ - widgets/WindowTypeSelector.cpp + +TEMPLATE = lib + +exists(config.pri) { + include(config.pri) +} +win* { + !exists(config.pri) { + DEFINES += HAVE_BZ2 HAVE_FFTW3 HAVE_FFTW3F HAVE_SNDFILE HAVE_SAMPLERATE HAVE_VAMP HAVE_VAMPHOSTSDK HAVE_RUBBERBAND HAVE_DATAQUAY HAVE_LIBLO HAVE_MAD HAVE_ID3TAG + } +} + +CONFIG += staticlib qt thread warn_on stl rtti exceptions +QT += network xml gui widgets + +TARGET = svgui + +DEPENDPATH += . ../svcore +INCLUDEPATH += . ../svcore +OBJECTS_DIR = o +MOC_DIR = o + +win32-g++ { + INCLUDEPATH += ../sv-dependency-builds/win32-mingw/include +} +win32-msvc* { + INCLUDEPATH += ../sv-dependency-builds/win32-msvc/include +} + +HEADERS += layer/Colour3DPlotLayer.h \ + layer/ColourDatabase.h \ + layer/ColourMapper.h \ + layer/ImageLayer.h \ + layer/ImageRegionFinder.h \ + layer/Layer.h \ + layer/LayerFactory.h \ + layer/NoteLayer.h \ + layer/FlexiNoteLayer.h \ + layer/PaintAssistant.h \ + layer/RegionLayer.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/WaveformLayer.h +SOURCES += layer/Colour3DPlotLayer.cpp \ + layer/ColourDatabase.cpp \ + layer/ColourMapper.cpp \ + layer/ImageLayer.cpp \ + layer/ImageRegionFinder.cpp \ + layer/Layer.cpp \ + layer/LayerFactory.cpp \ + layer/NoteLayer.cpp \ + layer/FlexiNoteLayer.cpp \ + layer/PaintAssistant.cpp \ + layer/RegionLayer.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 + +HEADERS += view/Overview.h \ + view/Pane.h \ + view/PaneStack.h \ + view/View.h \ + view/ViewManager.h +SOURCES += 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/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/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/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/WindowShapePreview.cpp \ + widgets/WindowTypeSelector.cpp
--- a/view/Overview.cpp Thu Jun 20 13:47:36 2013 +0100 +++ b/view/Overview.cpp Fri Jul 12 13:25:22 2013 +0100 @@ -22,6 +22,8 @@ #include <QPainter> #include <iostream> +//#define DEBUG_OVERVIEW 1 + using std::cerr; using std::endl; @@ -90,14 +92,20 @@ } void -Overview::globalCentreFrameChanged(unsigned long) +Overview::globalCentreFrameChanged(unsigned long f) { +#ifdef DEBUG_OVERVIEW + std::cerr << "Overview::globalCentreFrameChanged: " << f << std::endl; +#endif update(); } void -Overview::viewCentreFrameChanged(View *v, unsigned long) +Overview::viewCentreFrameChanged(View *v, unsigned long f) { +#ifdef DEBUG_OVERVIEW + std::cerr << "Overview[" << this << "]::viewCentreFrameChanged(" << v << "): " << f << std::endl; +#endif if (m_views.find(v) != m_views.end()) { update(); } @@ -115,6 +123,10 @@ void Overview::viewManagerPlaybackFrameChanged(unsigned long f) { +#ifdef DEBUG_OVERVIEW + std::cerr << "Overview[" << this << "]::viewManagerPlaybackFrameChanged(" << f << "): " << f << std::endl; +#endif + bool changed = false; f = getAlignedPlaybackFrame(); @@ -130,7 +142,9 @@ { // Recalculate zoom in case the size of the widget has changed. -// SVDEBUG << "Overview::paintEvent: width is " << width() << ", centre frame " << m_centreFrame << endl; +#ifdef DEBUG_OVERVIEW + std::cerr << "Overview::paintEvent: width is " << width() << ", centre frame " << m_centreFrame << std::endl; +#endif size_t startFrame = getModelsStartFrame(); size_t frameCount = getModelsEndFrame() - getModelsStartFrame(); @@ -148,10 +162,14 @@ centreFrame = (startFrame + getModelsEndFrame())/2; } if (centreFrame != m_centreFrame) { -// SVDEBUG << "Overview::paintEvent: Centre frame changed from " -// << m_centreFrame << " to " << centreFrame << " and thus start frame from " << getStartFrame(); +#ifdef DEBUG_OVERVIEW + std::cerr << "Overview::paintEvent: Centre frame changed from " + << m_centreFrame << " to " << centreFrame << " and thus start frame from " << getStartFrame(); +#endif m_centreFrame = centreFrame; -// SVDEBUG << " to " << getStartFrame() << endl; +#ifdef DEBUG_OVERVIEW + std::cerr << " to " << getStartFrame() << std::endl; +#endif emit centreFrameChanged(m_centreFrame, false, PlaybackIgnore); } @@ -259,6 +277,9 @@ if (std::max(m_centreFrame, newCentreFrame) - std::min(m_centreFrame, newCentreFrame) > size_t(m_zoomLevel)) { size_t rf = alignToReference(newCentreFrame); +#ifdef DEBUG_OVERVIEW + std::cerr << "Overview::mouseMoveEvent: x " << e->x() << " and click x " << m_clickPos.x() << " -> frame " << newCentreFrame << " -> rf " << rf << std::endl; +#endif emit centreFrameChanged(rf, true, PlaybackScrollContinuous); } } @@ -269,6 +290,10 @@ long frame = getFrameForX(e->x()); size_t rf = 0; if (frame > 0) rf = alignToReference(frame); +#ifdef DEBUG_OVERVIEW + std::cerr << "Overview::mouseDoubleClickEvent: frame " << frame << " -> rf " << rf << std::endl; +#endif + m_clickedInRange = false; // we're not starting a drag with the second click emit centreFrameChanged(rf, true, PlaybackScrollContinuous); }
--- a/view/Pane.cpp Thu Jun 20 13:47:36 2013 +0100 +++ b/view/Pane.cpp Fri Jul 12 13:25:22 2013 +0100 @@ -40,6 +40,7 @@ #include <QDropEvent> #include <QCursor> #include <QTextStream> +#include <QMimeData> #include <iostream> #include <cmath> @@ -1124,7 +1125,6 @@ if (m_manager && m_manager->shouldShowVerticalScale()) { for (LayerList::iterator vi = m_layers.end(); vi != m_layers.begin(); ) { --vi; - QPainter paint(image); sw = (*vi)->getVerticalScaleWidth (this, m_manager->shouldShowVerticalColourScale(), paint); break; @@ -1540,7 +1540,8 @@ // std::cerr << "mouseMoveEvent" << std::endl; - updateContextHelp(&e->pos()); + QPoint pos = e->pos(); + updateContextHelp(&pos); if (m_navigating && m_clickedInRange && !m_releasing) { @@ -2374,7 +2375,8 @@ << ", possibleActions: " << e->possibleActions() << ", proposedAction: " << e->proposedAction() << std::endl; - if (e->provides("text/uri-list") || e->provides("text/plain")) { + if (e->mimeData()->hasFormat("text/uri-list") || + e->mimeData()->hasFormat("text/plain")) { if (e->proposedAction() & Qt::CopyAction) { e->acceptProposedAction(); @@ -2391,7 +2393,8 @@ std::cerr << "dropEvent: text: \"" << e->mimeData()->text().toStdString() << "\"" << std::endl; - if (e->provides("text/uri-list") || e->provides("text/plain")) { + if (e->mimeData()->hasFormat("text/uri-list") || + e->mimeData()->hasFormat("text/plain")) { if (e->proposedAction() & Qt::CopyAction) { e->acceptProposedAction(); @@ -2400,16 +2403,16 @@ e->accept(); } - if (e->provides("text/uri-list")) { - - SVDEBUG << "accepting... data is \"" << e->encodedData("text/uri-list").data() << "\"" << endl; + if (e->mimeData()->hasFormat("text/uri-list")) { + + SVDEBUG << "accepting... data is \"" << e->mimeData()->data("text/uri-list").data() << "\"" << endl; emit dropAccepted(QString::fromLocal8Bit - (e->encodedData("text/uri-list").data()) + (e->mimeData()->data("text/uri-list").data()) .split(QRegExp("[\\r\\n]+"), QString::SkipEmptyParts)); } else { emit dropAccepted(QString::fromLocal8Bit - (e->encodedData("text/plain").data())); + (e->mimeData()->data("text/plain").data())); } } }
--- a/view/View.cpp Thu Jun 20 13:47:36 2013 +0100 +++ b/view/View.cpp Fri Jul 12 13:25:22 2013 +0100 @@ -731,10 +731,16 @@ void View::drawVisibleText(QPainter &paint, int x, int y, QString text, TextStyle style) const { - if (style == OutlinedText) { + if (style == OutlinedText || style == OutlinedItalicText) { paint.save(); + if (style == OutlinedItalicText) { + QFont f(paint.font()); + f.setItalic(true); + paint.setFont(f); + } + QColor penColour, surroundColour, boxColour; penColour = getForeground(); @@ -744,6 +750,7 @@ paint.setPen(Qt::NoPen); paint.setBrush(boxColour); + QRect r = paint.fontMetrics().boundingRect(text); r.translate(QPoint(x, y)); // std::cerr << "drawVisibleText: r = " << r.x() << "," <<r.y() << " " << r.width() << "x" << r.height() << std::endl;
--- a/view/View.h Thu Jun 20 13:47:36 2013 +0100 +++ b/view/View.h Fri Jul 12 13:25:22 2013 +0100 @@ -190,7 +190,8 @@ enum TextStyle { BoxedText, - OutlinedText + OutlinedText, + OutlinedItalicText }; virtual void drawVisibleText(QPainter &p, int x, int y,
--- a/view/ViewManager.cpp Thu Jun 20 13:47:36 2013 +0100 +++ b/view/ViewManager.cpp Fri Jul 12 13:25:22 2013 +0100 @@ -129,7 +129,7 @@ ViewManager::getGlobalCentreFrame() const { #ifdef DEBUG_VIEW_MANAGER - std::cout << "ViewManager::getGlobalCentreFrame: returning " << m_globalCentreFrame << std::endl; + std::cerr << "ViewManager::getGlobalCentreFrame: returning " << m_globalCentreFrame << std::endl; #endif return m_globalCentreFrame; } @@ -138,7 +138,7 @@ ViewManager::setGlobalCentreFrame(unsigned long f) { #ifdef DEBUG_VIEW_MANAGER - std::cout << "ViewManager::setGlobalCentreFrame to " << f << std::endl; + std::cerr << "ViewManager::setGlobalCentreFrame to " << f << std::endl; #endif m_globalCentreFrame = f; emit globalCentreFrameChanged(f); @@ -148,7 +148,7 @@ ViewManager::getGlobalZoom() const { #ifdef DEBUG_VIEW_MANAGER - std::cout << "ViewManager::getGlobalZoom: returning " << m_globalZoom << std::endl; + std::cerr << "ViewManager::getGlobalZoom: returning " << m_globalZoom << std::endl; #endif return m_globalZoom; } @@ -474,7 +474,7 @@ m_playbackFrame = m_playSource->getCurrentPlayingFrame(); #ifdef DEBUG_VIEW_MANAGER - std::cout << "ViewManager::checkPlayStatus: Playing, frame " << m_playbackFrame << ", levels " << m_lastLeft << "," << m_lastRight << std::endl; + std::cerr << "ViewManager::checkPlayStatus: Playing, frame " << m_playbackFrame << ", levels " << m_lastLeft << "," << m_lastRight << std::endl; #endif emit playbackFrameChanged(m_playbackFrame); @@ -492,7 +492,7 @@ } #ifdef DEBUG_VIEW_MANAGER -// std::cout << "ViewManager::checkPlayStatus: Not playing" << std::endl; +// std::cerr << "ViewManager::checkPlayStatus: Not playing" << std::endl; #endif } } @@ -510,7 +510,7 @@ View *v = dynamic_cast<View *>(sender()); #ifdef DEBUG_VIEW_MANAGER - SVDEBUG << "ViewManager::viewCentreFrameChanged(" << f << ", " << locked << ", " << mode << "), view is " << v << endl; + std::cerr << "ViewManager::viewCentreFrameChanged(" << f << ", " << locked << ", " << mode << "), view is " << v << std::endl; #endif if (locked) { @@ -539,7 +539,7 @@ ViewManager::seek(unsigned long f) { #ifdef DEBUG_VIEW_MANAGER - std::cout << "ViewManager::seek(" << f << ")" << std::endl; + std::cerr << "ViewManager::seek(" << f << ")" << std::endl; #endif if (m_playSource && m_playSource->isPlaying()) { @@ -549,7 +549,7 @@ m_playbackFrame = f; m_playSource->play(f); #ifdef DEBUG_VIEW_MANAGER - std::cout << "ViewManager::considerSeek: reseeking from " << playFrame << " to " << f << std::endl; + std::cerr << "ViewManager::considerSeek: reseeking from " << playFrame << " to " << f << std::endl; #endif emit playbackFrameChanged(f); } @@ -578,7 +578,7 @@ } #ifdef DEBUG_VIEW_MANAGER - std::cout << "ViewManager::viewZoomLevelChanged(" << v << ", " << z << ", " << locked << ")" << std::endl; + std::cerr << "ViewManager::viewZoomLevelChanged(" << v << ", " << z << ", " << locked << ")" << std::endl; #endif emit viewZoomLevelChanged(v, z, locked);
--- a/widgets/AudioDial.cpp Thu Jun 20 13:47:36 2013 +0100 +++ b/widgets/AudioDial.cpp Fri Jul 12 13:25:22 2013 +0100 @@ -510,7 +510,7 @@ } else { - int newPosition = QInputDialog::getInteger + int newPosition = QInputDialog::getInt (this, tr("Enter new value"), tr("Enter a new value from %1 to %2:")
--- a/widgets/InteractiveFileFinder.cpp Thu Jun 20 13:47:36 2013 +0100 +++ b/widgets/InteractiveFileFinder.cpp Fri Jul 12 13:25:22 2013 +0100 @@ -130,7 +130,7 @@ // Use our own QFileDialog just for symmetry with getSaveFileName below QFileDialog dialog; - dialog.setFilters(filter.split('\n')); + dialog.setNameFilters(filter.split('\n')); dialog.setWindowTitle(title); dialog.setDirectory(lastPath); @@ -254,7 +254,7 @@ // need to adjust the file extension based on the selected filter QFileDialog dialog; - dialog.setFilters(filter.split('\n')); + dialog.setNameFilters(filter.split('\n')); dialog.setWindowTitle(title); dialog.setDirectory(lastPath); @@ -289,7 +289,7 @@ if ((type == LayerFile || type == LayerFileNoMidi) && fi.suffix() == "") { QString expectedExtension; - QString selectedFilter = dialog.selectedFilter(); + QString selectedFilter = dialog.selectedNameFilter(); if (selectedFilter.contains(".svl")) { expectedExtension = "svl"; } else if (selectedFilter.contains(".txt")) {
--- a/widgets/KeyReference.cpp Thu Jun 20 13:47:36 2013 +0100 +++ b/widgets/KeyReference.cpp Fri Jul 12 13:25:22 2013 +0100 @@ -49,7 +49,7 @@ QString name = action->text(); if (overrideName != "") name = overrideName; - QString shortcut = action->shortcut(); + QString shortcut = action->shortcut().toString(); QString tip = action->statusTip(); registerShortcut(name, shortcut, tip);
--- a/widgets/LayerTree.cpp Thu Jun 20 13:47:36 2013 +0100 +++ b/widgets/LayerTree.cpp Fri Jul 12 13:25:22 2013 +0100 @@ -238,7 +238,7 @@ { if (!parent.isValid()) { if (row >= m_models.size()) return QModelIndex(); - return createIndex(row, column, 0); + return createIndex(row, column, (void *)0); } return QModelIndex();
--- a/widgets/LayerTreeDialog.cpp Thu Jun 20 13:47:36 2013 +0100 +++ b/widgets/LayerTreeDialog.cpp Fri Jul 12 13:25:22 2013 +0100 @@ -51,7 +51,11 @@ subgrid->addWidget(m_modelView); m_modelView->verticalHeader()->hide(); +#if (QT_VERSION >= 0x050000) + m_modelView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); +#else m_modelView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); +#endif m_modelView->setShowGrid(false); m_modelModel = new ModelMetadataModel(m_paneStack, true); @@ -69,7 +73,11 @@ subgrid->setMargin(5); m_layerView = new QTreeView; +#if (QT_VERSION >= 0x050000) + m_layerView->header()->setSectionResizeMode(QHeaderView::ResizeToContents); +#else m_layerView->header()->setResizeMode(QHeaderView::ResizeToContents); +#endif subgrid->addWidget(m_layerView); m_layerModel = new LayerTreeModel(m_paneStack);
--- a/widgets/ListInputDialog.cpp Thu Jun 20 13:47:36 2013 +0100 +++ b/widgets/ListInputDialog.cpp Fri Jul 12 13:25:22 2013 +0100 @@ -25,8 +25,8 @@ ListInputDialog::ListInputDialog(QWidget *parent, const QString &title, const QString &labelText, const QStringList &list, - int current, Qt::WFlags f) : - QDialog(parent, f), + int current) : + QDialog(parent), m_strings(list) { setWindowTitle(title); @@ -89,9 +89,9 @@ QString ListInputDialog::getItem(QWidget *parent, const QString &title, const QString &label, const QStringList &list, - int current, bool *ok, Qt::WFlags f) + int current, bool *ok) { - ListInputDialog dialog(parent, title, label, list, current, f); + ListInputDialog dialog(parent, title, label, list, current); bool accepted = (dialog.exec() == QDialog::Accepted); if (ok) *ok = accepted;
--- a/widgets/ListInputDialog.h Thu Jun 20 13:47:36 2013 +0100 +++ b/widgets/ListInputDialog.h Fri Jul 12 13:25:22 2013 +0100 @@ -37,7 +37,7 @@ public: ListInputDialog(QWidget *parent, const QString &title, const QString &label, const QStringList &list, - int current = 0, Qt::WFlags f = 0); + int current = 0); virtual ~ListInputDialog(); void setItemAvailability(int item, bool available); @@ -47,7 +47,7 @@ static QString getItem(QWidget *parent, const QString &title, const QString &label, const QStringList &list, - int current = 0, bool *ok = 0, Qt::WFlags f = 0); + int current = 0, bool *ok = 0); protected: QStringList m_strings;
--- a/widgets/Thumbwheel.cpp Thu Jun 20 13:47:36 2013 +0100 +++ b/widgets/Thumbwheel.cpp Fri Jul 12 13:25:22 2013 +0100 @@ -373,7 +373,7 @@ } else { - int newValue = QInputDialog::getInteger + int newValue = QInputDialog::getInt (this, tr("Enter new value"), tr("Enter a new value from %1 to %2:")
--- a/widgets/TipDialog.cpp Thu Jun 20 13:47:36 2013 +0100 +++ b/widgets/TipDialog.cpp Fri Jul 12 13:25:22 2013 +0100 @@ -28,8 +28,8 @@ #include <iostream> -TipDialog::TipDialog(QWidget *parent, Qt::WFlags flags) : - QDialog(parent, flags), +TipDialog::TipDialog(QWidget *parent) : + QDialog(parent), m_tipNumber(0), m_label(0), m_caption(tr("Tip of the Day"))
--- a/widgets/TipDialog.h Thu Jun 20 13:47:36 2013 +0100 +++ b/widgets/TipDialog.h Fri Jul 12 13:25:22 2013 +0100 @@ -32,7 +32,7 @@ Q_OBJECT public: - TipDialog(QWidget *parent = 0, Qt::WFlags flags = 0); + TipDialog(QWidget *parent = 0); virtual ~TipDialog(); bool isOK() { return !m_tips.empty(); }