Bleepint Version 4.4

Make your Delphi programs bleep like FractInt.
Control of PC Speaker in Windows.
(Now with full C++ Builder Support)

Copyleft Andy Preston, Apollo Developments, 1999.
andy@apollod.freeserve.co.uk ( non-commercial)
apollod@FSBDial.co.uk (commercial)

Licensing

This is Free Software, released under the LGPL (Copy Enclosed).
OSI Certified Open Source Software.
OSI Certified is a certification mark of the Open Source Initiative.< /SMALL>

Platforms

Delphi 1, 2, 3, and 4; C++ Builder 1, and 3.

Use

  1. Copy bleepint.pas to your library directory.
  2. (C++ Builder only) you must create your own bleepint.hpp file; to do this, load and compile the demo program.
  3. (Delphi) Add Bleepint to the Uses clause o f your Implementation section.
  4. (C++ Builder) Add a #include directive for bleepi nt (e.g. #include <mylib/bleepint.hpp>)
  5. You can call Bleep or DoBleep as illustrated below.

Delphi example

   Procedure FractintBeeps;
   Begin 
     Bleep (bOK);
     Bleep (bInterrupt);
     Bleep (bError);
   End;

   Procedure PlayTune;   { Play some nice tones of set duration }
   Begin                 { The people of Earth call it music. }
     DoBleep (146, 250);
     DoBleep (123, 250);
     DoBleep (164, 500);
     DoBleep (123, 500);
   End;

   Procedure HurtMe;     { Play a nasty high pitched note }
   Begin                 { Don't stop until you're told to }
     DoBleep (1000, -1);
   End;

   Procedure MakeItStop; { Stop whatever sound is being produced }
   Begin
     ShutUp;
   End;

See Demo.dpr, Demo1.dfm, And Demo1.pas (included in this archive) for more information.

C++ Builder Example:

   void __fastcall FractintBeeps {
        Bleep (bOK);
        Bleep (bInterrupt);
        Bleep (bError);
   }

   void __fastcall PlayTune {   // Play some nice tones of set duration 
        DoBleep (146, 250);
        DoBleep (123, 250);
        DoBleep (164, 500);
        DoBleep (123, 500);
   }

   void __fastcall HurtMe {     // Play a nasty high pitched note.
        DoBleep (1000, -1);     // Don't stop until you're told to
   }

   void __fastcall MakeItStop { // Stop whatever sound is being produced
        ShutUp();
   }

See CBDemo.mak, CBDemo.cpp, CBDemo1.dfm, CBDemo1.cpp, And CBDemo1.h (included in this archive) for more information.

The Story

My customer needed a set of warning bleeps in his application, he didn't have a sound card (not much use in a kitchen!), and Windows' built-in (and rathe r sad) dit was no use at all.

I got hold of the TPCSpeaker component by Song Weng Sam from The DSP. But I thought a simple beeper was best implemented as a set of stand-alone procedures.

I was in the process of hacking TPCSpeaker into such a set of routines when I came across an ancient copy of the FractInt source (Version 7.0 I think) which contained assembly source for the classic FractInt 'do-do-doop'.

Why not give my customer a bleep with real class!

So what we've got here is an mixture of Song Weng Sam's delay loop, and a rather cut down version of FractInt's sound routines.

Thanks

FractInt, still the ultimate fractal generator, is a product of the Stone-Soup Group. I'm not sure which particular Stone-Souper was responsible for the bits I 've filched, so I can't give hir the credit sHe deserves, I'll just take my hat off (except I don't wear a hat) to the lot of them.

Thanks to:

Testing

If you've tested it with Delphi 3, Delphi 4, C++ Builder, or on NT, e-mail me and let me know. Then I can update this.

If you've got any fab-and-groovy modifications or just want to let me know you love Bleepint, I'd also be glad to hear from you.


This page has been checked by Weblint, Version 1.020