ESD configuration dialog and software volume control option for Gui

Patch by Paul Wilhelm Elsinghorst ( paul [at] uni-bonn de )


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14687 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2005-02-12 16:05:11 +00:00
parent 9a2b32ca82
commit f630d42c8a
6 changed files with 60 additions and 0 deletions

View File

@ -210,6 +210,9 @@ D
Egger, Christoph <christoph_egger@gmx.de> Egger, Christoph <christoph_egger@gmx.de>
* vo_ggi updates * vo_ggi updates
Elsinghorst, Paul Wilhelm <paul@uni-bonn.de>
* GUI: remote ESD support including software mixer
Ernesti, Bernd <mplayer@lists.veego.de> Ernesti, Bernd <mplayer@lists.veego.de>
* NetBSD support patches * NetBSD support patches

View File

@ -6,6 +6,7 @@
#include "../config.h" #include "../config.h"
#include "../mp_msg.h" #include "../mp_msg.h"
#include "../help_mp.h" #include "../help_mp.h"
#include "../mixer.h"
#include "../mplayer.h" #include "../mplayer.h"
#include "../m_config.h" #include "../m_config.h"
#include "../m_option.h" #include "../m_option.h"
@ -46,6 +47,9 @@ char * gtkAOALSADevice;
#ifdef HAVE_SDL #ifdef HAVE_SDL
char * gtkAOSDLDriver; char * gtkAOSDLDriver;
#endif #endif
#ifdef USE_ESD
char * gtkAOESDDevice;
#endif
int gtkCacheOn = 0; int gtkCacheOn = 0;
int gtkCacheSize = 2048; int gtkCacheSize = 2048;
@ -108,6 +112,7 @@ static m_option_t gui_opts[] =
{ "ao_driver",&audio_driver_list,CONF_TYPE_STRING_LIST,0,0,0,NULL }, { "ao_driver",&audio_driver_list,CONF_TYPE_STRING_LIST,0,0,0,NULL },
{ "ao_volnorm",&gtkAONorm,CONF_TYPE_FLAG,0,0,1,NULL }, { "ao_volnorm",&gtkAONorm,CONF_TYPE_FLAG,0,0,1,NULL },
{ "softvol",&soft_vol,CONF_TYPE_FLAG,0,0,1,NULL },
{ "ao_surround",&gtkAOSurround,CONF_TYPE_FLAG,0,0,1,NULL }, { "ao_surround",&gtkAOSurround,CONF_TYPE_FLAG,0,0,1,NULL },
{ "ao_extra_stereo",&gtkAOExtraStereo,CONF_TYPE_FLAG,0,0,1,NULL }, { "ao_extra_stereo",&gtkAOExtraStereo,CONF_TYPE_FLAG,0,0,1,NULL },
{ "ao_extra_stereo_coefficient",&gtkAOExtraStereoMul,CONF_TYPE_FLOAT,CONF_RANGE,-10,10,NULL }, { "ao_extra_stereo_coefficient",&gtkAOExtraStereoMul,CONF_TYPE_FLOAT,CONF_RANGE,-10,10,NULL },
@ -124,6 +129,9 @@ static m_option_t gui_opts[] =
#ifdef HAVE_SDL #ifdef HAVE_SDL
{ "ao_sdl_subdriver",&gtkAOSDLDriver,CONF_TYPE_STRING,0,0,0,NULL }, { "ao_sdl_subdriver",&gtkAOSDLDriver,CONF_TYPE_STRING,0,0,0,NULL },
#endif #endif
#ifdef USE_ESD
{ "ao_esd_device",&gtkAOESDDevice,CONF_TYPE_STRING,0,0,0,NULL },
#endif
{ "dvd_device",&dvd_device,CONF_TYPE_STRING,0,0,0,NULL }, { "dvd_device",&dvd_device,CONF_TYPE_STRING,0,0,0,NULL },
{ "cdrom_device",&cdrom_device,CONF_TYPE_STRING,0,0,0,NULL }, { "cdrom_device",&cdrom_device,CONF_TYPE_STRING,0,0,0,NULL },

View File

