]> git.tdb.fi Git - xinema.git/blob - remote/qml/pages/PlaybackPage.qml
4a487a4f8cd9b80add977b1ad9b3e52931ef7fce
[xinema.git] / remote / qml / pages / PlaybackPage.qml
1 import QtQuick 2.0
2 import Sailfish.Silica 1.0
3 import fi.mikkosoft.xinema 0.1
4
5 Page
6 {
7         id: page
8
9         Column
10         {
11                 width: parent.width
12                 spacing: Theme.paddingLarge
13
14                 PageHeader
15                 {
16                         title: qsTr("Playback")
17                 }
18
19                 Label
20                 {
21                         text: streamControl.title
22                 }
23
24                 Slider
25                 {
26                         id: slider
27                         width: parent.width
28                         minimumValue: 0.0
29                         maximumValue: Math.max(streamControl.duration, 1.0)
30                         valueText:
31                         {
32                                 var secs = Math.round(value);
33                                 var mins = Math.floor(secs/60);
34                                 secs %= 60;
35                                 var hours = Math.floor(mins/60);
36                                 mins %= 60;
37
38                                 var str = "";
39                                 if(hours>0)
40                                 {
41                                         str = hours+":";
42                                         if(mins<10)
43                                                 str += "0";
44                                 }
45
46                                 str += mins+":";
47                                 if(secs<10)
48                                         str += "0";
49
50                                 return str+secs;
51                         }
52                 }
53         }
54
55         StreamControl
56         {
57                 id: streamControl
58                 control: xinemaControl
59                 onPositionChanged:
60                 {
61                         if(!slider.down)
62                                 slider.value = streamControl.position
63                 }
64         }
65 }