Merge branch 'master' of dev.sourcefabric.org:airtime
This commit is contained in:
commit
aa564434dd
|
@ -557,6 +557,7 @@ class Application_Model_Scheduler
|
||||||
*/
|
*/
|
||||||
$instances = $this->getInstances($schedule["instance"]);
|
$instances = $this->getInstances($schedule["instance"]);
|
||||||
foreach($instances as $instance) {
|
foreach($instances as $instance) {
|
||||||
|
$linked = $instance->getCcShow()->isLinked();
|
||||||
if ($id !== 0) {
|
if ($id !== 0) {
|
||||||
$schedItem = CcScheduleQuery::create()->findPK($id, $this->con);
|
$schedItem = CcScheduleQuery::create()->findPK($id, $this->con);
|
||||||
/* We use the selected cursor's position to find the same
|
/* We use the selected cursor's position to find the same
|
||||||
|
@ -609,12 +610,31 @@ class Application_Model_Scheduler
|
||||||
$filesToInsert = array_merge($filesToInsert, $this->retrieveMediaFiles($media["id"], $media["type"]));
|
$filesToInsert = array_merge($filesToInsert, $this->retrieveMediaFiles($media["id"], $media["type"]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($filesToInsert as $file) {
|
foreach ($filesToInsert as $file) {
|
||||||
//item existed previously and is being moved.
|
//item existed previously and is being moved.
|
||||||
//need to keep same id for resources if we want REST.
|
//need to keep same id for resources if we want REST.
|
||||||
if (isset($file['sched_id'])) {
|
if (isset($file['sched_id'])) {
|
||||||
$sched = CcScheduleQuery::create()->findPk($file["sched_id"]);
|
$sched = CcScheduleQuery::create()->findPk($file["sched_id"]);
|
||||||
|
|
||||||
|
/* We need to keep a record of the original positon a track
|
||||||
|
* is being moved from so we can use it to retrieve the correct
|
||||||
|
* items in linked instances
|
||||||
|
*/
|
||||||
|
if (!isset($originalPosition)) {
|
||||||
|
$originalPosition = $sched->getDbPosition();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If we are moving an item in a linked show we need to get
|
||||||
|
* the relative item to move in each instance. We know what the
|
||||||
|
* relative item is by its position
|
||||||
|
*/
|
||||||
|
if ($linked && $moveAction) {
|
||||||
|
$sched = CcScheduleQuery::create()
|
||||||
|
->filterByDbInstanceId($instance->getDbId())
|
||||||
|
->filterByDbPosition($originalPosition)
|
||||||
|
->findOne();
|
||||||
|
}
|
||||||
$excludeIds[] = intval($sched->getDbId());
|
$excludeIds[] = intval($sched->getDbId());
|
||||||
|
|
||||||
$file["cliplength"] = $sched->getDbClipLength();
|
$file["cliplength"] = $sched->getDbClipLength();
|
||||||
|
@ -694,7 +714,6 @@ class Application_Model_Scheduler
|
||||||
//recalculate the start/end times after the inserted items.
|
//recalculate the start/end times after the inserted items.
|
||||||
foreach ($followingSchedItems as $item) {
|
foreach ($followingSchedItems as $item) {
|
||||||
$endTimeDT = $this->findEndTime($nextStartDT, $item->getDbClipLength());
|
$endTimeDT = $this->findEndTime($nextStartDT, $item->getDbClipLength());
|
||||||
|
|
||||||
$item->setDbStarts($nextStartDT);
|
$item->setDbStarts($nextStartDT);
|
||||||
$item->setDbEnds($endTimeDT);
|
$item->setDbEnds($endTimeDT);
|
||||||
$item->setDbPosition($pos);
|
$item->setDbPosition($pos);
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
<input type="button" class="pl-waveform-cues-btn" value="Show Waveform"></input>
|
<input type="button" class="pl-waveform-cues-btn" value="Show Waveform"></input>
|
||||||
</dd>
|
</dd>
|
||||||
<dt><? echo _("Cue In: "); ?><span class='spl_cue_hint'><? echo _("(hh:mm:ss.t)")?></span></dt>
|
<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>
|
<span contenteditable="true" class="spl_text_input"><?php echo $this->cueIn; ?></span>
|
||||||
</dd>
|
</dd>
|
||||||
<dd class="edit-error"></dd>
|
<dd class="edit-error"></dd>
|
||||||
<dt><? echo _("Cue Out: "); ?><span class='spl_cue_hint'><? echo _("(hh:mm:ss.t)")?></span></dt>
|
<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>
|
<span contenteditable="true" class="spl_text_input"><?php echo $this->cueOut; ?></span>
|
||||||
</dd>
|
</dd>
|
||||||
<dd class="edit-error"></dd>
|
<dd class="edit-error"></dd>
|
||||||
|
|
|
@ -74,6 +74,8 @@ if (($i < count($items) -1) && ($items[$i+1]['type'] == 0)) {
|
||||||
'id' => $item["id"],
|
'id' => $item["id"],
|
||||||
'cueIn' => $item['cuein'],
|
'cueIn' => $item['cuein'],
|
||||||
'cueOut' => $item['cueout'],
|
'cueOut' => $item['cueout'],
|
||||||
|
'cueInSec' => $item['cueInSec'],
|
||||||
|
'cueOutSec' => $item['cueOutSec'],
|
||||||
'uri' => $fileUrl,
|
'uri' => $fileUrl,
|
||||||
'origLength' => $item['orig_length'])); ?>
|
'origLength' => $item['orig_length'])); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1284,11 +1284,17 @@ var AIRTIME = (function(AIRTIME){
|
||||||
$parent = $el.parent(),
|
$parent = $el.parent(),
|
||||||
uri = $parent.data("uri"),
|
uri = $parent.data("uri"),
|
||||||
$html = $($("#tmpl-pl-cues").html()),
|
$html = $($("#tmpl-pl-cues").html()),
|
||||||
tracks = [{
|
|
||||||
src: uri
|
|
||||||
}],
|
|
||||||
cueIn = $li.find('.spl_cue_in').data("cueIn"),
|
cueIn = $li.find('.spl_cue_in').data("cueIn"),
|
||||||
cueOut = $li.find('.spl_cue_out').data("cueOut"),
|
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(),
|
dim = AIRTIME.utilities.findViewportDimensions(),
|
||||||
playlistEditor;
|
playlistEditor;
|
||||||
|
|
||||||
|
|
|
@ -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.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.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.classList.add("channel-wrapper");
|
||||||
this.container.style.left = this.leftOffset;
|
this.container.style.left = this.leftOffset;
|
||||||
|
@ -156,6 +156,14 @@ TrackEditor.prototype.loadTrack = function(track) {
|
||||||
},
|
},
|
||||||
track.states || {}
|
track.states || {}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (track.selected !== undefined) {
|
||||||
|
this.selectedArea = {
|
||||||
|
start: this.secondsToSamples(track.selected.start),
|
||||||
|
end: this.secondsToSamples(track.selected.end)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
this.loadBuffer(track.src);
|
this.loadBuffer(track.src);
|
||||||
|
|
||||||
return el;
|
return el;
|
||||||
|
@ -201,7 +209,9 @@ TrackEditor.prototype.drawTrack = function(buffer) {
|
||||||
};
|
};
|
||||||
|
|
||||||
TrackEditor.prototype.onTrackLoad = function(buffer) {
|
TrackEditor.prototype.onTrackLoad = function(buffer) {
|
||||||
var res;
|
var res,
|
||||||
|
startTime,
|
||||||
|
endTime;
|
||||||
|
|
||||||
if (this.cues === undefined) {
|
if (this.cues === undefined) {
|
||||||
this.setCuePoints(0, buffer.length - 1);
|
this.setCuePoints(0, buffer.length - 1);
|
||||||
|
@ -219,6 +229,14 @@ TrackEditor.prototype.onTrackLoad = function(buffer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.drawTrack(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) {
|
TrackEditor.prototype.samplesToSeconds = function(samples) {
|
||||||
|
@ -302,6 +320,8 @@ TrackEditor.prototype.timeShift = function(e) {
|
||||||
startTime, endTime in seconds.
|
startTime, endTime in seconds.
|
||||||
*/
|
*/
|
||||||
TrackEditor.prototype.notifySelectUpdate = function(startTime, endTime) {
|
TrackEditor.prototype.notifySelectUpdate = function(startTime, endTime) {
|
||||||
|
|
||||||
|
this.updateEditor(-1, undefined, undefined, true);
|
||||||
|
|
||||||
this.fire('changecursor', {
|
this.fire('changecursor', {
|
||||||
start: startTime,
|
start: startTime,
|
||||||
|
@ -451,7 +471,6 @@ TrackEditor.prototype.selectStart = function(e) {
|
||||||
editor.setSelectedArea(startX, startX);
|
editor.setSelectedArea(startX, startX);
|
||||||
startTime = editor.samplesToSeconds(offset + editor.selectedArea.start);
|
startTime = editor.samplesToSeconds(offset + editor.selectedArea.start);
|
||||||
|
|
||||||
editor.updateEditor(-1, undefined, undefined, true);
|
|
||||||
editor.notifySelectUpdate(startTime, startTime);
|
editor.notifySelectUpdate(startTime, startTime);
|
||||||
|
|
||||||
//dynamically put an event on the element.
|
//dynamically put an event on the element.
|
||||||
|
@ -477,7 +496,6 @@ TrackEditor.prototype.selectStart = function(e) {
|
||||||
endTime = editor.samplesToSeconds(offset + editor.selectedArea.end);
|
endTime = editor.samplesToSeconds(offset + editor.selectedArea.end);
|
||||||
|
|
||||||
editor.setSelectedArea(selectStart, selectEnd);
|
editor.setSelectedArea(selectStart, selectEnd);
|
||||||
editor.updateEditor(-1, undefined, undefined, true);
|
|
||||||
editor.notifySelectUpdate(startTime, endTime);
|
editor.notifySelectUpdate(startTime, endTime);
|
||||||
prevX = currentX;
|
prevX = currentX;
|
||||||
};
|
};
|
||||||
|
@ -507,7 +525,6 @@ TrackEditor.prototype.selectStart = function(e) {
|
||||||
startTime = editor.samplesToSeconds(offset + editor.selectedArea.start);
|
startTime = editor.samplesToSeconds(offset + editor.selectedArea.start);
|
||||||
endTime = editor.samplesToSeconds(offset + editor.selectedArea.end);
|
endTime = editor.samplesToSeconds(offset + editor.selectedArea.end);
|
||||||
|
|
||||||
editor.updateEditor(-1, undefined, undefined, true);
|
|
||||||
editor.config.setCursorPos(startTime);
|
editor.config.setCursorPos(startTime);
|
||||||
editor.notifySelectUpdate(startTime, endTime);
|
editor.notifySelectUpdate(startTime, endTime);
|
||||||
};
|
};
|
||||||
|
@ -531,7 +548,6 @@ TrackEditor.prototype.selectCursorPos = function(e) {
|
||||||
startTime = editor.samplesToSeconds(offset + editor.selectedArea.start);
|
startTime = editor.samplesToSeconds(offset + editor.selectedArea.start);
|
||||||
endTime = editor.samplesToSeconds(offset + editor.selectedArea.end);
|
endTime = editor.samplesToSeconds(offset + editor.selectedArea.end);
|
||||||
|
|
||||||
editor.updateEditor(-1, undefined, undefined, true);
|
|
||||||
editor.config.setCursorPos(startTime);
|
editor.config.setCursorPos(startTime);
|
||||||
editor.notifySelectUpdate(startTime, endTime);
|
editor.notifySelectUpdate(startTime, endTime);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue