Skip to content

Commit

Permalink
restored the software renderering (non-opengl) waveforms, deprecated …
Browse files Browse the repository at this point in the history
…all qt(old qglwidget based), gl and glsl waveform widgets
  • Loading branch information
m0dB authored and m0dB committed May 22, 2024
1 parent 217dc86 commit e113136
Show file tree
Hide file tree
Showing 20 changed files with 39 additions and 137 deletions.
21 changes: 4 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1208,12 +1208,8 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/util/workerthreadscheduler.cpp
src/util/xml.cpp
src/waveform/guitick.cpp
src/waveform/renderers/deprecated/glslwaveformrenderersignal.cpp
src/waveform/renderers/deprecated/glvsynctestrenderer.cpp
src/waveform/renderers/deprecated/glwaveformrenderbackground.cpp
src/waveform/renderers/deprecated/glwaveformrendererfilteredsignal.cpp
src/waveform/renderers/deprecated/glwaveformrendererrgb.cpp
src/waveform/renderers/deprecated/glwaveformrenderersimplesignal.cpp
src/waveform/renderers/glwaveformrenderbackground.cpp
src/waveform/renderers/glvsynctestrenderer.cpp
src/waveform/renderers/waveformmark.cpp
src/waveform/renderers/waveformmarkrange.cpp
src/waveform/renderers/waveformmarkset.cpp
Expand All @@ -1240,16 +1236,12 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/waveform/waveformmarklabel.cpp
src/waveform/waveformwidgetfactory.cpp
src/waveform/widgets/emptywaveformwidget.cpp
src/waveform/widgets/deprecated/glrgbwaveformwidget.cpp
src/waveform/widgets/deprecated/glsimplewaveformwidget.cpp
src/waveform/widgets/deprecated/glslwaveformwidget.cpp
src/waveform/widgets/deprecated/glvsynctestwidget.cpp
src/waveform/widgets/deprecated/glwaveformwidget.cpp
src/waveform/widgets/deprecated/glwaveformwidgetabstract.cpp
src/waveform/widgets/hsvwaveformwidget.cpp
src/waveform/widgets/rgbwaveformwidget.cpp
src/waveform/widgets/softwarewaveformwidget.cpp
src/waveform/widgets/waveformwidgetabstract.cpp
src/waveform/widgets/glwaveformwidgetabstract.cpp
src/waveform/widgets/glvsynctestwidget.cpp
src/widget/controlwidgetconnection.cpp
src/widget/findonwebmenufactory.cpp
src/widget/findonwebmenuservices/findonwebmenudiscogs.cpp
Expand Down Expand Up @@ -1541,11 +1533,6 @@ else()
src/waveform/renderers/qtvsynctestrenderer.cpp
src/waveform/renderers/qtwaveformrendererfilteredsignal.cpp
src/waveform/renderers/qtwaveformrenderersimplesignal.cpp
src/waveform/widgets/qthsvwaveformwidget.cpp
src/waveform/widgets/qtrgbwaveformwidget.cpp
src/waveform/widgets/qtsimplewaveformwidget.cpp
src/waveform/widgets/qtvsynctestwidget.cpp
src/waveform/widgets/qtwaveformwidget.cpp
src/widget/wglwidgetqglwidget.cpp
)
endif()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "waveform/renderers/deprecated/glvsynctestrenderer.h"
#include "waveform/renderers/glvsynctestrenderer.h"
#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2)

#include "util/performancetimer.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "waveform/renderers/deprecated/glwaveformrenderbackground.h"
#include "waveform/renderers/glwaveformrenderbackground.h"

