eyalgo
7/8/2017 - 8:28 AM

NI Traktor Kontrol S5 - Add Minutes Markerts to Stripe

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;
>   }