|
@@ -1,5 +1,7 @@
|
|
|
|
|
|
import pyray
|
|
|
+
|
|
|
+
|
|
|
import sys
|
|
|
sys.path.insert(0,"/opt/LibreLight/Xdesk/")
|
|
|
|
|
@@ -8,8 +10,10 @@ sys.path.insert(0,"/opt/LibreLight/Xdesk/")
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+pyray.ConfigFlags(pyray.FLAG_WINDOW_RESIZABLE )
|
|
|
+pyray.set_config_flags(pyray.FLAG_WINDOW_HIGHDPI )
|
|
|
+pyray.set_config_flags(pyray.FLAG_MSAA_4X_HINT)
|
|
|
+pyray.set_config_flags(pyray.FLAG_WINDOW_RESIZABLE)
|
|
|
|
|
|
|
|
|
CAPTION = 'RAY-DMX'
|
|
@@ -25,11 +29,17 @@ win_title =CAPTION.strip().split()[-1]
|
|
|
store = movewin.load_all_sdl(win_title)
|
|
|
print(store)
|
|
|
POS=[10,10]
|
|
|
+W=760
|
|
|
+H=450
|
|
|
if store:
|
|
|
POS=[store[-2],store[-1]]
|
|
|
+ POS[0] += 5
|
|
|
+ POS[1] += 29
|
|
|
+ print(store)
|
|
|
+ W=int(store[-4])
|
|
|
+ H=int(store[-3])
|
|
|
|
|
|
-
|
|
|
-pyray.init_window(760, 450, CAPTION)
|
|
|
+pyray.init_window(W, H, CAPTION)
|
|
|
|
|
|
|
|
|
|
|
@@ -62,16 +72,11 @@ start = time.time()
|
|
|
frame_count = 0
|
|
|
fps_count = 0
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
|
|
|
-
|
|
|
-a = "/usr/share/fonts/truetype/freefont/FreeSans.ttf"
|
|
|
-a = "/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf"
|
|
|
-a = "/usr/share/fonts/truetype/freefont/FreeSansBold.ttf"
|
|
|
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
k=200
|
|
@@ -197,7 +202,7 @@ def draw_mouse_box(window,pos1,mouse=[None,None,None],color=[128,128,128],text=1
|
|
|
pyray.draw_text_ex(font10l,str(pos2[0])+" "+str(pos2[1]), [pos2[0]+5,pos2[1]+10], font_size, 0, pyray.WHITE)
|
|
|
pyray.draw_text_ex(font10l,str(w), [pos2[0]+5+w/2*wd,pos2[1]], font_size, 0, pyray.WHITE)
|
|
|
pyray.draw_text_ex(font10l,str(h), [pos2[0]+5,pos2[1]+h/2*hd], font_size, 0, pyray.WHITE)
|
|
|
- return pos1,pos2
|
|
|
+ return pos1,pos2,[pos1[0]-pos2[0],pos1[1]-pos2[1]]
|
|
|
|
|
|
mouse_old=[None,None,None]
|
|
|
|
|
@@ -234,16 +239,17 @@ def render_spectrum(cur,x,y):
|
|
|
spectrum.pop(0)
|
|
|
|
|
|
for i,lines in enumerate(spectrum):
|
|
|
- for j,pix in enumerate(lines):
|
|
|
- if type(pix) is not int:
|
|
|
- pix=0
|
|
|
- if pix > 255:
|
|
|
- pix=255
|
|
|
- if pix < 0:
|
|
|
- pix=0
|
|
|
- c=[255,255,255,pix]
|
|
|
-
|
|
|
- pyray.draw_line(x+j,y+i*6,x+j,y+i*6-5,c)
|
|
|
+ if lines:
|
|
|
+ for j,pix in enumerate(lines):
|
|
|
+ if type(pix) is not int:
|
|
|
+ pix=0
|
|
|
+ if pix > 255:
|
|
|
+ pix=255
|
|
|
+ if pix < 0:
|
|
|
+ pix=0
|
|
|
+ c=[255,255,255,pix]
|
|
|
+
|
|
|
+ pyray.draw_line(x+j,y+i*6,x+j,y+i*6-5,c)
|
|
|
|
|
|
|
|
|
def render_grid(cur,x,y):
|
|
@@ -337,6 +343,9 @@ while not pyray.window_should_close():
|
|
|
|
|
|
if cur is None:
|
|
|
cur = k
|
|
|
+ if cur not in host_list:
|
|
|
+ if host_list:
|
|
|
+ cur = keys[0]
|
|
|
|
|
|
if spectrum_btn.btn.btn1.val.get():
|
|
|
render_spectrum(cur,230,50)
|
|
@@ -414,18 +423,14 @@ while not pyray.window_should_close():
|
|
|
|
|
|
for k,btn in buttons.items():
|
|
|
btn.event(old_x,old_y,mouse_old)
|
|
|
-
|
|
|
if "release" == mouse_old[0]:
|
|
|
btn.button = 1
|
|
|
-
|
|
|
if check_area(btn.btn.pos,[old_y,old_x]):
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- cur = k
|
|
|
+ cur = k
|
|
|
btn.draw()
|
|
|
aapos = draw_mouse_box(None,[old_x,old_y],mouse_old,color=[128,128,128],text=1)
|
|
|
|
|
|
+
|
|
|
|
|
|
pyray.draw_text_ex(font20,"POS:{}:{}".format(int(m.x),int(m.y)),[10,34], 20, 0, pyray.VIOLET)
|
|
|
|