changeset 33897:e0d211c62cf7

Cosmetic: Rename some guiInfo members. Rename TimeSec ElapsedTime and LengthInSec RunningTime for clarity. Rename AudioFile AudioFilename and Subtitlename SubtitleFilename for consistency.
author ib
date Fri, 12 Aug 2011 15:25:30 +0000
parents 89157330d7da
children 67790ce1185e
files gui/interface.c gui/interface.h gui/ui/actions.c gui/ui/gtk/fileselect.c gui/ui/gtk/preferences.c gui/ui/main.c gui/ui/render.c gui/win32/interface.c gui/win32/widgetrender.c mplayer.c
diffstat 10 files changed, 54 insertions(+), 54 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Fri Aug 12 14:56:19 2011 +0000
+++ b/gui/interface.c	Fri Aug 12 15:25:30 2011 +0000
@@ -273,7 +273,7 @@
         uiSetFileName(plCurrent->path, plCurrent->name, STREAMTYPE_FILE);
 
     if (subdata)
-        setdup(&guiInfo.Subtitlename, subdata->filename);
+        setdup(&guiInfo.SubtitleFilename, subdata->filename);
 
     mplayerLoadFont();
 
@@ -606,7 +606,7 @@
 
         // subtitle
 
-// subdata->filename=gstrdup( guiInfo.Subtitlename );
+// subdata->filename=gstrdup( guiInfo.SubtitleFilename );
         stream_dump_type = 0;
 
         if (gtkSubDumpMPSub)
@@ -626,8 +626,8 @@
         if (gtkAutoSyncOn)
             autosync = gtkAutoSync;
 
-        if (guiInfo.AudioFile)
-            audio_stream = gstrdup(guiInfo.AudioFile);
+        if (guiInfo.AudioFilename)
+            audio_stream = gstrdup(guiInfo.AudioFilename);
         else if (guiInfo.NewPlay == GUI_FILE_NEW)
             nfree(audio_stream);
 
@@ -788,13 +788,13 @@
             setddup(&guiInfo.Filename, next->path, next->name);
             guiInfo.StreamType = STREAMTYPE_FILE;
             guiInfo.NewPlay    = GUI_FILE_NEW;
-            nfree(guiInfo.AudioFile);
-            nfree(guiInfo.Subtitlename);
+            nfree(guiInfo.AudioFilename);
+            nfree(guiInfo.SubtitleFilename);
         } else {
             if (guiInfo.NewPlay == GUI_FILE_NEW)
                 break;
 
-            guiInfo.TimeSec       = 0;
+            guiInfo.ElapsedTime   = 0;
             guiInfo.Position      = 0;
             guiInfo.AudioChannels = 0;
             guiInfo.MovieWindow   = True;
--- a/gui/interface.h	Fri Aug 12 14:56:19 2011 +0000
+++ b/gui/interface.h	Fri Aug 12 15:25:30 2011 +0000
@@ -125,14 +125,14 @@
     int Track;
     int AudioChannels;
     int StreamType;
-    int TimeSec;
-    int LengthInSec;
+    int ElapsedTime;
+    int RunningTime;
 
     char *Filename;
 
-    char *Subtitlename;
+    char *SubtitleFilename;
 
-    char *AudioFile;
+    char *AudioFilename;
 } guiInterface_t;
 
 extern guiInterface_t guiInfo;
--- a/gui/ui/actions.c	Fri Aug 12 14:56:19 2011 +0000
+++ b/gui/ui/actions.c	Fri Aug 12 15:25:30 2011 +0000
@@ -263,8 +263,8 @@
         setddup(&guiInfo.Filename, dir, name);
 
     guiInfo.StreamType = type;
-    nfree(guiInfo.AudioFile);
-    nfree(guiInfo.Subtitlename);
+    nfree(guiInfo.AudioFilename);
+    nfree(guiInfo.SubtitleFilename);
 }
 
 void uiCurr(void)
--- a/gui/ui/gtk/fileselect.c	Fri Aug 12 14:56:19 2011 +0000
+++ b/gui/ui/gtk/fileselect.c	Fri Aug 12 15:25:30 2011 +0000
@@ -278,7 +278,7 @@
         gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
         g_list_free( fsList_items );
         gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsSubtitleFilterNames[k >= 0 ? k : i-2][0] );
