aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Gui/events.c3
-rw-r--r--Gui/events.h1
-rw-r--r--Gui/interface.c7
-rw-r--r--Gui/interface.h3
-rw-r--r--Gui/mplayer/gtk/fs.c52
-rw-r--r--Gui/mplayer/gtk/fs.h1
-rw-r--r--Gui/mplayer/gtk/menu.c1
-rw-r--r--Gui/mplayer/mw.h23
-rw-r--r--Gui/mplayer/sw.h2
-rw-r--r--Gui/mplayer/widgets.c4
-rw-r--r--help_mp-en.h2
-rw-r--r--help_mp-hu.h2
-rw-r--r--libmpdemux/demuxer.c2
-rw-r--r--libmpdemux/stream.h2
-rw-r--r--mplayer.c1
15 files changed, 67 insertions, 39 deletions
diff --git a/Gui/events.c b/Gui/events.c
index 7b3f10491c..5e61b64ea5 100644
--- a/Gui/events.c
+++ b/Gui/events.c
@@ -46,7 +46,8 @@ evName evNames[] =
{ evLoadSubtitle, "evLoadSubtitle" },
{ evPlayDVD, "evPlayDVD" },
{ evPlayVCD, "evPlayVCD" },
- { evSetURL, "evSetURL" }
+ { evSetURL, "evSetURL" },
+ { evLoadAudioFile, "evLoadAudioFile" }
};
int evBoxs = sizeof( evNames ) / sizeof( evName );
diff --git a/Gui/events.h b/Gui/events.h
index d79f6b605e..f8f400260e 100644
--- a/Gui/events.h
+++ b/Gui/events.h
@@ -50,6 +50,7 @@
#define evPlayDVD 39
#define evPlayVCD 40
#define evPlayNetwork 41
+#define evLoadAudioFile 42
#define evExit 1000
diff --git a/Gui/interface.c b/Gui/interface.c
index 7e473a59c9..9dbd1919e0 100644
--- a/Gui/interface.c
+++ b/Gui/interface.c
@@ -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:
diff --git a/Gui/interface.h b/Gui/interface.h
index 82748fa5b2..f8bdc133b1 100644
--- a/Gui/interface.h
+++ b/Gui/interface.h
@@ -91,6 +91,9 @@ typedef struct
char * Othername;
int OtherChanged;
+
+ char * AudioFile;
+ int AudioFileChanged;
int SkinChange;
} guiInterface_t;
diff --git a/Gui/mplayer/gtk/fs.c b/Gui/mplayer/gtk/fs.c
index 9ee5a6c58b..8c460bbd9f 100644
--- a/Gui/mplayer/gtk/fs.c
+++ b/Gui/mplayer/gtk/fs.c
@@ -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 )
diff --git a/Gui/mplayer/gtk/fs.h b/Gui/mplayer/gtk/fs.h
index b1de763a26..cb125135ba 100644
--- a/Gui/mplayer/gtk/fs.h
+++ b/Gui/mplayer/gtk/fs.h
@@ -6,6 +6,7 @@
#define fsVideoSelector 0
#define fsSubtitleSelector 1
#define fsOtherSelector 2
+#define fsAudioSelector 3
extern GtkWidget * fsFileSelect;
diff --git a/Gui/mplayer/gtk/menu.c b/Gui/mplayer/gtk/menu.c
index 41eb584b49..eb0df3d163 100644
--- a/Gui/mplayer/gtk/menu.c
+++ b/Gui/mplayer/gtk/menu.c
@@ -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 );
diff --git a/Gui/mplayer/mw.h b/Gui/mplayer/mw.h
index 56f1bfc214..3aab21bc94 100644
--- a/Gui/mplayer/mw.h
+++ b/Gui/mplayer/mw.h
@@ -351,6 +351,9 @@ NoPause:
mplMainRender=1;
gtkShow( evLoadSubtitle,NULL );
break;
+ case evLoadAudioFile:
+ gtkShow( evLoadAudioFile,NULL );
+ break;
case evPrev:
mplPrev();
mplMainRender=1;
@@ -413,28 +416,28 @@ set_volume:
case 1: wsIconify( appMPlayer.subWindow ); break;
}
break;
- case evNormalSize:
+ case evDoubleSize:
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;
+ appMPlayer.subWindow.OldX=( wsMaxX - guiIntfStruct.MovieWidth * 2 ) / 2;
+ appMPlayer.subWindow.OldY=( wsMaxY - guiIntfStruct.MovieHeight * 2 ) / 2;
+ appMPlayer.subWindow.OldWidth=guiIntfStruct.MovieWidth * 2; appMPlayer.subWindow.OldHeight=guiIntfStruct.MovieHeight * 2;
wsFullScreen( &appMPlayer.subWindow );
vo_fs=0;
}
break;
- case evDoubleSize:
+ case evNormalSize:
if ( guiIntfStruct.Playing )
{
appMPlayer.subWindow.isFullScreen=True;
- appMPlayer.subWindow.OldX=( wsMaxX - guiIntfStruct.MovieWidth * 2 ) / 2;
- appMPlayer.subWindow.OldY=( wsMaxY - guiIntfStruct.MovieHeight * 2 ) / 2;
- appMPlayer.subWindow.OldWidth=guiIntfStruct.MovieWidth * 2; appMPlayer.subWindow.OldHeight=guiIntfStruct.MovieHeight * 2;
+ 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;
+ break;
+ } else if ( !appMPlayer.subWindow.isFullScreen ) break;
case evFullScreen:
for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ )
{
diff --git a/Gui/mplayer/sw.h b/Gui/mplayer/sw.h
index 0dc177b8ce..82d6aaa61b 100644
--- a/Gui/mplayer/sw.h
+++ b/Gui/mplayer/sw.h
@@ -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;
diff --git a/Gui/mplayer/widgets.c b/Gui/mplayer/widgets.c
index 69225367e3..d8d728016c 100644
--- a/Gui/mplayer/widgets.c
+++ b/Gui/mplayer/widgets.c
@@ -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 );
diff --git a/help_mp-en.h b/help_mp-en.h
index d277fd5aa6..6846dfa232 100644
--- a/help_mp-en.h
+++ b/help_mp-en.h
@@ -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"
diff --git a/help_mp-hu.h b/help_mp-hu.h
index e5c778ce73..3227a8aaa9 100644
--- a/help_mp-hu.h
+++ b/help_mp-hu.h
@@ -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"
diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c
index dbba020e3c..1c36517eaf 100644
--- a/libmpdemux/demuxer.c
+++ b/libmpdemux/demuxer.c
@@ -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;
diff --git a/libmpdemux/stream.h b/libmpdemux/stream.h
index e345870487..5f6281eef4 100644
--- a/libmpdemux/stream.h
+++ b/libmpdemux/stream.h
@@ -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
diff --git a/mplayer.c b/mplayer.c
index 0dd976f388..7ba6af976d 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -862,6 +862,7 @@ if(!use_stdin && !slave_mode){
}
guiIntfStruct.FilenameChanged=0;
}
+ audio_stream=guiIntfStruct.AudioFile;
}
#endif
//---------------------------------------------------------------------------