GLWaveformRenderBackground::GLWaveformRenderBackground(
WaveformWidgetRenderer* waveformWidgetRenderer)
Expand Down
90 changes: 12 additions & 78 deletions src/waveform/waveformwidgetfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,8 @@
#ifdef MIXXX_USE_QOPENGL
#include "waveform/renderers/allshader/waveformrenderersignalbase.h"
#include "waveform/widgets/allshader/waveformwidget.h"
#else
#include "waveform/widgets/qthsvwaveformwidget.h"
#include "waveform/widgets/qtrgbwaveformwidget.h"
#include "waveform/widgets/qtsimplewaveformwidget.h"
#include "waveform/widgets/qtvsynctestwidget.h"
#include "waveform/widgets/qtwaveformwidget.h"
#include "waveform/widgets/glvsynctestwidget.h"
#endif
#include "waveform/widgets/deprecated/glrgbwaveformwidget.h"
#include "waveform/widgets/deprecated/glsimplewaveformwidget.h"
#include "waveform/widgets/deprecated/glslwaveformwidget.h"
#include "waveform/widgets/deprecated/glvsynctestwidget.h"
#include "waveform/widgets/deprecated/glwaveformwidget.h"
#include "waveform/widgets/emptywaveformwidget.h"
#include "waveform/widgets/hsvwaveformwidget.h"
#include "waveform/widgets/rgbwaveformwidget.h"
Expand Down Expand Up @@ -935,72 +925,38 @@ void WaveformWidgetFactory::evaluateWidgets() {
addHandle(collectedHandles, type, waveformWidgetVars<EmptyWaveformWidget>());
break;
case WaveformWidgetType::Simple:
addHandle(collectedHandles, type, waveformWidgetVars<GLSimpleWaveformWidget>());
#ifdef MIXXX_USE_QOPENGL
addHandle(collectedHandles, type, allshader::WaveformWidget::vars());
supportedOptions[type] = allshader::WaveformWidget::supportedOptions(type);
#else
addHandle(collectedHandles, type, waveformWidgetVars<QtSimpleWaveformWidget>());
#endif
break;
case WaveformWidgetType::Filtered:
#ifndef __APPLE__
// Don't offer the simple renderers on macOS, they do not work with skins
// that load GL widgets (spinnies, waveforms) in singletons.
// Also excluded in enum WaveformWidgetType
// https://bugs.launchpad.net/bugs/1928772
addHandle(collectedHandles, type, waveformWidgetVars<SoftwareWaveformWidget>());
#endif
addHandle(collectedHandles, type, waveformWidgetVars<GLWaveformWidget>());
addHandle(collectedHandles, type, waveformWidgetVars<GLSLFilteredWaveformWidget>());
#ifdef MIXXX_USE_QOPENGL
addHandle(collectedHandles, type, allshader::WaveformWidget::vars());
supportedOptions[type] = allshader::WaveformWidget::supportedOptions(type);
#else
addHandle(collectedHandles, type, waveformWidgetVars<QtWaveformWidget>());
#endif
addHandle(collectedHandles, type, waveformWidgetVars<SoftwareWaveformWidget>());
break;
case WaveformWidgetType::VSyncTest:
#ifdef MIXXX_USE_QOPENGL
addHandle(collectedHandles, type, waveformWidgetVars<GLVSyncTestWidget>());
#ifndef MIXXX_USE_QOPENGL
addHandle(collectedHandles, type, waveformWidgetVars<QtVSyncTestWidget>());
#endif
break;
case WaveformWidgetType::RGB:
addHandle(collectedHandles, type, waveformWidgetVars<GLSLRGBWaveformWidget>());
addHandle(collectedHandles, type, waveformWidgetVars<GLSLRGBStackedWaveformWidget>());
addHandle(collectedHandles, type, waveformWidgetVars<GLRGBWaveformWidget>());
#ifndef __APPLE__
// Don't offer the simple renderers on macOS, they do not work with skins
// that load GL widgets (spinnies, waveforms) in singletons.
// Also excluded in enum WaveformWidgetType
// https://bugs.launchpad.net/bugs/1928772
addHandle(collectedHandles, type, waveformWidgetVars<RGBWaveformWidget>());
#endif
#ifdef MIXXX_USE_QOPENGL
addHandle(collectedHandles, type, allshader::WaveformWidget::vars());
supportedOptions[type] = allshader::WaveformWidget::supportedOptions(type);
#else
addHandle(collectedHandles, type, waveformWidgetVars<QtRGBWaveformWidget>());
#endif
addHandle(collectedHandles, type, waveformWidgetVars<RGBWaveformWidget>());
break;
case WaveformWidgetType::HSV:
#ifndef __APPLE__
// Don't offer the simple renderers on macOS, they do not work with skins
// that load GL widgets (spinnies, waveforms) in singletons.
// Also excluded in enum WaveformWidgetType
// https://bugs.launchpad.net/bugs/1928772
addHandle(collectedHandles, type, waveformWidgetVars<HSVWaveformWidget>());
#endif
#ifdef MIXXX_USE_QOPENGL
addHandle(collectedHandles, type, allshader::WaveformWidget::vars());
supportedOptions[type] = allshader::WaveformWidget::supportedOptions(type);
#else
addHandle(collectedHandles, type, waveformWidgetVars<QtHSVWaveformWidget>());
#endif
break;
case WaveformWidgetType::Stacked:
addHandle(collectedHandles, type, waveformWidgetVars<GLSLRGBStackedWaveformWidget>());
#ifdef MIXXX_USE_QOPENGL
addHandle(collectedHandles, type, allshader::WaveformWidget::vars());
supportedOptions[type] = allshader::WaveformWidget::supportedOptions(type);
Expand Down Expand Up @@ -1051,17 +1007,10 @@ WaveformWidgetAbstract* WaveformWidgetFactory::createFilteredWaveformWidget(
preferredBackend());

switch (backend) {
case WaveformWidgetBackend::GL:
return new GLWaveformWidget(viewer->getGroup(), viewer);
case WaveformWidgetBackend::GLSL:
return new GLSLFilteredWaveformWidget(viewer->getGroup(), viewer);
#ifdef MIXXX_USE_QOPENGL
case WaveformWidgetBackend::AllShader: {
return createAllshaderWaveformWidget(WaveformWidgetType::Type::Filtered, viewer);
}
#else
case WaveformWidgetBackend::Qt:
return new QtWaveformWidget(viewer->getGroup(), viewer);
#endif
default:
return new SoftwareWaveformWidget(viewer->getGroup(), viewer);
Expand Down Expand Up @@ -1099,16 +1048,9 @@ WaveformWidgetAbstract* WaveformWidgetFactory::createRGBWaveformWidget(WWaveform
preferredBackend());

switch (backend) {
case WaveformWidgetBackend::GL:
return new GLRGBWaveformWidget(viewer->getGroup(), viewer);
case WaveformWidgetBackend::GLSL:
return new GLSLRGBWaveformWidget(viewer->getGroup(), viewer);
#ifdef MIXXX_USE_QOPENGL
case WaveformWidgetBackend::AllShader:
return createAllshaderWaveformWidget(WaveformWidgetType::Type::RGB, viewer);
#else
case WaveformWidgetBackend::Qt:
return new QtRGBWaveformWidget(viewer->getGroup(), viewer);
#endif
default:
return new RGBWaveformWidget(viewer->getGroup(), viewer);
Expand All @@ -1127,14 +1069,12 @@ WaveformWidgetAbstract* WaveformWidgetFactory::createStackedWaveformWidget(
ConfigKey("[Waveform]", "use_hardware_acceleration"),
preferredBackend());
switch (backend) {
case WaveformWidgetBackend::GL:
return new GLSLRGBStackedWaveformWidget(viewer->getGroup(), viewer);
default:
case WaveformWidgetBackend::AllShader:
return createAllshaderWaveformWidget(WaveformWidgetType::Type::Stacked, viewer);
}
#else
return new GLSLRGBStackedWaveformWidget(viewer->getGroup(), viewer);
#endif
default:
return new EmptyWaveformWidget(viewer->getGroup(), viewer);
}
}

WaveformWidgetAbstract* WaveformWidgetFactory::createSimpleWaveformWidget(WWaveformViewer* viewer) {
Expand All @@ -1149,16 +1089,11 @@ WaveformWidgetAbstract* WaveformWidgetFactory::createSimpleWaveformWidget(WWavef

switch (backend) {
#ifdef MIXXX_USE_QOPENGL
case WaveformWidgetBackend::GL:
return new GLSimpleWaveformWidget(viewer->getGroup(), viewer);
default:
case WaveformWidgetBackend::AllShader:
return createAllshaderWaveformWidget(WaveformWidgetType::Type::Simple, viewer);
#else
case WaveformWidgetBackend::Qt:
return new QtSimpleWaveformWidget(viewer->getGroup(), viewer);
default:
return new GLSimpleWaveformWidget(viewer->getGroup(), viewer);
#endif
default:
return new EmptyWaveformWidget(viewer->getGroup(), viewer);
}
}

Expand All @@ -1167,7 +1102,7 @@ WaveformWidgetAbstract* WaveformWidgetFactory::createVSyncTestWaveformWidget(
#ifdef MIXXX_USE_QOPENGL
return new GLVSyncTestWidget(viewer->getGroup(), viewer);
#else
return new QtVSyncTest(viewer->getGroup(), viewer);
return new EmptyWaveformWidget(viewer->getGroup(), viewer);
#endif
}

Expand Down Expand Up @@ -1198,7 +1133,6 @@ WaveformWidgetAbstract* WaveformWidgetFactory::createWaveformWidget(
case WaveformWidgetType::Stacked:
widget = createStackedWaveformWidget(viewer);
break;
//case WaveformWidgetType::EmptyWaveform:
default:
widget = new EmptyWaveformWidget(viewer->getGroup(), viewer);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ void QtHSVWaveformWidget::paintEvent(QPaintEvent* event) {
mixxx::Duration QtHSVWaveformWidget::render() {
PerformanceTimer timer;
mixxx::Duration t1;
//mixxx::Duration t2, t3;
// mixxx::Duration t2, t3;
timer.start();
// QPainter makes QGLContext::currentContext() == context()
// this may delayed until previous buffer swap finished
QPainter painter(paintDevice());
t1 = timer.restart();
draw(&painter, nullptr);
//t2 = timer.restart();
//qDebug() << "QtHSVWaveformWidget "<< t1 << t2;
// t2 = timer.restart();
// qDebug() << "QtHSVWaveformWidget "<< t1 << t2;
return t1; // return timer for painter setup
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ void QtRGBWaveformWidget::paintEvent(QPaintEvent* event) {
mixxx::Duration QtRGBWaveformWidget::render() {
PerformanceTimer timer;
mixxx::Duration t1;
//mixxx::Duration t2, t3;
// mixxx::Duration t2, t3;
timer.start();
// QPainter makes QGLContext::currentContext() == context()
// this may delayed until previous buffer swap finished
QPainter painter(paintDevice());
t1 = timer.restart();
draw(&painter, nullptr);
//t2 = timer.restart();
//qDebug() << "GLVSyncTestWidget "<< t1 << t2;
// t2 = timer.restart();
// qDebug() << "GLVSyncTestWidget "<< t1 << t2;
return t1; // return timer for painter setup
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@ class QtRGBWaveformWidget : public GLWaveformWidgetAbstract {
virtual WaveformWidgetType::Type getType() const {
return WaveformWidgetType::RGB;
}

static inline QString getWaveformWidgetName() { return tr("RGB") + " - Qt"; }
static inline bool useOpenGl() { return true; }
static inline bool useOpenGles() { return true; }
static inline bool useOpenGLShaders() { return false; }
static inline bool useTextureForWaveform() {
return false;
}
static inline WaveformWidgetCategory category() {
return WaveformWidgetCategory::Legacy;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ void QtSimpleWaveformWidget::castToQWidget() {
}

void QtSimpleWaveformWidget::paintEvent(QPaintEvent* event) {
//qDebug() << "paintEvent()";
// qDebug() << "paintEvent()";
Q_UNUSED(event);
}

mixxx::Duration QtSimpleWaveformWidget::render() {
PerformanceTimer timer;
mixxx::Duration t1;
//mixxx::Duration t2;
// mixxx::Duration t2;
timer.start();
// QPainter makes QGLContext::currentContext() == context()
// this may delayed until previous buffer swap finished
QPainter painter(paintDevice());
t1 = timer.restart();
draw(&painter, nullptr);
//t2 = timer.restart();
//qDebug() << "QtSimpleWaveformWidget" << t1 << t2;
// t2 = timer.restart();
// qDebug() << "QtSimpleWaveformWidget" << t1 << t2;
return t1; // return timer for painter setup
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@ class QtSimpleWaveformWidget : public GLWaveformWidgetAbstract {
return WaveformWidgetType::Simple;
}

static inline QString getWaveformWidgetName() {
return tr("Simple") + "- Qt";
}
static inline bool useOpenGl() { return true; }
static inline bool useOpenGles() { return true; }
static inline bool useOpenGLShaders() { return false; }
static inline bool useTextureForWaveform() {
return false;
}
static inline WaveformWidgetCategory category() {
return WaveformWidgetCategory::Legacy;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ void QtVSyncTestWidget::paintEvent(QPaintEvent* event) {
mixxx::Duration QtVSyncTestWidget::render() {
PerformanceTimer timer;
mixxx::Duration t1;
//mixxx::Duration t2, t3;
// mixxx::Duration t2, t3;
timer.start();
// QPainter makes QGLContext::currentContext() == context()
// this may delayed until previous buffer swap finished
QPainter painter(paintDevice());
t1 = timer.restart();
draw(&painter, nullptr);
//t2 = timer.restart();
//qDebug() << "GLVSyncTestWidget "<< t1 << t2;
// t2 = timer.restart();
// qDebug() << "GLVSyncTestWidget "<< t1 << t2;
return t1; // return timer for painter setup
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@ class QtVSyncTestWidget : public GLWaveformWidgetAbstract {
return WaveformWidgetType::VSyncTest;
}

static inline QString getWaveformWidgetName() { return tr("VSyncTest") + " - Qt"; }
static inline bool useOpenGl() { return true; }
static inline bool useOpenGles() { return true; }
static inline bool useOpenGLShaders() { return false; }
static inline bool useTextureForWaveform() {
return false;
}
static inline WaveformWidgetCategory category() {
return WaveformWidgetCategory::DeveloperOnly;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ void QtWaveformWidget::paintEvent(QPaintEvent* event) {
mixxx::Duration QtWaveformWidget::render() {
PerformanceTimer timer;
mixxx::Duration t1;
//mixxx::Duration t2;
// mixxx::Duration t2;
timer.start();
// QPainter makes QGLContext::currentContext() == context()
// this may delayed until previous buffer swap finished
QPainter painter(paintDevice());
t1 = timer.restart();
draw(&painter, nullptr);
//t2 = timer.restart();
//qDebug() << "GLVSyncTestWidget "<< t1 << t2;
// t2 = timer.restart();
// qDebug() << "GLVSyncTestWidget "<< t1 << t2;
return t1; // return timer for painter setup
}
Loading

0 comments on commit e113136

Please sign in to comment.