www.pudn.com > EndpointDetection_Pitch.zip > PitchDlg.h


// PitchDlg.h : header file 
// 
#include "xShadeButton.h" 
//{{AFX_INCLUDES() 
#include "labelcontrol.h" 
//}}AFX_INCLUDES 
// MIDI Status Bytes for Channel Voice Messages 
#define MIDI_NOTE_OFF           0x80 
#define MIDI_NOTE_ON            0x90 
#define MIDI_POLY_PRESSURE      0xA0 
#define MIDI_CONTROL_CHANGE     0xB0 
#define MIDI_PROGRAM_CHANGE     0xC0 
#define MIDI_CHANNEL_PRESSURE   0xD0 
#define MIDI_PITCH_WHEEL        0xE0 
 
// MIDI Status Bytes for System Real-Time Messages 
#define MIDI_TIMING_CLOCK       0xF8 
#define MIDI_START              0xFA 
#define MIDI_CONTINUE           0xFB 
#define MIDI_STOP               0xFC 
#define MIDI_ACTIVE_SENSING     0xFE 
#define MIDI_SYSTEM_RESET       0xFF 
 
// control numbers for MIDI_CONTROL_CHANGE (MIDI status byte 0xB0) 
// note: not a complete list 
#define MIDI_MOD_WHEEL              0x01 
#define MIDI_BREATH_CONTROL         0x02 
#define MIDI_FOOT_CONTROL           0x04 
#define MIDI_PORTAMENTO_TIME        0x05 
#define MIDI_DATA_ENTRY_SLIDER      0x06 
#define MIDI_VOLUME                 0x07 
#define MIDI_BALANCE                0x08 
#define MIDI_PAN                    0x0A 
#define MIDI_EXPRESSION             0x0B 
#define MIDI_GENERAL_PURPOSE_1      0x10    
#define MIDI_GENERAL_PURPOSE_2      0x11 
#define MIDI_GENERAL_PURPOSE_3      0x12 
#define MIDI_GENERAL_PURPOSE_4      0x13 
#define MIDI_SUSTAIN                0x40 
#define MIDI_PORTAMENTO             0x41 
#define MIDI_SOSTENUTO              0x42 
#define MIDI_SOFT                   0x43 
#define MIDI_HOLD_2                 0x45 
#define MIDI_GENERAL_PURPOSE_5      0x50 
#define MIDI_GENERAL_PURPOSE_6      0x51 
#define MIDI_GENERAL_PURPOSE_7      0x52 
#define MIDI_GENERAL_PURPOSE_8      0x53 
#define MIDI_EXTERNAL_EFFECTS_DEPTH 0x5B 
#define MIDI_TREMELO_DEPTH          0x5C 
#define MIDI_CHORUS_DEPTH           0x5D 
#define MIDI_CELESTE_DEPTH          0x5E 
#define MIDI_PHASER_DEPTH           0x5F 
#define MIDI_DATA_INCREMENT         0x60 
#define MIDI_DATA_DECREMENT         0x61 
#define MIDI_NONREG_PARAM_NUM_MSB   0x62 
#define MIDI_NONREG_PARAM_NUM_LSB   0x63 
#define MIDI_REG_PARAM_NUM_MSB      0x64 
#define MIDI_REG_PARAM_NUM_LSB      0x65 
#define MIDI_RESET_ALL_CONTROLLERS  0x79 
#define MIDI_LOCAL_CONTROL          0x7A 
#define MIDI_ALL_NOTES_OFF          0x7B 
#define MIDI_OMNI_MODE_OFF          0x7C 
#define MIDI_OMNI_MODE_ON           0x7D 
#define MIDI_MONO_MODE_ON           0x7E 
#define MIDI_POLY_MODE_ON           0x7F       
// macro to pack a MIDI short message                                                 
#define MAKEMIDISHORTMSG(cStatus, cChannel, cData1, cData2)            \ 
    cStatus | cChannel | (((UINT)cData1) << 8) | (((DWORD)cData2) << 16) 
     
// macros to unpack a MIDI short message     
#define MIDI_STATUS(dwMsg)  ((LOBYTE(LOWORD(dwMsg)) < MIDI_SYSEX) ? \ 
                              LOWORD(dwMsg) & 0xF0 : LOBYTE(LOWORD(dwMsg))) 
#define MIDI_CHANNEL(dwMsg) ((LOBYTE(LOWORD(dwMsg)) < MIDI_SYSEX) ? \ 
                              LOWORD(dwMsg) & 0x0F : 0) 
#define MIDI_DATA1(dwMsg)   (HIBYTE(LOWORD(dwMsg))) 
#define MIDI_DATA2(dwMsg)   (LOBYTE(HIWORD(dwMsg)))  
 
////////////////////////////////////////////////////////////////////////////// 
// 
// declarations for MIDI wrapper functions 
// 
////////////////////////////////////////////////////////////////////////////// 
 
#define MIDI_IN      0x0001  // specifies MIDI input device 
#define MIDI_OUT     0x0002  // specifies MIDI output device 
#define NO_MIDI      0xFF00  // MIDI device unavaible or not selected  
 
