Created
July 8, 2017 08:28
-
-
Save eyalgo/70a7e8affbbc27aeb4e0a5c23fc645c5 to your computer and use it in GitHub Desktop.
NI Traktor Kontrol S5 - Add Minutes Markerts to Stripe
This file contains hidden or 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
29c29,30 | |
< | |
--- | |
> AppProperty { id: trackBPM; path: "app.traktor.decks." + (deckId+1) + ".tempo.base_bpm" } | |
> | |
184a186,213 | |
> Repeater { | |
> readonly property int minutes: numberOfMinutes(trackLength.value) | |
> readonly property real minuteDelta: (stripe.width * 60.0) / trackLength.value | |
> | |
> id: minutesMarker | |
> model: minutes | |
> Rectangle { | |
> property real roundedX: minutesMarker.minuteDelta * (index+1) | |
> | |
> x: roundedX | |
> anchors.bottom: parent.bottom | |
> height: 28 | |
> width: 1 | |
> radius: 1 | |
> color: colors.colorWhite75 | |
> antialiasing: false | |
> } | |
> } | |
> | |
> function numberOfMinutes(inSeconds) | |
> { | |
> var neg = (inSeconds < 0); | |
> var roundedSec = Math.floor(inSeconds); | |
> | |
> if (neg) | |
> { | |
> roundedSec = -roundedSec; | |
> } | |
185a215,219 | |
> var sec = roundedSec % 60; | |
> var min = (roundedSec - sec) / 60; | |
> | |
> return min; | |
> } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment