rewrite eq interface and add *.rm to fs

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7218 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
pontscho 2002-09-01 11:28:18 +00:00
parent 30c502e5ce
commit acc08a36ec
6 changed files with 39 additions and 54 deletions

View File

@ -4,7 +4,7 @@ LIB = libgui.a
include ../config.mak
include config.mak
INCDIR = -I. -I./event -I./wm -I./skin $(GTKINC) $(EXTRA_INC) $(FREETYPE_INC)
INCDIR = -I. -I../loader -I./wm -I./skin $(GTKINC) $(EXTRA_INC) $(FREETYPE_INC)
OPTIMIZE = $(OPTFLAGS) -fomit-frame-pointer \
-fexpensive-optimizations -fschedule-insns2 -Wall

View File

@ -36,6 +36,8 @@
#include "../libmpdemux/stream.h"
#include "../libmpdemux/demuxer.h"
#include "../libmpdemux/stheader.h"
#include "../libmpcodecs/dec_video.h"
guiInterface_t guiIntfStruct;
@ -175,20 +177,6 @@ int guiCMDArray[] =
evSkinBrowser
};
typedef struct
{
demux_stream_t *ds;
unsigned int format;
struct codecs_st *codec;
int inited;
// output format:
float timer;
float fps;
float frametime;
int i_bps;
int disp_w,disp_h;
} tmp_sh_video_t;
extern ao_functions_t * audio_out;
extern vo_functions_t * video_out;
extern int frame_dropping;
@ -436,18 +424,11 @@ int guiGetEvent( int type,char * arg )
break;
case guiSetValues:
// -- video
guiIntfStruct.sh_video=arg;
if ( arg )
{
tmp_sh_video_t * sh = (tmp_sh_video_t *)arg;
sh_video_t * sh = (sh_video_t *)arg;
guiIntfStruct.FPS=sh->fps;
if ( vo_gamma_brightness == 1000 )
{ vo_gamma_brightness=0; get_video_colors( (void *)arg,"brightness",&vo_gamma_brightness ); }
if ( vo_gamma_contrast == 1000 )
{ vo_gamma_contrast=0; get_video_colors( (void *)arg,"contrast",&vo_gamma_contrast ); }
if ( vo_gamma_hue == 1000 )
{ vo_gamma_hue=0; get_video_colors( (void *)arg,"hue",&vo_gamma_hue ); }
if ( vo_gamma_saturation == 1000 )
{ vo_gamma_saturation=0; get_video_colors( (void *)arg,"saturation",&vo_gamma_saturation ); }
}
if ( guiIntfStruct.NoWindow ) wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow );
@ -619,7 +600,6 @@ void list( void )
void * gtkSet( int cmd,float fparam, void * vparam )
{
mp_cmd_t * mp_cmd;
equalizer_t * eq = (equalizer_t *)vparam;
plItem * item = (plItem *)vparam;
@ -775,31 +755,30 @@ void * gtkSet( int cmd,float fparam, void * vparam )
audio_delay=gtkAODelay=fparam;
return NULL;
case gtkSetPanscan:
mp_cmd=(mp_cmd_t *)calloc( 1,sizeof( *mp_cmd ) );
mp_cmd->id=MP_CMD_PANSCAN; mp_cmd->name=strdup( "panscan" );
mp_cmd->args[0].v.f=fparam; mp_cmd->args[1].v.i=1;
mp_input_queue_cmd( mp_cmd );
{
mp_cmd_t * mp_cmd;
mp_cmd=(mp_cmd_t *)calloc( 1,sizeof( *mp_cmd ) );
mp_cmd->id=MP_CMD_PANSCAN; mp_cmd->name=strdup( "panscan" );
mp_cmd->args[0].v.f=fparam; mp_cmd->args[1].v.i=1;
mp_input_queue_cmd( mp_cmd );
}
return NULL;
case gtkSetAutoq:
auto_quality=(int)fparam;
return NULL;
// --- set equalizers
case gtkSetContrast:
mp_cmd=(mp_cmd_t *)calloc( 1,sizeof( *mp_cmd ) );
mp_cmd->id=MP_CMD_CONTRAST; mp_cmd->name=strdup( "contrast" );
break;
if ( guiIntfStruct.sh_video ) set_video_colors( guiIntfStruct.sh_video,"contrast",(int)fparam );
return NULL;
case gtkSetBrightness:
mp_cmd=(mp_cmd_t *)calloc( 1,sizeof( *mp_cmd ) );
mp_cmd->id=MP_CMD_BRIGHTNESS; mp_cmd->name=strdup( "brightness" );
break;
if ( guiIntfStruct.sh_video ) set_video_colors( guiIntfStruct.sh_video,"brightness",(int)fparam );
return NULL;
case gtkSetHue:
mp_cmd=(mp_cmd_t *)calloc( 1,sizeof( *mp_cmd ) );
mp_cmd->id=MP_CMD_HUE; mp_cmd->name=strdup( "hue" );
break;
if ( guiIntfStruct.sh_video ) set_video_colors( guiIntfStruct.sh_video,"hue",(int)fparam );
return NULL;
case gtkSetSaturation:
mp_cmd=(mp_cmd_t *)calloc( 1,sizeof( *mp_cmd ) );
mp_cmd->id=MP_CMD_SATURATION; mp_cmd->name=strdup( "saturation" );
break;
if ( guiIntfStruct.sh_video ) set_video_colors( guiIntfStruct.sh_video,"saturation",(int)fparam );
return NULL;
case gtkSetEqualizer:
if ( eq )
{
@ -815,10 +794,6 @@ void * gtkSet( int cmd,float fparam, void * vparam )
{ tmp.channel=i; tmp.band=j; audio_plugin_eq.control( AOCONTROL_PLUGIN_EQ_SET_GAIN,(int)&tmp ); }
}
return NULL;
default: return NULL;
}
mp_cmd->args[0].v.i=(int)fparam;
mp_cmd->args[1].v.i=1;
mp_input_queue_cmd( mp_cmd );
return NULL;
}

