MoCord Mode - Alarm Sound always plays? correct behavior?

Support and queries relating to all previous versions of ZoneMinder
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I think the .cpp file is correct, it is only the .php one that is wrong. And you don't need to recompile that, just change in situ if you prefer.

Try this combination instead of the lines I originally suggested.

Code: Select all

$is_alarmed = ( $status == STATE_ALARM || $status == STATE_ALERT );
$was_alarmed = ( $last_status == STATE_ALARM || $last_status == STATE_ALERT );

$new_alarm = ( $is_alarmed && !$was_alarmed );
$old_alarm = ( !$is_alarmed && $was_alarmed );
Again, I haven't actually run this so it may not work, or might have typos etc in.
Phil
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Okay, Phil this last change seems to have fixed the issue. I'll create a patch and get it on the wiki.

Code: Select all

--- ../ZoneMinder-1.22.3-Orig/web/zm_html_view_watchstatus.php	2006-03-27 14:01:33.000000000 -0800
+++ web/zm_html_view_watchstatus.php	2007-02-08 09:48:20.460895838 -0800
@@ -61,8 +61,11 @@
 	$status_string = $zmSlangRecord;
 }
 $fps_string = sprintf( "%.2f", $fps );
-$new_alarm = ( $status > STATE_PREALARM && $last_status <= STATE_PREALARM );
-$old_alarm = ( $status <= STATE_PREALARM && $last_status > STATE_PREALARM );
+$is_alarmed = ( $status == STATE_ALARM || $status == STATE_ALERT );
+$was_alarmed = ( $last_status == STATE_ALARM || $last_status == STATE_ALERT );
+
+$new_alarm = ( $is_alarmed && !$was_alarmed );
+$old_alarm = ( !$is_alarmed && $was_alarmed );
 
 $refresh = (isset($force)||$forced||isset($disable)||$disabled||(($status>=STATE_PREALARM)&&($status<=STATE_ALERT)))?1:ZM_WEB_REFRESH_STATUS;
 $url = "$PHP_SELF?view=watchstatus&mid=$mid&last_status=$status".(($force||$forced)?"&forced=1":"").(($disable||$disabled)?"&disabled=1":"");
Or maybe not since I have no way to upload it to downloads area :roll:
Thanks Paul for letting me in. Your all set to go.

Cheers
Image
Image
3939663646337

It's better to keep your mouth shut and appear stupid than open it and remove all doubt.
-Mark Twain
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Oh, Paul,
I forgot to mention that I rebuilt ZM so your binaries are all good. You should remove my login from zm's interface, and I'm jealous, you have sunshine :D
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I would suggest just posting it as text for now. If I get chance I will turn it into a proper patch.
Phil
pmurdock
Posts: 15
Joined: Wed Jun 08, 2005 5:23 am
Location: Herriman, Utah

fantastic..

Post by pmurdock »

Works like a champ now! That's great guys! So it was just the PHP code.. easy fix.. ;)

Cheers!
Paul
Locked