kdenliveclipmonitor.qml 5.48 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.3
import QtQuick 2.0
import AudioThumb 1.0

Item {
    id: root
    objectName: "root"

    // default size, but scalable by user
    height: 300; width: 400
12
    property string markerText
13 14
    property string timecode
    property point profile
15
    property double zoom
16 17
    property double scalex
    property double scaley
18 19
    property bool dropped
    property string fps
20 21
    property bool showMarkers
    property bool showTimecode
22
    property bool showFps
23 24
    property bool showSafezone
    property bool showAudiothumb
25
    property bool showToolbar: false
26
    property int displayFontSize
27 28 29
    onZoomChanged: {
        sceneToolBar.setZoom(root.zoom)
    }
30
    signal editCurrentMarker()
31 32
    signal toolBarChanged(bool doAccept)

33 34 35 36 37 38 39 40 41 42
    SceneToolBar {
        id: sceneToolBar
        anchors {
            left: parent.left
            top: parent.top
            topMargin: 10
            leftMargin: 10
        }
        visible: root.showToolbar
    }
43

44 45 46
    Item {
        id: frame
        objectName: "referenceframe"
47 48
        width: root.profile.x * root.scalex
        height: root.profile.y * root.scaley
49 50
        anchors.centerIn: parent
        visible: root.showSafezone
51
        property color overlayColor: 'cyan'
52 53 54 55
        Rectangle {
            id: safezone
            objectName: "safezone"
            color: "transparent"
56
            border.color: frame.overlayColor
57 58 59 60 61 62 63
            width: parent.width * 0.9
            height: parent.height * 0.9
            anchors.centerIn: parent
            Rectangle {
              id: safetext
              objectName: "safetext"
              color: "transparent"
64
              border.color: frame.overlayColor
65 66 67 68
              width: frame.width * 0.8
              height: frame.height * 0.8
              anchors.centerIn: parent
            }
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 95 96 97 98 99 100 101 102 103 104 105 106 107 108
            Rectangle {
                color: frame.overlayColor
                width: frame.width / 20
                height: 1
                anchors.centerIn: parent
            }
            Rectangle {
                color: frame.overlayColor
                height: frame.width / 20
                width: 1
                anchors.centerIn: parent
            }
            Rectangle {
                color: frame.overlayColor
                height: frame.height / 11
                width: 1
                y: 0
                x: parent.width / 2
            }
            Rectangle {
                color: frame.overlayColor
                height: frame.height / 11
                width: 1
                y: parent.height -height
                x: parent.width / 2
            }
            Rectangle {
                color: frame.overlayColor
                width: frame.width / 11
                height: 1
                y: parent.height / 2
                x: 0
            }
            Rectangle {
                color: frame.overlayColor
                width: frame.width / 11
                height: 1
                y: parent.height / 2
                x: parent.width -width
            }
109 110 111
        }
    }

112 113 114 115 116 117 118 119 120 121 122
    QmlAudioThumb {
        id: audioThumb
        objectName: "audiothumb"
        property bool stateVisible: true
        anchors {
            left: parent.left
            bottom: parent.bottom
        }
        height: parent.height / 6
        //font.pixelSize * 3
        width: parent.width
123
        visible: root.showAudiothumb
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143

        states: [
            State { when: audioThumb.stateVisible;
                    PropertyChanges {   target: audioThumb; opacity: 1.0    } },
            State { when: !audioThumb.stateVisible;
                    PropertyChanges {   target: audioThumb; opacity: 0.0    } }
        ]
        transitions: [ Transition {
            NumberAnimation { property: "opacity"; duration: 500}
        } ]

        MouseArea {
            hoverEnabled: true
            onExited: audioThumb.stateVisible = false
            onEntered: audioThumb.stateVisible = true
            acceptedButtons: Qt.NoButton
            anchors.fill: parent
        }
    }

144 145 146 147 148 149 150
    Text {
        id: timecode
        objectName: "timecode"
        color: "white"
        style: Text.Outline; 
        styleColor: "black"
        text: root.timecode
151
        font.pixelSize: root.displayFontSize
152 153 154 155 156 157 158
        visible: root.showTimecode
        anchors {
            right: root.right
            bottom: root.bottom
            rightMargin: 4
        }
    }
159 160 161 162 163 164 165
    Text {
        id: fpsdropped
        objectName: "fpsdropped"
        color: root.dropped ? "red" : "white"
        style: Text.Outline;
        styleColor: "black"
        text: root.fps + "fps"
166
        visible: root.showFps
167 168
        font.pixelSize: root.displayFontSize
        anchors {
169
            right: timecode.visible ? timecode.left : root.right
170 171 172 173
            bottom: root.bottom
            rightMargin: 10
        }
    }
174 175 176 177 178
    TextField {
        id: marker
        objectName: "markertext"
        activeFocusOnPress: true
        onEditingFinished: {
179
            root.markerText = marker.displayText
180 181
            marker.focus = false
            root.editCurrentMarker()
182
        }
183

184 185
        anchors {
            left: parent.left
186
            bottom: parent.bottom
187 188
        }
        visible: root.showMarkers && text != ""
189
        text: root.markerText
190 191 192
        maximumLength: 20
        style: TextFieldStyle {
            textColor: "white"
193
            background: Rectangle {
194 195
                color: "#99ff0000"
                width: marker.width
196 197
            }
        }
198
        font.pixelSize: root.displayFontSize
199
    }
200
}