[MPlayer-dev-eng] [PATCH] more implicit declarations of functions 3/3

Stephen Sheldon sfsheldo at gmail.com
Fri Jul 8 04:35:54 CEST 2011


In this patch I move functions around in gui/win32/interface.c to avoid
forward references.


Index: gui/win32/interface.c
===================================================================
--- gui/win32/interface.c	(revision 33847)
+++ gui/win32/interface.c	(working copy)
@@ -30,7 +30,7 @@
 #endif
 
 #include "path.h"
-#include "gui/interface.h"
+#include "gui/win32/interface.h"
 #include "m_option.h"
 #include "mixer.h"
 #include "mp_msg.h"
@@ -156,6 +156,116 @@
     (*list)[i + 1] = NULL;
 }
 
+void uiPause( void )
+{
+   if(!guiInfo.Playing) return;
+
+   if(guiInfo.Playing == GUI_PLAY)
+   {
+       mp_cmd_t * cmd = calloc(1, sizeof(*cmd));
+       cmd->id=MP_CMD_PAUSE;
+       cmd->name=strdup("pause");
+       mp_input_queue_cmd(cmd);
+   } else guiInfo.Playing = GUI_PLAY;
+}
+
+void uiPlay( void )
+{
+   if((!guiInfo.Filename ) || (guiInfo.Filename[0] == 0))
+     return;
+
+   if(guiInfo.Playing > GUI_STOP)
+   {
+       uiPause();
+       return;
+   }
+   guiInfo.NewPlay = 1;
+   gui(GUI_SET_STATE, (void *) GUI_PLAY);
+}
+
+void uiNext(void)
+{
+    if(guiInfo.Playing == GUI_PAUSE) return;
+    switch(guiInfo.StreamType)
+    {
+#ifdef CONFIG_DVDREAD
+        case STREAMTYPE_DVD:
+            if(guiInfo.DVD.current_chapter == (guiInfo.DVD.chapters - 1))
+                return;
+            guiInfo.DVD.current_chapter++;
+            break;
+#endif
+        default:
+            if(mygui->playlist->current == (mygui->playlist->trackcount - 1))
+                return;
+            uiSetFileName(NULL,
mygui->playlist->tracks[(mygui->playlist->current)++]->filename,
+                           STREAMTYPE_STREAM);
+            break;
+    }
+    mygui->startplay(mygui);
+}
+
+void uiPrev(void)
+{
+    if(guiInfo.Playing == GUI_PAUSE) return;
+    switch(guiInfo.StreamType)
+    {
+#ifdef CONFIG_DVDREAD
+        case STREAMTYPE_DVD:
+            if(guiInfo.DVD.current_chapter == 1)
+                return;
+            guiInfo.DVD.current_chapter--;
+            break;
+#endif
+        default:
+            if(mygui->playlist->current == 0)
+                return;
+            uiSetFileName(NULL,
mygui->playlist->tracks[(mygui->playlist->current)--]->filename,
+                           STREAMTYPE_STREAM);
+            break;
+    }
+    mygui->startplay(mygui);
+}
+
+void uiSetFileName(char *dir, char *name, int type)
+{
+    if(!name) return;
+    if(!dir)
+        setdup(&guiInfo.Filename, name);
+    else
+        setddup(&guiInfo.Filename, dir, name);
+
+    guiInfo.StreamType = type;
+    free(guiInfo.AudioFile);
+    guiInfo.AudioFile = NULL;
+    free(guiInfo.Subtitlename);
+    guiInfo.Subtitlename = NULL;
+}
+
+void uiFullScreen( void )
+{
+    if(!guiInfo.sh_video) return;
+
+    if(sub_window)
+    {
+        if(!fullscreen && IsWindowVisible(mygui->subwindow) &&
!IsIconic(mygui->subwindow))
+           GetWindowRect(mygui->subwindow, &old_rect);
+
+        if(fullscreen)
+        {
+            fullscreen = 0;
+            style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
+        } else {
+            fullscreen = 1;
+            style = WS_VISIBLE | WS_POPUP;
+        }
+        SetWindowLong(mygui->subwindow, GWL_STYLE, style);
+        update_subwindow();
+    }
+    video_out->control(VOCTRL_FULLSCREEN, 0);
+    if(sub_window) ShowWindow(mygui->subwindow, SW_SHOW);
+}
+
 /* this function gets called by the gui to update mplayer */
 static void guiSetEvent(int event)
 {
@@ -326,116 +436,6 @@
     }
 }
 
