comparison Gui/interface.c @ 8043:e5dda05f9aab

cleanup
author pontscho
date Sat, 02 Nov 2002 16:09:05 +0000
parents 0e5544951425
children 9246adcf95f0
comparison
equal deleted inserted replaced
8042:72b8f3c62d83 8043:e5dda05f9aab
161 if ( !gtkDXR3Device ) gtkDXR3Device=strdup( "/dev/em8300-0" ); 161 if ( !gtkDXR3Device ) gtkDXR3Device=strdup( "/dev/em8300-0" );
162 #endif 162 #endif
163 fullscreen=gtkLoadFullscreen; 163 fullscreen=gtkLoadFullscreen;
164 164
165 gtkInit(); 165 gtkInit();
166 // --- initialize X
166 wsXInit( (void *)mDisplay ); 167 wsXInit( (void *)mDisplay );
167 appInit( (void*)mDisplay ); 168 // ---
169 skinDirInHome=get_path("Skin");
170 skinMPlayerDir=DATADIR "/Skin";
171 printf("SKIN dir 1: '%s'\n",skinDirInHome);
172 printf("SKIN dir 2: '%s'\n",skinMPlayerDir);
173 if ( !skinName ) skinName=strdup( "default" );
174 switch ( skinRead( skinName ) )
175 {
176 case -1: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinNotFound,skinName ); exit( 0 );
177 case -2: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinCfgReadError,skinName ); exit( 0 );
178 }
179 mplInit( (void *)mDisplay );
180 // ---
168 181
169 if ( plCurrent && !filename ) mplSetFileName( plCurrent->path,plCurrent->name,STREAMTYPE_FILE ); 182 if ( plCurrent && !filename ) mplSetFileName( plCurrent->path,plCurrent->name,STREAMTYPE_FILE );
170 if ( sub_name ) guiSetFilename( guiIntfStruct.Subtitlename,sub_name ); 183 if ( sub_name ) guiSetFilename( guiIntfStruct.Subtitlename,sub_name );
171 #if defined( USE_OSD ) || defined( USE_SUB ) 184 #if defined( USE_OSD ) || defined( USE_SUB )
172 guiLoadFont(); 185 guiLoadFont();
173 #endif 186 #endif
174 } 187 }
175 188
176 void guiDone( void ) 189 void guiDone( void )
177 { 190 {
178 mp_msg( MSGT_GPLAYER,MSGL_V,"[mplayer] exit.\n" ); 191 mp_msg( MSGT_GPLAYER,MSGL_V,"[gui] done.\n" );
179 cfg_write(); 192 cfg_write();
180 gtkDone();
181 wsXDone(); 193 wsXDone();
182 } 194 }
183 195
184 int guiCMDArray[] = 196 int guiCMDArray[] =
185 { 197 {
397 int i; 409 int i;
398 for ( i=1;i < 100;i++ ) 410 for ( i=1;i < 100;i++ )
399 if ( vcd_seek_to_track( stream->fd,i ) < 0 ) break; 411 if ( vcd_seek_to_track( stream->fd,i ) < 0 ) break;
400 vcd_seek_to_track( stream->fd,vcd_track ); 412 vcd_seek_to_track( stream->fd,vcd_track );
401 guiIntfStruct.VCDTracks=--i; 413 guiIntfStruct.VCDTracks=--i;
402 mp_msg( MSGT_GPLAYER,MSGL_INFO,"[interface] vcd tracks: %d\n",guiIntfStruct.VCDTracks ); 414 mp_msg( MSGT_GPLAYER,MSGL_INFO,"[gui] vcd tracks: %d\n",guiIntfStruct.VCDTracks );
403 guiIntfStruct.Track=vcd_track; 415 guiIntfStruct.Track=vcd_track;
404 break; 416 break;
405 } 417 }
406 #endif 418 #endif
407 default: break; 419 default: break;
476 gtkSet( gtkSetEqualizer,0,&eq ); 488 gtkSet( gtkSetEqualizer,0,&eq );
477 } 489 }
478 } 490 }
479 // -- subtitle 491 // -- subtitle
480 #ifdef HAVE_DXR3 492 #ifdef HAVE_DXR3
481 if ( video_driver_list && !gstrcmp( video_driver_list[0],"dxr3" ) && guiIntfStruct.FileFormat != DEMUXER_TYPE_MPEG_PS && !gtkVopLAVC && !gtkVopFAME ) 493 if ( video_driver_list && !gstrcmp( video_driver_list[0],"dxr3" ) && guiIntfStruct.FileFormat != DEMUXER_TYPE_MPEG_PS
494 #ifdef USE_LIBAVCODEC
495 && !gtkVopLAVC
496 #endif
497 #ifdef USE_LIBFAME
498 && !gtkVopFAME
499 #endif
500 )
482 { 501 {
483 gtkMessageBox( GTK_MB_FATAL,MSGTR_NEEDLAVCFAME ); 502 gtkMessageBox( GTK_MB_FATAL,MSGTR_NEEDLAVCFAME );
484 guiIntfStruct.Playing=0; 503 guiIntfStruct.Playing=0;
485 return True; 504 return True;
486 } 505 }
522 { guiIntfStruct.NoWindow=True; break; } 541 { guiIntfStruct.NoWindow=True; break; }
523 } 542 }
524 } 543 }
525 544
526 #ifdef HAVE_DXR3 545 #ifdef HAVE_DXR3
546 #ifdef USE_LIBAVCODEC
527 remove_vop( "lavc" ); 547 remove_vop( "lavc" );
548 #endif
549 #ifdef USE_LIBFAME
528 remove_vop( "fame" ); 550 remove_vop( "fame" );
551 #endif
529 if ( video_driver_list && !gstrcmp( video_driver_list[0],"dxr3" ) ) 552 if ( video_driver_list && !gstrcmp( video_driver_list[0],"dxr3" ) )
530 { 553 {
531 if ( ( guiIntfStruct.StreamType != STREAMTYPE_DVD)&&( guiIntfStruct.StreamType != STREAMTYPE_VCD ) ) 554 if ( ( guiIntfStruct.StreamType != STREAMTYPE_DVD)&&( guiIntfStruct.StreamType != STREAMTYPE_VCD ) )
532 { 555 {
556 #ifdef USE_LIBAVCODEC
533 if ( gtkVopLAVC ) add_vop( "lavc" ); 557 if ( gtkVopLAVC ) add_vop( "lavc" );
558 #endif
559 #ifdef USE_LIBFAME
534 if ( gtkVopFAME ) add_vop( "fame" ); 560 if ( gtkVopFAME ) add_vop( "fame" );
561 #endif
535 } 562 }
536 } 563 }
537 #endif 564 #endif
538 // --- 565 // ---
539 if ( gtkVopPP ) add_vop( "pp" ); 566 if ( gtkVopPP ) add_vop( "pp" );
540 else remove_vop( "pp" ); 567 else remove_vop( "pp" );
541 568
542 // --- audio opts 569 // --- audio opts
543 audio_delay=gtkAODelay;
544 // if ( ao_plugin_cfg.plugin_list ) { free( ao_plugin_cfg.plugin_list ); ao_plugin_cfg.plugin_list=NULL; } 570 // if ( ao_plugin_cfg.plugin_list ) { free( ao_plugin_cfg.plugin_list ); ao_plugin_cfg.plugin_list=NULL; }
545 if ( gtkAONorm ) gset( &ao_plugin_cfg.plugin_list,"volnorm" ); 571 if ( gtkAONorm ) gset( &ao_plugin_cfg.plugin_list,"volnorm" );
546 if ( gtkEnableAudioEqualizer ) gset( &ao_plugin_cfg.plugin_list,"eq" ); 572 if ( gtkEnableAudioEqualizer ) gset( &ao_plugin_cfg.plugin_list,"eq" );
547 if ( gtkAOExtraStereo ) 573 if ( gtkAOExtraStereo )
548 { 574 {
576 break; 602 break;
577 } 603 }
578 return False; 604 return False;
579 } 605 }
580 606
581 extern unsigned int GetTimerMS( void );
582 extern int mplTimer;
583
584 void guiEventHandling( void ) 607 void guiEventHandling( void )
585 { 608 {
586 if ( !guiIntfStruct.Playing || guiIntfStruct.NoWindow ) wsHandleEvents(); 609 if ( !guiIntfStruct.Playing || guiIntfStruct.NoWindow ) wsHandleEvents();
587 gtkEventHandling(); 610 gtkEventHandling();
588 mplTimer=GetTimerMS() / 20;
589 } 611 }
590 612
591 // --- 613 // ---
592 614
593 float gtkEquChannels[6][10]; 615 float gtkEquChannels[6][10];
699 } 721 }
700 if ( ( !is_added )&&( gstrcmp( next_url->url,url_item->url ) ) ) next_url->next=url_item; 722 if ( ( !is_added )&&( gstrcmp( next_url->url,url_item->url ) ) ) next_url->next=url_item;
701 } else { url_item->next=NULL; URLList=url_item; } 723 } else { url_item->next=NULL; URLList=url_item; }
702 return NULL; 724 return NULL;
703 // --- subtitle 725 // --- subtitle
704 case gtkSetSubAuto:
705 sub_auto=(int)fparam;
706 return NULL;
707 case gtkSetSubDelay:
708 sub_delay=fparam;
709 return NULL;
710 case gtkSetSubFPS:
711 sub_fps=(int)fparam;
712 return NULL;
713 case gtkSetSubPos:
714 sub_pos=(int)fparam;
715 return NULL;
716 #if defined( USE_OSD ) || defined( USE_SUB ) 726 #if defined( USE_OSD ) || defined( USE_SUB )
717 #ifndef HAVE_FREETYPE 727 #ifndef HAVE_FREETYPE
718 case gtkSetFontFactor: 728 case gtkSetFontFactor:
719 font_factor=fparam; 729 font_factor=fparam;
720 guiLoadFont(); 730 guiLoadFont();
761 #endif 771 #endif
762 #ifdef HAVE_VCD 772 #ifdef HAVE_VCD
763 if ( (unsigned int)vparam & guiVCD ) guiIntfStruct.VCDTracks=0; 773 if ( (unsigned int)vparam & guiVCD ) guiIntfStruct.VCDTracks=0;
764 #endif 774 #endif
765 return NULL; 775 return NULL;
766 case gtkSetCacheSize:
767 stream_cache_size=(int)fparam;
768 return NULL;
769 case gtkSetExtraStereo: 776 case gtkSetExtraStereo:
770 gtkAOExtraStereoMul=fparam; 777 gtkAOExtraStereoMul=fparam;
771 audio_plugin_extrastereo.control( AOCONTROL_PLUGIN_ES_SET,(int)&gtkAOExtraStereoMul ); 778 audio_plugin_extrastereo.control( AOCONTROL_PLUGIN_ES_SET,(int)&gtkAOExtraStereoMul );
772 return NULL; 779 return NULL;
773 case gtkSetAudioDelay:
774 audio_delay=gtkAODelay=fparam;
775 return NULL;
776 case gtkSetPanscan: 780 case gtkSetPanscan:
777 { 781 {
778 mp_cmd_t * mp_cmd; 782 mp_cmd_t * mp_cmd;
779 mp_cmd=(mp_cmd_t *)calloc( 1,sizeof( *mp_cmd ) ); 783 mp_cmd=(mp_cmd_t *)calloc( 1,sizeof( *mp_cmd ) );
780 mp_cmd->id=MP_CMD_PANSCAN; mp_cmd->name=strdup( "panscan" ); 784 mp_cmd->id=MP_CMD_PANSCAN; mp_cmd->name=strdup( "panscan" );