View File

@ -57,8 +57,10 @@ typedef struct
guiResizeStruct resize;
guiVideoStruct videodata;
guiUnknowErrorStruct error;
void * sh_video;
int DiskChanged;
int DiskChanged;
#ifdef USE_DVDREAD
guiDVDStruct DVD;

View File

@ -66,6 +66,14 @@ static void eqSetBands( int channel )
gtk_adjustment_set_value( A8000adj,0.0f - gtkEquChannels[channel][8] );
gtk_adjustment_set_value( A16000adj,0.0f - gtkEquChannels[channel][9] );
if ( guiIntfStruct.sh_video )
{
get_video_colors( guiIntfStruct.sh_video,"brightness",&vo_gamma_brightness );
get_video_colors( guiIntfStruct.sh_video,"contrast",&vo_gamma_contrast );
get_video_colors( guiIntfStruct.sh_video,"hue",&vo_gamma_hue );
get_video_colors( guiIntfStruct.sh_video,"saturation",&vo_gamma_saturation );
}
gtk_adjustment_set_value( VContrastadj,(float)vo_gamma_contrast );
gtk_adjustment_set_value( VBrightnessadj,(float)vo_gamma_brightness );
gtk_adjustment_set_value( VHueadj,(float)vo_gamma_hue );
@ -111,12 +119,7 @@ void ShowEqualizer( void )
eqSetChannelNames();
VContrastadj->value=(float)vo_gamma_contrast;
VBrightnessadj->value=(float)vo_gamma_brightness;
VHueadj->value=(float)vo_gamma_hue;
VSaturationadj->value=(float)vo_gamma_saturation;
if ( !guiIntfStruct.Playing )
if ( !guiIntfStruct.Playing || !guiIntfStruct.sh_video )
{
gtk_widget_set_sensitive( VContrast,FALSE );
gtk_widget_set_sensitive( VBrightness,FALSE );
@ -215,7 +218,6 @@ static void eqButtonReleased( GtkButton * button,gpointer user_data )
gtkSet( gtkSetBrightness,0.0f,NULL );
gtkSet( gtkSetHue,0.0f,NULL );
gtkSet( gtkSetSaturation,0.0f,NULL );
vo_gamma_brightness=vo_gamma_contrast=vo_gamma_hue=vo_gamma_saturation=0;
eqSetBands( Channel );
}
break;
@ -231,6 +233,9 @@ gboolean eqDestroy( GtkWidget * widget,GdkEvent * event,gpointer user_data )
static void eqShow( GtkWidget * widget,gpointer user_data )
{ gtkVEqualizer=(int)user_data; }
static void eqFocus( GtkWindow * window,GtkWidget * widget,gpointer user_data )
{ eqSetBands( Channel ); }
static void eqSelectChannelsListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data )
{
Channel=row - 1;
@ -708,6 +713,8 @@ GtkWidget * create_Equalizer( void )
gtk_signal_connect( GTK_OBJECT( Equalizer ),"destroy",GTK_SIGNAL_FUNC( eqDestroy ),NULL );
gtk_signal_connect( GTK_OBJECT( Equalizer ),"show",GTK_SIGNAL_FUNC( eqShow ),(void *)1 );
gtk_signal_connect( GTK_OBJECT( Equalizer ),"hide",GTK_SIGNAL_FUNC( eqShow ),(void *)0 );
gtk_signal_connect( GTK_OBJECT( Equalizer ),"focus_in_event",GTK_SIGNAL_FUNC( eqFocus ),(void *)2 );
gtk_signal_connect( GTK_OBJECT( ChannelsList ),"select_row",GTK_SIGNAL_FUNC( eqSelectChannelsListRow ),NULL );
gtk_signal_connect( GTK_OBJECT( A3125 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)0 );

View File

@ -48,6 +48,7 @@ char * fsVideoFilterNames[][2] =
{ "QT files (*.mov)", "*.mov" },
{ "ASF files (*.asf)", "*.asf" },
{ "VIVO files (*.viv)", "*.viv" },
{ "RealVideo files (*.rm)", "*.rm" },
{ "Windows Media Video (*.wmv)", "*.wmv" },
{ "MP3 files (*.mp3,mp2)", "*.mp3,*.mp2" },
{ "Wave files (*.wav)", "*.wav" },

View File

@ -655,7 +655,7 @@ GtkWidget * create_Preferences( void )
#endif
gtk_window_set_title( GTK_WINDOW( Preferences ),MSGTR_Preferences );
gtk_window_set_position( GTK_WINDOW( Preferences ),GTK_WIN_POS_CENTER );
gtk_window_set_policy( GTK_WINDOW( Preferences ),FALSE,FALSE,FALSE );
// gtk_window_set_policy( GTK_WINDOW( Preferences ),FALSE,FALSE,FALSE );
gtk_window_set_wmclass( GTK_WINDOW( Preferences ),"Preferences","MPlayer" );
gtk_widget_realize( Preferences );