add a "shut up" feature which kills all the active voices without otherwise interrupting the spu. handy for shutting up streaming sounds. hook it up in windows.

This commit is contained in:
zeromus 2009-03-31 22:11:00 +00:00
parent d1ccf402ad
commit 80296899f2
5 changed files with 16 additions and 1 deletions

View File

@ -258,6 +258,11 @@ void SPU_DeInit(void)
//////////////////////////////////////////////////////////////////////////////
void SPU_struct::ShutUp()
{
for(int i=0;i<16;i++)
channels[i].status = CHANSTAT_STOPPED;
}
void SPU_struct::KeyOn(int channel)
{

View File

@ -87,6 +87,9 @@ public:
void WriteByte(u32 addr, u8 val);
void WriteWord(u32 addr, u16 val);
void WriteLong(u32 addr, u32 val);
//kills all channels but leaves SPU otherwise running normally
void ShutUp();
};
int SPU_ChangeSoundCore(int coreid, int buffersize);
@ -105,7 +108,7 @@ u32 SPU_ReadLong(u32 addr);
void SPU_Emulate_core(void);
void SPU_Emulate_user(void);
extern SPU_struct *SPU_core;
extern SPU_struct *SPU_core, *SPU_user;
extern int spu_core_samples;
void spu_savestate(std::ostream* os);

View File

@ -2375,6 +2375,9 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
}
switch(LOWORD(wParam))
{
case IDM_SHUT_UP:
if(SPU_user) SPU_user->ShutUp();
return 0;
case IDM_QUIT:
DestroyWindow(hwnd);
return 0;

View File

@ -412,8 +412,10 @@
#define IDC_FRAMELIMIT 40005
#define IDC_WINDOW1_5X 40006
#define IDM_WIFISETTINGS 40007
#define IDM__1 40008
#define ID_VIEW_FRAMECOUNTER 40009
#define ID_VIEW_DISPLAYFPS 40010
#define IDM_SHUT_UP 40011
#define IDM_FILE_RECORDAVI 40015
#define IDM_FILE_STOPAVI 40016
#define ACCEL_CTRL_O 40032

View File

@ -243,6 +243,8 @@ BEGIN
MENUITEM "&Pause", IDM_PAUSE
MENUITEM "&Reset", IDM_RESET
MENUITEM SEPARATOR
MENUITEM "Shut Up", IDM_SHUT_UP
MENUITEM SEPARATOR
MENUITEM "GBA &slot", IDM_GBASLOT
POPUP "&Cheats"
BEGIN