00001 #if !defined(COMMAND_H)
00002 #define COMMAND_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 enum CommandType {PLAY_ONE_SHOT_SAMPLE,START_RECORDING,STOP_RECORDING};
00015
00016
00017 struct PlaySampleSoundCommand
00018 {
00019 int channel;
00020 int frequency;
00021 void* data;
00022 int length;
00023 int volume;
00024 };
00025
00026
00027 struct StartRecordingCommand
00028 {
00029 u8* buffer;
00030 int length;
00031 };
00032
00033
00034
00035 struct Command {
00036 enum CommandType commandType;
00037 union {
00038 void* data;
00039 struct PlaySampleSoundCommand playSample;
00040 struct StartRecordingCommand startRecording;
00041 };
00042 };
00043
00044
00045 #define MAX_COMMANDS 20
00046
00047
00048
00049
00050 typedef struct CommandControl {
00051 struct Command command[MAX_COMMANDS];
00052 int currentCommand;
00053 int return_data;
00054 }CommandControl;
00055
00056
00057 #define commandControl ((CommandControl*)((uint32)(IPC) + sizeof(TransferRegion)))
00058
00059 #if defined(ARM9)
00060 void PA_MicInit();
00061 void PA_PlaySample(int channel, int frequency, void* data, int length, int volume);
00062 void PA_StartRecording(u8* buffer, int length);
00063 int PA_StopRecording();
00064 int PA_GetMicVol();
00065 #endif
00066
00067 #if defined(ARM7)
00068 void CommandProcessCommands();
00069 #endif
00070
00071 #endif