CC-1919:Playlist builder show time offset

Fixed.

- I wasn't sure if I had to wait for html/css code from Vladmir.
I just did what I could do.
This commit is contained in:
james 2011-05-31 16:49:01 -04:00
parent 1e62a7be9c
commit 75ffe91325
3 changed files with 16 additions and 3 deletions

View File

@ -91,7 +91,7 @@ class Playlist {
{ {
$seconds = $p_seconds; $seconds = $p_seconds;
$milliseconds = intval(($seconds - intval($seconds)) * 1000); $milliseconds = intval(($seconds - intval($seconds)) * 1000);
$milliStr = str_pad($milliseconds, 6, '0'); $milliStr = str_pad($milliseconds, 3, '0');
$hours = floor($seconds / 3600); $hours = floor($seconds / 3600);
$seconds -= $hours * 3600; $seconds -= $hours * 3600;
$minutes = floor($seconds / 60); $minutes = floor($seconds / 60);
@ -387,9 +387,14 @@ class Playlist {
->orderByDbPosition() ->orderByDbPosition()
->filterByDbPlaylistId($this->id) ->filterByDbPlaylistId($this->id)
->find(); ->find();
$i = 0;
$offset = 0;
foreach ($rows as $row) { foreach ($rows as $row) {
$files[] = $row->toArray(BasePeer::TYPE_FIELDNAME, true, true); $files[$i] = $row->toArray(BasePeer::TYPE_FIELDNAME, true, true);
$offset += Playlist::playlistTimeToSeconds($files[$i]['cliplength']);
$files[$i]['offset'] = Playlist::secondsToPlaylistTime($offset);
$i++;
} }
return $files; return $files;

View File

@ -15,6 +15,7 @@
</div> </div>
<div class="text-row"> <div class="text-row">
<span class="spl_artist"><?php echo $item["CcFiles"]['artist_name'] ?></span> <span class="spl_artist"><?php echo $item["CcFiles"]['artist_name'] ?></span>
<span class="spl_offset"><?php echo $item["offset"]?></span>
</div> </div>
<?php if($i < count($this->pl->getContents()) -1): ?> <?php if($i < count($this->pl->getContents()) -1): ?>
<div id="fade_<?php echo $i ?>" class="spl_fade_control ui-state-default"></div> <div id="fade_<?php echo $i ?>" class="spl_fade_control ui-state-default"></div>

View File

@ -81,6 +81,13 @@
color:#d5d5d5; color:#d5d5d5;
} }
.spl_offset {
float: right;
text-align: right;
padding: 0 5px 0 0;
color: #D5D5D5;
}
/*#spl_editor { /*#spl_editor {
height: 50px; height: 50px;
}*/ }*/