Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrolling waveform using SceneGraph in QML #13470

Draft
wants to merge 70 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
280fcf7
using rendergraph for allshader waveforms, with rendergraph::Geometry…
Aug 23, 2024
d3a69bb
waveformrenderbeat with rendergraph, various fixes, use same shaders …
Aug 27, 2024
c2fffea
preroll/postroll using rendergraph
Aug 30, 2024
4ad583c
node iterator, fixed examples
Aug 30, 2024
1dc16a5
fix teardown order
Aug 30, 2024
8014163
mark range with dynamic nodes
Aug 31, 2024
9a01213
make linked list handling part of rendergraph::Node
Aug 31, 2024
9eb2938
towards digits renderer as node
Aug 31, 2024
1e4d04b
draw playpos with rendergraph
Aug 31, 2024
058f5ec
reuse materialshaders
Aug 31, 2024
8032b38
keep track of material that modified the shader uniforms, fix scenegraph
Aug 31, 2024
3dcf907
digitsrenderer with rendergraph
Aug 31, 2024
507a465
draw marks with rendergraph
Aug 31, 2024
a0df59e
removed pimpl from rendergraph opengl
Sep 1, 2024
18fa2c4
removed pimpl from rendergraph scenegraph
Sep 18, 2024
1967817
cleanup and moved common rendergraph files to common/rendergraph
Sep 18, 2024
88013d4
remove nodebase, use encapsulation for scenegraph Node
Sep 19, 2024
b8bcb19
reorganized the code, with a public common API that is derived from t…
Sep 19, 2024
319ffb0
Update src/rendergraph/common/rendergraph/material/patternmaterial.h
m0dB Sep 22, 2024
390dd0e
Update src/rendergraph/common/rendergraph/material/rgbamaterial.cpp
m0dB Sep 22, 2024
afdc0ed
Update res/shaders/rendergraph/unicolor.frag
m0dB Sep 22, 2024
dff3a31
Update src/rendergraph/opengl/backend/shadercache.h
m0dB Sep 22, 2024
c713d6a
Update src/rendergraph/common/rendergraph/attribute.h
m0dB Sep 22, 2024
6ebc9d5
removed accidental commit
Sep 22, 2024
2a4a7d1
removed backend:: namespace, minor changes based on reviews
Sep 22, 2024
c5444fc
added comment to explain return value of remove node functions
Sep 22, 2024
ec3f816
use a generic Material::compare
Sep 22, 2024
86e5f09
added some DEBUG_ASSERTs and some vector.reserve calls
Sep 22, 2024
bc32a9c
use string literal
Sep 22, 2024
eeae3ea
use qshader to load qsb files for opengl Qt >= 6.6
Sep 22, 2024
0a691ad
avoid adding entire src dir to include paths
Sep 22, 2024
9c607c1
updated READMEs
Sep 22, 2024
2f8e548
improved/added asserts
Sep 23, 2024
c6cdb34
moved opengl node as baseclass for waveform renderers to derived clas…
Sep 23, 2024
92cd753
fix typo
Sep 23, 2024
8e5128f
moved rendergraph::OpenGLNode to derived
Sep 23, 2024
07d1f6a
moved vertexupdaters
Sep 23, 2024
b24e9ba
ported waveformrendererrgb to rendergraph, hurray!
Sep 23, 2024
b817d6c
removed class Attribute and use BaseGeometry::Attribute to reduce del…
Sep 24, 2024
0e870dd
comment
Sep 24, 2024
941f0cc
put rendergraph_sg and rendergraph_gl in different namespaces
Sep 25, 2024
1f10725
remove generated file
Sep 27, 2024
ca5f780
also use rendergraph::Engine in scenegraph to initialize and resize n…
Sep 27, 2024
bf7ed15
wip
Oct 6, 2024
1e57aae
let matrix be handled by qt scenegraph or by the opengl engine, remov…
Oct 19, 2024
8011f61
remove treenode
Oct 20, 2024
6b2442d
add nodeinterface for unique_ptr ownership methods
Oct 20, 2024
1a38137
reduce delta with feat/qml-scrolling-waveform-with-sg-and-rendergraph
Oct 20, 2024
cf17f15
reduce delta with feat/qml-scrolling-waveform-with-sg-and-rendergraph
Oct 20, 2024
5220b39
reduced delta with feat/qml-scrolling-waveform-with-sg-and-rendergraph
Oct 20, 2024
b8f2268
some cleanup
Oct 20, 2024
3c76b1b
merge changes from acolombier, clear and set owned by parent flag, mo…
Nov 1, 2024
2de8ded
missing file
Nov 1, 2024
d12d463
typo
Nov 2, 2024
c2d6c44
various cleanup, acting on review
Nov 2, 2024
8b25d13
improved attributeset from niko
Nov 2, 2024
a57b823
cleanup and comments
Nov 2, 2024
c7a3c7a
use std::erase
Nov 2, 2024
f409455
reduce delta with qml-rendergraph-fixes
Nov 2, 2024
709f8ca
Move back local classes in the private namespace
acolombier Nov 23, 2024
42a53d1
Round texture coordinate to prevent glitch
acolombier Nov 23, 2024
51bf675
Merge pull request #10 from acolombier/rendergraph-reduce-delta
m0dB Nov 30, 2024
ebc1108
minor changes to fix compilation
Nov 30, 2024
b27ab9a
improve alignment of markers, avoid images that are half empty
Nov 30, 2024
368776d
draw rounded to pixel
Dec 1, 2024
6aae89b
fix: prevent use-after-free with a texture buffer deepcopy
acolombier Oct 21, 2024
72f0a0b
scrolling qml waveformdisplay working
Oct 22, 2024
a59fe88
feat: add scrolling waveform in QML using scenegraph
acolombier Oct 22, 2024
ad11a74
fixup! feat: add scrolling waveform in QML using scenegraph
acolombier Dec 1, 2024
d424088
fixup! feat: add scrolling waveform in QML using scenegraph
acolombier Dec 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 40 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1502,6 +1502,7 @@ else()
)
endif()
if(QOPENGL)
target_compile_definitions(mixxx-lib PRIVATE __RENDERGRAPH_IS_OPENGL)
target_sources(mixxx-lib PRIVATE
src/shaders/endoftrackshader.cpp
src/shaders/slipmodeshader.cpp
Expand All @@ -1514,7 +1515,6 @@ if(QOPENGL)
src/shaders/vinylqualityshader.cpp
src/util/opengltexture2d.cpp
src/waveform/renderers/allshader/digitsrenderer.cpp
src/waveform/renderers/allshader/matrixforwidgetgeometry.cpp
src/waveform/renderers/allshader/waveformrenderbackground.cpp
src/waveform/renderers/allshader/waveformrenderbeat.cpp
src/waveform/renderers/allshader/waveformrenderer.cpp
Expand Down Expand Up @@ -1771,7 +1771,7 @@ if(QT6)
# below that takes care of the correct object order in the resulting binary
# According to https://doc.qt.io/qt-6/qt-finalize-target.html it is importand for
# builds with Qt < 3.21
qt_add_executable(mixxx WIN32 src/main.cpp MANUAL_FINALIZATION)
qt_add_executable(mixxx WIN32 MACOSX_BUNDLE src/main.cpp MANUAL_FINALIZATION)
else()
find_package(Qt5 COMPONENTS Core) # For Qt Core cmake functions
# This is the first package form the environment, if this fails give hints how to install the environment
Expand Down Expand Up @@ -2767,9 +2767,11 @@ if(QML)
res/qml/Mixxx/Controls/WaveformOverviewHotcueMarker.qml
res/qml/Mixxx/Controls/WaveformOverviewMarker.qml
res/qml/Mixxx/Controls/WaveformOverview.qml
res/qml/Mixxx/Controls/WaveformDisplay.qml
)
target_link_libraries(mixxx-qml-lib PRIVATE mixxx-qml-mixxxcontrolsplugin)

