From 0b9ed43e50b5c294bcad40ebbc2c9d5cc1f39507 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 10 Feb 2012 18:37:10 -0500 Subject: [PATCH] Updated library functionality and started with playlist work. --- airtime_mvc/application/models/StoredFile.php | 6 ++- .../views/scripts/playlist/update.phtml | 6 ++- .../js/airtime/dashboard/helperfunctions.js | 45 +++++++++++++++++++ 3 files changed, 53 insertions(+), 4 deletions(-) diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index c795b2ccf..aee765c85 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -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'] = ''; + + if($type == "au") { + $audioFile = $audioResults[$row['id']-1]['gunid'].".".pathinfo($audioResults[$row['id']-1]['filepath'], PATHINFO_EXTENSION); + $row['image'] = ''; } else { $row['image'] = ''; diff --git a/airtime_mvc/application/views/scripts/playlist/update.phtml b/airtime_mvc/application/views/scripts/playlist/update.phtml index 24ddd0882..3159530f3 100644 --- a/airtime_mvc/application/views/scripts/playlist/update.phtml +++ b/airtime_mvc/application/views/scripts/playlist/update.phtml @@ -7,8 +7,10 @@ if (count($items)) : ?>
  • " unqid="">
    ', - 'spl_')"> + accesskey=onClick="playlistAudioPreviewEditor( + '', '');"> +
    diff --git a/airtime_mvc/public/js/airtime/dashboard/helperfunctions.js b/airtime_mvc/public/js/airtime/dashboard/helperfunctions.js index ccedc28e9..f4516ea2c 100644 --- a/airtime_mvc/public/js/airtime/dashboard/helperfunctions.js +++ b/airtime_mvc/public/js/airtime/dashboard/helperfunctions.js @@ -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');