-	tmp=guiInfo.Subtitlename;
+	tmp=guiInfo.SubtitleFilename;
         break;
 /*   case fsOtherSelector:
         gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_OtherSelect );
@@ -299,7 +299,7 @@
 	gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
 	g_list_free( fsList_items );
 	gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsAudioFileNames[k >= 0 ? k : i-2][0] );
-	tmp=guiInfo.AudioFile;
+	tmp=guiInfo.AudioFilename;
 	break;
    case fsFontSelector:
         gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FontSelect );
@@ -492,19 +492,19 @@
           setddup( &guiInfo.Filename,fsSelectedDirectory,fsSelectedFile );
           guiInfo.StreamType=STREAMTYPE_FILE;
           guiInfo.NewPlay=GUI_FILE_NEW; sub_fps=0;
-	  nfree( guiInfo.AudioFile );
-	  nfree( guiInfo.Subtitlename );
+	  nfree( guiInfo.AudioFilename );
+	  nfree( guiInfo.SubtitleFilename );
           fs_PersistantHistory( get_current_dir_name_utf8() );      //totem, write into history
           break;
    case fsSubtitleSelector:
-          setddup( &guiInfo.Subtitlename,fsSelectedDirectory,fsSelectedFile );
-	  mplayerLoadSubtitle( guiInfo.Subtitlename );
+          setddup( &guiInfo.SubtitleFilename,fsSelectedDirectory,fsSelectedFile );
+	  mplayerLoadSubtitle( guiInfo.SubtitleFilename );
           break;
 /*   case fsOtherSelector:
           setddup( &guiInfo.Othername,fsSelectedDirectory,fsSelectedFile );
           break;*/
    case fsAudioSelector:
-          setddup( &guiInfo.AudioFile,fsSelectedDirectory,fsSelectedFile );
+          setddup( &guiInfo.AudioFilename,fsSelectedDirectory,fsSelectedFile );
           break;
    case fsFontSelector:
           setddup( &font_name,fsSelectedDirectory,fsSelectedFile );
--- a/gui/ui/gtk/preferences.c	Fri Aug 12 14:56:19 2011 +0000
+++ b/gui/ui/gtk/preferences.c	Fri Aug 12 15:25:30 2011 +0000
@@ -313,7 +313,7 @@
    case 3: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBOSDTPTT ),TRUE ); break;
   }
 #if 0
- if ( guiInfo.Subtitlename ) gtk_entry_set_text( GTK_ENTRY( ESubtitleName ),guiInfo.Subtitlename );
+ if ( guiInfo.SubtitleFilename ) gtk_entry_set_text( GTK_ENTRY( ESubtitleName ),guiInfo.SubtitleFilename );
 #endif
 
 #ifdef CONFIG_ICONV
--- a/gui/ui/main.c	Fri Aug 12 14:56:19 2011 +0000
+++ b/gui/ui/main.c	Fri Aug 12 15:25:30 2011 +0000
@@ -108,8 +108,8 @@
   if (what & CLEAR_FILE)
   {
     nfree(guiInfo.Filename);
-    nfree(guiInfo.Subtitlename);
-    nfree(guiInfo.AudioFile);
+    nfree(guiInfo.SubtitleFilename);
+    nfree(guiInfo.AudioFilename);
     listSet(gtkDelPl, NULL);
   }
 
@@ -143,8 +143,8 @@
         break;
 
    case evPlayNetwork:
-        nfree( guiInfo.Subtitlename );
-	nfree( guiInfo.AudioFile );
+        nfree( guiInfo.SubtitleFilename );
+	nfree( guiInfo.AudioFilename );
 	guiInfo.StreamType=STREAMTYPE_STREAM;
         goto play;
    case evSetURL:
@@ -272,7 +272,7 @@
         break;
    case evLoadSubtitle:  gtkShow( evLoadSubtitle,NULL );  break;
    case evDropSubtitle:
-	nfree( guiInfo.Subtitlename );
+	nfree( guiInfo.SubtitleFilename );
 	mplayerLoadSubtitle( NULL );
 	break;
    case evLoadAudioFile: gtkShow( evLoadAudioFile,NULL ); break;
