Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3967 from Holzhaus/qml-scrolling-waveforms
QML: Add scrolling waveforms
- Loading branch information
Showing
21 changed files
with
1,484 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import Mixxx 1.0 as Mixxx | ||
import QtQuick 2.15 | ||
import QtQuick.Shapes 1.4 | ||
import QtQuick.Window 2.15 | ||
|
||
import QtQuick.Controls 2.15 | ||
|
||
import "Theme" | ||
|
||
Item { | ||
id: root | ||
|
||
property color color: Theme.waveformMarkerDefault | ||
|
||
property real markerHeight: root.height | ||
property color labelColor: Theme.waveformMarkerLabel | ||
property real radiusSize: 4 | ||
property string cueLabel: qsTr("CUE") | ||
|
||
FontMetrics { | ||
id: fontMetrics | ||
font.family: Theme.fontFamily | ||
} | ||
|
||
property rect contentRect: fontMetrics.tightBoundingRect(cueLabel) | ||
|
||
Shape { | ||
ShapePath { | ||
strokeWidth: 0 | ||
strokeColor: 'transparent' | ||
fillColor: color | ||
strokeStyle: ShapePath.SolidLine | ||
startX: -1; startY: 0 | ||
|
||
PathLine { x: 8; y: 0 } | ||
PathLine { x: 8 - radiusSize + contentRect.width; y: 0 } | ||
PathArc { | ||
x: 8 + contentRect.width | ||
y: radiusSize | ||
radiusX: radiusSize; radiusY: radiusSize | ||
direction: PathArc.Clockwise | ||
} | ||
PathLine { x: 8 + contentRect.width; y: 16 - radiusSize } | ||
PathArc { | ||
x: 8 - radiusSize + contentRect.width | ||
y: 16 | ||
radiusX: radiusSize; radiusY: radiusSize | ||
direction: PathArc.Clockwise | ||
} | ||
PathLine { x: 8; y: 16 } | ||
PathLine { x: 2; y: 16 } | ||
PathLine { x: 2; y: markerHeight } | ||
PathLine { x: -1; y: markerHeight } | ||
PathLine { x: -1; y: 0 } | ||
} | ||
} | ||
Shape { | ||
ShapePath { | ||
fillColor: labelColor | ||
strokeColor: labelColor | ||
PathText { | ||
x: 3 | ||
y: 3 | ||
font.family: Theme.fontFamily | ||
font.pixelSize: 13 | ||
font.weight: Font.Bold | ||
text: cueLabel | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import "." as Skin | ||
import Mixxx 1.0 as Mixxx | ||
import QtQuick 2.15 | ||
import QtQuick.Shapes 1.4 | ||
import QtQuick.Window 2.15 | ||
|
||
import QtQuick.Controls 2.15 | ||
|
||
import "Theme" | ||
|
||
Item { | ||
id: root | ||
|
||
required property int hotcueNumber | ||
required property string group | ||
required property string label | ||
property bool isLoop: false | ||
|
||
Skin.Hotcue { | ||
id: hotcue | ||
|
||
group: root.group | ||
hotcueNumber: root.hotcueNumber | ||
} | ||
|
||
property real markerHeight: root.height | ||
property color labelColor: Theme.waveformMarkerLabel | ||
property real radiusSize: 4 | ||
property string hotcueLabel: label != "" ? `${hotcueNumber}: ${label}` : `${hotcueNumber}` | ||
|
||
FontMetrics { | ||
id: fontMetrics | ||
font.family: Theme.fontFamily | ||
} | ||
|
||
property rect contentRect: fontMetrics.tightBoundingRect(hotcueLabel) | ||
|
||
Rectangle { | ||
visible: root.isLoop | ||
anchors.fill: parent | ||
color: Qt.alpha(hotcue.color, 0.3) | ||
} | ||
|
||
Shape { | ||
ShapePath { | ||
strokeWidth: 0 | ||
strokeColor: 'transparent' | ||
fillColor: hotcue.color | ||
strokeStyle: ShapePath.SolidLine | ||
startX: -1; startY: 0 | ||
|
||
PathLine { x: 1; y: 0 } | ||
PathLine { x: 1; y: markerHeight - 16 } | ||
PathLine { x: 8 - radiusSize + contentRect.width; y: markerHeight - 16 } | ||
PathArc { | ||
x: 8 + contentRect.width | ||
y: markerHeight - 16 + radiusSize | ||
radiusX: radiusSize; radiusY: radiusSize | ||
direction: PathArc.Clockwise | ||
} | ||
PathLine { x: 8 + contentRect.width; y: markerHeight - radiusSize } | ||
PathArc { | ||
x: 8 - radiusSize + contentRect.width | ||
y: markerHeight | ||
radiusX: radiusSize; radiusY: radiusSize | ||
direction: PathArc.Clockwise | ||
} | ||
PathLine { x: -1; y: markerHeight } | ||
PathLine { x: -1; y: 0 } | ||
} | ||
} | ||
Shape { | ||
visible: root.isLoop | ||
ShapePath { | ||
strokeWidth: 0 | ||
strokeColor: 'transparent' | ||
fillColor: hotcue.color | ||
strokeStyle: ShapePath.SolidLine | ||
startX: root.width - 1; startY: 0 | ||
|
||
PathLine { x: root.width - 1; y: markerHeight } | ||
PathLine { x: root.width + 1; y: markerHeight } | ||
PathLine { x: root.width + 1; y: 0 } | ||
} | ||
} | ||
Shape { | ||
ShapePath { | ||
fillColor: labelColor | ||
strokeColor: labelColor | ||
PathText { | ||
x: 3 | ||
y: markerHeight - 13 | ||
font.family: Theme.fontFamily | ||
font.pixelSize: 13 | ||
font.weight: Font.Medium | ||
text: hotcueLabel | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import Mixxx 1.0 as Mixxx | ||
import QtQuick 2.15 | ||
import QtQuick.Shapes 1.4 | ||
import QtQuick.Window 2.15 | ||
|
||
import QtQuick.Controls 2.15 | ||
|
||
import "Theme" | ||
|
||
Item { | ||
id: root | ||
|
||
property color mainColor: Theme.waveformMarkerIntroOutroColor | ||
property bool isIntro: true | ||
|
||
property real markerHeight: root.height | ||
property real radiusSize: 4 | ||
|
||
Rectangle { | ||
anchors.fill: parent | ||
color: Qt.alpha(root.mainColor, 0.1) | ||
} | ||
|
||
Shape { | ||
ShapePath { | ||
strokeWidth: 0 | ||
strokeColor: 'transparent' | ||
fillColor: root.mainColor | ||
strokeStyle: ShapePath.SolidLine | ||
startX: -1; startY: 0 | ||
|
||
PathLine { x: 16 - radiusSize; y: 0 } | ||
PathArc { | ||
x: 16 | ||
y: radiusSize | ||
radiusX: radiusSize; radiusY: radiusSize | ||
direction: PathArc.Clockwise | ||
} | ||
PathLine { x: 16; y: 16 - radiusSize } | ||
PathArc { | ||
x: 16 - radiusSize | ||
y: 16 | ||
radiusX: radiusSize; radiusY: radiusSize | ||
direction: PathArc.Clockwise | ||
} | ||
PathLine { x: 1; y: 16 } | ||
PathLine { x: 1; y: markerHeight } | ||
PathLine { x: -1; y: markerHeight } | ||
} | ||
} | ||
Shape { | ||
visible: root.width != 0 | ||
ShapePath { | ||
strokeWidth: 0 | ||
strokeColor: 'transparent' | ||
fillColor: root.mainColor | ||
strokeStyle: ShapePath.SolidLine | ||
startX: root.width - 1; startY: 0 | ||
|
||
PathLine { x: root.width - 16 + radiusSize; y: 0 } | ||
PathArc { | ||
x: root.width - 16 | ||
y: radiusSize | ||
radiusX: radiusSize; radiusY: radiusSize | ||
direction: PathArc.Counterclockwise | ||
} | ||
PathLine { x: root.width - 16; y: 16 - radiusSize } | ||
PathArc { | ||
x: root.width - 16 + radiusSize | ||
y: 16 | ||
radiusX: radiusSize; radiusY: radiusSize | ||
direction: PathArc.Counterclockwise | ||
} | ||
PathLine { x: root.width -1; y: 16 } | ||
PathLine { x: root.width -1; y: markerHeight } | ||
PathLine { x: root.width + 1; y: markerHeight } | ||
PathLine { x: root.width + 1; y: 0 } | ||
} | ||
} | ||
Image { | ||
x: 2 | ||
y: 2 | ||
width: 12 | ||
height: 12 | ||
source: `images/mark_${(root.isIntro ? 'intro' : 'outro')}.svg` | ||
} | ||
Image { | ||
visible: root.width != 0 | ||
x: root.width - 14 | ||
y: 2 | ||
width: 12 | ||
height: 12 | ||
source: `images/mark_${(root.isIntro ? 'intro' : 'outro')}.svg` | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import Mixxx 1.0 as Mixxx | ||
import QtQuick 2.15 | ||
import QtQuick.Shapes 1.4 | ||
import QtQuick.Window 2.15 | ||
|
||
import QtQuick.Controls 2.15 | ||
|
||
import "Theme" | ||
|
||
Item { | ||
id: root | ||
|
||
property color mainColor: Theme.waveformMarkerLoopColor | ||
property color disabledColor: Theme.waveformMarkerLoopColorDisabled | ||
property real enabledOpacity: 0.8 | ||
property real disabledOpacity: 0.5 | ||
|
||
property real markerHeight: root.height | ||
property real radiusSize: 4 | ||
property bool enabled: true | ||
|
||
Rectangle { | ||
anchors.fill: parent | ||
color: Qt.alpha(root.enabled ? root.mainColor : root.disabledColor, root.enabled ? root.enabledOpacity : root.disabledOpacity) | ||
} | ||
|
||
Shape { | ||
ShapePath { | ||
strokeWidth: 0 | ||
strokeColor: 'transparent' | ||
fillColor: root.mainColor | ||
strokeStyle: ShapePath.SolidLine | ||
startX: -1; startY: 0 | ||
|
||
PathLine { x: -16 + radiusSize; y: 0 } | ||
PathArc { | ||
x: -16 | ||
y: radiusSize | ||
radiusX: radiusSize; radiusY: radiusSize | ||
direction: PathArc.Counterclockwise | ||
} | ||
PathLine { x: -16; y: 16 - radiusSize } | ||
PathArc { | ||
x: -16 + radiusSize | ||
y: 16 | ||
radiusX: radiusSize; radiusY: radiusSize | ||
direction: PathArc.Counterclockwise | ||
} | ||
PathLine { x: -1; y: 16 } | ||
PathLine { x: -1; y: markerHeight } | ||
PathLine { x: 1; y: markerHeight } | ||
PathLine { x: 1; y: 0 } | ||
} | ||
} | ||
Shape { | ||
|
||
ShapePath { | ||
strokeWidth: 0 | ||
strokeColor: 'transparent' | ||
fillColor: root.mainColor | ||
strokeStyle: ShapePath.SolidLine | ||
startX: root.width - 1; startY: 0 | ||
|
||
PathLine { x: root.width - 1; y: markerHeight } | ||
PathLine { x: root.width + 1; y: markerHeight } | ||
PathLine { x: root.width + 1; y: 0 } | ||
} | ||
} | ||
Image { | ||
x: -14 | ||
y: 2 | ||
width: 12 | ||
height: 12 | ||
source: "images/mark_loop.svg" | ||
} | ||
} |
Oops, something went wrong.