# 
#  Module stateSignal.tcl
#  
#  $Log: stateSignal.tcl,v $
#  Revision 1.3  2006/11/15 06:52:16  vfom
#  pred port
#
#  Revision 1.2  2006/10/26 09:39:17  vfom
#  Added code for netstate server query
#
#
#  State Signaling procedures
#
catch { package require snack } 
#
proc playSound { f } {
    if [string match $::soundPlayCmd "" ] {
	if { [catch { snack::sound snd -file $f} rez ] } { 
	    puts "playSound: $rez"
	    return 
	} 
	if { [catch { snd play -block 0} rez ] } {
	    puts "playSound: $rez"
	    return 
	}
	snd destroy
    } else {
	if { ![string match  $f "" ] } {
	    if { [catch { eval  "blt::bgexec rez $::soundPlayCmd $f & "} rez ] } {
		puts "playSound: $rez"
	    }
	}    
    }
}
#
proc signalUNK { nd }   {
}
#
proc signalDGRD { nd }  {
}
#
proc signalWARN { nd }  {
}
#
proc signalUP { nd } {
    set snd $::node_soundup($nd)
    if { ![string match  $::node_soundup($nd) "" ] } {
	playSound $::arSounds($snd)
    } elseif { ![string match  $::nodeUpSound "" ] } {
	playSound $::arSounds($::nodeUpSound)
    }
}
#
proc signalDOWN { nd } {
    set snd $::node_sounddown($nd)
    if { ![string match  $::node_sounddown($nd) "" ] } {
	playSound $::arSounds($snd)
    } elseif { ![string match  $::nodeDownSound "" ] } {
	playSound $::arSounds($::nodeDownSound)
    }
}
#
proc longPlaySound { f } {

}
#
