Poor man's mic fake implementation, don't expect it to be similar to a blow it's just noise or not.

This commit is contained in:
riccardom 2009-04-25 10:21:10 +00:00
parent c89f3a86bd
commit 61e4c0bddc
3 changed files with 23 additions and 2 deletions

View File

@ -40,6 +40,7 @@
#include "debug.h" #include "debug.h"
#include "rasterize.h" #include "rasterize.h"
#include "saves.h" #include "saves.h"
#include "mic.h"
#ifdef GDB_STUB #ifdef GDB_STUB
#include "gdbstub.h" #include "gdbstub.h"
@ -115,6 +116,7 @@ static void MenuSave(GtkMenuItem *item, gpointer slot);
static void MenuLoad(GtkMenuItem *item, gpointer slot); static void MenuLoad(GtkMenuItem *item, gpointer slot);
static void About();//GtkWidget* widget, gpointer data); static void About();//GtkWidget* widget, gpointer data);
static void desmume_gtk_disable_audio (GtkToggleAction *action); static void desmume_gtk_disable_audio (GtkToggleAction *action);
static void desmume_gtk_mic_noise (GtkToggleAction *action);
static void Modify_Layer(GtkToggleAction* action, gpointer data); static void Modify_Layer(GtkToggleAction* action, gpointer data);
static const char *ui_description = static const char *ui_description =
@ -154,6 +156,7 @@ static const char *ui_description =
" <menuitem action='pause'/>" " <menuitem action='pause'/>"
" <menuitem action='reset'/>" " <menuitem action='reset'/>"
" <menuitem action='enableaudio'/>" " <menuitem action='enableaudio'/>"
" <menuitem action='micnoise'/>"
" <menu action='FrameskipMenu'>" " <menu action='FrameskipMenu'>"
" <menuitem action='frameskip0'/>" " <menuitem action='frameskip0'/>"
" <menuitem action='frameskip1'/>" " <menuitem action='frameskip1'/>"
@ -234,7 +237,8 @@ static const GtkActionEntry action_entries[] = {
}; };
static const GtkToggleActionEntry toggle_entries[] = { static const GtkToggleActionEntry toggle_entries[] = {
{ "enableaudio", NULL, "_Enable audio", NULL, NULL, G_CALLBACK(desmume_gtk_disable_audio), TRUE}//, { "enableaudio", NULL, "_Enable audio", NULL, NULL, G_CALLBACK(desmume_gtk_disable_audio), TRUE},
{ "micnoise", NULL, "_Fake mic noise", NULL, NULL, G_CALLBACK(desmume_gtk_mic_noise), FALSE}//,
}; };
static const GtkRadioActionEntry frameskip_entries[] = { static const GtkRadioActionEntry frameskip_entries[] = {
@ -1455,6 +1459,11 @@ static void desmume_gtk_disable_audio (GtkToggleAction *action)
} }
} }
static void desmume_gtk_mic_noise (GtkToggleAction *action)
{
Mic_DoNoise((BOOL)gtk_toggle_action_get_active(action));
}
#if 0 #if 0
static void desmume_gtk_menu_config (GtkWidget *pMenuBar, int act_savetype) static void desmume_gtk_menu_config (GtkWidget *pMenuBar, int act_savetype)
{ {

View File

@ -3,6 +3,8 @@
#include "types.h" #include "types.h"
#include "mic.h" #include "mic.h"
static BOOL silence = TRUE;
BOOL Mic_Init() BOOL Mic_Init()
{ {
return TRUE; return TRUE;
@ -18,7 +20,15 @@ void Mic_DeInit()
u8 Mic_ReadSample() u8 Mic_ReadSample()
{ {
return 0; if (silence)
return 0;
return 150;
}
void Mic_DoNoise(BOOL noise)
{
silence = !noise;
} }
#endif #endif

View File

@ -6,6 +6,8 @@ extern int MicButtonPressed;
static char MicSampleName[256]; static char MicSampleName[256];
char* LoadSample(const char *name); char* LoadSample(const char *name);
extern int MicDisplay; extern int MicDisplay;
#else
void Mic_DoNoise(BOOL);
#endif #endif
BOOL Mic_Init(); BOOL Mic_Init();