home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!utcsri!relay.cs.toronto.edu!compuserve.com!76336.3114
- Newsgroups: comp.lang.c++
- From: 76336.3114@CompuServe.COM (Kevin Dean)
- Subject: How to turn PC speaker off
- Message-ID: <921221185052_76336.3114_EHJ5-1@CompuServe.COM>
- Date: 21 Dec 92 18:55:34 GMT
- Lines: 59
-
- C.S. Chang (cschang@umd5.umd.edu) writes:
-
- >Is there any way to turn the PC speaker off so that there will be no
- >beeps if a certain function call failed.
-
- class PowerCase {
- friend class ScrewDriver;
- friend class Pliers;
-
- Screws _screws[6];
- Speaker _speaker;
- // ... other private items here.
-
- void open();
- void close();
-
- public:
-
- void powerOn();
- void powerOff();
- };
-
- class Screwdriver {
- // ...
-
- void undo(Screw & s);
-
- public:
-
- void openPowerCase(PowerCase & pc) {
- for (int i = 0; i < 6; i++)
- undo(pc._screws[i]);
- pc.open();
- }
- };
-
- class Pliers {
- void cut(Wire & w);
- public:
-
- void disableSpeaker(PowerCase & pc) {
- cut(pc._speaker._wire);
- }
- };
-
- main() {
- PowerCase pc;
- ScrewDriver sd;
- Pliers p;
-
- sd.openPowerCase(pc);
- p.disableSpeaker(pc);
-
- return (0);
- }
-
- That should do it, I think.
-
-
-