Browse Source

add socket server thread to receive remote call,and try add skin design on it

cuu 6 years ago
parent
commit
aea9534d4d
61 changed files with 86 additions and 91 deletions
  1. 0 4
      Menu/GameShell/10_Settings/Wifi/__init__.py
  2. 0 0
      Menu/GameShell/10_Settings/Wifi/icons/__init__.py
  3. 0 21
      Menu/GameShell/10_Settings/Wifi/icons/preload.py
  4. 2 2
      Menu/GameShell/10_Settings/Wifi/keyboard.py
  5. 3 3
      Menu/GameShell/10_Settings/Wifi/net_item.py
  6. 0 12
      Menu/GameShell/Music Player/__init__.py
  7. 0 0
      Menu/GameShell/Music Player/icons/__init__.py
  8. BIN
      Menu/GameShell/Music Player/icons/done.png
  9. 0 21
      Menu/GameShell/Music Player/icons/preload.py
  10. 0 1
      Menu/GameShell/Music Player/list_item.py
  11. 0 0
      skin/default/Menu/GameShell/20_Retro Games/GBA.png
  12. 0 0
      skin/default/Menu/GameShell/20_Retro Games/MAME.png
  13. 0 0
      skin/default/Menu/GameShell/20_Retro Games/NES.png
  14. 0 0
      skin/default/Menu/GameShell/CaveStory.png
  15. 0 0
      skin/default/Menu/GameShell/Music Player.png
  16. 0 0
      skin/default/Menu/GameShell/PowerOFF.png
  17. 0 0
      skin/default/Menu/GameShell/Retro Games.png
  18. 0 0
      skin/default/Menu/GameShell/RetroArch.png
  19. 0 0
      skin/default/Menu/GameShell/Settings.png
  20. 0 0
      skin/default/Menu/GameShell/Sleep.png
  21. 0 0
      skin/default/Menu/GameShell/TinyCloud.png
  22. 0 0
      skin/default/Menu/GameShell/freeDM.png
  23. 0 0
      skin/default/sys.py/gameshell/blank.png
  24. 0 0
      skin/default/sys.py/gameshell/footbar_icons/footbar.png
  25. 0 0
      skin/default/sys.py/gameshell/icons/_L.png
  26. 0 0
      skin/default/sys.py/gameshell/icons/_R.png
  27. 0 0
      skin/default/sys.py/gameshell/icons/about_bg.png
  28. 0 0
      skin/default/sys.py/gameshell/icons/done.png
  29. 0 0
      skin/default/sys.py/gameshell/icons/empty.png
  30. 0 0
      skin/default/sys.py/gameshell/icons/heart.png
  31. 0 0
      skin/default/sys.py/gameshell/icons/icon_sd.png
  32. 0 0
      skin/default/sys.py/gameshell/icons/light.png
  33. 0 0
      skin/default/sys.py/gameshell/icons/lock.png
  34. 0 0
      skin/default/sys.py/gameshell/icons/needwifi_bg.png
  35. 0 0
      skin/default/sys.py/gameshell/icons/online.png
  36. 0 0
      skin/default/sys.py/gameshell/icons/rom_download.png
  37. 0 0
      skin/default/sys.py/gameshell/icons/roundcorners.png
  38. 0 0
      skin/default/sys.py/gameshell/icons/scale.png
  39. 0 0
      skin/default/sys.py/gameshell/icons/star.png
  40. 0 0
      skin/default/sys.py/gameshell/icons/sys.png
  41. 0 0
      skin/default/sys.py/gameshell/icons/vol.png
  42. 0 0
      skin/default/sys.py/gameshell/titlebar_icons/battery_unknown.png
  43. 0 0
      skin/default/sys.py/gameshell/titlebar_icons/soundvolume.png
  44. 0 0
      skin/default/sys.py/gameshell/titlebar_icons/wifi.png
  45. 0 0
      skin/default/sys.py/gameshell/titlebar_icons/withcharging.png
  46. 0 0
      skin/default/sys.py/gameshell/titlebar_icons/without_charging.png
  47. 0 0
      skin/default/truetype/NotoSansCJK-Regular.ttf
  48. 0 0
      skin/default/truetype/NotoSansMono-Regular.ttf
  49. 0 0
      skin/default/truetype/VarelaRound-Regular.ttf
  50. 0 0
      skin/default/truetype/VeraMono.ttf
  51. 1 0
      sys.py/UI/.#page.py
  52. 7 6
      sys.py/UI/fonts.py
  53. 2 2
      sys.py/UI/foot_bar.py
  54. 2 2
      sys.py/UI/icon_pool.py
  55. 6 6
      sys.py/UI/main_screen.py
  56. 2 9
      sys.py/UI/title_bar.py
  57. 17 0
      sys.py/UI/util_funcs.py
  58. 3 1
      sys.py/config.py
  59. BIN
      sys.py/gameshell/titlebar_icons/ic_battery_charging_full_black.png
  60. BIN
      sys.py/gameshell/titlebar_icons/ic_volume_up_black.png
  61. 41 1
      sys.py/run.py

