Skip to content

Instantly share code, notes, and snippets.

@eyalgo
Created July 8, 2017 08:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eyalgo/70a7e8affbbc27aeb4e0a5c23fc645c5 to your computer and use it in GitHub Desktop.
Save eyalgo/70a7e8affbbc27aeb4e0a5c23fc645c5 to your computer and use it in GitHub Desktop.
NI Traktor Kontrol S5 - Add Minutes Markerts to Stripe
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