main.qml 21.9 KB
Newer Older
luyikei's avatar
luyikei committed
1 2
import QtQuick 2.0
import QtQuick.Controls 1.4
3
import QtQuick.Dialogs 1.2
luyikei's avatar
luyikei committed
4 5 6 7 8 9

Rectangle {
    id: page
    anchors.fill: parent
    color: "#777777"
    border.width: 0
10
    focus: true
luyikei's avatar
luyikei committed
11

12
    property int length // in frames
13
    property int cursorPosition: 0 // in frames
14
    property int initPosOfCursor: 150
15 16
    property double ppu: 10 // Pixels Per minimum Unit
    property double unit: 3000 // In milliseconds therefore ppu / unit = Pixels Per milliseconds
luyikei's avatar
luyikei committed
17 18
    property double fps: 29.97
    property int maxZ: 100
19
    property int scale: 4
luyikei's avatar
luyikei committed
20
    property var allClips: [] // Actual clip item objects
21
    property var allClipsDict: ({}) // Actual clip item objects
22
    property var selectedClips: [] // Selected clip uuids
luyikei's avatar
luyikei committed
23
    property var groups: [] // list of lists of clip uuids
24
    property var linkedClipsDict: ({}) // Uuid
25
    property alias isMagneticMode: magneticModeButton.selected
26
    property bool isCutMode: false
27
    property bool dragging: false
luyikei's avatar
luyikei committed
28

luyikei's avatar
luyikei committed
29
    property int trackHeight: 60
luyikei's avatar
luyikei committed
30 31 32

    function clearSelectedClips() {
        while ( selectedClips.length ) {
33
            var clip = findClipItem( selectedClips.pop() );
luyikei's avatar
luyikei committed
34 35
            if ( clip )
                clip.selected = false;
luyikei's avatar
luyikei committed
36 37 38
        }
    }

39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
    function zerofill( number, width ) {
        var str = "" + number;
        while ( str.length < width ) {
            str = "0" + str;
        }
        return str;
    }

    function timecodeFromFrames( frames ) {
        var seconds = Math.floor( frames / Math.round( fps )  );
        var minutes = Math.floor( seconds / 60 );
        var hours = Math.floor( minutes / 60 );

        return zerofill( hours, 3 ) + ':' + // hours
                zerofill( minutes % 60, 2 ) + ':' + // minutes
                zerofill( seconds % 60, 2 ) + ':' + // seconds
                // The second Math.round prevents the first value from exceeding fps.
                // e.g. 30 % Math.round( 29.97 ) = 0
                zerofill( Math.floor( frames % Math.round( fps ) ), 2 ); // frames in a minute
    }

luyikei's avatar
luyikei committed
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 95
    // Convert length in frames to pixels
    function ftop( frames )
    {
        return frames / fps * 1000 * ppu / unit;
    }

    // Convert length in pixels to frames
    function ptof( pixels )
    {
        return Math.round( pixels * fps / 1000 / ppu * unit );
    }

    function trackContainer( trackType )
    {
        if ( trackType === "Video" )
            return trackContainers.get( 0 );
        return trackContainers.get( 1 );
    }

    function addTrack( trackType )
    {
        trackContainer( trackType )["tracks"].append( { "clips": [] } );
    }

    function removeTrack( trackType )
    {
        var tracks = trackContainer( trackType )["tracks"];
        tracks.remove( tracks.count - 1 );
    }

    function addClip( trackType, trackId, clipDict )
    {
        var newDict = {};
        newDict["begin"] = clipDict["begin"];
        newDict["end"] = clipDict["end"];
        newDict["position"] = clipDict["position"];
96
        newDict["lastPosition"] = clipDict["position"];
luyikei's avatar
luyikei committed
97
        newDict["length"] = clipDict["length"];
98
        newDict["libraryUuid"] = clipDict["libraryUuid"];
luyikei's avatar
luyikei committed
99 100 101
        newDict["uuid"] = clipDict["uuid"];
        newDict["trackId"] = trackId;
        newDict["name"] = clipDict["name"];
102
        newDict["selected"] = clipDict["selected"] === false ? false : true ;
luyikei's avatar
luyikei committed
103
        var tracks = trackContainer( trackType )["tracks"];
104 105
        while ( trackId > tracks.count - 1 )
            addTrack( trackType );
luyikei's avatar
luyikei committed
106 107 108 109 110 111 112 113 114
        tracks.get( trackId )["clips"].append( newDict );
        return newDict;
    }

    function removeClipFromTrack( trackType, trackId, uuid )
    {
        var ret = false;
        var tracks = trackContainer( trackType )["tracks"];
        var clips = tracks.get( trackId )["clips"];
luyikei's avatar
luyikei committed
115

luyikei's avatar
luyikei committed
116 117 118 119 120 121 122 123 124 125 126 127 128
        for ( var j = 0; j < clips.count; j++ ) {
            var clip = clips.get( j );
            if ( clip.uuid === uuid ) {
                clips.remove( j );
                ret = true;
                j--;
            }
        }
        return ret;
    }

    function removeClipFromTrackContainer( trackType, uuid )
    {
129
        for ( var i = 0; i < trackContainer( trackType )["tracks"].count; i++  )
luyikei's avatar
luyikei committed
130 131 132
            removeClipFromTrack( trackType, i, uuid );
    }

133 134 135 136 137 138
    function removeClip( uuid )
    {
        removeClipFromTrackContainer( "Audio", uuid );
        removeClipFromTrackContainer( "Video", uuid );
    }

luyikei's avatar
luyikei committed
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
    function findClipFromTrackContainer( trackType, uuid )
    {
        var tracks = trackContainer( trackType )["tracks"];
        for ( var i = 0; i < tracks.count; i++  ) {
            var clip = findClipFromTrack( trackType, i, uuid );
            if( clip )
                return clip;
        }

        return null;
    }

    function findClipFromTrack( trackType, trackId, uuid )
    {
        var clips = trackContainer( trackType )["tracks"].get( trackId )["clips"];
        for ( var j = 0; j < clips.count; j++ ) {
            var clip = clips.get( j );
            if ( clip.uuid === uuid )
                return clip;
        }
        return null;
    }

    function findClip( uuid )
    {
        var v = findClipFromTrackContainer( "Video", uuid );
        if ( !v )
            return findClipFromTrackContainer( "Audio", uuid );
        return v;
    }

170
    function findClipItem( uuid ) {
171
        return allClipsDict[uuid];
172 173
    }

luyikei's avatar
luyikei committed
174 175 176 177 178 179 180 181 182
    function adjustTracks( trackType ) {
        var tracks = trackContainer( trackType )["tracks"];

        while ( tracks.count > 1 && tracks.get( tracks.count - 1 )["clips"].count === 0 &&
               tracks.get( tracks.count - 2 )["clips"].count === 0 )
            removeTrack( trackType );

        if ( tracks.get( tracks.count - 1 )["clips"].count > 0 )
            addTrack( trackType );
luyikei's avatar
luyikei committed
183
    }
luyikei's avatar
luyikei committed
184

luyikei's avatar
luyikei committed
185
    function addMarker( pos ) {
luyikei's avatar
luyikei committed
186 187 188
        markers.append( {
                           "position": pos
                       } );
luyikei's avatar
luyikei committed
189 190
    }

luyikei's avatar
luyikei committed
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
    function findMarker( pos ) {
        for ( var i = 0; i < markers.count; ++i ) {
            if ( markers.get( i )["position"] === pos ) {
                return markers.get( i );
            }
        }
        return null;
    }

    function removeMarker( pos ) {
        for ( var i = 0; i < markers.count; ++i ) {
            if ( markers.get( i )["position"] === pos ) {
                markers.remove( i );
                return;
            }
        }
    }

luyikei's avatar
luyikei committed
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235
    function addGroup( clips ) {
        groups.push( clips );
    }

    function findGroup( uuid ) {
        for ( var i = 0; i < groups.length; ++i ) {
            var group = groups[i];
            for ( var j = 0; j < group.length; ++j ) {
                if ( group[j] === uuid )
                    return group;
            }
        }
        return null;
    }

    function removeGroup( uuid ) {
        for ( var i = 0; i < groups.length; ++i ) {
            var group = groups[i];
            for ( var j = 0; j < group.length; ++j ) {
                if ( group[j] === uuid ) {
                    groups.splice( i, 1 );
                    return;
                }
            }
        }
    }

236 237 238 239 240 241
    function updateLinkedClips( uuid ) {
        var item = findClipItem( uuid );
        if ( item )
            item.linkedClips = linkedClipsDict[uuid];
    }

242
    function zoomIn( ratio, scrollToCuror ) {
243 244 245
        var newPpu = ppu;
        var newUnit = unit;
        newPpu *= ratio;
246
        var contentXPos = ptof( sView.flickableItem.contentX );
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264

        // Don't be too narrow.
        while ( newPpu < 10 ) {
            newPpu *= 2;
            newUnit *= 2;
        }

        // Don't be too distant.
        while ( newPpu > 20 ) {
            newPpu /= 2;
            newUnit /= 2;
        }

        // Can't be more precise than 1000msec / fps.
        var mUnit = 1000 / fps;

        if ( newUnit < mUnit ) {
            newPpu /= ratio; // Restore the original scale.
265
            newPpu *= mUnit / newUnit;
266 267 268
            newUnit = mUnit;
        }

269
        // Make unit a multiple of 1 / fps.
270
        newPpu *= ( newUnit - ( newUnit % mUnit ) ) / newUnit;
271 272 273 274 275 276 277 278 279
        newUnit -= newUnit % mUnit;

        // If "almost" the same value, don't bother redrawing the ruler.
        if ( Math.abs( unit - newUnit ) > 0.01 )
            unit = newUnit;

        if ( Math.abs( ppu - newPpu ) > 0.0001 )
            ppu = newPpu;

280 281 282 283 284 285 286 287 288 289 290
        if ( scrollToCuror === true ) {
            // Let's scroll to the cursor position!
            var newContentX = cursor.x - sView.width / 2;
            // Never show the background behind the timeline
            if ( newContentX >= 0 && sView.flickableItem.contentWidth - newContentX > sView.width  )
                sView.flickableItem.contentX = newContentX;
        }
        else {
            sView.flickableItem.contentX = ftop( contentXPos );
        }

291

292 293 294
        scale = Math.floor( Math.log( newUnit / mUnit ) / Math.log( 2 ) - 1 );
        scale = Math.min( 9, scale );
        scale = Math.max( 0, scale );
295
        mainwindow.setScale( scale );
296 297
    }

298 299 300 301 302
    // Sort clips in a manner that clips won't overlap each other while they are being moved
    function sortSelectedClips() {
        // Workaround: We cannot sort selectedClips directly maybe because of a Qt bug
        var sorted = selectedClips.slice();
        sorted.sort(
303
                    function( clipAUuid, clipBUuid )
304
                    {
305 306
                        var clipA = findClipItem( clipAUuid );
                        var clipB = findClipItem( clipBUuid );
307 308 309 310 311
                        if ( clipA.newTrackId > clipA.trackId )
                        {
                            return - ( clipA.newTrackId - clipB.newTrackId );
                        }
                        else if ( clipA.newTrackId < clipA.trackId )
312 313 314 315 316 317 318
                        {
                            return clipA.newTrackId - clipB.newTrackId;
                        }
                        else if ( clipA.position > clipA.lastPosition )
                        {
                            return - ( clipA.position - clipB.position );
                        }
319
                        else if ( clipA.position < clipA.lastPosition )
320 321
                        {
                            return clipA.position - clipB.position;
322 323
                        };
                        return 0;
324 325
                    }
                    );
326
    }
327

328
    function dragFinished() {
329
        dragging = false;
330
        sortSelectedClips();
331 332 333 334

        // We don't want to rely on selectedClips while moving since it "will" be changed
        // I'm aware that it's not the best solution but it's the safest solution for sure
        var toMove = [];
335
        for ( var i = 0; i < selectedClips.length; ++i )
336 337 338 339
        {
            var clip = findClipItem( selectedClips[i] );
            toMove.push( [clip.uuid, clip.newTrackId, clip.position] );
        }
340
        for ( i = 0; i < toMove.length; ++i )
luyikei's avatar
luyikei committed
341
            workflow.moveClip( toMove[i][0], toMove[i][1], toMove[i][2] );
342

luyikei's avatar
luyikei committed
343 344 345 346
        adjustTracks( "Audio" );
        adjustTracks( "Video" );
    }

luyikei's avatar
luyikei committed
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365
    ListModel {
        id: trackContainers

        ListElement {
            name: "Video"
            tracks: []
        }

        ListElement {
            name: "Audio"
            tracks: []
        }

        Component.onCompleted: {
            addTrack( "Video" );
            addTrack( "Audio" );
        }
    }

luyikei's avatar
luyikei committed
366 367 368 369
    ListModel {
        id: markers
    }

luyikei's avatar
luyikei committed
370 371
    MouseArea {
        id: selectionArea
372 373 374 375
        width: parent.width - initPosOfCursor
        height: audioTrackContainer.y + audioTrackContainer.height - videoTrackContainer.y
        y: videoTrackContainer.y
        x: initPosOfCursor
luyikei's avatar
luyikei committed
376 377 378 379

        onPressed: {
            clearSelectedClips();
            selectionRect.visible = true;
380 381
            selectionRect.x = mouseX + x;
            selectionRect.y = mouseY + y;
luyikei's avatar
luyikei committed
382 383
            selectionRect.width = 0;
            selectionRect.height = 0;
384
            selectionRect.initPos = Qt.point( mouseX + x, mouseY + y );
luyikei's avatar
luyikei committed
385 386 387 388
        }

        onPositionChanged: {
            if ( selectionRect.visible === true ) {
389 390 391 392
                selectionRect.x = Math.min( mouseX + x, selectionRect.initPos.x );
                selectionRect.y = Math.min( mouseY + y, selectionRect.initPos.y );
                selectionRect.width = Math.abs( mouseX + x - selectionRect.initPos.x );
                selectionRect.height = Math.abs( mouseY + y - selectionRect.initPos.y );
393
                selectionRect.selectClips();
luyikei's avatar
luyikei committed
394 395 396 397 398 399 400 401
            }
        }

        onReleased: {
            selectionRect.visible = false;
        }
    }

402 403
    ScrollView {
        id: sView
luyikei's avatar
luyikei committed
404 405
        height: page.height
        width: page.width
406 407 408 409

        readonly property int sViewPadding: 50

        flickableItem.contentWidth: Math.max( page.width, ftop( length ) + initPosOfCursor + sViewPadding )
410 411 412
        flickableItem.contentHeight: Math.max( sView.height,
                                              topArea.height + videoTrackContainer.height +
                                              containerMarginItem.height + audioTrackContainer.height )
luyikei's avatar
luyikei committed
413

414
        Flickable {
luyikei's avatar
luyikei committed
415

luyikei's avatar
luyikei committed
416 417
            interactive: false

418 419 420 421 422 423 424 425 426 427 428 429
            TrackContainer {
                y: topArea.height
                id: videoTrackContainer
                type: "Video"
                isUpward: true
                tracks: trackContainers.get( 0 )["tracks"]
            }

            Rectangle {
                id: containerMarginItem
                anchors.top: videoTrackContainer.bottom
                height: 20
430
                width: parent.width
431 432 433 434
                gradient: Gradient {
                    GradientStop {
                        position: 0.00;
                        color: "#797979"
435 436
                    }

437 438 439 440
                    GradientStop {
                        position: 0.748
                        color: "#959697"
                    }
441

442 443 444
                    GradientStop {
                        position: 0.986
                        color: "#858f99"
445
                    }
446
                }
447
            }
448

449 450 451 452 453 454 455 456 457 458 459 460 461 462
            TrackContainer {
                anchors.top: containerMarginItem.bottom
                id: audioTrackContainer
                type: "Audio"
                isUpward: false
                tracks: trackContainers.get( 1 )["tracks"]
            }

            Item {
                id: topArea
                width: parent.width
                height: 52
                x: topLeftArea.width
                y: sView.flickableItem.contentY
luyikei's avatar
luyikei committed
463

464 465 466 467 468 469 470 471
                Ruler {
                    id: ruler

                    Rectangle {
                        id: borderBottomOfRuler
                        width: parent.width
                        height: 1
                        color: "#111111"
luyikei's avatar
luyikei committed
472 473
                    }
                }
474

475 476 477 478 479
                Cursor {
                    id: cursor
                    anchors.top: ruler.bottom
                    z: 2000
                    height: page.height
480
                }
luyikei's avatar
luyikei committed
481

482 483 484 485 486 487 488 489
                Repeater {
                    model: markers
                    anchors.top: topArea.top
                    delegate: Marker {
                        position: model.position
                        markerModel: model
                    }
                }
luyikei's avatar
luyikei committed
490
            }
luyikei's avatar
luyikei committed
491

492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518
            Rectangle {
                id: topLeftArea
                x: sView.flickableItem.contentX
                y: sView.flickableItem.contentY
                width: initPosOfCursor
                height: topArea.height
                color: "#333333"
                border.width: 1
                border.color: "#111111"

                Text {
                    id: cursorTimecode
                    x: 5
                    y: 2

                    text: timecodeFromFrames( cursorPosition )
                    color: "#EEEEEE"
                    font.pixelSize: parent.height / 4
                }

                Item {
                    id: properties
                    x: 5
                    y: parent.height / 2
                    width: parent.width - x * 2
                    height: parent.height / 2

luyikei's avatar
luyikei committed
519 520 521 522 523 524 525 526 527
                    Row {
                        spacing: 2

                        PropertyButton {
                            id: magneticModeButton
                            text: "M"
                            selected: true
                        }

528 529 530 531 532 533
                        PropertyButton {
                            id: zoomInButton
                            text: "+"
                            selected: false

                            onPressed: {
534
                                zoomIn( 2.0, true );
535 536 537 538 539 540 541 542 543 544
                                selected = false;
                            }
                        }

                        PropertyButton {
                            id: zoomOutButton
                            text: "-"
                            selected: false

                            onPressed: {
545
                                zoomIn( 0.5, true );
546 547 548
                                selected = false;
                            }
                        }
549 550 551 552 553 554 555 556 557 558 559

                        PropertyButton {
                            id: fxButton
                            text: "Fx"
                            selected: false

                            onPressed: {
                                workflow.showEffectStack();
                                selected = false;
                            }
                        }
560
                    }
luyikei's avatar
luyikei committed
561 562
                }
            }
luyikei's avatar
luyikei committed
563 564 565 566 567 568 569 570
        }
    }

    Rectangle {
        id: selectionRect
        visible: false
        color: "#999999cc"
        property point initPos
571 572 573 574 575 576 577 578 579 580

        function selectClips() {
            for ( var i = 0; i < allClips.length; ++i ) {
                var clip = allClips[i];
                var clipPos = clip.mapToItem( page, 0, 0 );
                if ( ( x - clip.width < clipPos.x && clipPos.x < x + width ) &&
                     ( y - clip.height < clipPos.y && clipPos.y < y + height ) )
                    clip.selected = true;
            }
        }
luyikei's avatar
luyikei committed
581 582
    }

583
    MessageDialog {
luyikei's avatar
luyikei committed
584
        id: removeSelectedClipsDialog
585 586 587 588 589
        title: "VLMC"
        text: qsTr( "Do you really want to remove selected clips?" )
        icon: StandardIcon.Question
        standardButtons: StandardButton.Yes | StandardButton.No
        onYes: {
590 591
            while ( selectedClips.length > 0 )
                workflow.removeClip( selectedClips[0] );
592 593 594 595 596
        }
    }

    Keys.onPressed: {
        if ( event.key === Qt.Key_Delete ) {
luyikei's avatar
luyikei committed
597
            removeSelectedClipsDialog.visible = true;
598
        }
599 600 601
        else if ( event.key === Qt.Key_Plus &&
                 event.modifiers & Qt.ControlModifier
                 && scale > 0 ) {
602
            zoomIn( 2, true );
603
        }
604 605 606
        else if ( event.key === Qt.Key_Minus &&
                 event.modifiers & Qt.ControlModifier &&
                 scale < 9 ) {
607
            zoomIn( 0.5, true );
608 609
        }
        event.accepted = true;
610 611
    }

luyikei's avatar
luyikei committed
612 613
    Connections {
        target: workflow
614 615 616 617 618

        onFpsChanged: {
            page.fps = fps;
        }

luyikei's avatar
luyikei committed
619
        onLengthChanged: {
luyikei's avatar
luyikei committed
620
            page.length = length;
621
        }
622 623 624 625

        onClipAdded: {
            var clipInfo = workflow.clipInfo( uuid );
            var type = clipInfo["audio"] ? "Audio" : "Video";
626
            clipInfo["selected"] = false;
627
            linkedClipsDict[uuid] = clipInfo["linkedClips"];
628
            addClip( type, clipInfo["trackId"], clipInfo );
luyikei's avatar
luyikei committed
629
            adjustTracks( type );
630

631
            zoomIn( page.width / sView.flickableItem.contentWidth, false );
632 633 634 635 636 637
        }

        onClipMoved: {
            var clipInfo = workflow.clipInfo( uuid );
            var type = clipInfo["audio"] ? "Audio" : "Video";
            var oldClip = findClipFromTrackContainer( type, uuid );
638 639
            linkedClipsDict[uuid] = clipInfo["linkedClips"];
            updateLinkedClips( uuid );
640 641 642 643 644

            if ( clipInfo["trackId"] !== oldClip["trackId"] ) {
                addClip( type, clipInfo["trackId"], clipInfo );
                removeClipFromTrack( type, oldClip["trackId"], uuid );
            }
645 646
            findClipItem( uuid ).position = clipInfo["position"];
            findClipItem( uuid ).lastPosition = clipInfo["position"];
luyikei's avatar
luyikei committed
647
            adjustTracks( type );
648 649 650 651
        }

        onClipRemoved: {
            removeClip( uuid );
luyikei's avatar
luyikei committed
652 653
            adjustTracks( "Audio" );
            adjustTracks( "Video" );
654 655 656 657 658 659 660 661
        }

        onClipResized: {
            var clipInfo = workflow.clipInfo( uuid );
            var clip = findClipItem( uuid );
            clip.position = clipInfo["position"];
            clip.end = clipInfo["end"];
            clip.begin = clipInfo["begin"];
662
            clip.updateEffects( clipInfo );
663
        }
664 665

        onClipLinked: {
666 667 668 669
            linkedClipsDict[uuidA].push( uuidB );
            linkedClipsDict[uuidB].push( uuidA );
            updateLinkedClips( uuidA );
            updateLinkedClips( uuidB );
670
        }
671

672
        onClipUnlinked: {
673 674 675 676 677 678 679 680 681 682 683 684 685 686
            for ( var i = 0; i < linkedClipsDict[uuidA].length; ++i )
                if ( linkedClipsDict[uuidA][i] === uuidB )
                {
                    linkedClipsDict[uuidA].splice( i, 1 );
                    break;
                }
            for ( i = 0; i < linkedClipsDict[uuidB].length; ++i )
                if ( linkedClipsDict[uuidB][i] === uuidA )
                {
                    linkedClipsDict[uuidB].splice( i, 1 );
                    break;
                }
            updateLinkedClips( uuidA );
            updateLinkedClips( uuidB );
687 688
        }

689 690 691 692 693
        onEffectsUpdated: {
            var item = findClipItem( clipUuid );
            if ( item )
                item.updateEffects( workflow.clipInfo( clipUuid ) );
        }
694 695 696 697 698 699
    }

    Connections {
        target: mainwindow
        onScaleChanged: {
            // 10 levels
700
            if ( scale < scaleLevel )
701
                zoomIn( 0.5, false );
702
            else if ( scale > scaleLevel )
703
                zoomIn( 2, false );
704
            scale = scaleLevel;
luyikei's avatar
luyikei committed
705
        }
706 707 708 709 710 711
        onCutToolSelected: {
            isCutMode = true;
        }
        onSelectionToolSelected: {
            isCutMode = false;
        }
luyikei's avatar
luyikei committed
712
    }
713 714 715 716 717 718 719 720 721 722

    Connections {
        target: timeline
        onMarkerAdded: {
            addMarker( pos );
        }
        onMarkerRemoved: {
            removeMarker( pos );
        }
    }
luyikei's avatar
luyikei committed
723 724
}