mirror of
https://github.com/mpv-player/mpv
synced 2024-12-27 09:32:40 +00:00
add -audiofile support for gui
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6624 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
ec989de7b0
commit
1de8673b17
@ -46,7 +46,8 @@ evName evNames[] =
|
||||
{ evLoadSubtitle, "evLoadSubtitle" },
|
||||
{ evPlayDVD, "evPlayDVD" },
|
||||
{ evPlayVCD, "evPlayVCD" },
|
||||
{ evSetURL, "evSetURL" }
|
||||
{ evSetURL, "evSetURL" },
|
||||
{ evLoadAudioFile, "evLoadAudioFile" }
|
||||
};
|
||||
|
||||
int evBoxs = sizeof( evNames ) / sizeof( evName );
|
||||
|
@ -50,6 +50,7 @@
|
||||
#define evPlayDVD 39
|
||||
#define evPlayVCD 40
|
||||
#define evPlayNetwork 41
|
||||
#define evLoadAudioFile 42
|
||||
|
||||
#define evExit 1000
|
||||
|
||||
|
@ -178,13 +178,6 @@ void guiGetEvent( int type,char * arg )
|
||||
#endif
|
||||
break;
|
||||
case guiReDraw:
|
||||
// if ( audio_out )
|
||||
// {
|
||||
// float l,r;
|
||||
// mixer_getvolume( &l,&r );
|
||||
// guiIntfStruct.Volume=(r>l?r:l);
|
||||
// printf( "!!! guiIntfStruct.Volume: %.2f \n",guiIntfStruct.Volume );
|
||||
// }
|
||||
mplEventHandling( evRedraw,0 );
|
||||
break;
|
||||
case guiSetVolume:
|
||||
|
@ -91,6 +91,9 @@ typedef struct
|
||||
|
||||
char * Othername;
|
||||
int OtherChanged;
|
||||
|
||||
char * AudioFile;
|
||||
int AudioFileChanged;
|
||||
|
||||
int SkinChange;
|
||||
} guiInterface_t;
|
||||
|
@ -35,7 +35,6 @@ unsigned char * fsThatDir = ".";
|
||||
gchar fsFilter[64] = "*";
|
||||
|
||||
int fsPressed = 0;
|
||||
int fsMessage = -1;
|
||||
int fsType = 0;
|
||||
|
||||
int gtkVFileSelect = 0;
|
||||
@ -64,11 +63,18 @@ char * fsSubtitleFilterNames[fsNumberOfSubtitleFilterNames+1][2] =
|
||||
{ "SSA (*.ssa)", "*.ssa" },
|
||||
{ "AQT (*.aqt)", "*.aqt" },
|
||||
{ "Subtitles (*.utf,*.sub,*.srt,*.smi,*.rt,*.txt,*.ssa,*.aqt)", "*.utf,*.sub,*.srt,*.smi,*.rt,*.txt,*.ssa,*.aqt" },
|
||||
{ "All files ( * )", "*" } };
|
||||
{ "All files ( * )", "*" } };
|
||||
|
||||
#define fsNumberOfOtherFilterNames 0
|
||||
char * fsOtherFilterNames[fsNumberOfOtherFilterNames+1][2] =
|
||||
{ { "All files ( * )", "*" } };
|
||||
|
||||
#define fsNumberOfAudioFilterNames 3
|
||||
char * fsAudioFileNames[fsNumberOfAudioFilterNames+1][2] =
|
||||
{ { "WAV files (*.wav)", "*.wav" },
|
||||
{ "MP3 files (*.mp2, *.mp3)", "*.mp2,*.mp3" },
|
||||
{ "Audio files (*.wav,*.mp2,*.mp3)", "*.wav,*.mp2,*.mp3" },
|
||||
{ "All files ( * )", "*" } };
|
||||
|
||||
GtkWidget * fsFileNamesList;
|
||||
GtkWidget * fsFNameList;
|
||||
@ -207,7 +213,6 @@ void ShowFileSelect( int type,int modal )
|
||||
switch ( type )
|
||||
{
|
||||
case fsVideoSelector:
|
||||
fsMessage=evFileLoaded;
|
||||
gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FileSelect );
|
||||
fsList_items=NULL;
|
||||
for( i=0;i<fsNumberOfVideoFilterNames + 1;i++ )
|
||||
@ -234,6 +239,15 @@ void ShowFileSelect( int type,int modal )
|
||||
g_list_free( fsList_items );
|
||||
gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsOtherFilterNames[fsNumberOfOtherFilterNames][0] );
|
||||
break;
|
||||
case fsAudioSelector:
|
||||
gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_AudioFileSelect );
|
||||
fsList_items=NULL;
|
||||
for( i=0;i<fsNumberOfAudioFilterNames + 1;i++ )
|
||||
fsList_items=g_list_append( fsList_items,fsAudioFileNames[i][0] );
|
||||
gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
|
||||
g_list_free( fsList_items );
|
||||
gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsAudioFileNames[fsNumberOfAudioFilterNames - 1][0] );
|
||||
break;
|
||||
}
|
||||
|
||||
gtk_window_set_modal( GTK_WINDOW( fsFileSelect ),modal );
|
||||
@ -269,31 +283,26 @@ void fs_fsFilterCombo_changed( GtkEditable * editable,gpointer user_data )
|
||||
case fsVideoSelector:
|
||||
for( i=0;i<fsNumberOfVideoFilterNames+1;i++ )
|
||||
if( !strcmp( str,fsVideoFilterNames[i][0] ) )
|
||||
{
|
||||
strcpy( fsFilter,fsVideoFilterNames[i][1] );
|
||||
CheckDir( fsFNameList,get_current_dir_name() );
|
||||
break;
|
||||
}
|
||||
{ strcpy( fsFilter,fsVideoFilterNames[i][1] ); break; }
|
||||
break;
|
||||
case fsSubtitleSelector:
|
||||
for( i=0;i<fsNumberOfSubtitleFilterNames+1;i++ )
|
||||
if( !strcmp( str,fsSubtitleFilterNames[i][0] ) )
|
||||
{
|
||||
strcpy( fsFilter,fsSubtitleFilterNames[i][1] );
|
||||
CheckDir( fsFNameList,get_current_dir_name() );
|
||||
break;
|
||||
}
|
||||
{ strcpy( fsFilter,fsSubtitleFilterNames[i][1] ); break; }
|
||||
break;
|
||||
case fsOtherSelector:
|
||||
for( i=0;i<fsNumberOfOtherFilterNames+1;i++ )
|
||||
if( !strcmp( str,fsOtherFilterNames[i][0] ) )
|
||||
{
|
||||
strcpy( fsFilter,fsOtherFilterNames[i][1] );
|
||||
CheckDir( fsFNameList,get_current_dir_name() );
|
||||
break;
|
||||
}
|
||||
{ strcpy( fsFilter,fsOtherFilterNames[i][1] ); break; }
|
||||
break;
|
||||
case fsAudioSelector:
|
||||
for( i=0;i<fsNumberOfAudioFilterNames+1;i++ )
|
||||
if( !strcmp( str,fsAudioFileNames[i][0] ) )
|
||||
{ strcpy( fsFilter,fsAudioFileNames[i][1] ); break; }
|
||||
break;
|
||||
default: return;
|
||||
}
|
||||
CheckDir( fsFNameList,get_current_dir_name() );
|
||||
}
|
||||
|
||||
void fs_fsPathCombo_activate( GtkEditable * editable,gpointer user_data )
|
||||
@ -375,6 +384,8 @@ void fs_Ok_released( GtkButton * button,gpointer user_data )
|
||||
guiSetDF( guiIntfStruct.Filename,fsSelectedDirectory,fsSelectedFile );
|
||||
guiIntfStruct.StreamType=STREAMTYPE_FILE;
|
||||
guiIntfStruct.FilenameChanged=1;
|
||||
if ( guiIntfStruct.AudioFile ) free( guiIntfStruct.AudioFile );
|
||||
guiIntfStruct.AudioFile=NULL;
|
||||
break;
|
||||
case fsSubtitleSelector:
|
||||
guiSetDF( guiIntfStruct.Subtitlename,fsSelectedDirectory,fsSelectedFile );
|
||||
@ -383,6 +394,9 @@ void fs_Ok_released( GtkButton * button,gpointer user_data )
|
||||
case fsOtherSelector:
|
||||
guiSetDF( guiIntfStruct.Othername,fsSelectedDirectory,fsSelectedFile );
|
||||
break;
|
||||
case fsAudioSelector:
|
||||
guiSetDF( guiIntfStruct.AudioFile,fsSelectedDirectory,fsSelectedFile );
|
||||
break;
|
||||
}
|
||||
|
||||
HideFileSelect();
|
||||
@ -394,7 +408,7 @@ void fs_Ok_released( GtkButton * button,gpointer user_data )
|
||||
item=item->next;
|
||||
}
|
||||
if ( i ) fsTopList_items=g_list_prepend( fsTopList_items,(gchar *)get_current_dir_name() );
|
||||
if ( mplMainAutoPlay ) mplEventHandling( evPlay,0 );
|
||||
if ( mplMainAutoPlay ) mplEventHandling( evPlay,0 );
|
||||
}
|
||||
|
||||
void fs_Cancel_released( GtkButton * button,gpointer user_data )
|
||||
|
@ -6,6 +6,7 @@
|
||||
#define fsVideoSelector 0
|
||||
#define fsSubtitleSelector 1
|
||||
#define fsOtherSelector 2
|
||||
#define fsAudioSelector 3
|
||||
|
||||
extern GtkWidget * fsFileSelect;
|
||||
|
||||
|
@ -277,6 +277,7 @@ GtkWidget * create_PopUpMenu( void )
|
||||
#endif
|
||||
AddMenuItem( SubMenu,MSGTR_MENU_PlayURL, evSetURL );
|
||||
AddMenuItem( SubMenu,MSGTR_MENU_LoadSubtitle" ", evLoadSubtitle );
|
||||
AddMenuItem( SubMenu,MSGTR_MENU_LoadExternAudioFile, evLoadAudioFile );
|
||||
SubMenu=AddSubMenu( Menu,MSGTR_MENU_Playing );
|
||||
AddMenuItem( SubMenu,MSGTR_MENU_Play" ", evPlay );
|
||||
AddMenuItem( SubMenu,MSGTR_MENU_Pause, evPause );
|
||||
|
@ -351,6 +351,9 @@ NoPause:
|
||||
mplMainRender=1;
|
||||
gtkShow( evLoadSubtitle,NULL );
|
||||
break;
|
||||
case evLoadAudioFile:
|
||||
gtkShow( evLoadAudioFile,NULL );
|
||||
break;
|
||||
case evPrev:
|
||||
mplPrev();
|
||||
mplMainRender=1;
|
||||
@ -413,17 +416,6 @@ set_volume:
|
||||
case 1: wsIconify( appMPlayer.subWindow ); break;
|
||||
}
|
||||
break;
|
||||
case evNormalSize:
|
||||
if ( guiIntfStruct.Playing )
|
||||
{
|
||||
appMPlayer.subWindow.isFullScreen=True;
|
||||
appMPlayer.subWindow.OldX=( wsMaxX - guiIntfStruct.MovieWidth ) / 2;
|
||||
appMPlayer.subWindow.OldY=( wsMaxY - guiIntfStruct.MovieHeight ) / 2;
|
||||
appMPlayer.subWindow.OldWidth=guiIntfStruct.MovieWidth; appMPlayer.subWindow.OldHeight=guiIntfStruct.MovieHeight;
|
||||
wsFullScreen( &appMPlayer.subWindow );
|
||||
vo_fs=0;
|
||||
}
|
||||
break;
|
||||
case evDoubleSize:
|
||||
if ( guiIntfStruct.Playing )
|
||||
{
|
||||
@ -435,6 +427,17 @@ set_volume:
|
||||
vo_fs=0;
|
||||
}
|
||||
break;
|
||||
case evNormalSize:
|
||||
if ( guiIntfStruct.Playing )
|
||||
{
|
||||
appMPlayer.subWindow.isFullScreen=True;
|
||||
appMPlayer.subWindow.OldX=( wsMaxX - guiIntfStruct.MovieWidth ) / 2;
|
||||
appMPlayer.subWindow.OldY=( wsMaxY - guiIntfStruct.MovieHeight ) / 2;
|
||||
appMPlayer.subWindow.OldWidth=guiIntfStruct.MovieWidth; appMPlayer.subWindow.OldHeight=guiIntfStruct.MovieHeight;
|
||||
wsFullScreen( &appMPlayer.subWindow );
|
||||
vo_fs=0;
|
||||
break;
|
||||
} else if ( !appMPlayer.subWindow.isFullScreen ) break;
|
||||
case evFullScreen:
|
||||
for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ )
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY )
|
||||
{
|
||||
if( SubVisible++%2 ) wsMoveTopWindow( wsDisplay,appMPlayer.mainWindow.WindowID );
|
||||
else if ( wsWMType != wsWMNetWM && wsWMType != wsWMKDE ) wsMoveTopWindow( wsDisplay,appMPlayer.subWindow.WindowID );
|
||||
}
|
||||
}
|
||||
msButton=0;
|
||||
mplSubMoved=0;
|
||||
break;
|
||||
|
@ -174,6 +174,10 @@ void gtkShow( int type,char * param )
|
||||
ShowFileSelect( fsSubtitleSelector,0 );
|
||||
gtkSetLayer( fsFileSelect );
|
||||
break;
|
||||
case evLoadAudioFile:
|
||||
ShowFileSelect( fsAudioSelector,0 );
|
||||
gtkSetLayer( fsFileSelect );
|
||||
break;
|
||||
case evAbout:
|
||||
ShowAboutBox();
|
||||
gtkSetLayer( AboutBox );
|
||||
|
@ -236,6 +236,7 @@ static char help_text[]=
|
||||
#define MSGTR_FileSelect "Select file ..."
|
||||
#define MSGTR_SubtitleSelect "Select subtitle ..."
|
||||
#define MSGTR_OtherSelect "Select ..."
|
||||
#define MSGTR_AudioFileSelect "Select external audio channel ..."
|
||||
#define MSGTR_MessageBox "MessageBox"
|
||||
#define MSGTR_PlayList "PlayList"
|
||||
#define MSGTR_SkinBrowser "Skin Browser"
|
||||
@ -283,6 +284,7 @@ static char help_text[]=
|
||||
#define MSGTR_MENU_PlayDVD "Play DVD ..."
|
||||
#define MSGTR_MENU_PlayURL "Play URL ..."
|
||||
#define MSGTR_MENU_LoadSubtitle "Load subtitle ..."
|
||||
#define MSGTR_MENU_LoadExternAudioFile "Load external audio file ..."
|
||||
#define MSGTR_MENU_Playing "Playing"
|
||||
#define MSGTR_MENU_Play "Play"
|
||||
#define MSGTR_MENU_Pause "Pause"
|
||||
|
@ -231,6 +231,7 @@ static char help_text[]=
|
||||
#define MSGTR_FileSelect "File kiválasztása ..."
|
||||
#define MSGTR_SubtitleSelect "Felirat kiválasztása ..."
|
||||
#define MSGTR_OtherSelect "File kiválasztása ..."
|
||||
#define MSGTR_AudioFileSelect "Külsõ audio csatorna választása ..."
|
||||
#define MSGTR_MessageBox "Üzenetablak"
|
||||
#define MSGTR_PlayList "Lejátszási lista"
|
||||
#define MSGTR_SkinBrowser "Skin böngészõ"
|
||||
@ -278,6 +279,7 @@ static char help_text[]=
|
||||
#define MSGTR_MENU_PlayDVD "DVD lejátszás ..."
|
||||
#define MSGTR_MENU_PlayURL "URL lejátszás ..."
|
||||
#define MSGTR_MENU_LoadSubtitle "Felirat betöltése ..."
|
||||
#define MSGTR_MENU_LoadExternAudioFile "Külsõ hang betöltése ..."
|
||||
#define MSGTR_MENU_Playing "Lejátszás"
|
||||
#define MSGTR_MENU_Play "Lejátszás"
|
||||
#define MSGTR_MENU_Pause "Pillanatállj"
|
||||
|
@ -946,7 +946,7 @@ pts_from_bps=0; // !!!
|
||||
return demuxer;
|
||||
}
|
||||
|
||||
static char* audio_stream = NULL;
|
||||
char* audio_stream = NULL;
|
||||
static char* sub_stream = NULL;
|
||||
static int demuxer_type = 0, audio_demuxer_type = 0, sub_demuxer_type = 0;
|
||||
extern m_config_t* mconfig;
|
||||
|
@ -202,6 +202,8 @@ extern int dvd_nav;
|
||||
int dvd_parse_chapter_range(struct config*, const char*);
|
||||
//#endif
|
||||
|
||||
extern char * audio_stream;
|
||||
|
||||
#ifdef USE_DVDNAV
|
||||
#include "dvdnav_stream.h"
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user