00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __NOTE_H__
00021 #define __NOTE_H__
00022
00023 #include "smart_ptr.h"
00024 #include "impulse.h"
00025
00026
00027 enum ENote
00028 {
00029 NOTE_C = 0,
00030 NOTE_C_SHARP = 1,
00031 NOTE_D = 2,
00032 NOTE_D_SHARP = 3,
00033 NOTE_E = 4,
00034 NOTE_F = 5,
00035 NOTE_F_SHARP = 6,
00036 NOTE_G = 7,
00037 NOTE_G_SHARP = 8,
00038 NOTE_A = 9,
00039 NOTE_A_SHARP = 10,
00040 NOTE_B = 11
00041 };
00042
00043 class CNote : public IImpulse
00044 {
00045 friend class CSmartPtr<CNote>;
00046
00047 private :
00048 ushort m_Volume, m_Pitch;
00049
00050 CNote( const ushort Volume, const ENote Note, const ushort Octave, const uint Duration );
00051
00052 public :
00053 static CSmartPtr<IImpulse> Create( const ushort Volume, const ENote Note, const ushort Octave, const uint Duration )
00054 {
00055 return new CNote(Volume, Note, Octave, Duration);
00056 }
00057
00058 virtual ~CNote();
00059
00060 static float DefaultTempoFactor()
00061 {
00062 return 1.0f;
00063 }
00064
00065 static ushort DefaultVolume()
00066 {
00067 return 100;
00068 }
00069
00070 const ushort & Volume() const;
00071 const ushort & Pitch() const;
00072 virtual void Play() const;
00073 virtual EEntityType Type() const;
00074 };
00075
00076 #endif //__NOTE_H__