target_compile_definitions(mixxx-qml-lib PRIVATE __RENDERGRAPH_IS_SCENEGRAPH)
target_sources(mixxx-qml-lib PRIVATE
src/qml/asyncimageprovider.cpp
src/qml/qmlapplication.cpp
Expand All @@ -2789,6 +2791,22 @@ if(QML)
src/qml/qmlvisibleeffectsmodel.cpp
src/qml/qmlchainpresetmodel.cpp
src/qml/qmlwaveformoverview.cpp
src/qml/qmlwaveformdisplay.cpp
src/qml/qmlwaveformrenderer.cpp
src/waveform/renderers/allshader/digitsrenderer.cpp
src/waveform/renderers/allshader/waveformrenderbeat.cpp
src/waveform/renderers/allshader/waveformrenderer.cpp
src/waveform/renderers/allshader/waveformrendererendoftrack.cpp
src/waveform/renderers/allshader/waveformrendererpreroll.cpp
src/waveform/renderers/allshader/waveformrendererrgb.cpp
src/waveform/renderers/allshader/waveformrenderersignalbase.cpp
src/waveform/renderers/allshader/waveformrendermark.cpp
src/waveform/renderers/allshader/waveformrendermarkrange.cpp
# FIXME depends on rendergraph/openglnode.h
# src/waveform/renderers/allshader/waveformrendererslipmode.cpp
# src/waveform/renderers/allshader/waveformrendererfiltered.cpp
# src/waveform/renderers/allshader/waveformrendererhsv.cpp
# src/waveform/renderers/allshader/waveformrenderersimple.cpp
# The following sources need to be in this target to get QML_ELEMENT properly interpreted
src/control/controlmodel.cpp
src/control/controlsortfiltermodel.cpp
Expand Down Expand Up @@ -3481,6 +3499,7 @@ if (STEM)
if(QML)
target_compile_definitions(mixxx-qml-lib PUBLIC __STEM__)
target_sources(mixxx-qml-lib PRIVATE
src/waveform/renderers/allshader/waveformrendererstem.cpp
src/qml/qmlstemsmodel.cpp
)
endif()
Expand Down Expand Up @@ -3810,6 +3829,25 @@ if(VINYLCONTROL)
target_link_libraries(mixxx-lib PRIVATE mixxx-xwax)
endif()

# rendergraph
add_subdirectory(src/rendergraph/opengl)
add_subdirectory(res/shaders/rendergraph)
target_compile_definitions(rendergraph_gl PUBLIC
$<$<CONFIG:Debug>:MIXXX_DEBUG_ASSERTIONS_ENABLED>
)
target_link_libraries(mixxx-lib PUBLIC rendergraph_gl)
target_compile_definitions(mixxx-lib PRIVATE rendergraph=rendergraph_gl)
target_compile_definitions(mixxx-lib PRIVATE allshader=allshader_gl)
if(QML)
add_subdirectory(src/rendergraph/scenegraph)
target_compile_definitions(rendergraph_sg PUBLIC
$<$<CONFIG:Debug>:MIXXX_DEBUG_ASSERTIONS_ENABLED>
)
target_link_libraries(mixxx-qml-lib PRIVATE rendergraph_sg)
target_compile_definitions(mixxx-qml-lib PRIVATE rendergraph=rendergraph_sg)
target_compile_definitions(mixxx-qml-lib PRIVATE allshader=allshader_sg)
endif()

# WavPack audio file support
find_package(wavpack)
default_option(WAVPACK "WavPack audio file support" "wavpack_FOUND")
Expand Down
4 changes: 4 additions & 0 deletions res/mixxx.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,9 @@
<file>shaders/passthrough.vert</file>
<file>shaders/rgbsignal.frag</file>
<file>shaders/stackedsignal.frag</file>
<file>shaders/rendergraph/endoftrack.frag.gl</file>
<file>shaders/rendergraph/endoftrack.vert.gl</file>
<file>shaders/rendergraph/texture.frag.gl</file>
<file>shaders/rendergraph/texture.vert.gl</file>
</qresource>
</RCC>
48 changes: 48 additions & 0 deletions res/qml/Deck.qml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,54 @@ Item {
activeColor: Theme.deckActiveColor
}

Row {
anchors.left: playButton.right
anchors.leftMargin: 10
anchors.bottom: playButton.bottom
anchors.topMargin: 5
spacing: -1

Skin.IntroOutroButton {
keyPrefix: "intro_start"
group: root.group

text: "Intro\nStart"

width: playButton.height * 2 - 1
height: playButton.height
}

Skin.IntroOutroButton {
keyPrefix: "intro_end"
group: root.group

text: "Intro\nEnd"

width: playButton.height * 2 - 1
height: playButton.height
}

Skin.IntroOutroButton {
keyPrefix: "outro_start"
group: root.group

text: "Outro\nStart"

width: playButton.height * 2 - 1
height: playButton.height
}

Skin.IntroOutroButton {
keyPrefix: "outro_end"
group: root.group

text: "Outro\nEnd"

width: playButton.height * 2 - 1
height: playButton.height
}
}

Row {
anchors.left: cueButton.right
anchors.top: parent.top
Expand Down
45 changes: 45 additions & 0 deletions res/qml/IntroOutroButton.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import "." as Skin
import Mixxx 1.0 as Mixxx
import QtQuick 2.12

import "Theme"

Skin.Button {
id: root

required property string keyPrefix
required property string group

activeColor: Theme.deckActiveColor
highlight: enabledControl.value

Mixxx.ControlProxy {
id: control

group: root.group
key: `${root.keyPrefix}_activate`
value: root.down
}

Mixxx.ControlProxy {
id: enabledControl

group: root.group
key: `${root.keyPrefix}_enabled`
}

Mixxx.ControlProxy {
id: cleanControl

group: root.group
key: `${root.keyPrefix}_clear`
value: mousearea.pressed && enabledControl.value
}

MouseArea {
id: mousearea

anchors.fill: parent
acceptedButtons: Qt.RightButton
}
}
7 changes: 7 additions & 0 deletions res/qml/Mixxx/Controls/WaveformDisplay.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Mixxx 1.0 as Mixxx

Mixxx.WaveformDisplay {
id: root

player: Mixxx.PlayerManager.getPlayer(root.group)
}
Loading