-void uiPlay( void )
-{
-   if((!guiInfo.Filename ) || (guiInfo.Filename[0] == 0))
-     return;
-
-   if(guiInfo.Playing > GUI_STOP)
-   {
-       uiPause();
-       return;
-   }
-   guiInfo.NewPlay = 1;
-   gui(GUI_SET_STATE, (void *) GUI_PLAY);
-}
-
-void uiPause( void )
-{
-   if(!guiInfo.Playing) return;
-
-   if(guiInfo.Playing == GUI_PLAY)
-   {
-       mp_cmd_t * cmd = calloc(1, sizeof(*cmd));
-       cmd->id=MP_CMD_PAUSE;
-       cmd->name=strdup("pause");
-       mp_input_queue_cmd(cmd);
-   } else guiInfo.Playing = GUI_PLAY;
-}
-
-void uiNext(void)
-{
-    if(guiInfo.Playing == GUI_PAUSE) return;
-    switch(guiInfo.StreamType)
-    {
-#ifdef CONFIG_DVDREAD
-        case STREAMTYPE_DVD:
-            if(guiInfo.DVD.current_chapter == (guiInfo.DVD.chapters - 1))
-                return;
-            guiInfo.DVD.current_chapter++;
-            break;
-#endif
-        default:
-            if(mygui->playlist->current == (mygui->playlist->trackcount - 1))
-                return;
-            uiSetFileName(NULL,
mygui->playlist->tracks[(mygui->playlist->current)++]->filename,
-                           STREAMTYPE_STREAM);
-            break;
-    }
-    mygui->startplay(mygui);
-}
-
-void uiPrev(void)
-{
-    if(guiInfo.Playing == GUI_PAUSE) return;
-    switch(guiInfo.StreamType)
-    {
-#ifdef CONFIG_DVDREAD
-        case STREAMTYPE_DVD:
-            if(guiInfo.DVD.current_chapter == 1)
-                return;
-            guiInfo.DVD.current_chapter--;
-            break;
-#endif
-        default:
-            if(mygui->playlist->current == 0)
-                return;
-            uiSetFileName(NULL,
mygui->playlist->tracks[(mygui->playlist->current)--]->filename,
-                           STREAMTYPE_STREAM);
-            break;
-    }
-    mygui->startplay(mygui);
-}
-
-void uiSetFileName(char *dir, char *name, int type)
-{
-    if(!name) return;
-    if(!dir)
-        setdup(&guiInfo.Filename, name);
-    else
-        setddup(&guiInfo.Filename, dir, name);
-
-    guiInfo.StreamType = type;
-    free(guiInfo.AudioFile);
-    guiInfo.AudioFile = NULL;
-    free(guiInfo.Subtitlename);
-    guiInfo.Subtitlename = NULL;
-}
-
-void uiFullScreen( void )
-{
-    if(!guiInfo.sh_video) return;
-
-    if(sub_window)
-    {
-        if(!fullscreen && IsWindowVisible(mygui->subwindow) &&
!IsIconic(mygui->subwindow))
-           GetWindowRect(mygui->subwindow, &old_rect);
-
-        if(fullscreen)
-        {
-            fullscreen = 0;
-            style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
-        } else {
-            fullscreen = 1;
-            style = WS_VISIBLE | WS_POPUP;
-        }
-        SetWindowLong(mygui->subwindow, GWL_STYLE, style);
-        update_subwindow();
-    }
-    video_out->control(VOCTRL_FULLSCREEN, 0);
-    if(sub_window) ShowWindow(mygui->subwindow, SW_SHOW);
-}
-
 static unsigned __stdcall GuiThread(void* param)
 {
     MSG msg;




More information about the MPlayer-dev-eng mailing list