@ -25,6 +25,9 @@ extern char * gtkAOALSADevice;
#ifdef HAVE_SDL #ifdef HAVE_SDL
extern char * gtkAOSDLDriver; extern char * gtkAOSDLDriver;
#endif #endif
#ifdef USE_ESD
extern char * gtkAOESDDevice;
#endif
#ifdef HAVE_DXR3 #ifdef HAVE_DXR3
extern char * gtkDXR3Device; extern char * gtkDXR3Device;
#endif #endif

View File

@ -875,6 +875,19 @@ int guiGetEvent( int type,char * arg )
free(tmp); free(tmp);
} }
#endif #endif
#ifdef USE_ESD
if ( audio_driver_list && !gstrncmp( audio_driver_list[0],"esd",3 ) )
{
char *tmp;
if (gtkAOESDDevice) {
tmp = calloc( 1,strlen( gtkAOESDDevice ) + 10 );
sprintf( tmp,"esd:%s",gtkAOESDDevice );
} else
tmp = strdup("esd");
gaddlist( &audio_driver_list,tmp );
free(tmp);
}
#endif
// -- subtitle // -- subtitle
#ifdef USE_SUB #ifdef USE_SUB
//subdata->filename=gstrdup( guiIntfStruct.Subtitlename ); //subdata->filename=gstrdup( guiIntfStruct.Subtitlename );

View File

