From bf98e9266c3bd0b18bdbb5565527ed3c026d39d8 Mon Sep 17 00:00:00 2001 From: Taiko2k Date: Wed, 7 Mar 2018 19:52:22 +1300 Subject: [PATCH] add icon --- CHANGELOG.txt | 1 + gui/2x/error.png | Bin 0 -> 2110 bytes gui/error.png | Bin 0 -> 1210 bytes tauon.py | 340 ++--------------------------------------------- 4 files changed, 10 insertions(+), 331 deletions(-) create mode 100644 gui/2x/error.png create mode 100644 gui/error.png diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c2c4027d6..c1bd68c63 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -22,6 +22,7 @@ v2.7.0 - Fixed gallery setting not being remembered on restart - Fixed remove embed function causing crash - Fixed showcase view not showing radio metadata, not showing title when missing metadata + - Fixed cursor flicker on column drag - [Windows] Fixed non ascii device names causing playback to fail diff --git a/gui/2x/error.png b/gui/2x/error.png new file mode 100644 index 0000000000000000000000000000000000000000..3a7e9718eb6ebefce9d4adc5eea7abdab4be4c64 GIT binary patch literal 2110 zcmV-E2*LM>P)%i@@$cF8AWSM~_}~L*&>11sU$_{JyCE68Nf{BpgHa0wUX6BavTA zf4}L3!jS=QN2ALPI0$^xNqZmgx13=--aareVz;4Tw?VSAv)h1w@Z}K?aDTuwhfhYM z-?Q7$@(9rWej|DE~>N~DC}&DM1E@Zmat?%Di#Z6GnoUxdN;{c46286OO|YG z-@A9RTxeMXQn6SlJ27ztkw?7Au3|WvYiQ^$XF|zmfP!Q*nSK9*;sMqL&YU@@{rx31 zmb{pZMt1^_d74&bu|7FG{EJcnH@yXhqtO`fN6%CG0-&lJB8kK+b6uO$fD>I^cLq%J zZD66VnN<##1G!w}-lIo9EWR-77Eq9YY5tD?AMpSSuLlALbdG=cECZ6Aottqp$r0ge z8#nTmrY6S}#V|r4?%2AOs#|Y$o))Z5Mx(QyXE!*Kip3UZGnq6{@2nT$_AOheU$+i( zVuBC1Z|7Pn^$`%j(r-#TPoNsbOhfU&&twBNSq3Z*N)gd4$4Y?%2B3 zQfv`cCZo|d_-L z_MRTO!!pFUlA@l(*8YBdJQ5Ee0g=BO;^5&oC!E|4)z#E4Uv4?xL-7EZ&};}adcp>dOt1>C#RCX5 z8i2JiYZX42;D`8WtT0r>+1$SrJT$>a@c{J(rn$fmW-m;%Q7i3PCv=`ra!+Ib2qDrGjvv-k{5eNo{0CmITWHqwwsp(O`R*iY$}?)*{tQ9r}19f;NUixxi4Uv2ko)|oQuc# z^yQaJ#@JfbS-c&_M@AUgwvF61`!jigLc#?D=85cK>I9~3lrq85lD3QqZp5Q{p$7Kl z{|w|m{3e~w{&>ZTT138OpB2W_X>y-^MqOK5;XAkM`MC^7DJ*@xnv@hUKtf zn!A8=j+lXSgM)m!e?Q<+F{5ZCxD^kaHLI(4&-`N6UO+M$-J~<_5htjB_+hRL50`!5 zS%wJVt}f0WJ4SAN+%b)+J{CzNet!e?tRRqNG&%&_@3^NgC*Ew0$Ja>FtanyLNI-K_ zJH?kPmYV;#6v*X%P%Iv9a!#;)U|>W=e&~N*m4U$KxlV{diGz}n!NET%?DQ|KisAXz zc>K>dyI8U)+7^#LjmQDdQ>qkH54A=j&y)%&X@G#{Zo91qRqyw@{KsE%OO|XbcWmC$ zmiS-StO+ixtJ@>6$(!7K#~*SH4VyeUE}w^jBs)8wNA+oUx%mnOUTBTSe>T?>e=gWQ z6fxY<(S^ut8f{aN4X8c@+=GMn z6Q^MU?*Ol17>C*h29lm7ISpS7n28e|9rZzx2Z5EUdN(2~fW@dTDx6JFy@tpo-~x~q ocps6}b<-SbPb56wyPS#t0;I8H#gKM>YybcN07*qoM6N<$f*(@+Gynhq literal 0 HcmV?d00001 diff --git a/gui/error.png b/gui/error.png new file mode 100644 index 0000000000000000000000000000000000000000..894b1d09b5030e04a5bc7b057ac0662cea9d2a14 GIT binary patch literal 1210 zcmV;r1V#IaP)j?u2qLgv118HT zgoFi>?Pj;S3pH7?$YMf}5jIVXyV|a&S$2U#t$buRXqF&^#1vR?Dg;R8hRlRvX$$n@ zoL!7!OMBWQ!T;6i^FHtM`=8VIea?FX1~t*t)xahYg1keAbcZ#lwQg>9rWlxNYdf~R+B3sTOF7!thpV?2*>2AY zfA8Em+*hySsH@XAA;cGxUT^V^0W}`KfX-I4l$LU|w-?jFgIHZITs=LRO>D!Rjg1JC zi6fnz*-Y3?iqZujCYqWY7L#e23{6HUEW~~78YZVRB_4YGn1xH1h=;?k;AhX`JasB1 zPmM&Fzj%@G)2EqCgz}+8GAl}RCOANBZH?8@(X_a&qT%8j0wY23S?L zUo2U*eB%ZHMeXe=ajVOP)#chN9064la3q(3go%}#H*@A0g#&0%CIJp328@^p&deBw zZ|i`RJ10p(r0s}g$#y%!Y<{hh5)d#7PwaC&<(HM|_leAUDFKW70Z%Avv)Wx279?P5 zukdxhpMP%O-m?i+)28LqZnsT9d&Z0$@WsA90uLV|%x2v_u{Jh_rn4x85LYCN#WDzl zG9@Su2ew^>li`WgzI^>UFMPhVJWELl=AxpEa3Ey1SVrXUA3chE?sk^}Y28rW+T!K- zI0rl)l!Ahc@MKfTPa+-;v(Vj5cux0B`eW6tTffKvr_0O#K!`JdoMvKUW5>kC{Cw7Z z9-N*=n9bxLKFmUQH=!p_^xzRW9{==*xw(ILj%5DU)+@l5dNWK;C-Gp=P?Iqi6%kok z(H$3>_HFguyI(=liD)el=n^oYHz~ThYPiE?gCoSaEf(wE`I$U6>Gc*XiZUtST|=bT z*WW@_J=KGQe{9J<;;MsnYHTY8&;-h4EngM`XpKnHsMr(lI_KhyYcq|t4 zRNcAr`|hEPFQb}~kr(!8^h2R(J?QiZgNgv(*dvjKEo4i~X&|B5jt+Y?5@}XdwLu6`&Ho3P?o+&SH`2GI=ppm-& Y0seE43bTX$1ONa407*qoM6N<$f>#DM%>V!Z literal 0 HcmV?d00001 diff --git a/tauon.py b/tauon.py index 9111e0873..8fbfe5428 100644 --- a/tauon.py +++ b/tauon.py @@ -16443,6 +16443,7 @@ def render(self): switch_showcase() if view_box.was_album: force_album_view() + return 0 if pctl.playing_state == 3: @@ -16474,14 +16475,6 @@ def render(self): track = pctl.master_library[pctl.track_queue[pctl.queue_step]] - - # if self.artist_mode: - # - # if track.artist == self.lastfm_artist: - # - # return - # - # else: album_art_gen.display(index, (x, y), (box, box)) if coll_point(mouse_position, (x, y, box, box)) and input.mouse_click is True: album_art_gen.cycle_offset(index) @@ -16489,8 +16482,8 @@ def render(self): if track.lyrics == "": w = window_size[0] - (x + box) - 30 - # x = int(x + box + (window_size[0] - x - box) / 2) - x = int((window_size[0]) / 2) + x = int(x + box + (window_size[0] - x - box) / 2) + #x = int((window_size[0]) / 2) y = int(window_size[1] / 2) - 60 if track.artist == "" and track.title == "": @@ -16536,53 +16529,6 @@ def render(self): showcase = Showcase() -class AlbumCard: - - def __init__(self): - self.x = 100 - self.y = 100 - self.w = 350 - self.h = 500 - - self.selected = 0 - self.active = False - - def activate(self, selected, x, y): - - self.selected = selected - self.x = x - self.y = y - self.active = True - - def render(self): - - if not self.active: - return - - bg = colours.sys_background_2 - - tracks = get_album_info(self.selected) - print(tracks) - - self.h = 25 + (16 * len(tracks[1])) - - c = colours.gallery_highlight - c = [c[1], c[2], c[0], c[3]] - draw.rect((self.x - 4 * gui.scale, self.y - 4 * gui.scale), (self.w + 8 * gui.scale, self.h + 8 * gui.scale), - c, True) - - #draw.rect_r([self.x - 2, self.y, self.w, self.h], bg, True) - draw.rect_r([self.x, self.y, self.w, self.h], bg, True) - - y = self.y + 5 - - for i, item in enumerate(tracks[1]): - line_render(pctl.master_library[default_playlist[item]], item, y + (16 * i), False, 255, self.x + 10, self.w - 20) - - - -album_card = AlbumCard() - class ColourPulse: def __init__(self, hue): @@ -16597,8 +16543,6 @@ def __init__(self, hue): self.max_sat = 0.75 self.max_lumi = 0.45 - - def get(self, hit, on): if on: @@ -16624,16 +16568,12 @@ def get(self, hit, on): if in_time < ani_time: self.out_timer.force_set(ani_time - in_time) - lumi = 0 sat = 0 - in_time = self.in_timer.get() out_time = self.out_timer.get() - - if self.active: if in_time < ani_time: gui.update = 2 @@ -16664,227 +16604,6 @@ def get(self, hit, on): rgb = colorsys.hls_to_rgb(self.hue, lumi, sat) return [int(rgb[0] * 255), int(rgb[1] * 255), int(rgb[2] * 255), 255] -# class ViewBox: -# -# def __init__(self): -# self.x = 0 -# self.y = gui.panelY -# self.w = 270 * gui.scale -# self.h = 95 * gui.scale -# self.active = False -# -# self.border = 3 * gui.scale -# -# if gui.scale == 1: -# self.tracks_img = WhiteModImageAsset("/gui/tracks.png") -# self.side_img = WhiteModImageAsset("/gui/tracks+side.png") -# self.gallery1_img = WhiteModImageAsset("/gui/gallery1.png") -# self.combo_img = WhiteModImageAsset("/gui/combo.png") -# self.lyrics_img = WhiteModImageAsset("/gui/lyrics.png") -# self.gallery2_img = WhiteModImageAsset("/gui/gallery2.png") -# self.col_img = WhiteModImageAsset("/gui/col.png") -# else: -# self.tracks_img = WhiteModImageAsset("/gui/2x/tracks.png") -# self.side_img = WhiteModImageAsset("/gui/2x/tracks+side.png") -# self.gallery1_img = WhiteModImageAsset("/gui/2x/gallery1.png") -# self.combo_img = WhiteModImageAsset("/gui/2x/combo.png") -# self.lyrics_img = WhiteModImageAsset("/gui/2x/lyrics.png") -# self.gallery2_img = WhiteModImageAsset("/gui/2x/gallery2.png") -# self.col_img = WhiteModImageAsset("/gui/2x/col.png") -# -# # self.tracks_colour = ColourPulse(0.0) -# # self.side_colour = ColourPulse(0.1) -# # self.gallery1_colour = ColourPulse(0.2) -# # self.combo_colour = ColourPulse(0.3) -# # self.lyrics_colour = ColourPulse(0.5) -# # self.gallery2_colour = ColourPulse(0.7) -# -# self.tracks_colour = ColourPulse(0.5) -# self.side_colour = ColourPulse(0.55) -# self.gallery1_colour = ColourPulse(0.6) -# self.combo_colour = ColourPulse(0.75) -# self.lyrics_colour = ColourPulse(0.7) -# self.gallery2_colour = ColourPulse(0.65) -# self.col_colour = ColourPulse(0.14) -# -# self.on_colour = [255, 190, 50, 255] -# self.over_colour = [255, 190, 50, 255] -# self.off_colour = colours.grey(40) -# -# def activate(self, x): -# self.x = x -# self.active = True -# -# self.tracks_colour.out_timer.force_set(10) -# self.side_colour.out_timer.force_set(10) -# self.gallery1_colour.out_timer.force_set(10) -# self.combo_colour.out_timer.force_set(10) -# self.lyrics_colour.out_timer.force_set(10) -# self.gallery2_colour.out_timer.force_set(10) -# self.col_colour.out_timer.force_set(10) -# -# self.tracks_colour.active = False -# self.side_colour.active = False -# self.gallery1_colour.active = False -# self.combo_colour.active = False -# self.lyrics_colour.active = False -# self.gallery2_colour.active = False -# self.col_colour.active = False -# -# gui.level_2_click = False -# gui.update = 2 -# -# def button(self, x, y, asset, test, colour_get=None, name="Unknown"): -# -# on = test() -# rect = [x - 8 * gui.scale, -# y - 8 * gui.scale, -# asset.w + 16 * gui.scale, -# asset.h + 16 * gui.scale] -# fields.add(rect) -# -# if on: -# colour = self.on_colour -# -# else: -# colour = self.off_colour -# -# -# fun = None -# col = False -# if coll_point(mouse_position, rect): -# -# tool_tip.test(x + asset.w + 10 * gui.scale, y - 15 * gui.scale, name) -# -# col = True -# if gui.level_2_click: -# fun = test -# if colour_get is None: -# colour = self.over_colour -# -# if colour_get is not None: -# colour = colour_get.get(col, on) -# -# asset.render(x, y, colour) -# -# return fun -# -# def tracks(self, hit=False): -# -# if hit is False: -# return album_mode is False and \ -# gui.combo_mode is False and \ -# side_panel_enable is False -# view_tracks() -# -# def side(self, hit=False): -# -# if hit is False: -# return album_mode is False and \ -# gui.combo_mode is False and \ -# side_panel_enable is True -# view_standard_meta() -# -# def gallery1(self, hit=False): -# -# if hit is False: -# return album_mode is True and \ -# gui.combo_mode is False and \ -# gui.show_playlist is True -# force_album_view() -# -# def combo(self, hit=False): -# -# if hit is False: -# return album_mode is False and \ -# gui.combo_mode is True and \ -# gui.showcase_mode is False -# toggle_combo_view() -# -# def lyrics(self, hit=False): -# -# if hit is False: -# return album_mode is False and \ -# gui.combo_mode is True and \ -# gui.showcase_mode is True -# switch_showcase() -# -# def gallery2(self, hit=False): -# -# if hit is False: -# return album_mode is True and \ -# gui.combo_mode is False and \ -# gui.show_playlist is False -# gallery_only_view() -# -# def col(self, hit=False): -# -# if hit is False: -# return gui.set_mode -# toggle_library_mode() -# -# def render(self): -# -# rect = [self.x, self.y, self.w, self.h] -# -# if gui.level_2_click and not coll_point(mouse_position, rect): -# self.active = False -# gui.level_2_click = False -# return -# -# draw.rect_r(rect, colours.menu_background, True) -# -# draw.rect_r([self.x, self.y, self.border, self.h], colours.grey(30), True) -# draw.rect_r([self.x, self.y + self.h, self.w, self.border], colours.grey(30), True) -# draw.rect_r([self.x + self.w, self.y, self.border, self.h], colours.grey(30), True) -# -# x = self.x + 20 * gui.scale -# y = self.y + 15 * gui.scale -# -# func = None -# -# test = self.button(x, y, self.tracks_img, self.tracks, self.tracks_colour, "Tracks only") -# if test is not None: -# func = test -# -# x += 60 * gui.scale -# test = self.button(x, y, self.side_img, self.side, self.side_colour, "Tracks + Side bar") -# if test is not None: -# func = test -# -# x += 65 * gui.scale -# test = self.button(x, y, self.gallery1_img, self.gallery1, self.gallery1_colour, "Tracks + Gallery") -# if test is not None: -# func = test -# -# x = self.x + 21 * gui.scale -# y = self.y + 56 * gui.scale -# -# test = self.button(x, y, self.combo_img, self.combo, self.combo_colour, "Art + Tracks") -# if test is not None: -# func = test -# -# x += 63 * gui.scale -# test = self.button(x, y, self.lyrics_img, self.lyrics, self.lyrics_colour, "Art + Lyrics") -# if test is not None: -# func = test -# -# x += 68 * gui.scale -# test = self.button(x, y, self.gallery2_img, self.gallery2, self.gallery2_colour, "Gallery only") -# if test is not None: -# func = test -# -# test = self.button(x + 70 * gui.scale, y - 23 * gui.scale, self.col_img, self.col, self.col_colour, "Toggle columns") -# if test is not None: -# func = test -# -# if func is not None: -# func(True) -# self.active = False -# -# gui.level_2_click = False -# -# view_box = ViewBox() class ViewBox: def __init__(self): @@ -16913,13 +16632,6 @@ def __init__(self): self.gallery2_img = WhiteModImageAsset("/gui/2x/gallery2.png") self.col_img = WhiteModImageAsset("/gui/2x/col.png") - # self.tracks_colour = ColourPulse(0.0) - # self.side_colour = ColourPulse(0.1) - # self.gallery1_colour = ColourPulse(0.2) - # self.combo_colour = ColourPulse(0.3) - # self.lyrics_colour = ColourPulse(0.5) - # self.gallery2_colour = ColourPulse(0.7) - self.tracks_colour = ColourPulse(0.5) self.side_colour = ColourPulse(0.55) self.gallery1_colour = ColourPulse(0.6) @@ -17019,13 +16731,6 @@ def gallery1(self, hit=False): return album_mode is True and gui.show_playlist is True force_album_view() - # def combo(self, hit=False): - # - # if hit is False: - # return album_mode is False and \ - # gui.combo_mode is True and \ - # gui.showcase_mode is False - # toggle_combo_view() def lyrics(self, hit=False): @@ -17068,20 +16773,7 @@ def render(self): if x_menu.clicked: gui.level_2_click = True - # if gui.level_2_click and not coll_point(mouse_position, rect): - # self.active = False - # gui.level_2_click = False - # return - - # draw.rect_r(rect, colours.menu_background, True) - # - # draw.rect_r([self.x, self.y, self.border, self.h], colours.grey(30), True) - # draw.rect_r([self.x, self.y + self.h, self.w, self.border], colours.grey(30), True) - # draw.rect_r([self.x + self.w, self.y, self.border, self.h], colours.grey(30), True) - # - # x = self.x + 20 * gui.scale - # y = self.y + 15 * gui.scale x = self.x - 40 vr = [x, gui.panelY, 52, 220] @@ -17115,14 +16807,6 @@ def render(self): if test is not None: func = test - # test = self.button(x, y, self.combo_img, self.combo, self.combo_colour, "Art + Tracks") - # if test is not None: - # func = test - - # x += 68 * gui.scale - # test = self.button(x, y, self.gallery2_img, self.gallery2, self.gallery2_colour, "Gallery only") - # if test is not None: - # func = test y += 40 * gui.scale @@ -17139,6 +16823,7 @@ def render(self): view_box = ViewBox() + class GalleryJumper: def __init__(self): @@ -18411,7 +18096,7 @@ def save_state(): show_message("Test error message", 'error', "Just a test, no need to worry.") - gallery_jumper.calculate() + # gallery_jumper.calculate() # colours.level_1_bg = [0, 6, 30, 255] # colours.level_2_bg = [0, 6, 30, 255] @@ -18436,8 +18121,6 @@ def save_state(): # print(gl) # print(sum(x[1] for x in gl)) - - key_F7 = False @@ -18847,7 +18530,6 @@ def save_state(): SDL_RenderClear(renderer) SDL_SetRenderTarget(renderer, gui.main_texture) - # perf_timer.set() fields.clear() @@ -18887,10 +18569,8 @@ def save_state(): and not view_box.active \ and not folder_menu.active: - #update_layout = True - if side_drag != True: draw_sep_hl = True @@ -18901,7 +18581,7 @@ def save_state(): gui.cursor_mode = 2 SDL_SetCursor(cursor_shift) - elif not side_drag and gui.cursor_mode == 2: + elif not side_drag and gui.cursor_mode == 2 and not mouse_down: SDL_SetCursor(cursor_standard) gui.cursor_mode = 0 @@ -18999,10 +18679,8 @@ def save_state(): album_pos_px = -55 gallery_pulse_top.pulse() - gallery_pulse_top.render(gui.playlist_width + 30 * gui.scale, gui.panelY + 1, window_size[0] - gui.playlist_width + 30 * gui.scale, 2) - # ---- rect = ( window_size[0] - (33 * gui.scale if not gui.maximized else 32 * gui.scale), gui.panelY, 31 * gui.scale, window_size[1] - gui.panelBY - gui.panelY) @@ -19286,8 +18964,8 @@ def save_state(): draw.rect((0, 0), (window_size[0], gui.panelY), colours.top_panel_background, True) - if gui.show_playlist is False: - album_card.render() + # if gui.show_playlist is False: + # album_card.render() # if gui.album_tab_mode: # draw.rect_r([l_area - 4, gui.panelY, r_area + 4, 2], [80, 70, 220, 255], True) @@ -19413,7 +19091,7 @@ def save_state(): gui.cursor_mode = 2 SDL_SetCursor(cursor_shift) else: - if gui.cursor_mode == 2 and mouse_position[1] < 50: + if gui.cursor_mode == 2 and mouse_position[1] < 50 and not mouse_down: SDL_SetCursor(cursor_standard) gui.cursor_mode = 0