1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-17 04:58:06 +00:00

- add play time subtitle change support

- better language support


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7151 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
pontscho 2002-08-29 22:24:49 +00:00
parent 354fc0e75c
commit 8a147cf3f0
8 changed files with 58 additions and 13 deletions

View File

@ -238,6 +238,27 @@ void guiLoadFont( void )
}
#endif
#ifdef USE_SUB
void guiLoadSubtitle( char * name )
{
if ( guiIntfStruct.Playing == 0 )
{
guiIntfStruct.SubtitleChanged=1;
return;
}
if ( subtitles )
{
sub_free( subtitles );
if ( sub_name ) free( sub_name );
sub_name=NULL;
vo_sub=NULL;
subtitles=NULL;
}
sub_name=gstrdup( name );
subtitles=sub_read_file( sub_name,guiIntfStruct.FPS );
}
#endif
static void add_vop( char * str )
{
mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[gui] add video filter: %s\n",str );
@ -337,9 +358,11 @@ int guiGetEvent( int type,char * arg )
guiIntfStruct.StreamType=stream->type;
switch( stream->type )
{
#ifdef USE_DVDREAD
case STREAMTYPE_DVD:
guiGetEvent( guiSetDVD,(char *)stream->priv );
break;
#endif
#ifdef HAVE_VCD
case STREAMTYPE_VCD:
{
@ -353,6 +376,7 @@ int guiGetEvent( int type,char * arg )
break;
}
#endif
default: break;
}
break;
case guiIEvent:
@ -391,6 +415,8 @@ int guiGetEvent( int type,char * arg )
// -- video
if ( arg )
{
tmp_sh_video_t * sh = (tmp_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 )

View File

@ -86,6 +86,7 @@ typedef struct
int LengthInSec;
int FrameDrop;
int FileFormat;
float FPS;
char * Filename;
int FilenameChanged;

View File

@ -431,10 +431,12 @@ void fs_Ok_released( GtkButton * button,gpointer user_data )
gfree( (void **)&guiIntfStruct.AudioFile );
gfree( (void **)&guiIntfStruct.Subtitlename );
break;
#ifdef USE_SUB
case fsSubtitleSelector:
guiSetDF( guiIntfStruct.Subtitlename,fsSelectedDirectory,fsSelectedFile );
guiIntfStruct.SubtitleChanged=1;
guiLoadSubtitle( guiIntfStruct.Subtitlename );
break;
#endif
case fsOtherSelector:
guiSetDF( guiIntfStruct.Othername,fsSelectedDirectory,fsSelectedFile );
break;

View File

@ -33,20 +33,20 @@ inline void TranslateFilename( int c,char * tmp )
else strcpy( tmp,guiIntfStruct.Filename );
if ( tmp[strlen( tmp ) - 4] == '.' ) tmp[strlen( tmp ) - 4]=0;
if ( tmp[strlen( tmp ) - 5] == '.' ) tmp[strlen( tmp ) - 5]=0;
} else strcpy( tmp,"no file loaded" );
} else strcpy( tmp,MSGTR_NoFileLoaded );
break;
#ifdef USE_DVDREAD
case STREAMTYPE_DVD:
if ( guiIntfStruct.DVD.current_chapter ) sprintf( tmp,"chapter %d",guiIntfStruct.DVD.current_chapter );
else strcat( tmp,"no chapter" );
if ( guiIntfStruct.DVD.current_chapter ) sprintf( tmp,MSGTR_Chapter,guiIntfStruct.DVD.current_chapter );
else strcat( tmp,MSGTR_NoChapter );
break;
#endif
#ifdef HAVE_VCD
case STREAMTYPE_VCD:
sprintf( tmp,"VCD track %d",guiIntfStruct.Track );
sprintf( tmp,MSGTR_VCDTrack,guiIntfStruct.Track );
break;
#endif
default: strcpy( tmp,"no media opened" );
default: strcpy( tmp,MSGTR_NoMediaOpened );
}
if ( c )
{

View File

@ -336,6 +336,11 @@ static char help_text[]=
#define MSGTR_Network "Network streaming ..."
#define MSGTR_Preferences "Preferences"
#define MSGTR_OSSPreferences "OSS driver configuration"
#define MSGTR_NoMediaOpened "no media opened"
#define MSGTR_VCDTrack "VCD track %d"
#define MSGTR_NoChapter "no chapter"
#define MSGTR_Chapter "chapter %d"
#define MSGTR_NoFileLoaded "no file loaded"
// --- buttons ---
#define MSGTR_Ok "Ok"

View File

@ -228,7 +228,7 @@ static char help_text[]=
#ifdef HAVE_NEW_GUI
// --- labels ---
#define MSGTR_About "A GUI-ról"
#define MSGTR_About "Az MPlayer - röl"
#define MSGTR_FileSelect "File kiválasztása ..."
#define MSGTR_SubtitleSelect "Felirat kiválasztása ..."
#define MSGTR_OtherSelect "File kiválasztása ..."
@ -240,6 +240,11 @@ static char help_text[]=
#define MSGTR_Network "Lejátszás WEB - röl ..."
#define MSGTR_Preferences "Beállítások"
#define MSGTR_OSSPreferences "OSS driver beállítások"
#define MSGTR_NoMediaOpened "nincs megnyitva semmi"
#define MSGTR_VCDTrack "%d. VCD track"
#define MSGTR_NoChapter "nincs megnyitott fejezet"
#define MSGTR_Chapter "%d. fejezet"
#define MSGTR_NoFileLoaded "nincs file betöltve"
// --- buttons ---
#define MSGTR_Ok "Ok"
@ -305,10 +310,10 @@ static char help_text[]=
#define MSGTR_MENU_PlayDisc "Lemez megnyitása ..."
#define MSGTR_MENU_ShowDVDMenu "DVD menû"
#define MSGTR_MENU_Titles "Sávok"
#define MSGTR_MENU_Title "Sáv %2d"
#define MSGTR_MENU_Title "%2d. sáv"
#define MSGTR_MENU_None "(nincs)"
#define MSGTR_MENU_Chapters "Fejezetek"
#define MSGTR_MENU_Chapter "Fejezet %2d"
#define MSGTR_MENU_Chapter "%2d. fejezet"
#define MSGTR_MENU_AudioLanguages "Szinkron nyelvei"
#define MSGTR_MENU_SubtitleLanguages "Feliratok nyelvei"
#define MSGTR_MENU_PlayList "Playlist"

View File

@ -251,6 +251,10 @@ int sub_auto = 1;
char *vobsub_name=NULL;
/*DSP!!char *dsp=NULL;*/
int subcc_enabled=0;
#ifdef USE_SUB
subtitle* subtitles=NULL;
float sub_last_pts = -303;
#endif
extern char *vo_subdevice;
extern char *ao_subdevice;
@ -467,10 +471,6 @@ static int libmpdemux_was_interrupted(int eof) {
int main(int argc,char* argv[], char *envp[]){
#ifdef USE_SUB
static subtitle* subtitles=NULL;
float sub_last_pts = -303;
#endif
static demux_stream_t *d_audio=NULL;
static demux_stream_t *d_video=NULL;
@ -2803,6 +2803,7 @@ if(use_gui || playtree_iter != NULL){
if ( subtitles )
{
sub_free( subtitles );
if ( sub_name ) free( sub_name );
sub_name=NULL;
vo_sub=NULL;
subtitles=NULL;

View File

@ -2,6 +2,9 @@
#ifndef __MPLAYER_MAIN
#define __MPLAYER_MAIN
#include "libvo/sub.h"
#include "subreader.h"
extern int use_gui;
extern char* current_module;
extern int fullscreen;
@ -25,6 +28,8 @@ extern float sub_fps;
extern int sub_auto;
extern int sub_pos;
extern int sub_unicode;
extern subtitle* subtitles;
extern subtitle* vo_sub;
extern char * filename;