forked from mixxxdj/mixxx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QML: Add loop, intro and outro on scrolling waveform
- Loading branch information
1 parent
12fed41
commit 6b92221
Showing
7 changed files
with
321 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
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 { | ||
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 { | ||
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" | ||
} | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.