source: trunk/src/winmm/MIDI.HPP@ 10366

Last change on this file since 10366 was 46, checked in by sandervl, 26 years ago

* empty log message *

File size: 2.4 KB
Line 
1/*
2 * RTMIDI code
3 *
4 * Copyright 1998 Joel Troster
5 *
6 *
7 * Project Odin Software License can be found in LICENSE.TXT
8 *
9 */
10#ifndef _MIDI_HPP_
11#define _MIDI_HPP_
12
13#include "misc.h"
14#include "winmm.h"
15#include "irtmidi.hpp"
16
17// The Midi class represent a win32 midi device.
18class Midi
19{
20 public:
21 Midi( UINT uDeviceId );
22 virtual ~Midi();
23 UINT device() const
24 { return iDeviceId; };
25 void setCallback( DWORD dwCallback,
26 DWORD dwCallbackInstance,
27 DWORD dwflags );
28 virtual MMRESULT open()=0;
29 virtual MMRESULT close()=0;
30 void callback( UINT msg, DWORD p1, DWORD p2);
31
32 protected:
33 UINT iDeviceId;
34 IMidiInstance * iHwdInstance; // The Hardware Instance that this connected to
35 IAppMidiInstance* iAppInstance;
36
37 LPDRVCALLBACK iCallbackFunction;
38 HWND iCallbackWindow;
39 DWORD iCallbackInstance;
40};
41
42class MidiIn : public Midi
43{
44 public:
45 MidiIn( UINT uDeviceId );
46 virtual ~MidiIn();
47 virtual MMRESULT open();
48 virtual MMRESULT start();
49 virtual MMRESULT stop();
50 virtual MMRESULT close();
51 void getMessages();
52 static MidiIn* find( HMIDIIN );
53 static MidiIn* find( UINT uDeviceId );
54 private:
55 IAppMidiInstance* iAppInstance;
56 unsigned long iStartTime;
57 int iThreadId;
58 BOOL iRunning;
59 static MidiIn* iFirst; // First in linked list of MidiIn devices
60 MidiIn* iNext; // Next in linked list of handles
61};
62
63class MidiOut : public Midi
64{
65 public:
66 MidiOut( UINT uDeviceId );
67 virtual ~MidiOut();
68 virtual MMRESULT open();
69 virtual MMRESULT close();
70 virtual MMRESULT sendMessage( DWORD msg ) const;
71 virtual MMRESULT sendSysexMessage( BYTE* msg, ULONG msgLen ) const;
72 virtual MMRESULT sendVolume( DWORD volume ) const;
73 virtual DWORD getVolume() const;
74 static MidiOut* find( HMIDIOUT );
75 static MidiOut* find( UINT uDeviceId );
76 protected:
77 static MidiOut* iFirst; // First in linked list of MidiOut devices
78 MidiOut* iNext; // Next in linked list of handles
79 DWORD iVolume;
80};
81
82class MidiMapper : public MidiOut
83{
84 public:
85 MidiMapper();
86 virtual ~MidiMapper();
87 virtual MMRESULT open();
88 virtual MMRESULT close();
89 virtual MMRESULT sendMessage( DWORD msg ) const;
90 virtual MMRESULT sendSysexMessage( BYTE* msg, ULONG msgLen ) const;
91 private:
92};
93
94#endif
Note: See TracBrowser for help on using the repository browser.