Location: PHPKode > projects > TVEz - Media Library > tvez-0.2.1/html/player/volume.php
<?php

# ------------------------------------------------------------------------------
#
# This file contains the volume gui for TVEz
#
# ------------------------------------------------------------------------------
#
# Copyright (C) 2003 Christian Eheim and Alex Pachikov
#                                                                               
# This file is part of TVEz (tvez.sourceforge.net).
#                                                                               
# TVEz is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#                                                                               
# TVEz is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#                                                                               
# You should have received a copy of the GNU General Public License
# along with TVEz; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#                                                                               
# ------------------------------------------------------------------------------
#
# Created on 02/12/2003 by Christian Eheim
#
# LAST MODIFIED:
# $Date: 2004/01/19 19:06:39 $
# $Revision: 1.4 $
# $Author: eheim $
#
# ------------------------------------------------------------------------------
require "../shared/session.php";
require "../../config/config_file.php";
require "../locale/localize.php";
$TRANSLATED_TEXT = get_translation("../locale");
require "socket.php";
require "../themes/theme.php";
$theme = get_theme();
                                                                                     
echo '
<html>
<head>
<link rel="stylesheet" type="text/css" href="../themes/theme.css.php?theme='.$theme.'">
<link rel="stylesheet" type="text/css" href="../themes/theme.css.php?theme='.$theme.'&content=player">
';
?>
</head>
<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
<table class="volume" cellspacing="0" cellpadding="2">
  <tr>
  <td rowspan="3" class="volume">
 <?php

$cmd = "volume\r\n";

list($err,$vol) = send_command($cmd);
$vol = chop($vol);
if (!$err && !preg_match("/^(XINE|Authentication)/", $vol)) {
	list($volume,$mute) = split(",",$vol);
	if ($mute)
		$img = "images/bar2.gif";
	else
		$img = "images/bar1.gif";
	$volume = floor($vol/10);
	$top = 10-$volume;

	for ($i=0;$i<$top;$i++)
		echo "<a href='volcontrol.php?tvst=volumeset&level=".(10-$i)."0'><img src=\"images/bar0.gif\" border=\"0\" title=\"".((10-$i)*10)."%\"></a><br>";
	for ($i=$top;$i<10;$i++)
		echo "<a href='volcontrol.php?tvst=volumeset&level=".(10-$i)."0'><img src=\"$img\" border=\"0\" title=\"".((10-$i)*10)."%\"></a><br>";

	echo "
	  </td>
	  <td class=\"updown\">
		  <a href='volcontrol.php?tvst=up'>".localize_string("Up")."</a>
	  </td>
  </tr>
  <tr>
	  <td class=\"updown\">
		  <a href='volcontrol.php?tvst=mute'>".localize_string("Mute")."</a>
	  </td>
  </tr>
  <tr>
	  <td class=\"updown\">
		  <a href='volcontrol.php?tvst=down'>".localize_string("Down")."</a>
	  </td>
  </tr>
	";
} else {
	for ($i=0;$i<10;$i++)
		echo "<img src=images/bar0.gif border=0><br>";

	echo "
	  </td>
	  <td class=\"updown\">
		  ".localize_string("Up")."
	  </td>
  </tr>
  <tr>
	  <td class=\"updown\">
		  ".localize_string("Mute")."
	  </td>
  </tr>
  <tr>
	  <td class=\"updown\">
		  ".localize_string("Down")."
	  </td>
  </tr>
	";
}
?>
</table>
</body>
</html>
Return current item: TVEz - Media Library