#define MIDI_OPEN    0x0001  // uActivateMode parameter for MidiActivate 
#define MIDI_CLOSE   0x0010  // uActivateMode parameter for MidiActivate 
#define MIDI_ABANDON 0x0011  // uActivateMode parameter for MidiActivate 
#define MIDI_BUSY    0xFF01  // possible MidiActivate return value 
 
#define MIDI_ERRMSG_SIZE 128 // for MidiShowError string buffer 
 
typedef struct _MIDIINFO     // MIDI device information block 
{                            
    UINT uDeviceType;        // either MIDI_IN, MIDI_OUT or NO_MIDI 
    UINT uDeviceID;          // ID of device chosen by user or NO_MIDI  
 
    BOOL fAlwaysKeepOpen;    // access level requested by application 
    UINT uDeviceStatus;      // current status of device 
} MIDIINFO, FAR * LPMIDIINFO; 
 
// defines for MIDIINFO uDeviceStatus member 
#define MIDI_DEVICE_IDLE        0x0000  // device is not in use 
#define MIDI_DEVICE_BUSY        0x0001  // device is busy 
#define MIDI_DEVICE_ABANDONED   0x0002  // device was reset while busy 
 
//UINT uMidiInDevices;         // number of MIDI input devices in system 
//UINT uMidiOutDevices;        // number of MIDI output devices in system 
///////////////////////////////////////////////////////////////////////////// 
 
///////////////////////////////////////////////////////////////////////////// 
// CPitchDlg dialog 
 
class CPitchDlg : public CDialog 
{ 
// Construction 
public: 
	CPitchDlg(CWnd* pParent = NULL);	// standard constructor 
public: 
	friend class CPerfDlg; 
	friend class CRelDlg; 
	friend class CChords; 
	virtual int GetARandomNumber(int, int); 
	virtual void UpdateInstrument(int); 
	virtual void UpdatePort(int); 
	virtual void ProcessPopupMenu(int, int); 
	virtual void ShowError(); 
	virtual void SendShortMessage(); 
	virtual void UpdateNoteLength(int); 
// Dialog Data 
	//{{AFX_DATA(CPitchDlg) 
	enum { IDD = IDD_PITCH_DIALOG }; 
	CxShadeButton	m_GetOutCommand; 
	CxShadeButton	m_HelpCommand; 
	CxShadeButton	m_ChordsCommand; 
	CxShadeButton	m_PerfectPitchCommand; 
	CxShadeButton	m_RelativePitchCommand; 
	CLabelControl	m_MainTitle; 
	CxShadeButton	m_PitchTitle; 
	//}}AFX_DATA 
 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CPitchDlg) 
	protected: 
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support 
	//}}AFX_VIRTUAL 
 