+ 0 - 4
Menu/GameShell/10_Settings/Wifi/__init__.py

@@ -1,6 +1,5 @@
 # -*- coding: utf-8 -*- 
 
-
 ## local UI import
 import pages
 import myvars
@@ -10,11 +9,8 @@ try:
 except:
     print("No icons package")
 """
-from icons import preload
 
 def Init(main_screen):
-    
-    preload.load_icons()
     pages.InitPasswordPage(main_screen)
     pages.InitScanPage(main_screen)
 

+ 0 - 0
Menu/GameShell/10_Settings/Wifi/icons/__init__.py


+ 0 - 21
Menu/GameShell/10_Settings/Wifi/icons/preload.py

@@ -1,21 +0,0 @@
-# -*- coding: utf-8 -*- 
-
-import pygame
-from pygame.locals import *
-from sys import exit
-import os
-import sys
-
-from beeprint import pp
-
-ICONS_PRELOAD={}
-
-
-def load_icons():
-    basepath = os.path.dirname(os.path.realpath(__file__))
-
-    files = os.listdir(basepath)
-    for i in files:
-        if os.path.isfile(basepath+"/"+i) and i.endswith(".png"):
-            keyname = i.split(".")[0]
-            ICONS_PRELOAD[keyname] = pygame.image.load(basepath+"/"+i).convert_alpha()

+ 2 - 2
Menu/GameShell/10_Settings/Wifi/keyboard.py

@@ -12,12 +12,12 @@ from UI.fonts  import fonts
 from UI.util_funcs import midRect
 from UI.keys_def import CurKeys
 from UI.icon_item import IconItem
+from UI.icon_pool    import MyIconPool
 
 from libs.roundrects import aa_round_rect
 
 from textarea  import Textarea
 from text_item import TextItem
-from icons     import preload
 
 import myvars
 
@@ -135,7 +135,7 @@ class Keyboard(Page):
 
                     if val == "_L" or val == "_R":
                         it  = KeyboardIcon()
-                        it._ImgSurf = preload.ICONS_PRELOAD[val]
+                        it._ImgSurf = MyIconPool._Icons[val]
                         it._Parent = self
                         it._Str = val
                         it.Init(start_x+it._ImgSurf.get_width()/2  ,start_y,it._ImgSurf.get_width(),it._ImgSurf.get_height(),0)

+ 3 - 3
Menu/GameShell/10_Settings/Wifi/net_item.py

@@ -8,8 +8,8 @@ from UI.label  import Label
 from UI.fonts  import fonts
 from UI.icon_item import IconItem
 from UI.multi_icon_item  import MultiIconItem
+from UI.icon_pool   import MyIconPool
 
-from icons  import preload
 
 class NetItemMultiIcon(MultiIconItem):
     _CanvasHWND = None
@@ -140,13 +140,13 @@ class NetItem(object):
         
 
         lock_icon = NetItemIcon()
-        lock_icon._ImgSurf = preload.ICONS_PRELOAD["lock"]
+        lock_icon._ImgSurf = MyIconPool._Icons["lock"]
         lock_icon._CanvasHWND = self._Parent._CanvasHWND
         lock_icon._Parent = self
         self._Icons["lock"] = lock_icon
         
         done_icon = NetItemIcon()
-        done_icon._ImgSurf = preload.ICONS_PRELOAD["done"]
+        done_icon._ImgSurf = MyIconPool._Icons["done"]
         done_icon._CanvasHWND = self._Parent._CanvasHWND
         done_icon._Parent = self
         

+ 0 - 12
Menu/GameShell/Music Player/__init__.py

@@ -1,26 +1,14 @@
 # -*- coding: utf-8 -*- 
 
 import pygame
-from pygame.locals import *
-from sys import exit
-import os
-import sys
-
-from datetime import datetime
-
-import base64
-from beeprint import pp
-
 
 ## local UI import
 import pages
 import myvars
-from icons import preload
 
 def Init(main_screen):
     pages.InitPoller()
 
-    preload.load_icons()
     pages.InitListPage(main_screen)
     pages.InitMusicLibPage(main_screen)
     pages.InitSpectrumPage(main_screen)

+ 0 - 0
Menu/GameShell/Music Player/icons/__init__.py


BIN
Menu/GameShell/Music Player/icons/done.png


+ 0 - 21
Menu/GameShell/Music Player/icons/preload.py

@@ -1,21 +0,0 @@
-# -*- coding: utf-8 -*- 
-
-import pygame
-from pygame.locals import *
-from sys import exit
-import os
-import sys
-
-from beeprint import pp
-
-ICONS_PRELOAD={}
-
-
-def load_icons():
-    basepath = os.path.dirname(os.path.realpath(__file__))
-
-    files = os.listdir(basepath)
-    for i in files:
-        if os.path.isfile(basepath+"/"+i) and i.endswith(".png"):
-            keyname = i.split(".")[0]
-            ICONS_PRELOAD[keyname] = pygame.image.load(basepath+"/"+i).convert_alpha()

+ 0 - 1
Menu/GameShell/Music Player/list_item.py

@@ -17,7 +17,6 @@ from UI.util_funcs import midRect
 # ------------------------
 
 import myvars # icons_path
-from icons import preload
 
 class ListItemIcon(IconItem):
 

+ 0 - 0
Menu/GameShell/20_Retro Games/GBA.png → skin/default/Menu/GameShell/20_Retro Games/GBA.png


+ 0 - 0
Menu/GameShell/20_Retro Games/MAME.png → skin/default/Menu/GameShell/20_Retro Games/MAME.png


+ 0 - 0
Menu/GameShell/20_Retro Games/NES.png → skin/default/Menu/GameShell/20_Retro Games/NES.png


+ 0 - 0
Menu/GameShell/CaveStory.png → skin/default/Menu/GameShell/CaveStory.png


+ 0 - 0
Menu/GameShell/Music Player.png → skin/default/Menu/GameShell/Music Player.png


+ 0 - 0
Menu/GameShell/PowerOFF.png → skin/default/Menu/GameShell/PowerOFF.png


+ 0 - 0
Menu/GameShell/Retro Games.png → skin/default/Menu/GameShell/Retro Games.png


+ 0 - 0
Menu/GameShell/RetroArch.png → skin/default/Menu/GameShell/RetroArch.png


+ 0 - 0
Menu/GameShell/Settings.png → skin/default/Menu/GameShell/Settings.png


+ 0 - 0
Menu/GameShell/Sleep.png → skin/default/Menu/GameShell/Sleep.png


+ 0 - 0
Menu/GameShell/TinyCloud.png → skin/default/Menu/GameShell/TinyCloud.png


+ 0 - 0
Menu/GameShell/freeDM.png → skin/default/Menu/GameShell/freeDM.png


+ 0 - 0
sys.py/gameshell/blank.png → skin/default/sys.py/gameshell/blank.png


+ 0 - 0
sys.py/gameshell/footbar_icons/footbar.png → skin/default/sys.py/gameshell/footbar_icons/footbar.png


+ 0 - 0
Menu/GameShell/10_Settings/Wifi/icons/_L.png → skin/default/sys.py/gameshell/icons/_L.png


+ 0 - 0
Menu/GameShell/10_Settings/Wifi/icons/_R.png → skin/default/sys.py/gameshell/icons/_R.png


+ 0 - 0
sys.py/gameshell/icons/about_bg.png → skin/default/sys.py/gameshell/icons/about_bg.png


+ 0 - 0
Menu/GameShell/10_Settings/Wifi/icons/done.png → skin/default/sys.py/gameshell/icons/done.png


+ 0 - 0
sys.py/gameshell/icons/empty.png → skin/default/sys.py/gameshell/icons/empty.png


+ 0 - 0
sys.py/gameshell/icons/heart.png → skin/default/sys.py/gameshell/icons/heart.png


+ 0 - 0
sys.py/gameshell/icons/icon_sd.png → skin/default/sys.py/gameshell/icons/icon_sd.png


+ 0 - 0
sys.py/gameshell/icons/light.png → skin/default/sys.py/gameshell/icons/light.png


+ 0 - 0
Menu/GameShell/10_Settings/Wifi/icons/lock.png → skin/default/sys.py/gameshell/icons/lock.png


+ 0 - 0
sys.py/gameshell/icons/needwifi_bg.png → skin/default/sys.py/gameshell/icons/needwifi_bg.png


+ 0 - 0
sys.py/gameshell/icons/online.png → skin/default/sys.py/gameshell/icons/online.png


+ 0 - 0
sys.py/gameshell/icons/rom_download.png → skin/default/sys.py/gameshell/icons/rom_download.png


+ 0 - 0
sys.py/gameshell/icons/roundcorners.png → skin/default/sys.py/gameshell/icons/roundcorners.png


+ 0 - 0
sys.py/gameshell/icons/scale.png → skin/default/sys.py/gameshell/icons/scale.png


+ 0 - 0
sys.py/gameshell/icons/star.png → skin/default/sys.py/gameshell/icons/star.png


+ 0 - 0
sys.py/gameshell/icons/sys.png → skin/default/sys.py/gameshell/icons/sys.png


+ 0 - 0
sys.py/gameshell/icons/vol.png → skin/default/sys.py/gameshell/icons/vol.png


+ 0 - 0
sys.py/gameshell/titlebar_icons/battery_unknown.png → skin/default/sys.py/gameshell/titlebar_icons/battery_unknown.png


+ 0 - 0
sys.py/gameshell/titlebar_icons/soundvolume.png → skin/default/sys.py/gameshell/titlebar_icons/soundvolume.png


+ 0 - 0
sys.py/gameshell/titlebar_icons/wifi.png → skin/default/sys.py/gameshell/titlebar_icons/wifi.png


+ 0 - 0
sys.py/gameshell/titlebar_icons/withcharging.png → skin/default/sys.py/gameshell/titlebar_icons/withcharging.png


+ 0 - 0
sys.py/gameshell/titlebar_icons/without_charging.png → skin/default/sys.py/gameshell/titlebar_icons/without_charging.png


+ 0 - 0
truetype/NotoSansCJK-Regular.ttf → skin/default/truetype/NotoSansCJK-Regular.ttf


+ 0 - 0
truetype/NotoSansMono-Regular.ttf → skin/default/truetype/NotoSansMono-Regular.ttf


+ 0 - 0
truetype/VarelaRound-Regular.ttf → skin/default/truetype/VarelaRound-Regular.ttf


+ 0 - 0
truetype/VeraMono.ttf → skin/default/truetype/VeraMono.ttf


+ 1 - 0
sys.py/UI/.#page.py

@@ -0,0 +1 @@
+guu@guu-desktop.5528:1527716105

+ 7 - 6
sys.py/UI/fonts.py

@@ -6,18 +6,19 @@ from sys import exit
 import os
 import sys
 
-from datetime import datetime
-
+import config
 
 if not pygame.font.get_init():
     pygame.font.init()
 
+
+skinpath = "../skin/"+config.SKIN+"/truetype"
 fonts_path = {}
 
-fonts_path["varela"]   = "../truetype/VarelaRound-Regular.ttf"
-fonts_path["veramono"] = "../truetype/VeraMono.ttf"
-fonts_path["noto"]     = "../truetype/NotoSansMono-Regular.ttf"
-fonts_path["notocjk"]     = "../truetype/NotoSansCJK-Regular.ttf"
+fonts_path["varela"]   = "%s/VarelaRound-Regular.ttf" % skinpath
+fonts_path["veramono"] = "%s/VeraMono.ttf" % skinpath
+fonts_path["noto"]     = "%s/NotoSansMono-Regular.ttf" % skinpath
+fonts_path["notocjk"]     = "%s/NotoSansCJK-Regular.ttf" % skinpath
 
 fonts = {}
 fonts["varela12"] = pygame.font.Font(fonts_path["varela"],12)

+ 2 - 2
sys.py/UI/foot_bar.py

@@ -6,14 +6,14 @@ import os
 
 ##local import 
 from constants  import Width,Height,ICON_TYPES,ALIGN
-from util_funcs import FileExists,midRect
+from util_funcs import FileExists,midRect,SkinMap
 from icon_item  import IconItem
 from fonts      import fonts
 from multi_icon_item import MultiIconItem
 from icon_pool  import MyIconPool
 from libs.roundrects import aa_round_rect
 
-icon_base_path = "gameshell/footbar_icons/"
+icon_base_path = SkinMap("gameshell/footbar_icons/")
 
 class FootBarIcon(MultiIconItem):
 

+ 2 - 2
sys.py/UI/icon_pool.py

@@ -6,12 +6,12 @@ from sys import exit
 import os
 import sys
 
-
+from util_funcs  import SkinMap
 ##pool only store surfaces
 
 class IconPool(object):
 
-    _GameShellIconPath = "gameshell/icons/"
+    _GameShellIconPath = SkinMap("gameshell/icons/")
     _Icons = {}
     def __init__(self):
         self._Icons= {}

+ 6 - 6
sys.py/UI/main_screen.py

@@ -19,7 +19,7 @@ from page        import Page,PageStack
 from title_bar   import TitleBar
 from foot_bar    import FootBar
 from constants   import Width,Height,bg_color
-from util_funcs  import midRect,FileExists,ReplaceSuffix,ReadTheFileContent,CmdClean,MakeExecutable
+from util_funcs  import midRect,FileExists,ReplaceSuffix,ReadTheFileContent,CmdClean,MakeExecutable,SkinMap
 from fonts       import fonts
 from keys_def    import CurKeys
 from label       import Label
@@ -353,7 +353,7 @@ class MainScreen(object):
         return False
 
     def ReadTheDirIntoPages(self,_dir,pglevel,cur_page):
-
+        
         if FileExists(_dir) == False and os.path.isdir(_dir) == False:
             return
         
@@ -371,8 +371,8 @@ class MainScreen(object):
                     iconitem = IconItem()
                     iconitem._CmdPath = ""
                     iconitem.AddLabel(i2,self._IconFont)
-                    if FileExists(_dir+"/"+i2+".png"):
-                        iconitem._ImageName = _dir+"/"+i2+".png"
+                    if FileExists( SkinMap(_dir+"/"+i2+".png") ):
+                        iconitem._ImageName = SkinMap(_dir+"/"+i2+".png")
                     else:
                         untitled = UntitledIcon()
                         untitled.Init()
@@ -446,8 +446,8 @@ class MainScreen(object):
                     iconitem._CmdPath = _dir+"/"+i
                     MakeExecutable(iconitem._CmdPath)
                     iconitem._MyType  = ICON_TYPES["EXE"]
-                    if FileExists(_dir+"/"+ReplaceSuffix(i2,"png")):
-                        iconitem._ImageName = _dir+"/"+ReplaceSuffix(i2,"png")
+                    if FileExists( SkinMap( _dir+"/"+ReplaceSuffix(i2,"png"))):
+                        iconitem._ImageName = SkinMap(_dir+"/"+ReplaceSuffix(i2,"png"))
                     else:
                         untitled = UntitledIcon()
                         untitled.Init()

+ 2 - 9
sys.py/UI/title_bar.py

@@ -17,7 +17,7 @@ from icon_item   import IconItem
 from multi_icon_item import MultiIconItem
 from icon_pool   import MyIconPool
 
-from util_funcs  import midRect,SwapAndShow
+from util_funcs  import midRect,SwapAndShow,SkinMap
 
 from config import Battery
 
@@ -25,7 +25,7 @@ from libs.roundrects import aa_round_rect
 
 from libs.DBUS        import is_wifi_connected_now,wifi_strength
 
-icon_base_path = "gameshell/titlebar_icons/"
+icon_base_path = SkinMap("gameshell/titlebar_icons/")
 class TitleBar:
     _PosX      = 0
     _PosY      = 0
@@ -179,13 +179,6 @@ class TitleBar:
         self._CanvasHWND = pygame.Surface((self._Width,self._Height))
         self._HWND       = screen
         
-        icon_snd = IconItem()
-        icon_snd._MyType = ICON_TYPES["STAT"]
-        icon_snd._Parent = self
-        icon_snd._ImageName = icon_base_path+"ic_volume_up_black.png"
-        icon_snd.Adjust(start_x,self._icon_height/2+(self._BarHeight-self._icon_height)/2,self._icon_width,self._icon_height,0)
-        icon_snd.ChangeImgSurfColor(self._IconColor)
-
 
         icon_wifi_status = MultiIconItem()
         icon_wifi_status._MyType = ICON_TYPES["STAT"]

+ 17 - 0
sys.py/UI/util_funcs.py

@@ -11,7 +11,24 @@ import subprocess
 #from beeprint import pp
 import string
 from Xlib import X,display
+import config
 
+def SkinMap(orig_file_or_dir):
+    DefaultSkin = "default"
+    
+    if orig_file_or_dir.startswith(".."):
+        ret  = orig_file_or_dir.replace("..","../skin/"+config.SKIN)
+        if FileExists(ret) == False:
+            ret = orig_file_or_dir.replace("..","../skin/"+DefaultSkin)
+    else:
+        ret = "../skin/"+config.SKIN+"/sys.py/"+orig_file_or_dir
+        if FileExists(ret) == False:
+            ret = "../skin/"+DefaultSkin+"/sys.py/"+orig_file_or_dir
+        
+    if FileExists( ret ):
+        return ret
+    else:  ## if not existed both in default or custom skin ,return where it is
+        return orig_file_or_dir
 
 def get_git_revision_hash():
     return subprocess.check_output(['git', 'rev-parse', 'HEAD'])

+ 3 - 1
sys.py/config.py

@@ -12,4 +12,6 @@ MPD_socket = "/tmp/mpd.socket"
 
 UPDATE_URL="https://raw.githubusercontent.com/clockworkpi/CPI/master/launcher_ver.json"
 
-VERSION="1.0"
+VERSION="stable 1.0"
+
+SKIN="default"

BIN
sys.py/gameshell/titlebar_icons/ic_battery_charging_full_black.png


BIN
sys.py/gameshell/titlebar_icons/ic_volume_up_black.png


+ 41 - 1
sys.py/run.py

@@ -15,6 +15,7 @@ import time
 import gobject
 
 
+import socket
 import pygame
 from sys import exit
 import os
@@ -29,7 +30,7 @@ else:
 
 
 #local UI import
-from UI.constants    import Width,Height,bg_color,icon_width,icon_height,DT,GMEVT,RUNEVT,RUNSYS
+from UI.constants    import Width,Height,bg_color,icon_width,icon_height,DT,GMEVT,RUNEVT,RUNSYS,ICON_TYPES
 from UI.util_funcs   import ReplaceSuffix,FileExists, ReadTheFileContent,midRect,color_surface,SwapAndShow,GetExePath,X_center_mouse
 from UI.page         import PageStack,PageSelector,Page
 from UI.label        import Label
@@ -254,6 +255,42 @@ def gobject_pygame_event_timer(main_screen):
     
     return True 
 
+
+@misc.threaded
+def socket_thread(main_screen):
+    socket_path = "/tmp/gameshell"
+    if os.path.exists(socket_path):
+        os.remove(socket_path)
+
+    server = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+    server.bind(socket_path)
+    while True:
+        server.listen(1)
+        conn, addr = server.accept()
+        datagram = conn.recv(1024)
+        if datagram:
+            tokens = datagram.strip().split()
+            
+            if tokens[0].lower() == "quit":
+                conn.close()
+                on_exit_cb = getattr(main_screen,"OnExitCb",None)
+                if on_exit_cb != None:
+                    if callable( on_exit_cb ):
+                        main_screen.OnExitCb(None)
+                
+                gobject_main_loop.quit()
+                exit()
+                                
+            if tokens[0].lower() == "poweroff":
+                if main_screen._CurrentPage._Name == "GameShell":
+                    for i in main_screen._CurrentPage._Icons:
+                        if i._MyType == ICON_TYPES["FUNC"]:
+                            if i._Label.GetText() == "PowerOFF":
+                                api_cb = getattr(i._CmdPath,"API",None)
+                                if api_cb != None:
+                                    if callable(api_cb):
+                                        i._CmdPath.API(main_screen)   
+                
 def big_loop():
     global sound_patch
     
@@ -284,6 +321,8 @@ def big_loop():
     gobject.timeout_add(DT,gobject_pygame_event_poll_timer,main_screen)
     gobject.timeout_add(3000,title_bar.GObjectRoundRobin)
 
+
+    socket_thread(main_screen)
     
     gobject_loop()
     
@@ -319,6 +358,7 @@ if __name__ == '__main__':
     if pygame.image.get_extended() == False:
         print("This pygame does not support PNG")
         exit()
+
     
     big_loop()