@@ -660,8 +660,8 @@
     uiEventHandling( evPlay,0 );
   }
   if (subtitles) {
-    nfree(guiInfo.Subtitlename);
-    guiInfo.Subtitlename = subtitles;
-    mplayerLoadSubtitle(guiInfo.Subtitlename);
+    nfree(guiInfo.SubtitleFilename);
+    guiInfo.SubtitleFilename = subtitles;
+    mplayerLoadSubtitle(guiInfo.SubtitleFilename);
   }
 }
--- a/gui/ui/render.c	Fri Aug 12 14:56:19 2011 +0000
+++ b/gui/ui/render.c	Fri Aug 12 15:25:30 2011 +0000
@@ -148,44 +148,44 @@
                 break;
 
             case '6':
-                t = guiInfo.LengthInSec;
+                t = guiInfo.RunningTime;
                 goto calclengthhhmmss;
 
             case '1':
-                t = guiInfo.TimeSec;
+                t = guiInfo.ElapsedTime;
 calclengthhhmmss:
                 snprintf(tmp, sizeof(tmp), "%02d:%02d:%02d", t / 3600, t / 60 % 60, t % 60);
                 av_strlcat(trbuf, tmp, sizeof(trbuf));
                 break;
 
             case '7':
-                t = guiInfo.LengthInSec;
+                t = guiInfo.RunningTime;
                 goto calclengthmmmmss;
 
             case '2':
-                t = guiInfo.TimeSec;
+                t = guiInfo.ElapsedTime;
 calclengthmmmmss:
                 snprintf(tmp, sizeof(tmp), "%04d:%02d", t / 60, t % 60);
                 av_strlcat(trbuf, tmp, sizeof(trbuf));
                 break;
 
             case '3':
-                snprintf(tmp, sizeof(tmp), "%02d", guiInfo.TimeSec / 3600);
+                snprintf(tmp, sizeof(tmp), "%02d", guiInfo.ElapsedTime / 3600);
                 av_strlcat(trbuf, tmp, sizeof(trbuf));
                 break;
 
             case '4':
-                snprintf(tmp, sizeof(tmp), "%02d", (guiInfo.TimeSec / 60) % 60);
+                snprintf(tmp, sizeof(tmp), "%02d", (guiInfo.ElapsedTime / 60) % 60);
                 av_strlcat(trbuf, tmp, sizeof(trbuf));
                 break;
 
             case '5':
-                snprintf(tmp, sizeof(tmp), "%02d", guiInfo.TimeSec % 60);
+                snprintf(tmp, sizeof(tmp), "%02d", guiInfo.ElapsedTime % 60);
                 av_strlcat(trbuf, tmp, sizeof(trbuf));
                 break;
 
             case '8':
-                snprintf(tmp, sizeof(tmp), "%01d:%02d:%02d", guiInfo.TimeSec / 3600, (guiInfo.TimeSec / 60) % 60, guiInfo.TimeSec % 60);
+                snprintf(tmp, sizeof(tmp), "%01d:%02d:%02d", guiInfo.ElapsedTime / 3600, (guiInfo.ElapsedTime / 60) % 60, guiInfo.ElapsedTime % 60);
                 av_strlcat(trbuf, tmp, sizeof(trbuf));
                 break;
 
--- a/gui/win32/interface.c	Fri Aug 12 14:56:19 2011 +0000
+++ b/gui/win32/interface.c	Fri Aug 12 15:25:30 2011 +0000
@@ -341,8 +341,8 @@
         setddup(&guiInfo.Filename, dir, name);
 
     guiInfo.StreamType = type;
-    nfree(guiInfo.AudioFile);
-    nfree(guiInfo.Subtitlename);
+    nfree(guiInfo.AudioFilename);
+    nfree(guiInfo.SubtitleFilename);
 }
 
 void uiFullScreen( void )
@@ -664,7 +664,7 @@
           if(guiInfo.NewPlay == GUI_FILE_NEW)
               break;
 
-          guiInfo.TimeSec = 0;
+          guiInfo.ElapsedTime = 0;
           guiInfo.Position = 0;
           guiInfo.AudioChannels = 0;
 
