Bug 226 - Separated alarm sound from watch status

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1666 e3e1d417-86f3-4887-817a-d78f3d33393f
pull/27/merge
stan 2005-12-08 17:13:00 +00:00
parent d3ca56ab96
commit 0b9f6d093d
5 changed files with 90 additions and 35 deletions

View File

@ -56,6 +56,7 @@ web_DATA = \
zm_html_view_options.php \
zm_html_view_postlogin.php \
zm_html_view_settings.php \
zm_html_view_siren.php \
zm_html_view_state.php \
zm_html_view_stats.php \
zm_html_view_timeline.php \
@ -153,6 +154,7 @@ EXTRA_DIST = \
zm_html_view_options.php \
zm_html_view_postlogin.php \
zm_html_view_settings.php \
zm_html_view_siren.php \
zm_html_view_state.php \
zm_html_view_stats.php \
zm_html_view_timeline.php \

View File

@ -149,6 +149,7 @@ switch( $view )
case "watchfeed" :
case "watchstatus" :
case "watchevents" :
case "siren" :
case "settings" :
case "events" :
case "timeline" :

View File

@ -0,0 +1,68 @@
<?php
//
// ZoneMinder web siren view file, $Date$, $Revision$
// Copyright (C) 2003, 2004, 2005 Philip Coombes
//
// This program 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.
//
// This program 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 this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canView( 'Stream' ) )
{
$view = "error";
return;
}
$sound_src = ZM_DIR_SOUNDS.'/'.ZM_WEB_ALARM_SOUND;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
</head>
<body>
<?php
if ( ZM_WEB_USE_OBJECT_TAGS && isWindows() )
{
?>
<object id="MediaPlayer" width="0" height="0"
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902"
<param name="FileName" value="<?= $sound_src ?>">
<param name="autoStart" value="1">
<param name="loop" value="1">
<param name=hidden value="1">
<param name="showControls" value="0">
<embed src="<?= $sound_src ?>"
autostart="true"
loop="true"
hidden="true">
</embed>
</object>
<?php
}
else
{
?>
<embed src="<?= $sound_src ?>"
autostart="true"
loop="true"
hidden="true">
</embed>
<?php
}
?>
</body>
</html>

View File

@ -45,7 +45,7 @@ window.resizeTo( <?= reScale( $monitor['Width'], $resize_scale )+$jws['watch']['
window.focus();
</script>
</head>
<frameset rows="24,<?= reScale($monitor['Height'],$scale)+8 ?>,16,*" border="0" frameborder="no" framespacing="0">
<frameset rows="24,<?= reScale($monitor['Height'],$scale)+8 ?>,16,*,0" border="0" frameborder="no" framespacing="0">
<frame src="<?= $PHP_SELF ?>?view=watchmenu&mode=<?= $mode ?>&mid=<?= $monitor['Id'] ?>&scale=<?= $scale ?>&control=<?= $control ?>" marginwidth="0" marginheight="0" name="MonitorMenu<?= $monitor['Id' ] ?>" scrolling="no">
<frame src="<?= $PHP_SELF ?>?view=watchfeed&mode=<?= $mode ?>&mid=<?= $monitor['Id'] ?>&scale=<?= $scale ?>&control=<?= $control ?>" marginwidth="0" marginheight="0" name="MonitorStream<?= $monitor['Id' ] ?>" scrolling="no">
<frame src="<?= $PHP_SELF ?>?view=watchstatus&mid=<?= $monitor['Id'] ?>&control=<?= $control ?>" marginwidth="0" marginheight="0" name="MonitorStatus<?= $monitor['Id' ] ?>" scrolling="no">
@ -69,4 +69,5 @@ else
}
}
?>
<frame src="<?= $PHP_SELF ?>?view=blank" marginwidth="0" marginheight="0" name="Siren<?= $monitor['Id' ] ?>" scrolling="no">
</frameset>

View File

@ -81,15 +81,31 @@ header("Pragma: no-cache"); // HTTP/1.0
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script type="text/javascript">
<?php
if ( ZM_WEB_POPUP_ON_ALARM && $new_alarm )
if ( $new_alarm )
{
if ( ZM_WEB_SOUND_ON_ALARM )
{
?>
if ( window.parent.Siren<?= $mid ?> != null )
{
window.parent.Siren<?= $mid ?>.location = '<?= $PHP_SELF ?>?view=siren&mid=<?= $mid ?>';
}
<?php
}
if ( ZM_WEB_POPUP_ON_ALARM )
{
?>
top.window.focus();
<?php
}
}
if ( $old_alarm )
{
?>
if ( window.parent.Siren<?= $mid ?> != null )
{
window.parent.Siren<?= $mid ?>.location = '<?= $PHP_SELF ?>?view=blank';
}
if ( window.parent.MonitorEvents<?= $mid ?> != null )
{
window.parent.MonitorEvents<?= $mid ?>.location.reload(true);
@ -157,38 +173,5 @@ else
?>
</tr>
</table>
<?php
if ( ZM_WEB_SOUND_ON_ALARM && ($status == STATE_ALARM || $status == STATE_ALERT) )
{
$sound_src = ZM_DIR_SOUNDS.'/'.ZM_WEB_ALARM_SOUND;
if ( ZM_WEB_USE_OBJECT_TAGS && isWindows()
{
?>
<object id="MediaPlayer" width="0" height="0"
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902"
type="application/x-oleobject">
<param name="FileName" value="<?= $sound_src ?>">
<param name="autoStart" value="1">
<param name=hidden value="1">
<param name="showControls" value="0">
<embed src="<?= $sound_src ?>"
autostart="true"
hidden="true">
</embed>
</object>
<?php
}
else
{
?>
<embed src="<?= $sound_src ?>"
autostart="true"
hidden="true">
</embed>
<?php
}
}
?>
</body>
</html>