home *** CD-ROM | disk | FTP | other *** search
- #pragma once
-
- #ifndef __CONDITIONALMACROS__
- #define SndListHandle Handle
- #endif
-
- class soundchannel
- {
- public:
-
- soundchannel();
- ~soundchannel();
-
- void playsound( const int resourceno) const;
- void playsound( SndListHandle thesound) const;
- void setamplitude( unsigned char amp) const;
- void playnote( int half_millis, long frequency) const;
- void rest( int half_millis) const;
- void hush() const;
-
- private:
- SndChannelPtr thechannel;
-
- void sendcommand( short cmd, short param1, long param2) const;
- void sendImmediate( short cmd, short param1, long param2) const;
- };
-
- inline void soundchannel::playnote( int half_millis, long frequency) const
- {
- sendcommand( freqDurationCmd, half_millis, frequency);
- }
-
- inline void soundchannel::rest( int half_millis) const
- {
- sendcommand( restCmd, half_millis, 0);
- }
-
- inline void soundchannel::hush() const
- {
- sendImmediate( flushCmd, 0, 0);
- sendImmediate( quietCmd, 0, 0);
- }
-