--- a/gui/win32/widgetrender.c	Fri Aug 12 14:56:19 2011 +0000
+++ b/gui/win32/widgetrender.c	Fri Aug 12 15:25:30 2011 +0000
@@ -127,17 +127,17 @@
     }
     strcpy(text, item->label);
     if(item->type == tySlabel) return text;
-    stringreplace(text, "$1", "%.2i:%.2i:%.2i", guiInfo.TimeSec / 3600,
-                 (guiInfo.TimeSec / 60) % 60, guiInfo.TimeSec % 60);
-    stringreplace(text, "$2", "%.4i:%.2i", guiInfo.TimeSec / 60, guiInfo.TimeSec % 60);
-    stringreplace(text, "$3", "%.2i", guiInfo.TimeSec / 3600);
-    stringreplace(text, "$4", "%.2i", (guiInfo.TimeSec / 60) % 60);
-    stringreplace(text, "$5", "%.2i", guiInfo.TimeSec % 60);
-    stringreplace(text, "$6", "%.2i:%.2i:%.2i", guiInfo.LengthInSec / 3600,
-                 (guiInfo.LengthInSec / 60) % 60, guiInfo.LengthInSec % 60);
-    stringreplace(text, "$7", "%.4i:%.2i", guiInfo.LengthInSec / 60, guiInfo.LengthInSec % 60);
-    stringreplace(text, "$8", "%i:%.2i:%.2i", guiInfo.TimeSec / 3600,
-                 (guiInfo.TimeSec / 60) % 60, guiInfo.TimeSec % 60);
+    stringreplace(text, "$1", "%.2i:%.2i:%.2i", guiInfo.ElapsedTime / 3600,
+                 (guiInfo.ElapsedTime / 60) % 60, guiInfo.ElapsedTime % 60);
+    stringreplace(text, "$2", "%.4i:%.2i", guiInfo.ElapsedTime / 60, guiInfo.ElapsedTime % 60);
+    stringreplace(text, "$3", "%.2i", guiInfo.ElapsedTime / 3600);
+    stringreplace(text, "$4", "%.2i", (guiInfo.ElapsedTime / 60) % 60);
+    stringreplace(text, "$5", "%.2i", guiInfo.ElapsedTime % 60);
+    stringreplace(text, "$6", "%.2i:%.2i:%.2i", guiInfo.RunningTime / 3600,
+                 (guiInfo.RunningTime / 60) % 60, guiInfo.RunningTime % 60);
+    stringreplace(text, "$7", "%.4i:%.2i", guiInfo.RunningTime / 60, guiInfo.RunningTime % 60);
+    stringreplace(text, "$8", "%i:%.2i:%.2i", guiInfo.ElapsedTime / 3600,
+                 (guiInfo.ElapsedTime / 60) % 60, guiInfo.ElapsedTime % 60);
     stringreplace(text, "$v", "%3.2f", guiInfo.Volume);
     stringreplace(text, "$V", "%3.1f", guiInfo.Volume);
     stringreplace(text, "$b", "%3.2f", guiInfo.Balance);
--- a/mplayer.c	Fri Aug 12 14:56:19 2011 +0000
+++ b/mplayer.c	Fri Aug 12 15:25:30 2011 +0000
@@ -3967,10 +3967,10 @@
                     guiInfo.Position = demuxer_get_percent_pos(mpctx->demuxer);
                 }
                 if (mpctx->sh_video)
-                    guiInfo.TimeSec = mpctx->sh_video->pts;
+                    guiInfo.ElapsedTime = mpctx->sh_video->pts;
                 else if (mpctx->sh_audio)
-                    guiInfo.TimeSec = playing_audio_pts(mpctx->sh_audio, mpctx->d_audio, mpctx->audio_out);
-                guiInfo.LengthInSec = demuxer_get_time_length(mpctx->demuxer);
+                    guiInfo.ElapsedTime = playing_audio_pts(mpctx->sh_audio, mpctx->d_audio, mpctx->audio_out);
+                guiInfo.RunningTime = demuxer_get_time_length(mpctx->demuxer);
                 gui(GUI_SET_MIXER, 0);
                 gui(GUI_REDRAW, 0);
                 if (guiInfo.Playing == GUI_STOP)