Mercurial > code > home > repos > light9
changeset 1379:ea198addff5f
TL can stop following player song
Ignore-this: 81342af72a8bd4dc602f0364aecc831a
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Wed, 08 Jun 2016 07:04:40 +0000 |
parents | 64239c6651de |
children | 5805056fdf93 |
files | light9/web/timeline/timeline-elements.html light9/web/timeline/timeline.coffee |
diffstat | 2 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/light9/web/timeline/timeline-elements.html Wed Jun 08 07:04:16 2016 +0000 +++ b/light9/web/timeline/timeline-elements.html Wed Jun 08 07:04:40 2016 +0000 @@ -4,6 +4,7 @@ <link rel="import" href="light9-timeline-audio.html"> <link rel="import" href="../rdfdb-synced-graph.html"> <link rel="import" href="../light9-music.html"> +<link rel="import" href="../edit-choice.html"> <!-- Whole editor- include this on your page. @@ -35,12 +36,12 @@ <div> <rdfdb-synced-graph graph="{{graph}}"></rdfdb-synced-graph> <light9-music id="music" - song="{{song}}" + song="{{playerSong}}" t="{{songTime}}" playing="{{songPlaying}}" duration="{{songDuration}}"></light9-music> - timeline editor: song [{{song}}] <button>unlink</button> - <label><input type="checkbox"> follow player song choice</label> + timeline editor: song <edit-choice graph="{{graph}}" uri="{{song}}"></edit-choice> + <label><input type="checkbox" checked="{{followPlayerSong::change}}" > follow player song choice</label> </div> <div>[[debug]]</div> <iron-ajax id="vidrefTime" url="/vidref/time" method="PUT" content-type="application/json"></iron-ajax>
--- a/light9/web/timeline/timeline.coffee Wed Jun 08 07:04:16 2016 +0000 +++ b/light9/web/timeline/timeline.coffee Wed Jun 08 07:04:40 2016 +0000 @@ -7,6 +7,8 @@ viewState: { type: Object } debug: {type: String} graph: {type: Object, notify: true} + playerSong: {type: String, notify: true} + followPlayerSong: {type: Boolean, notify: true, value: true} song: {type: String, notify: true} show: {value: 'http://light9.bigasterisk.com/show/dance2016'} songTime: {type: Number, notify: true, observer: '_onSongTime'} @@ -17,12 +19,17 @@ width: ko.observable(1) listeners: 'iron-resize': '_onIronResize' + observers: [ + 'setSong(playerSong, followPlayerSong)' + ] _onIronResize: -> @width(@offsetWidth) _onSongTime: (t) -> @viewState.cursor.t(t) _onSongDuration: (d) -> @viewState.zoomSpec.duration(d) + setSong: (s) -> + @song = @playerSong if @followPlayerSong ready: -> @viewState =