Merge branch 'master' of dev.sourcefabric.org:airtime

This commit is contained in:
denise 2013-05-07 14:49:38 -04:00
commit 0efe914352
4 changed files with 35 additions and 11 deletions

View File

@ -3,12 +3,12 @@
<input type="button" class="pl-waveform-cues-btn" value="Show Waveform"></input>
</dd>
<dt><? echo _("Cue In: "); ?><span class='spl_cue_hint'><? echo _("(hh:mm:ss.t)")?></span></dt>
<dd id="spl_cue_in_<?php echo $this->id; ?>" class="spl_cue_in" data-cue-in="<?php echo $this->cueIn; ?>">
<dd id="spl_cue_in_<?php echo $this->id; ?>" class="spl_cue_in" data-cue-in="<?php echo $this->cueIn; ?>" data-cue-sec="<?php echo $this->cueInSec; ?>">
<span contenteditable="true" class="spl_text_input"><?php echo $this->cueIn; ?></span>
</dd>
<dd class="edit-error"></dd>
<dt><? echo _("Cue Out: "); ?><span class='spl_cue_hint'><? echo _("(hh:mm:ss.t)")?></span></dt>
<dd id="spl_cue_out_<?php echo $this->id; ?>" class="spl_cue_out" data-cue-out="<?php echo $this->cueOut; ?>">
<dd id="spl_cue_out_<?php echo $this->id; ?>" class="spl_cue_out" data-cue-out="<?php echo $this->cueOut; ?>" data-cue-sec="<?php echo $this->cueOutSec; ?>">
<span contenteditable="true" class="spl_text_input"><?php echo $this->cueOut; ?></span>
</dd>
<dd class="edit-error"></dd>

View File

@ -74,6 +74,8 @@ if (($i < count($items) -1) && ($items[$i+1]['type'] == 0)) {
'id' => $item["id"],
'cueIn' => $item['cuein'],
'cueOut' => $item['cueout'],
'cueInSec' => $item['cueInSec'],
'cueOutSec' => $item['cueOutSec'],
'uri' => $fileUrl,
'origLength' => $item['orig_length'])); ?>
</div>

View File

@ -1284,11 +1284,17 @@ var AIRTIME = (function(AIRTIME){
$parent = $el.parent(),
uri = $parent.data("uri"),
$html = $($("#tmpl-pl-cues").html()),
tracks = [{
src: uri
}],
cueIn = $li.find('.spl_cue_in').data("cueIn"),
cueOut = $li.find('.spl_cue_out').data("cueOut"),
cueInSec = $li.find('.spl_cue_in').data("cueSec"),
cueOutSec = $li.find('.spl_cue_out').data("cueSec"),
tracks = [{
src: uri,
selected: {
start: cueInSec,
end: cueOutSec
}
}],
dim = AIRTIME.utilities.findViewportDimensions(),
playlistEditor;

View File

@ -116,8 +116,8 @@ TrackEditor.prototype.init = function(src, start, end, fades, cues, stateConfig)
this.setCuePoints(this.secondsToSamples(cues.cuein), this.secondsToSamples(cues.cueout));
}
this.selectedArea = undefined; //selected area of track stored as inclusive buffer indices to the audio buffer.
this.active = false;
this.selectedArea = undefined; //selected area of track stored as inclusive buffer indices to the audio buffer.
this.container.classList.add("channel-wrapper");
this.container.style.left = this.leftOffset;
@ -156,6 +156,14 @@ TrackEditor.prototype.loadTrack = function(track) {
},
track.states || {}
);
if (track.selected !== undefined) {
this.selectedArea = {
start: this.secondsToSamples(track.selected.start),
end: this.secondsToSamples(track.selected.end)
};
}
this.loadBuffer(track.src);
return el;
@ -201,7 +209,9 @@ TrackEditor.prototype.drawTrack = function(buffer) {
};
TrackEditor.prototype.onTrackLoad = function(buffer) {
var res;
var res,
startTime,
endTime;
if (this.cues === undefined) {
this.setCuePoints(0, buffer.length - 1);
@ -219,6 +229,14 @@ TrackEditor.prototype.onTrackLoad = function(buffer) {
}
this.drawTrack(buffer);
if (this.selectedArea !== undefined) {
startTime = this.samplesToSeconds(this.selectedArea.start);
endTime = this.samplesToSeconds(this.selectedArea.end);
this.config.setCursorPos(startTime);
this.notifySelectUpdate(startTime, endTime);
}
};
TrackEditor.prototype.samplesToSeconds = function(samples) {
@ -302,6 +320,8 @@ TrackEditor.prototype.timeShift = function(e) {
startTime, endTime in seconds.
*/
TrackEditor.prototype.notifySelectUpdate = function(startTime, endTime) {
this.updateEditor(-1, undefined, undefined, true);
this.fire('changecursor', {
start: startTime,
@ -451,7 +471,6 @@ TrackEditor.prototype.selectStart = function(e) {
editor.setSelectedArea(startX, startX);
startTime = editor.samplesToSeconds(offset + editor.selectedArea.start);
editor.updateEditor(-1, undefined, undefined, true);
editor.notifySelectUpdate(startTime, startTime);
//dynamically put an event on the element.
@ -477,7 +496,6 @@ TrackEditor.prototype.selectStart = function(e) {
endTime = editor.samplesToSeconds(offset + editor.selectedArea.end);
editor.setSelectedArea(selectStart, selectEnd);
editor.updateEditor(-1, undefined, undefined, true);
editor.notifySelectUpdate(startTime, endTime);
prevX = currentX;
};
@ -507,7 +525,6 @@ TrackEditor.prototype.selectStart = function(e) {
startTime = editor.samplesToSeconds(offset + editor.selectedArea.start);
endTime = editor.samplesToSeconds(offset + editor.selectedArea.end);
editor.updateEditor(-1, undefined, undefined, true);
editor.config.setCursorPos(startTime);
editor.notifySelectUpdate(startTime, endTime);
};
@ -531,7 +548,6 @@ TrackEditor.prototype.selectCursorPos = function(e) {
startTime = editor.samplesToSeconds(offset + editor.selectedArea.start);
endTime = editor.samplesToSeconds(offset + editor.selectedArea.end);
editor.updateEditor(-1, undefined, undefined, true);
editor.config.setCursorPos(startTime);
editor.notifySelectUpdate(startTime, endTime);