@ -52,6 +52,7 @@ static GtkWidget * CBAudioEqualizer;
//static GtkWidget * CBSurround; //static GtkWidget * CBSurround;
static GtkWidget * CBExtraStereo; static GtkWidget * CBExtraStereo;
static GtkWidget * CBNormalize; static GtkWidget * CBNormalize;
static GtkWidget * CBSoftwareMixer;
static GtkWidget * CBDoubleBuffer; static GtkWidget * CBDoubleBuffer;
static GtkWidget * CBDR; static GtkWidget * CBDR;
static GtkWidget * CBFramedrop; static GtkWidget * CBFramedrop;
@ -180,6 +181,7 @@ void ShowPreferences( void )
#endif #endif
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBExtraStereo ),gtkAOExtraStereo ); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBExtraStereo ),gtkAOExtraStereo );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNormalize ),gtkAONorm ); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNormalize ),gtkAONorm );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSoftwareMixer ),soft_vol );
gtk_adjustment_set_value( HSExtraStereoMuladj,gtkAOExtraStereoMul ); gtk_adjustment_set_value( HSExtraStereoMuladj,gtkAOExtraStereoMul );
{ {
int i = 0; int i = 0;
@ -207,6 +209,7 @@ void ShowPreferences( void )
gtk_widget_set_sensitive( AConfig,FALSE ); gtk_widget_set_sensitive( AConfig,FALSE );
if ( !strncmp( ao_driver[0],"oss",3 ) || if ( !strncmp( ao_driver[0],"oss",3 ) ||
!strncmp( ao_driver[0],"alsa",4 ) || !strncmp( ao_driver[0],"alsa",4 ) ||
!strncmp( ao_driver[0],"esd",3 ) ||
!strncmp( ao_driver[0],"sdl",3 ) ) !strncmp( ao_driver[0],"sdl",3 ) )
gtk_widget_set_sensitive( AConfig,TRUE ); gtk_widget_set_sensitive( AConfig,TRUE );
} }
@ -407,6 +410,7 @@ void ShowPreferences( void )
// -- signals // -- signals
gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)0 ); gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)0 );
gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)1 ); gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)1 );
gtk_signal_connect( GTK_OBJECT( CBSoftwareMixer ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)1 );
gtk_signal_connect( GTK_OBJECT( CBAudioEqualizer ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)2 ); gtk_signal_connect( GTK_OBJECT( CBAudioEqualizer ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)2 );
gtk_signal_connect( GTK_OBJECT( CBShowVideoWindow ),"toggled",GTK_SIGNAL_FUNC( prToggled ), (void*)3 ); gtk_signal_connect( GTK_OBJECT( CBShowVideoWindow ),"toggled",GTK_SIGNAL_FUNC( prToggled ), (void*)3 );
#ifdef HAVE_FREETYPE #ifdef HAVE_FREETYPE
@ -509,6 +513,7 @@ void prButton( GtkButton * button,gpointer user_data )
gtkEnableAudioEqualizer=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBAudioEqualizer ) ); gtkEnableAudioEqualizer=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBAudioEqualizer ) );
gtkAOExtraStereo=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBExtraStereo ) ); gtkAOExtraStereo=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBExtraStereo ) );
gtkAONorm=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNormalize ) ); gtkAONorm=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNormalize ) );
soft_vol=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBSoftwareMixer ) );
gtkSet( gtkSetExtraStereo,HSExtraStereoMuladj->value,NULL ); gtkSet( gtkSetExtraStereo,HSExtraStereoMuladj->value,NULL );
audio_delay=HSAudioDelayadj->value; audio_delay=HSAudioDelayadj->value;
@ -605,6 +610,7 @@ void prButton( GtkButton * button,gpointer user_data )
gtk_widget_set_sensitive( AConfig,FALSE ); gtk_widget_set_sensitive( AConfig,FALSE );
if ( !strncmp( ao_driver[0],"oss",3 ) || if ( !strncmp( ao_driver[0],"oss",3 ) ||
!strncmp( ao_driver[0],"alsa",4 ) || !strncmp( ao_driver[0],"alsa",4 ) ||
!strncmp( ao_driver[0],"esd",3 ) ||
!strncmp( ao_driver[0],"sdl",3 ) ) { !strncmp( ao_driver[0],"sdl",3 ) ) {
ShowAudioConfig(); ShowAudioConfig();
gtk_widget_set_sensitive( AConfig,TRUE ); gtk_widget_set_sensitive( AConfig,TRUE );
@ -727,6 +733,7 @@ static void prCListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,g
gtk_widget_set_sensitive( AConfig,FALSE ); gtk_widget_set_sensitive( AConfig,FALSE );
if ( !strncmp( ao_driver[0],"oss",3 ) || if ( !strncmp( ao_driver[0],"oss",3 ) ||
!strncmp( ao_driver[0],"alsa",4 ) || !strncmp( ao_driver[0],"alsa",4 ) ||
!strncmp( ao_driver[0],"esd",3 ) ||
!strncmp( ao_driver[0],"sdl",3 ) ) !strncmp( ao_driver[0],"sdl",3 ) )
gtk_widget_set_sensitive( AConfig,TRUE ); gtk_widget_set_sensitive( AConfig,TRUE );
break; break;
@ -836,6 +843,7 @@ GtkWidget * create_Preferences( void )
CBNormalize=AddCheckButton( MSGTR_PREFERENCES_NormalizeSound,vbox3 ); CBNormalize=AddCheckButton( MSGTR_PREFERENCES_NormalizeSound,vbox3 );
CBAudioEqualizer=AddCheckButton( MSGTR_PREFERENCES_EnEqualizer,vbox3 ); CBAudioEqualizer=AddCheckButton( MSGTR_PREFERENCES_EnEqualizer,vbox3 );
CBSoftwareMixer=AddCheckButton( MSGTR_PREFERENCES_SoftwareMixer,vbox3 );
#if 0 #if 0
CBSurround=AddCheckButton( "Enable surround",vbox3 ); CBSurround=AddCheckButton( "Enable surround",vbox3 );
#endif #endif
@ -1253,6 +1261,7 @@ GtkWidget * create_Preferences( void )
#if 0 #if 0
gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( on_CBNormalize_toggled ),NULL ); gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( on_CBNormalize_toggled ),NULL );
gtk_signal_connect( GTK_OBJECT( CBSoftwareMixer ),"toggled",GTK_SIGNAL_FUNC( on_CBSoftwareMixer_toggled ),NULL );
gtk_signal_connect( GTK_OBJECT( CBSurround ),"toggled",GTK_SIGNAL_FUNC( on_CBSurround_toggled ),NULL ); gtk_signal_connect( GTK_OBJECT( CBSurround ),"toggled",GTK_SIGNAL_FUNC( on_CBSurround_toggled ),NULL );
gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( on_CBExtraStereo_toggled ),NULL ); gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( on_CBExtraStereo_toggled ),NULL );
gtk_signal_connect( GTK_OBJECT( CBDoubleBuffer ),"toggled",GTK_SIGNAL_FUNC( on_CBDoubleBuffer_toggled ),NULL ); gtk_signal_connect( GTK_OBJECT( CBDoubleBuffer ),"toggled",GTK_SIGNAL_FUNC( on_CBDoubleBuffer_toggled ),NULL );
@ -1382,6 +1391,14 @@ GList *appendSDLDevices(GList *l) {
} }
#endif #endif
#ifdef USE_ESD
GList *appendESDDevices(GList *l) {
l = g_list_append(l, (gpointer)"Enter Remote IP");
l = g_list_append(l, (gpointer)"Use Software Mixer");
return l;
}
#endif
// Gets text string from a gtk entry, interpreting // Gets text string from a gtk entry, interpreting
// MSGTR_PREFERENCES_DriverDefault as null string. // MSGTR_PREFERENCES_DriverDefault as null string.
char *getGtkEntryText(GtkWidget *from) { char *getGtkEntryText(GtkWidget *from) {
@ -1434,6 +1451,11 @@ void ShowAudioConfig() {
setGtkEntryText(CEAudioDevice, gtkAOSDLDriver); setGtkEntryText(CEAudioDevice, gtkAOSDLDriver);
} }
#endif #endif
#ifdef USE_ESD
if (strncmp(ao_driver[0], "esd", 3) == 0) {
setGtkEntryText(CEAudioDevice, gtkAOESDDevice);
}
#endif
gtk_widget_show(AudioConfig); gtk_widget_show(AudioConfig);
gtkSetLayer(AudioConfig); gtkSetLayer(AudioConfig);
@ -1474,6 +1496,12 @@ static void audioButton(GtkButton *button, gpointer user_data) {
gfree(&gtkAOSDLDriver); gfree(&gtkAOSDLDriver);
gtkAOSDLDriver = gstrdup(getGtkEntryText(CEAudioDevice)); gtkAOSDLDriver = gstrdup(getGtkEntryText(CEAudioDevice));
} }
#endif
#ifdef USE_ESD
if (strncmp(ao_driver[0], "esd", 3) == 0) {
gfree(&gtkAOESDDevice);
gtkAOESDDevice = gstrdup(getGtkEntryText(CEAudioDevice));
}
#endif #endif
case 0: case 0:
HideAudioConfig(); HideAudioConfig();
@ -1524,6 +1552,10 @@ GtkWidget *create_AudioConfig() {
#ifdef HAVE_SDL #ifdef HAVE_SDL
if (strncmp(ao_driver[0], "sdl", 3) == 0) if (strncmp(ao_driver[0], "sdl", 3) == 0)
items = appendSDLDevices(items); items = appendSDLDevices(items);
#endif
#ifdef USE_ESD
if (strncmp(ao_driver[0], "esd", 3) == 0)
items = appendESDDevices(items);
#endif #endif
gtk_combo_set_popdown_strings(GTK_COMBO(CBAudioDevice), items); gtk_combo_set_popdown_strings(GTK_COMBO(CBAudioDevice), items);
g_list_free(items); g_list_free(items);

View File

@ -735,6 +735,7 @@ static char help_text[]=
#define MSGTR_PREFERENCES_DoNotPlaySound "Do not play sound" #define MSGTR_PREFERENCES_DoNotPlaySound "Do not play sound"
#define MSGTR_PREFERENCES_NormalizeSound "Normalize sound" #define MSGTR_PREFERENCES_NormalizeSound "Normalize sound"
#define MSGTR_PREFERENCES_EnEqualizer "Enable equalizer" #define MSGTR_PREFERENCES_EnEqualizer "Enable equalizer"
#define MSGTR_PREFERENCES_SoftwareMixer "Enable Software Mixer"
#define MSGTR_PREFERENCES_ExtraStereo "Enable extra stereo" #define MSGTR_PREFERENCES_ExtraStereo "Enable extra stereo"
#define MSGTR_PREFERENCES_Coefficient "Coefficient:" #define MSGTR_PREFERENCES_Coefficient "Coefficient:"
#define MSGTR_PREFERENCES_AudioDelay "Audio delay" #define MSGTR_PREFERENCES_AudioDelay "Audio delay"