mirror of
https://github.com/mpv-player/mpv
synced 2025-04-18 13:16:43 +00:00
- fix equ handling
- fix dvd pos bar - fix 10l bug in evLoadPlay bugfix :) - mittomen git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6913 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
8d45b64a65
commit
a04e780da0
@ -18,7 +18,6 @@
|
|||||||
// --- params
|
// --- params
|
||||||
|
|
||||||
int gtkEnableAudioEqualizer = 0;
|
int gtkEnableAudioEqualizer = 0;
|
||||||
int gtkEnableVideoEqualizer = 0;
|
|
||||||
|
|
||||||
char * gtkVODriver = NULL;
|
char * gtkVODriver = NULL;
|
||||||
int gtkVODoubleBuffer = 1;
|
int gtkVODoubleBuffer = 1;
|
||||||
@ -61,7 +60,6 @@ static m_config_t * gui_conf;
|
|||||||
static config_t gui_opts[] =
|
static config_t gui_opts[] =
|
||||||
{
|
{
|
||||||
{ "enable_audio_equ",>kEnableAudioEqualizer,CONF_TYPE_FLAG,0,0,1,NULL },
|
{ "enable_audio_equ",>kEnableAudioEqualizer,CONF_TYPE_FLAG,0,0,1,NULL },
|
||||||
{ "enable_video_equ",>kEnableVideoEqualizer,CONF_TYPE_FLAG,0,0,1,NULL },
|
|
||||||
|
|
||||||
{ "vo_driver",>kVODriver,CONF_TYPE_STRING,0,0,0,NULL },
|
{ "vo_driver",>kVODriver,CONF_TYPE_STRING,0,0,0,NULL },
|
||||||
{ "vo_panscan",&vo_panscan,CONF_TYPE_FLOAT,CONF_RANGE,0.0,1.0,NULL },
|
{ "vo_panscan",&vo_panscan,CONF_TYPE_FLOAT,CONF_RANGE,0.0,1.0,NULL },
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
#define __CFG_H
|
#define __CFG_H
|
||||||
|
|
||||||
extern int gtkEnableAudioEqualizer;
|
extern int gtkEnableAudioEqualizer;
|
||||||
extern int gtkEnableVideoEqualizer;
|
|
||||||
|
|
||||||
extern char * gtkVODriver;
|
extern char * gtkVODriver;
|
||||||
extern int gtkVODoubleBuffer;
|
extern int gtkVODoubleBuffer;
|
||||||
|
@ -87,6 +87,7 @@ void guiInit( void )
|
|||||||
gtkAOOSSDevice=strdup( PATH_DEV_DSP );
|
gtkAOOSSDevice=strdup( PATH_DEV_DSP );
|
||||||
|
|
||||||
gtkInit();
|
gtkInit();
|
||||||
|
wsXInit( (void *)mDisplay );
|
||||||
|
|
||||||
cfg_read();
|
cfg_read();
|
||||||
appInit( (void*)mDisplay );
|
appInit( (void*)mDisplay );
|
||||||
@ -298,6 +299,18 @@ void guiGetEvent( int type,char * arg )
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case guiSetValues:
|
case guiSetValues:
|
||||||
|
// -- video
|
||||||
|
if ( arg )
|
||||||
|
{
|
||||||
|
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 ); }
|
||||||
|
}
|
||||||
// -- audio
|
// -- audio
|
||||||
if ( audio_out )
|
if ( audio_out )
|
||||||
{
|
{
|
||||||
|
@ -116,7 +116,7 @@ void ShowEqualizer( void )
|
|||||||
VHueadj->value=(float)vo_gamma_hue;
|
VHueadj->value=(float)vo_gamma_hue;
|
||||||
VSaturationadj->value=(float)vo_gamma_saturation;
|
VSaturationadj->value=(float)vo_gamma_saturation;
|
||||||
|
|
||||||
if ( !guiIntfStruct.Playing || !gtkEnableVideoEqualizer )
|
if ( !guiIntfStruct.Playing )
|
||||||
{
|
{
|
||||||
gtk_widget_set_sensitive( VContrast,FALSE );
|
gtk_widget_set_sensitive( VContrast,FALSE );
|
||||||
gtk_widget_set_sensitive( VBrightness,FALSE );
|
gtk_widget_set_sensitive( VBrightness,FALSE );
|
||||||
@ -210,7 +210,7 @@ static void eqButtonReleased( GtkButton * button,gpointer user_data )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( !guiIntfStruct.Playing || !gtkEnableVideoEqualizer ) break;
|
if ( !guiIntfStruct.Playing ) break;
|
||||||
gtkSet( gtkSetContrast,0.0f,NULL );
|
gtkSet( gtkSetContrast,0.0f,NULL );
|
||||||
gtkSet( gtkSetBrightness,0.0f,NULL );
|
gtkSet( gtkSetBrightness,0.0f,NULL );
|
||||||
gtkSet( gtkSetHue,0.0f,NULL );
|
gtkSet( gtkSetHue,0.0f,NULL );
|
||||||
|
@ -455,7 +455,7 @@ void fs_Ok_released( GtkButton * button,gpointer user_data )
|
|||||||
item=item->next;
|
item=item->next;
|
||||||
}
|
}
|
||||||
if ( i ) fsTopList_items=g_list_prepend( fsTopList_items,(gchar *)get_current_dir_name() );
|
if ( i ) fsTopList_items=g_list_prepend( fsTopList_items,(gchar *)get_current_dir_name() );
|
||||||
if ( mplMainAutoPlay ) mplEventHandling( evPlay,0 );
|
if ( mplMainAutoPlay ) { mplMainAutoPlay=0; mplEventHandling( evPlay,0 ); }
|
||||||
}
|
}
|
||||||
|
|
||||||
void fs_Cancel_released( GtkButton * button,gpointer user_data )
|
void fs_Cancel_released( GtkButton * button,gpointer user_data )
|
||||||
|
@ -35,7 +35,6 @@ static GtkWidget * EVFM;
|
|||||||
|
|
||||||
static GtkWidget * CBVFM;
|
static GtkWidget * CBVFM;
|
||||||
static GtkWidget * CBAudioEqualizer;
|
static GtkWidget * CBAudioEqualizer;
|
||||||
static GtkWidget * CBVideoEqualizer;
|
|
||||||
//static GtkWidget * CBSurround;
|
//static GtkWidget * CBSurround;
|
||||||
static GtkWidget * CBExtraStereo;
|
static GtkWidget * CBExtraStereo;
|
||||||
static GtkWidget * CBNoSound;
|
static GtkWidget * CBNoSound;
|
||||||
@ -122,7 +121,7 @@ void ShowPreferences( void )
|
|||||||
{
|
{
|
||||||
const ao_info_t *info = audio_out_drivers[i++]->info;
|
const ao_info_t *info = audio_out_drivers[i++]->info;
|
||||||
if ( !strcmp( info->short_name,"plugin" ) ) continue;
|
if ( !strcmp( info->short_name,"plugin" ) ) continue;
|
||||||
if ( !strcmp( gtkAODriver,info->short_name ) ) old_audio_driver=i - 1;
|
if ( !gstrcmp( gtkAODriver,info->short_name ) ) old_audio_driver=i - 1;
|
||||||
tmp[0]=(char *)info->short_name; tmp[1]=(char *)info->name; gtk_clist_append( GTK_CLIST( CLADrivers ),tmp );
|
tmp[0]=(char *)info->short_name; tmp[1]=(char *)info->name; gtk_clist_append( GTK_CLIST( CLADrivers ),tmp );
|
||||||
}
|
}
|
||||||
gtk_clist_select_row( GTK_CLIST( CLADrivers ),old_audio_driver,0 );
|
gtk_clist_select_row( GTK_CLIST( CLADrivers ),old_audio_driver,0 );
|
||||||
@ -132,7 +131,6 @@ void ShowPreferences( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// -- 2. page
|
// -- 2. page
|
||||||
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBVideoEqualizer ),gtkEnableVideoEqualizer );
|
|
||||||
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ),gtkVODoubleBuffer );
|
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ),gtkVODoubleBuffer );
|
||||||
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDR ),gtkVODirectRendering );
|
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDR ),gtkVODirectRendering );
|
||||||
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBFramedrop ),gtkVFrameDrop );
|
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBFramedrop ),gtkVFrameDrop );
|
||||||
@ -282,7 +280,6 @@ void prButton( GtkButton * button,gpointer user_data )
|
|||||||
gtkVODriver=gstrdup( vo_driver[0] );
|
gtkVODriver=gstrdup( vo_driver[0] );
|
||||||
|
|
||||||
// -- 2. page
|
// -- 2. page
|
||||||
gtkEnableVideoEqualizer=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBVideoEqualizer ) );
|
|
||||||
gtkVODoubleBuffer=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ) );
|
gtkVODoubleBuffer=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ) );
|
||||||
gtkVODirectRendering=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDR ) );
|
gtkVODirectRendering=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDR ) );
|
||||||
gtkVFrameDrop=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBFramedrop ) );
|
gtkVFrameDrop=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBFramedrop ) );
|
||||||
@ -822,13 +819,6 @@ GtkWidget * create_Preferences( void )
|
|||||||
gtk_container_add( GTK_CONTAINER( frame ),vbox5 );
|
gtk_container_add( GTK_CONTAINER( frame ),vbox5 );
|
||||||
gtk_widget_set_usize( vbox5,250,-2 );
|
gtk_widget_set_usize( vbox5,250,-2 );
|
||||||
|
|
||||||
CBVideoEqualizer=gtk_check_button_new_with_label( MSGTR_PREFERENCES_VideoEqu );
|
|
||||||
gtk_widget_set_name( CBVideoEqualizer,"CBVideoEqualizer" );
|
|
||||||
gtk_widget_ref( CBVideoEqualizer );
|
|
||||||
gtk_object_set_data_full( GTK_OBJECT( Preferences ),"CBVideoEqualizer",CBVideoEqualizer,(GtkDestroyNotify)gtk_widget_unref );
|
|
||||||
gtk_widget_show( CBVideoEqualizer );
|
|
||||||
gtk_box_pack_start( GTK_BOX( vbox5 ),CBVideoEqualizer,FALSE,FALSE,0 );
|
|
||||||
|
|
||||||
CBDoubleBuffer=gtk_check_button_new_with_label( MSGTR_PREFERENCES_DoubleBuffer );
|
CBDoubleBuffer=gtk_check_button_new_with_label( MSGTR_PREFERENCES_DoubleBuffer );
|
||||||
gtk_widget_set_name( CBDoubleBuffer,"CBDoubleBuffer" );
|
gtk_widget_set_name( CBDoubleBuffer,"CBDoubleBuffer" );
|
||||||
gtk_widget_ref( CBDoubleBuffer );
|
gtk_widget_ref( CBDoubleBuffer );
|
||||||
|
@ -54,10 +54,10 @@ void mplInit( void * disp )
|
|||||||
|
|
||||||
// read gui.conf, gui.pl
|
// read gui.conf, gui.pl
|
||||||
cfg_read();
|
cfg_read();
|
||||||
#endif
|
|
||||||
|
|
||||||
// opens X display, checks for extensions (XShape, DGA etc)
|
// opens X display, checks for extensions (XShape, DGA etc)
|
||||||
wsXInit( disp );
|
wsXInit( disp );
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
|
if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
|
||||||
{
|
{
|
||||||
|
@ -102,11 +102,14 @@ void mplEnd( void )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( mplMainAutoPlay ) { mplMainAutoPlay=0; return; }
|
if ( guiIntfStruct.FilenameChanged ) return;
|
||||||
|
|
||||||
guiIntfStruct.TimeSec=0;
|
guiIntfStruct.TimeSec=0;
|
||||||
guiIntfStruct.Position=0;
|
guiIntfStruct.Position=0;
|
||||||
guiIntfStruct.AudioType=0;
|
guiIntfStruct.AudioType=0;
|
||||||
|
guiIntfStruct.DVD.current_title=1;
|
||||||
|
guiIntfStruct.DVD.current_chapter=1;
|
||||||
|
guiIntfStruct.DVD.current_angle=1;
|
||||||
|
|
||||||
if ( !appMPlayer.subWindow.isFullScreen )
|
if ( !appMPlayer.subWindow.isFullScreen )
|
||||||
{
|
{
|
||||||
|
11
mplayer.c
11
mplayer.c
@ -1358,7 +1358,7 @@ fflush(stdout);
|
|||||||
guiGetEvent( guiSetFileName,filename );
|
guiGetEvent( guiSetFileName,filename );
|
||||||
if ( sh_audio ) guiIntfStruct.AudioType=sh_audio->channels; else guiIntfStruct.AudioType=0;
|
if ( sh_audio ) guiIntfStruct.AudioType=sh_audio->channels; else guiIntfStruct.AudioType=0;
|
||||||
if ( !sh_video && sh_audio ) guiGetEvent( guiSetAudioOnly,(char *)1 ); else guiGetEvent( guiSetAudioOnly,(char *)0 );
|
if ( !sh_video && sh_audio ) guiGetEvent( guiSetAudioOnly,(char *)1 ); else guiGetEvent( guiSetAudioOnly,(char *)0 );
|
||||||
guiGetEvent( guiSetValues,NULL );
|
guiGetEvent( guiSetValues,(char *)sh_video );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -2920,12 +2920,9 @@ if(rel_seek_secs || abs_seek_pos){
|
|||||||
// get pos from frame number / total frames
|
// get pos from frame number / total frames
|
||||||
guiIntfStruct.Position=(float)d_video->pack_no*100.0f/sh_video->video.dwLength;
|
guiIntfStruct.Position=(float)d_video->pack_no*100.0f/sh_video->video.dwLength;
|
||||||
} else {
|
} else {
|
||||||
// get pos from file position / filesize
|
int len = ( ( demuxer->movi_end - demuxer->movi_start ) >> 8 );
|
||||||
int len=((demuxer->movi_end-demuxer->movi_start));
|
int pos = ( demuxer->file_format == DEMUXER_TYPE_AUDIO?stream->pos:demuxer->filepos );
|
||||||
int pos;
|
guiIntfStruct.Position=(len <= 0? 0.0f : ( pos - demuxer->movi_start ) / len / 2.56f /* / 256.0f * 100.0f */ );
|
||||||
if ( demuxer->file_format==DEMUXER_TYPE_AUDIO ) pos=stream->pos;
|
|
||||||
else pos=(demuxer->file_format==DEMUXER_TYPE_AVI)?demuxer->filepos:d_video->pos;
|
|
||||||
guiIntfStruct.Position=(len<=0)?0:((float)(pos-demuxer->movi_start) / len * 100.0f);
|
|
||||||
}
|
}
|
||||||
if ( sh_video ) guiIntfStruct.TimeSec=d_video->pts;
|
if ( sh_video ) guiIntfStruct.TimeSec=d_video->pts;
|
||||||
else if ( sh_audio ) guiIntfStruct.TimeSec=sh_audio->timer;
|
else if ( sh_audio ) guiIntfStruct.TimeSec=sh_audio->timer;
|
||||||
|
Loading…
Reference in New Issue
Block a user