changeset 33646:f3300b0c38a9

Rename guiInterface_t member AudioType AudioChannels. Additionally, simplify code in mplayer.c.
author ib
date Mon, 27 Jun 2011 10:02:04 +0000
parents 4c3bee76ef3b
children 987e79f466f7
files gui/interface.h gui/ui/actions.c gui/ui/gtk/equalizer.c gui/ui/gtk/menu.c gui/ui/render.c gui/win32/interface.c gui/win32/widgetrender.c mplayer.c
diffstat 8 files changed, 11 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.h	Sun Jun 26 14:55:51 2011 +0000
+++ b/gui/interface.h	Mon Jun 27 10:02:04 2011 +0000
@@ -178,7 +178,7 @@
     float Balance;
 
     int Track;
-    int AudioType;
+    int AudioChannels;
     int StreamType;
     int AudioOnly;
     int TimeSec;
--- a/gui/ui/actions.c	Sun Jun 26 14:55:51 2011 +0000
+++ b/gui/ui/actions.c	Mon Jun 27 10:02:04 2011 +0000
@@ -113,7 +113,7 @@
 
         guiInfo.TimeSec   = 0;
         guiInfo.Position  = 0;
-        guiInfo.AudioType = 0;
+        guiInfo.AudioChannels = 0;
         guiInfo.NoWindow  = False;
 
 #ifdef CONFIG_DVDREAD
--- a/gui/ui/gtk/equalizer.c	Sun Jun 26 14:55:51 2011 +0000
+++ b/gui/ui/gtk/equalizer.c	Mon Jun 27 10:02:04 2011 +0000
@@ -105,17 +105,17 @@
  str[1]="";
  str[0]=MSGTR_EQU_All;
  gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
- if ( guiInfo.AudioType > 1 )
+ if ( guiInfo.AudioChannels > 1 )
   {
    str[0]=gtkEquChannel1; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
    str[0]=gtkEquChannel2; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
   }
- if ( guiInfo.AudioType > 2 )
+ if ( guiInfo.AudioChannels > 2 )
   {
    str[0]=gtkEquChannel3; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
    str[0]=gtkEquChannel4; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
   }
- if ( guiInfo.AudioType > 4 )
+ if ( guiInfo.AudioChannels > 4 )
   {
    str[0]=gtkEquChannel5; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
    str[0]=gtkEquChannel6; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
--- a/gui/ui/gtk/menu.c	Sun Jun 26 14:55:51 2011 +0000
+++ b/gui/ui/gtk/menu.c	Mon Jun 27 10:02:04 2011 +0000
@@ -609,7 +609,7 @@
 
   AddSeparator( Menu );
   MenuItem=AddMenuCheckItem( window1, (const char*)sound_xpm, Menu,MSGTR_MENU_Mute,mixer->muted,evMute );
-  if ( !guiInfo.AudioType ) gtk_widget_set_sensitive( MenuItem,FALSE );
+  if ( !guiInfo.AudioChannels ) gtk_widget_set_sensitive( MenuItem,FALSE );
   AddMenuItem( window1, (const char*)playlist_xpm, Menu,MSGTR_MENU_PlayList, evPlayList );
   AddMenuItem( window1, (const char*)skin_xpm, Menu,MSGTR_MENU_SkinBrowser, evSkinBrowser );
   AddMenuItem( window1, (const char*)prefs_xpm, Menu,MSGTR_MENU_Preferences, evPreferences );
--- a/gui/ui/render.c	Sun Jun 26 14:55:51 2011 +0000
+++ b/gui/ui/render.c	Mon Jun 27 10:02:04 2011 +0000
@@ -254,7 +254,7 @@
                     break;
                 }
 
-                switch (guiInfo.AudioType) {
+                switch (guiInfo.AudioChannels) {
                 case 0:
                     av_strlcat(trbuf, "n", sizeof(trbuf));
                     break;
--- a/gui/win32/interface.c	Sun Jun 26 14:55:51 2011 +0000
+++ b/gui/win32/interface.c	Mon Jun 27 10:02:04 2011 +0000
@@ -411,7 +411,7 @@
 
     guiInfo.TimeSec = 0;
     guiInfo.Position = 0;
-    guiInfo.AudioType = 0;
+    guiInfo.AudioChannels = 0;
 
 #ifdef CONFIG_DVDREAD
     guiInfo.DVD.current_title = 1;
--- a/gui/win32/widgetrender.c	Sun Jun 26 14:55:51 2011 +0000
+++ b/gui/win32/widgetrender.c	Mon Jun 27 10:02:04 2011 +0000
@@ -156,8 +156,8 @@
         else if(guiInfo.Playing == GUI_PAUSE) stringreplace(text, NULL, "e");
     }
 
-    if(guiInfo.AudioType == 0) stringreplace(text, "$a", "n");
-    else if(guiInfo.AudioType == 1) stringreplace(text, "$a", "m");
+    if(guiInfo.AudioChannels == 0) stringreplace(text, "$a", "n");
+    else if(guiInfo.AudioChannels == 1) stringreplace(text, "$a", "m");
     else stringreplace(text, "$a", "t");
 
     if(guiInfo.StreamType == 0)
--- a/mplayer.c	Sun Jun 26 14:55:51 2011 +0000
+++ b/mplayer.c	Mon Jun 27 10:02:04 2011 +0000
@@ -3677,10 +3677,7 @@
 
 #ifdef CONFIG_GUI
         if (use_gui) {
-            if (mpctx->sh_audio)
-                guiInfo.AudioType = mpctx->sh_audio->channels;
-            else
-                guiInfo.AudioType = 0;
+            guiInfo.AudioChannels = mpctx->sh_audio ? mpctx->sh_audio->channels : 0;
             if (!mpctx->sh_video && mpctx->sh_audio)
                 guiGetEvent(guiSetAudioOnly, (char *)1);
             else