Mercurial > mplayer.hg
comparison Gui/interface.c @ 6903:c2d4100c964e
- fix mixer handling
- some change in menu
- fix evLoadPlay bug
- etc
author | pontscho |
---|---|
date | Sun, 04 Aug 2002 19:23:58 +0000 |
parents | 138a7ff52a26 |
children | 5ddd609550d5 |
comparison
equal
deleted
inserted
replaced
6902:3ccdfd580f0d | 6903:c2d4100c964e |
---|---|
284 #endif | 284 #endif |
285 case guiReDraw: | 285 case guiReDraw: |
286 mplEventHandling( evRedraw,0 ); | 286 mplEventHandling( evRedraw,0 ); |
287 break; | 287 break; |
288 case guiSetVolume: | 288 case guiSetVolume: |
289 if ( audio_out ) | |
290 { | |
291 float l,r; | |
292 mixer_getvolume( &l,&r ); | |
293 guiIntfStruct.Volume=(r>l?r:l); | |
294 if ( r != l ) guiIntfStruct.Balance=( ( r - l ) + 100 ) * 0.5f; | |
295 else guiIntfStruct.Balance=50.0f; | |
296 btnModify( evSetVolume,guiIntfStruct.Volume ); | |
297 btnModify( evSetBalance,guiIntfStruct.Balance ); | |
298 } | |
299 break; | |
300 case guiSetValues: | |
289 // -- audio | 301 // -- audio |
290 if ( audio_out ) | 302 if ( audio_out ) |
291 { | 303 { |
292 float l,r; | 304 float l,r; |
293 mixer_getvolume( &l,&r ); | 305 mixer_getvolume( &l,&r ); |
327 gtkSet( gtkDelPl,0,NULL ); guiIntfStruct.StreamType=STREAMTYPE_FILE; | 339 gtkSet( gtkDelPl,0,NULL ); guiIntfStruct.StreamType=STREAMTYPE_FILE; |
328 guiSetFilename( guiIntfStruct.Filename,filename ); | 340 guiSetFilename( guiIntfStruct.Filename,filename ); |
329 } | 341 } |
330 | 342 |
331 guiIntfStruct.DiskChanged=0; | 343 guiIntfStruct.DiskChanged=0; |
332 // guiIntfStruct.FilenameChanged=0; | |
333 | 344 |
334 // --- video opts | 345 // --- video opts |
335 if ( !gtkVODriver ) | 346 if ( !gtkVODriver ) |
336 { | 347 { |
337 int i = 0; | 348 int i = 0; |
338 while ( video_out_drivers[i++] ) | 349 if ( video_driver && !gtkVODriver ) |
339 if ( video_out_drivers[i - 1]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE ) | 350 { |
340 { | 351 while ( video_out_drivers[i] ) |
341 const vo_info_t *info = video_out_drivers[i - 1]->get_info(); | 352 if ( video_out_drivers[i++]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE ) |
342 { gtkVODriver=gstrdup( (char *)info->short_name ); break; } | 353 { |
343 } | 354 const vo_info_t *info = video_out_drivers[i - 1]->get_info(); |
355 if ( !gstrcmp( video_driver,(char *)info->short_name ) ) gtkVODriver=gstrdup( video_driver ); | |
356 } | |
357 } | |
358 else | |
359 while ( video_out_drivers[i++] ) | |
360 if ( video_out_drivers[i - 1]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE ) | |
361 { | |
362 const vo_info_t *info = video_out_drivers[i - 1]->get_info(); | |
363 gtkVODriver=gstrdup( (char *)info->short_name ); | |
364 break; | |
365 } | |
344 } | 366 } |
345 | 367 |
346 if ( gtkVODriver ) { if ( video_driver ) free( video_driver ); video_driver=strdup( gtkVODriver ); } | 368 if ( gtkVODriver ) { gfree( (void **)&video_driver ); video_driver=gstrdup( gtkVODriver ); } |
347 else { gtkMessageBox( GTK_MB_FATAL,MSGTR_IDFGCVD ); exit_player( "gui init" ); } | 369 else { gtkMessageBox( GTK_MB_FATAL,MSGTR_IDFGCVD ); exit_player( "gui init" ); } |
348 | 370 |
349 if ( gtkVPP ) | 371 if ( gtkVPP ) |
350 { | 372 { |
351 if ( vo_plugin_args ) | 373 if ( vo_plugin_args ) |
391 { | 413 { |
392 gset( &ao_plugin_cfg.plugin_list,"extrastereo" ); | 414 gset( &ao_plugin_cfg.plugin_list,"extrastereo" ); |
393 ao_plugin_cfg.pl_extrastereo_mul=gtkAOExtraStereoMul; | 415 ao_plugin_cfg.pl_extrastereo_mul=gtkAOExtraStereoMul; |
394 } | 416 } |
395 mixer_device=gtkAOOSSMixer; | 417 mixer_device=gtkAOOSSMixer; |
396 if ( audio_driver ) free( audio_driver ); | 418 if ( audio_driver && !gtkAODriver ) gtkAODriver=gstrdup( audio_driver ); |
419 gfree( (void **)&audio_driver ); | |
397 if ( !gstrcmp( gtkAODriver,"oss" ) && gtkAOOSSDevice ) | 420 if ( !gstrcmp( gtkAODriver,"oss" ) && gtkAOOSSDevice ) |
398 { | 421 { |
399 char * tmp = calloc( 1,strlen( gtkAODriver ) + strlen( gtkAOOSSDevice ) + 2 ); | 422 char * tmp = calloc( 1,strlen( gtkAODriver ) + strlen( gtkAOOSSDevice ) + 2 ); |
400 sprintf( tmp,"%s:%s",gtkAODriver,gtkAOOSSDevice ); | 423 sprintf( tmp,"%s:%s",gtkAODriver,gtkAOOSSDevice ); |
401 audio_driver=tmp; | 424 audio_driver=tmp; |