summaryrefstree
path: root/usr/bin/qml/ipod/IPod_ProgressAndTime.qml
blob: 422fbf75278d39c483097dd78333dd29a75d8301 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import QtQuick 2.0
import Label 2.0
import "../com/neusoft/auto/widgets"
import "../windowsList.js" as WindowsList
import "ipod_define.js" as StatusList
import "../layoutList.js" as Layout
Rectangle
{
    id:ipodProgressAndTime

    height: -27//20

    property int ipod_playpausestatus: ipodCtrl.ipod_playstatus
    property int bar_width
    property int enterValue_test
    property string ipod_ptime:ipodCtrl.ipod_ptime
    property double ipod_playbarscale: ipodCtrl.ipod_playbarscale
    property string ipod_totaltime:ipodCtrl.ipod_totaltime
    property int isDrafting:0

    HMIProcessBarDrag
    {
        id:main_processbar
        x: 0//-6
        y: 0//8
        dragflag:true
        barBackgroundMiddlewidth:bar_width
        enterValue: enterValue_test
        onDragingStart:
        {
            ipodProgressAndTime.isDrafting = 1
        }
        onDragingEnd:
        {
            ipodProgressAndTime.isDrafting = 0
            //            if(ipod_playpausestatus === StatusList.IPOD_PAUSE)
            //            {
            //                ipodCtrl.ipod_playPauseClick();
            //            }
            ipodCtrl.ipod_setSeektoPosition(barScale)

        }
        onBarClicked:
        {
            //            if(ipod_playpausestatus === StatusList.IPOD_PAUSE)
            //            {
            //                ipodCtrl.ipod_playPauseClick();
            //            }
            ipodCtrl.ipod_setSeektoPosition(barScale)
        }
    }
    HMILabel
    {
        id: playtime
        x: 0-3
        y: 0
        width: 76
        height: 20
        anchors.verticalCenter:parent.verticalCenter
        text:ipod_ptime==""?"00:00:00":ipod_ptime
        font.pixelSize: 14//18
        horizontalAlignment: Label.AlignLeft
    }
    HMILabel
    {
        id:totaltime
        x: bar_width-75+12
        y: 0
        width: 76
        height: 20
        anchors.verticalCenter:parent.verticalCenter
        text:ipod_totaltime==""?"00:00:00":ipod_totaltime
        font.pixelSize: 14//18
        horizontalAlignment: Label.AlignLeft
    }
    Connections
    {
        target:ipodCtrl
        onIpod_ptimechange:
        {
            ipod_ptime = ipodCtrl.ipod_ptime
            ipod_totaltime=ipodCtrl.ipod_totaltime
            if(0 == ipodProgressAndTime.isDrafting)
            {
                ipod_playbarscale=ipodCtrl.ipod_playbarscale
                main_processbar.enterValue = ipod_playbarscale * main_processbar.totalValue
            }
        }
        onIpod_totaltimechange:
        {
            ipod_totaltime = ipodCtrl.ipod_totaltime
        }
    }
}