mirror of
https://github.com/reactos/reactos.git
synced 2024-08-07 19:58:21 +00:00
MIDI / MPU401 output test application.
This just opens the first MIDI device, which at present should be the one provided by mpu401.sys (via mmdrv.dll), and plays a note. svn path=/trunk/; revision=7925
This commit is contained in:
parent
549c9ff77e
commit
47fe4c6cf3
6
reactos/apps/tests/miditest/.cvsignore
Normal file
6
reactos/apps/tests/miditest/.cvsignore
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
*.o
|
||||||
|
*.d
|
||||||
|
*.exe
|
||||||
|
*.coff
|
||||||
|
*.sym
|
||||||
|
*.map
|
23
reactos/apps/tests/miditest/makefile
Normal file
23
reactos/apps/tests/miditest/makefile
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
PATH_TO_TOP = ../../..
|
||||||
|
|
||||||
|
TARGET_NORC = yes
|
||||||
|
|
||||||
|
TARGET_TYPE = program
|
||||||
|
|
||||||
|
TARGET_APPTYPE = console
|
||||||
|
|
||||||
|
TARGET_NAME = miditest
|
||||||
|
|
||||||
|
TARGET_SDKLIBS = winmm.a
|
||||||
|
|
||||||
|
TARGET_GCCLIBS =
|
||||||
|
|
||||||
|
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||||
|
|
||||||
|
TARGET_CFLAGS = -Wall -Werror
|
||||||
|
|
||||||
|
include $(PATH_TO_TOP)/rules.mak
|
||||||
|
|
||||||
|
include $(TOOLS_PATH)/helper.mk
|
||||||
|
|
||||||
|
# EOF
|
52
reactos/apps/tests/miditest/miditest.c
Normal file
52
reactos/apps/tests/miditest/miditest.c
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
#include <windows.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <mmsystem.h>
|
||||||
|
|
||||||
|
// WINE's mmsystem.h doesn't seem to define these properly:
|
||||||
|
|
||||||
|
#define MIDIOUTCAPS MIDIOUTCAPSA
|
||||||
|
#define MIDIINCAPS MIDIINCAPSA
|
||||||
|
#undef midiOutGetDevCaps
|
||||||
|
#define midiOutGetDevCaps midiOutGetDevCapsA
|
||||||
|
#undef midiInGetDevCaps
|
||||||
|
#define midiInGetDevCaps midiInGetDevCapsA
|
||||||
|
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
UINT outs = midiOutGetNumDevs();
|
||||||
|
// UINT ins = midiInGetNumDevs();
|
||||||
|
|
||||||
|
MIDIOUTCAPS outcaps;
|
||||||
|
// MIDIINCAPS incaps;
|
||||||
|
|
||||||
|
int c;
|
||||||
|
|
||||||
|
printf("MIDI output devices: %d\n", outs);
|
||||||
|
|
||||||
|
for (c = 0; c < outs; c ++)
|
||||||
|
{
|
||||||
|
if (midiOutGetDevCaps(c, &outcaps, sizeof(MIDIOUTCAPS)) == MMSYSERR_NOERROR)
|
||||||
|
printf("Device #%d: %s\n", c, outcaps.szPname);
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("Opening MIDI output #0\n");
|
||||||
|
|
||||||
|
HMIDIOUT Handle = NULL;
|
||||||
|
UINT Result = midiOutOpen(&Handle, 0, 0, 0, CALLBACK_NULL);
|
||||||
|
printf("Result == %d Handle == %d\n", Result, (int)Handle);
|
||||||
|
|
||||||
|
// play something:
|
||||||
|
midiOutShortMsg(Handle, 0x007f3090);
|
||||||
|
|
||||||
|
/*
|
||||||
|
printf("\nMIDI input devices: %d\n", ins);
|
||||||
|
|
||||||
|
for (c = 0; c < ins; c ++)
|
||||||
|
{
|
||||||
|
midiInGetDevCaps(c, &incaps, sizeof(incaps));
|
||||||
|
printf("Device #%d: %s\n", c, incaps.szPname);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
|
}
|
30
reactos/apps/tests/miditest/miditest.rc
Normal file
30
reactos/apps/tests/miditest/miditest.rc
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
#include <defines.h>
|
||||||
|
#include <reactos/resource.h>
|
||||||
|
#include "resource.h"
|
||||||
|
|
||||||
|
IDR_MAINMENU MENU DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
POPUP "&File"
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "&New", ID_FILE_NEW
|
||||||
|
MENUITEM "&Open...", ID_FILE_OPEN
|
||||||
|
MENUITEM "Save &As...", ID_FILE_SAVEAS, GRAYED
|
||||||
|
MENUITEM SEPARATOR
|
||||||
|
MENUITEM "&Close", ID_FILE_CLOSE, GRAYED
|
||||||
|
MENUITEM SEPARATOR
|
||||||
|
MENUITEM "E&xit", ID_FILE_EXIT
|
||||||
|
END
|
||||||
|
POPUP "&Edit", GRAYED
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "C&ut", ID_EDIT_CUT
|
||||||
|
MENUITEM "&Copy", ID_EDIT_COPY
|
||||||
|
MENUITEM "&Paste", ID_EDIT_PASTE
|
||||||
|
END
|
||||||
|
POPUP "&Window", GRAYED
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "&Tile", ID_WINDOW_TILE
|
||||||
|
MENUITEM "&Cascade", ID_WINDOW_CASCADE
|
||||||
|
END
|
||||||
|
END
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue