Skip to content

Commit

Permalink
feat: add scrolling waveform in QML using scenegraph
Browse files Browse the repository at this point in the history
  • Loading branch information
acolombier committed Nov 23, 2024
1 parent 7582045 commit 317256a
Show file tree
Hide file tree
Showing 36 changed files with 1,869 additions and 141 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ repos:
rev: v0.13.0
hooks:
- id: markdownlint-cli2
language_version: lts
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.1
hooks:
Expand Down
35 changes: 34 additions & 1 deletion 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 Down Expand Up @@ -1770,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 @@ -2766,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 @@ -2788,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 @@ -3480,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 @@ -3812,8 +3832,21 @@ 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)
Expand Down
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
}
}
Loading

0 comments on commit 317256a

Please sign in to comment.