Updated library functionality and started with playlist work.

This commit is contained in:
Daniel 2012-02-10 18:37:10 -05:00
parent dd3b7afff2
commit 0b9ed43e50
3 changed files with 53 additions and 4 deletions

View File

@ -655,8 +655,10 @@ class Application_Model_StoredFile {
//TODO url like this to work on both playlist/showbuilder screens.
//datatable stuff really needs to be pulled out and generalized within the project
//access to zend view methods to access url helpers is needed.
if ($type == "au") {
$row['image'] = '<img src="/css/images/icon_audioclip.png">';
if($type == "au") {
$audioFile = $audioResults[$row['id']-1]['gunid'].".".pathinfo($audioResults[$row['id']-1]['filepath'], PATHINFO_EXTENSION);
$row['image'] = '<img src="/css/images/big_play_arrow.png" onClick="audioPreview(\''.$audioFile.'\', \'spl_'.$row['id'].'\')">';
}
else {
$row['image'] = '<img src="/css/images/icon_playlist.png">';

View File

@ -7,8 +7,10 @@ if (count($items)) : ?>
<li class="ui-state-default" id="spl_<?php echo $item["id"] ?>" unqid="<?php echo $item["CcFiles"]["gunid"]."_".$item["id"]; ?>">
<div class="list-item-container">
<a href="javascript:void(0);" class="big_play"
onclick="audioPreview('<?php echo $item["CcFiles"]["gunid"].".".pathinfo($item["CcFiles"]["filepath"], PATHINFO_EXTENSION);?>',
'spl_<?php echo $item["id"] ?>')"><span class="ui-icon ui-icon-play"></span></a>
accesskey=onClick="playlistAudioPreviewEditor(
'<?php echo $item["CcFiles"]["gunid"].".".pathinfo($item["CcFiles"]["filepath"],
PATHINFO_EXTENSION);?>', '<?php echo $i ?>');">
<span class="ui-icon ui-icon-play"></span></a>
<div class="text-row top">
<span class="spl_playlength"><?php echo $item["cliplength"] ?></span>

View File

@ -188,6 +188,51 @@ function audioStream(){
});
}
function playlistAudioPreviewEditor(filename, elemIndexString){
elemIndex =parseInt(elemIndexString)+1;//increment the index as tags start from 1 not 0
console.log("hello world with index "+elemIndex);
var cueIn = $("dd[id^=spl_cue_in_"+elemIndex+"]").find('span').html();
console.log(cueIn);
var cueOut = $("dd[id^=spl_cue_out_"+elemIndex+"]").find('span').html();
console.log("The cueOut is "+cueOut);
var fadeIn = $("dd[id^=spl_fade_in_"+elemIndex+"]").find('span').html();
if (fadeIn == undefined){ console.log("undefined fadein"); fadeIn = $("dd[id^=spl_fade_in_main]").find('span').html();}
console.log("The fadeIn is "+fadeIn);
var fadeInFileName = "";
if (fadeIn != undefined && parseInt(fadeIn) > 0 ){
//need to get the previous element in the playlist...but don't support previous playlist fading becuase thats not possible.
}
console.log("The fadeInFileName is "+fadeInFileName);
var fadeOut = $("dd[id^=spl_fade_out_"+elemIndex+"]").find('span').html();
if (fadeOut == undefined){ console.log("undefined fadeout"); fadeOut = $("dd[id^=spl_fade_out_main]").find('span').html();}
console.log("The fadeOut is "+fadeOut);
var fadeOutFileName = "";
if (fadeOut != undefined && parseInt(fadeOut) > 0 ){
//need to get the next element in the playlist...but don't support next playlist fading becuase thats not possible.
}
console.log("The fadeOutFileName is "+fadeOutFileName);
//Pop out a play list with cue in and cue out set.
console.log(baseUrl+"Dashboard/audio-preview-player");
//window.open(baseUrl+"Dashboard/audio-preview-player", "music player", "width=200,height=200");
event.preventDefault();
//Set the play button to pause.
var elemID = "spl_"+elemIndexString;
$('#'+elemID+' div.list-item-container a span').attr("class", "ui-icon ui-icon-pause");
}
function audioPreview(filename, elemID){
var elems = $('.ui-icon.ui-icon-pause');