;; -*-Lisp-*- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; CoCreate Software GmbH Confidential ;; ;; SCCS: %W% ;; Description: Triggers sounds when a long command terminates ;; Author: Claus Brod ;; Created: 7/17/2003 16:40 ;; Modified: ;; Language: Lisp ;; ;; (C) Copyright 2003 CoCreate Software GmbH, all rights reserved ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; (in-package :beep) (use-package :oli) ;; Usage: ;; - Configure path of WAV file ;; - Configure delay (only commands taking longer ;; than the configured delay will cause the sound ;; to be triggered) ;; - Load LISP file ;; Note: The current implementation only works on Windows platforms, ;; but only the mechanism to trigger a sound needs to be modified ;; for other platforms. Use at your own risk. (defvar *soundfile* "c:/temp/tada.wav") (defvar *delay* 3) (let ((lastbusytime nil)) (defun busy-handler (&rest args) (declare (ignore args)) (setq lastbusytime (get-universal-time)) ) (defun interactive-handler (&rest args) (declare (ignore args)) (when lastbusytime (when (> (- (get-universal-time) lastbusytime) *delay*) (system "start" *soundfile*) ) ) (setq lastbusytime nil) ) ) ;; Register busy and interactive handlers (sd-unsubscribe-event *SD-BUSY-EVENT* 'busy-handler) (sd-subscribe-event *SD-BUSY-EVENT* 'busy-handler) (sd-unsubscribe-event *SD-INTERACTIVE-EVENT* 'interactive-handler) (sd-subscribe-event *SD-INTERACTIVE-EVENT* 'interactive-handler)