// Implementation 
protected: 
	HICON m_hIcon; 
 
	// Generated message map functions 
	//{{AFX_MSG(CPitchDlg) 
	virtual BOOL OnInitDialog(); 
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam); 
	afx_msg void OnPaint(); 
	afx_msg HCURSOR OnQueryDragIcon(); 
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point); 
	afx_msg void OnPort0(); 
	afx_msg void OnPort1(); 
	afx_msg void OnPort2(); 
	afx_msg void OnPort3(); 
	afx_msg void OnInstrument001(); 
	afx_msg void OnInstrument002(); 
	afx_msg void OnInstrument003(); 
	afx_msg void OnInstrument004(); 
	afx_msg void OnInstrument005(); 
	afx_msg void OnInstrument006(); 
	afx_msg void OnInstrument007(); 
	afx_msg void OnInstrument008(); 
	afx_msg void OnInstrument009(); 
	afx_msg void OnInstrument010(); 
	afx_msg void OnInstrument011(); 
	afx_msg void OnInstrument012(); 
	afx_msg void OnInstrument013(); 
	afx_msg void OnInstrument014(); 
	afx_msg void OnInstrument015(); 
	afx_msg void OnInstrument016(); 
	afx_msg void OnInstrument017(); 
	afx_msg void OnInstrument018(); 
	afx_msg void OnInstrument019(); 
	afx_msg void OnInstrument020(); 
	afx_msg void OnInstrument021(); 
	afx_msg void OnInstrument022(); 
	afx_msg void OnInstrument023(); 
	afx_msg void OnInstrument024(); 
	afx_msg void OnInstrument025(); 
	afx_msg void OnInstrument026(); 
	afx_msg void OnInstrument027(); 
	afx_msg void OnInstrument028(); 
	afx_msg void OnInstrument029(); 
	afx_msg void OnInstrument030(); 
	afx_msg void OnInstrument031(); 
	afx_msg void OnInstrument032(); 
	afx_msg void OnInstrument033(); 
	afx_msg void OnInstrument034(); 
	afx_msg void OnInstrument035(); 
	afx_msg void OnInstrument036(); 
	afx_msg void OnInstrument037(); 
	afx_msg void OnInstrument038(); 
	afx_msg void OnInstrument039(); 
	afx_msg void OnInstrument040(); 
	afx_msg void OnInstrument041(); 
	afx_msg void OnInstrument042(); 
	afx_msg void OnInstrument043(); 
	afx_msg void OnInstrument044(); 
	afx_msg void OnInstrument045(); 
	afx_msg void OnInstrument046(); 
	afx_msg void OnInstrument047(); 
	afx_msg void OnInstrument048(); 
	afx_msg void OnInstrument049(); 
	afx_msg void OnInstrument050(); 
	afx_msg void OnInstrument051(); 
	afx_msg void OnInstrument052(); 
	afx_msg void OnInstrument053(); 
	afx_msg void OnInstrument055(); 
	afx_msg void OnInstrument054(); 
	afx_msg void OnInstrument056(); 
	afx_msg void OnInstrument057(); 
	afx_msg void OnInstrument058(); 
	afx_msg void OnInstrument059(); 
	afx_msg void OnInstrument060(); 
	afx_msg void OnInstrument061(); 
	afx_msg void OnInstrument062(); 
	afx_msg void OnInstrument063(); 
	afx_msg void OnInstrument064(); 
	afx_msg void OnInstrument065(); 
	afx_msg void OnInstrument066(); 
	afx_msg void OnInstrument067(); 
	afx_msg void OnInstrument068(); 
	afx_msg void OnInstrument069(); 
	afx_msg void OnInstrument070(); 
	afx_msg void OnInstrument071(); 
	afx_msg void OnInstrument072(); 
	afx_msg void OnInstrument073(); 
	afx_msg void OnInstrument074(); 
	afx_msg void OnInstrument075(); 
	afx_msg void OnInstrument076(); 
	afx_msg void OnInstrument077(); 
	afx_msg void OnInstrument078(); 
	afx_msg void OnInstrument079(); 
	afx_msg void OnInstrument080(); 
	afx_msg void OnInstrument081(); 
	afx_msg void OnInstrument082(); 
	afx_msg void OnInstrument083(); 
	afx_msg void OnInstrument084(); 
	afx_msg void OnInstrument085(); 
	afx_msg void OnInstrument086(); 
	afx_msg void OnInstrument087(); 
	afx_msg void OnInstrument088(); 
	afx_msg void OnInstrument089(); 
	afx_msg void OnInstrument090(); 
	afx_msg void OnInstrument091(); 
	afx_msg void OnInstrument092(); 
	afx_msg void OnInstrument093(); 
	afx_msg void OnInstrument094(); 
	afx_msg void OnInstrument095(); 
	afx_msg void OnInstrument096(); 
	afx_msg void OnInstrument097(); 
	afx_msg void OnInstrument098(); 
	afx_msg void OnInstrument099(); 
	afx_msg void OnInstrument100(); 
	afx_msg void OnInstrument101(); 
	afx_msg void OnInstrument102(); 
	afx_msg void OnInstrument103(); 
	afx_msg void OnInstrument104(); 
	afx_msg void OnInstrument105(); 
	afx_msg void OnInstrument106(); 
	afx_msg void OnInstrument107(); 
	afx_msg void OnInstrument108(); 
	afx_msg void OnInstrument109(); 
	afx_msg void OnInstrument110(); 
	afx_msg void OnInstrument111(); 
	afx_msg void OnInstrument112(); 
	afx_msg void OnInstrument113();	  
	afx_msg void OnInstrument114(); 
	afx_msg void OnInstrument115(); 
	afx_msg void OnInstrument116(); 
	afx_msg void OnInstrument117(); 
	afx_msg void OnInstrument118(); 
	afx_msg void OnInstrument119(); 
	afx_msg void OnInstrument120(); 
	afx_msg void OnInstrument121(); 
	afx_msg void OnInstrument122(); 
	afx_msg void OnInstrument123(); 
	afx_msg void OnInstrument124(); 
	afx_msg void OnInstrument125(); 
	afx_msg void OnInstrument126(); 
	afx_msg void OnInstrument127(); 
	afx_msg void OnInstrument128(); 
	afx_msg void OnClickMainTitle(); 
	afx_msg void OnNoteLengthShort(); 
	afx_msg void OnNoteLengthLong(); 
	afx_msg void OnMainPopupNoteLength100(); 
	afx_msg void OnMainPopupNoteLength250(); 
	afx_msg void OnMainPopupNoteLength500(); 
	afx_msg void OnMainPopupNoteLength750(); 
	afx_msg void OnMainPopupNoteLength1000(); 
	afx_msg void OnMainPopupNoteLength1500(); 
	afx_msg void OnMainPopupNoteLength2000(); 
	afx_msg void OnMainPopupNoteLength3000(); 
	afx_msg void OnMainPopupNoteLength4000(); 
	afx_msg void OnMainPopupNoteLength5000(); 
	afx_msg void OnShowPreferences(); 
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); 
	afx_msg void OnDestroy(); 
	afx_msg void OnPerfectPitchCommand(); 
	afx_msg void OnRelativePitchCommand(); 
	afx_msg void OnChordsCommand(); 
	afx_msg void OnHelpCommand(); 
	afx_msg void OnGetOut(); 
	afx_msg void OnPitchTitle(); 
	DECLARE_EVENTSINK_MAP() 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
};