From 5b42b793a8cbad343b79be3c61a7c53ef96e4e90 Mon Sep 17 00:00:00 2001 From: Taiko2k Date: Thu, 12 Apr 2018 18:11:09 +1200 Subject: [PATCH] update --- CHANGELOG.txt | 1 - README.md | 10 ++-- docs/guide.md | 2 +- extra/tauonmb.desktop | 2 +- tauon.py | 118 +++++++++++++++++++++++------------------- 5 files changed, 73 insertions(+), 60 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 1e3214d40..3cf4e30e8 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -18,7 +18,6 @@ v2.8.0 - Fixed fixed message box not clearing after continued keyboard input - [Linux] Filename changes are now tracked when editing tags with Picard - Bound F5 key to toggle lyrics view - - Removed 'search' shortcut from menu v2.7.0 diff --git a/README.md b/README.md index 4a25fc461..c706be6b8 100644 --- a/README.md +++ b/README.md @@ -22,19 +22,21 @@ Designed to be simple and streamlined while putting the user in control of their - Lyrics display with support for fetching lyrics from LyricWiki. - Open Icecast/Shoutcast streams from URL. Record streams with automatic tagging and splitting. - Outbound radio broadcasting. Streams playlist in background without affecting local playback. - - + + ### Getting Started :dizzy: For __Windows__, download latest installer from [releases](https://github.com/Taiko2k/tauonmb/releases) section. -For __Ubuntu 17.10__, download and install latest deb package from [releases](https://github.com/Taiko2k/tauonmb/releases) section. (Experimental) - For __Arch Linux__, install from the AUR: $ yaourt -S tauon-music-box +For __Other Linux distributions__, you can try an experiemental **flatpak** package. + +1. If you have not already, make sure you have correctly installed and configured flatpak for your distro. See https://flatpak.org/setup/. +2. After downloading from lastes release in [releases](https://github.com/Taiko2k/tauonmb/releases) section. Install using `flatpak install --user tauon.flatpak`. To uninstall run `flatpak uninstall --user org.taiko2k.tauon` ___ diff --git a/docs/guide.md b/docs/guide.md index ab3624d20..75193e627 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -155,7 +155,7 @@ Access by right clicking track; _TRACK MENU -> META... -> MODIFY FOLDER..._ OR Compatible with HTTP streams (Shoutcast, Icecast etc). To open a stream: 1. Go to _MENU -> OPEN STREAM..._ -2. Type in an address (or ctrl+c to paste). (Must start with http:// or ftp://) +2. Type in an address (or ctrl+v to paste). (Must start with http:// or ftp://) > **Tip:** You can manually copy these URLs out of m3u files if available 3. Click GO to start playing diff --git a/extra/tauonmb.desktop b/extra/tauonmb.desktop index 76319f732..efdab51cb 100644 --- a/extra/tauonmb.desktop +++ b/extra/tauonmb.desktop @@ -2,7 +2,7 @@ Comment= Exec=python3 /opt/tauon-music-box/tauon.py %U GenericName=Audio Player -Icon=/opt/tauon-music-box/gui/icon.png +Icon=tauonmb MimeType=audio/ogg;audio/flac;audio/wav;audio/wave;audio/x-tta;audio/mp3;audio/m4a;audio/x-ape Name=Tauon Music Box StartupNotify=false diff --git a/tauon.py b/tauon.py index 29475cb4a..f5720ad2b 100644 --- a/tauon.py +++ b/tauon.py @@ -5338,7 +5338,7 @@ def draw_text_cairo(self, location, text, colour, font, max_x, bg, align=0, max_ cairo_text.prime_font(standard_font, 27 - 5, 17, 17) cairo_text.prime_font(standard_font, 28 - 6, 18, 17) - cairo_text.prime_font(standard_font, 30 - 6, 30, 17) + cairo_text.prime_font(standard_font, 50 - 6, 30, 17) cairo_text.prime_font(standard_font, 22 - 3, 412, 13) cairo_text.prime_font(standard_font, 23 - 3, 413, 13) @@ -5678,7 +5678,7 @@ def draw(self, x, y, text, bg, fg, font=None, align=0, wrap=False, max_x=100, ma pretty_text.prime_font(standard_font, 16 + 6, 16, weight=standard_weight, y_offset=1) pretty_text.prime_font(standard_font, 17 + 6, 17, weight=standard_weight, y_offset=1) - pretty_text.prime_font(standard_font, 30 + 6, 30, weight=standard_weight, y_offset=1) + pretty_text.prime_font(standard_font, 30 + 6, 30, weight=standard_weight, y_offset=-12) pretty_text.prime_font('Arial', 10 + 4, 210, weight=600, y_offset=1) pretty_text.prime_font('Arial', 11 + 3, 211, weight=600, y_offset=1) @@ -5704,6 +5704,7 @@ def draw(self, x, y, text, bg, fg, font=None, align=0, wrap=False, max_x=100, ma pretty_text.prime_font(standard_font, 15 + 4, 15, weight=standard_weight, y_offset=1) pretty_text.prime_font(standard_font, 16 + 4, 16, weight=standard_weight, y_offset=1) pretty_text.prime_font(standard_font, 17 + 4, 17, weight=standard_weight, y_offset=1) + pretty_text.prime_font(standard_font, 30 + 4, 30, weight=standard_weight, y_offset=-12) pretty_text.prime_font(semibold_font, 10 + 2, 210, weight=600, y_offset=1) pretty_text.prime_font(semibold_font, 11 + 2, 211, weight=bold_weight, y_offset=1) @@ -5735,7 +5736,7 @@ def draw(self, x, y, text, bg, fg, font=None, align=0, wrap=False, max_x=100, ma pretty_text.prime_font(standard_font, 17 + 2, 17, weight=standard_weight, y_offset=1) - pretty_text.prime_font(standard_font, 30 + 2, 30, weight=standard_weight, y_offset=1) + pretty_text.prime_font(standard_font, 30 + 2, 30, weight=standard_weight, y_offset=-12) pretty_text.prime_font(semibold_font, 10 + 3, 210, weight=600) pretty_text.prime_font('Arial', 11 + 3, 211, weight=600, y_offset=1) @@ -5765,8 +5766,9 @@ def draw(self, x, y, text, bg, fg, font=None, align=0, wrap=False, max_x=100, ma pretty_text.prime_font(standard_font, 15 + 5, 15, weight=standard_weight, y_offset=0) pretty_text.prime_font(standard_font, 16 + 5, 16, weight=standard_weight, y_offset=-1) pretty_text.prime_font(standard_font, 17 + 5, 17, weight=standard_weight, y_offset=0) + pretty_text.prime_font(standard_font, 30 + 5, 30, weight=standard_weight, y_offset=-12) pretty_text.prime_font(semibold_font, 10 + 5, 210, weight=600) - #pretty_text.prime_font('Arial', 11 + 4, 211, weight=600, y_offset=1) + pretty_text.prime_font(semibold_font, 11 + 3, 211, weight=600, y_offset=1) pretty_text.prime_font(semibold_font, 12 + 4, 212, weight=bold_weight, y_offset=1) pretty_text.prime_font(semibold_font, 13 + 4, 213, weight=bold_weight, y_offset=0) @@ -6016,6 +6018,9 @@ def draw(self, x, y, colour, active=True, secret=False, font=13, width=0, click= # A little bit messy. # For now, this is set up so where 'width' is set > 0, the cursor position becomes editable, # otherwise it is fixed to end + + selection_height *= gui.scale + if click is False: click = input.mouse_click @@ -7600,7 +7605,10 @@ def __init__(self, width, show_icons=False): self.down = False self.font = 412 self.show_icons = show_icons - self.sub_arrow = MenuIcon(WhiteModImageAsset("/gui/sub.png")) + if gui.scale > 1: + self.sub_arrow = MenuIcon(WhiteModImageAsset("/gui/2x/sub.png")) + else: + self.sub_arrow = MenuIcon(WhiteModImageAsset("/gui/sub.png")) self.id = Menu.count self.break_height = 4 * gui.scale @@ -7757,7 +7765,7 @@ def render(self): colour = [150, 150, 150, 255] if self.sub_active == self.items[i][2]: colour = [150, 150, 150, 255] - self.sub_arrow.asset.render(self.pos[0] + self.w - 13, y_run + 7, colour) + self.sub_arrow.asset.render(self.pos[0] + self.w - 13 * gui.scale, y_run + 7 * gui.scale, colour) # Render the items label draw_text((self.pos[0] + x, y_run + ytoff), label, fx[0], self.font, bg=bg) @@ -13363,6 +13371,8 @@ def toggle_scale(mode=0): if prefs.ui_scale != gui.scale: show_message("Change will be applied on restart.") + pref_box.small_preset() + def toggle_borderless(mode=0): global draw_border global update_layout @@ -14008,7 +14018,7 @@ def config_b(self): if system == "linux": y += 28 * gui.scale - self.toggle_square(x, y, toggle_scale, "2x UI scaling (broken)") + self.toggle_square(x, y, toggle_scale, "2x UI scaling") y += 28 * gui.scale self.toggle_square(x, y, toggle_titlebar_line, "Show playing in titlebar") @@ -14264,7 +14274,7 @@ def set_playlist_repeat(self, mode=0): def small_preset(self): - prefs.playlist_row_height = 22 * gui.scale + prefs.playlist_row_height = 22 * prefs.ui_scale prefs.playlist_font_size = 15 gui.update_layout() @@ -17042,14 +17052,14 @@ def render(self): gui.level_2_click = True - x = self.x - 40 + x = self.x - 40 * gui.scale - vr = [x, gui.panelY, 52, 220] + vr = [x, gui.panelY, 52 * gui.scale, 220 * gui.scale] draw.rect_r((vr[0] - 4, vr[1], vr[2] + 8, vr[3] + 4), colours.grey(30), True) draw.rect_r(vr, colours.menu_background, True) - x = x + 7 - y = gui.panelY + 14 + x = x + 7 * gui.scale + y = gui.panelY + 14 * gui.scale func = None @@ -17350,7 +17360,7 @@ def render(self): self.search_text.text = "" return - if input.mouse_click: + if gui.level_2_click and mouse_position[0] > 350 * gui.scale: self.active = False self.search_text.text = "" @@ -17369,7 +17379,7 @@ def render(self): elif not self.results and len(self.search_text.text) > 2: draw_text((130, 200), "No results found", [250, 250, 250, 255], 216, bg=[12, 12, 12, 255]) - self.search_text.draw(100, 80, [230, 230, 230, 255], True, False, 30, window_size[0] - 100, big=True) + self.search_text.draw(100, 80, [230, 230, 230, 255], True, False, 30, window_size[0] - 100, big=True, click=gui.level_2_click) yy = 130 @@ -17437,7 +17447,7 @@ def render(self): if item[4] < 4 and not sec: if i != 0: draw.rect_r((50, yy + 5, 300, 4), [50, 50, 50, 200], True) - yy += 20 + yy += 20 * gui.scale sec = True @@ -17448,22 +17458,22 @@ def render(self): if item[0] == 0: cl = [250, 140, 190, int(255 * fade)] text = "Artist" - yy += 3 - xx = draw_text((120, yy), item[1], [255, 255, 255, int(255 * fade)], 215, bg=[12, 12, 12, 255]) + yy += 3 * gui.scale + xx = draw_text((120 * gui.scale, yy), item[1], [255, 255, 255, int(255 * fade)], 215, bg=[12, 12, 12, 255]) - draw_text((65, yy), text, cl, 214, bg=[12, 12, 12, 255]) + draw_text((65 * gui.scale, yy), text, cl, 214, bg=[12, 12, 12, 255]) if fade == 1: - draw.rect_r((30, yy, 4, 23), [235, 80, 90, 255], True) + draw.rect_r((30 * gui.scale, yy, 4 * gui.scale, 23 * gui.scale), [235, 80, 90, 255], True) - rect = (30, yy, 600, 20) + rect = (30 * gui.scale, yy, 600 * gui.scale, 20 * gui.scale) fields.add(rect) if coll_point(mouse_position, rect) and mouse_change: if self.force_select != p: self.force_select = p gui.update = 2 - if input.mouse_click: + if gui.level_2_click: self.click_artist(item[1]) self.active = False self.search_text.text = "" @@ -17478,12 +17488,12 @@ def render(self): self.active = False self.search_text.text = "" - yy += 6 + yy += 6 * gui.scale if item[0] == 1: - yy += 5 - xx = draw_text((120, yy), item[1], [255, 255, 255, int(255 * fade)], 214, bg=[12, 12, 12, 255]) + yy += 5 * gui.scale + xx = draw_text((120 * gui.scale, yy), item[1], [255, 255, 255, int(255 * fade)], 214, bg=[12, 12, 12, 255]) artist = pctl.master_library[item[2]].album_artist if artist == "": @@ -17491,30 +17501,30 @@ def render(self): if full_count < 6: - draw_text((120 + 5, yy + 28), "BY", [250, 240, 110, int(255 * fade)], 212, bg=[12, 12, 12, 255]) - xx += 8 + draw_text((125 * gui.scale, yy + 28 * gui.scale), "BY", [250, 240, 110, int(255 * fade)], 212, bg=[12, 12, 12, 255]) + xx += 8 * gui.scale - xx += draw_text((120 + 30, yy + 25), artist, [250, 250, 250, int(255 * fade)], 15, bg=[12, 12, 12, 255]) + xx += draw_text((150 * gui.scale, yy + 25 * gui.scale), artist, [250, 250, 250, int(255 * fade)], 15, bg=[12, 12, 12, 255]) - draw.rect_r((50, yy + 5, 50, 50), [50,50,50,150], True) - gall_ren.render(item[2], (50, yy + 5), 50) + draw.rect_r((50 * gui.scale, yy + 5, 50 * gui.scale, 50 * gui.scale), [50,50,50,150], True) + gall_ren.render(item[2], (50 * gui.scale, yy + 5), 50 * gui.scale) if fade != 1: - draw.rect_r((50, yy + 5, 50, 50), [0, 0, 0, 70], True) + draw.rect_r((50 * gui.scale, yy + 5, 50 * gui.scale, 50 * gui.scale), [0, 0, 0, 70], True) full = True full_count += 1 if fade == 1: - draw.rect_r((30, yy + 5, 4, 50), [245, 90, 100, 255], True) + draw.rect_r((30 * gui.scale, yy + 5, 4 * gui.scale, 50 * gui.scale), [245, 90, 100, 255], True) # Mouse Selection - rect = (30, yy, 600, 55) + rect = (30 * gui.scale, yy, 600 * gui.scale, 55 * gui.scale) fields.add(rect) if coll_point(mouse_position, rect) and mouse_change: if self.force_select != p: self.force_select = p gui.update = 2 - if input.mouse_click: + if gui.level_2_click: self.click_album(item[2]) self.active = False self.search_text.text = "" @@ -17525,10 +17535,10 @@ def render(self): self.search_text.text = "" else: - draw_text((120 + xx + 11, yy + 3), "BY", [250, 240, 110, int(255 * fade)], 212, bg=[12, 12, 12, 255]) - xx += 8 + draw_text((120 + xx + 11 * gui.scale, yy + 3), "BY", [250, 240, 110, int(255 * fade)], 212, bg=[12, 12, 12, 255]) + xx += 8 * gui.scale - xx += draw_text((120 + xx + 30, yy), artist, [255, 255, 255, int(255 * fade)], 15, bg=[12, 12, 12, 255]) + xx += draw_text((120 + xx + 30 * gui.scale, yy), artist, [255, 255, 255, int(255 * fade)], 15, bg=[12, 12, 12, 255]) # Mouse Selection rect = (30, yy, 600, 20) @@ -17537,7 +17547,7 @@ def render(self): if self.force_select != p: self.force_select = p gui.update = 2 - if input.mouse_click: + if gui.level_2_click: self.click_album(item[2]) self.active = False self.search_text.text = "" @@ -17550,29 +17560,29 @@ def render(self): self.active = False self.search_text.text = "" if full: - yy += 50 + yy += 50 * gui.scale if item[0] == 2: cl = [250, 220, 190, int(255 * fade)] text = "Track" - xx = draw_text((120, yy), item[1], [255, 255, 255, int(255 * fade)], 15, bg=[12, 12, 12, 255]) + xx = draw_text((120 * gui.scale, yy), item[1], [255, 255, 255, int(255 * fade)], 15, bg=[12, 12, 12, 255]) - draw_text((120 + xx + 11, yy + 3), "BY", [250, 160, 110, int(255 * fade)], 212, bg=[12, 12, 12, 255]) - xx += 8 + draw_text((xx + (120 + 11) * gui.scale, yy + 3 * gui.scale), "BY", [250, 160, 110, int(255 * fade)], 212, bg=[12, 12, 12, 255]) + xx += 8 * gui.scale artist = pctl.master_library[item[2]].artist - xx += draw_text((120 + xx + 30, yy), artist, [255, 255, 255, int(255 * fade)], 214, bg=[12, 12, 12, 255]) + xx += draw_text((xx + (120 + 30) * gui.scale, yy), artist, [255, 255, 255, int(255 * fade)], 214, bg=[12, 12, 12, 255]) - draw_text((65, yy), text, cl, 14, bg=[12, 12, 12, 255]) + draw_text((65 * gui.scale, yy), text, cl, 14, bg=[12, 12, 12, 255]) if fade == 1: - draw.rect_r((30, yy, 4, 17), [245, 90, 100, 255], True) + draw.rect_r((30 * gui.scale, yy, 4 * gui.scale, 17 * gui.scale), [245, 90, 100, 255], True) - rect = (30, yy, 600, 20) + rect = (30 * gui.scale, yy, 600 * gui.scale, 20 * gui.scale) fields.add(rect) if coll_point(mouse_position, rect) and mouse_change: if self.force_select != p: self.force_select = p gui.update = 2 - if input.mouse_click: + if gui.level_2_click: self.click_album(item[2]) self.active = False self.search_text.text = "" @@ -17587,19 +17597,19 @@ def render(self): if item[0] == 3: cl = [240, 240, 160, int(255 * fade)] text = "Genre" - xx = draw_text((120, yy), item[1], [255, 255, 255, int(255 * fade)], 215, bg=[12, 12, 12, 255]) + xx = draw_text((120 * gui.scale, yy), item[1], [255, 255, 255, int(255 * fade)], 215, bg=[12, 12, 12, 255]) - draw_text((65, yy), text, cl, 214, bg=[12, 12, 12, 255]) + draw_text((65 * gui.scale, yy), text, cl, 214, bg=[12, 12, 12, 255]) if fade == 1: - draw.rect_r((30, yy + 4, 4, 17), [245, 90, 100, 255], True) + draw.rect_r((30 * gui.scale, yy + 4 * gui.scale, 4 * gui.scale, 17 * gui.scale), [245, 90, 100, 255], True) - rect = (30, yy, 600, 20) + rect = (30 * gui.scale, yy, 600 * gui.scale, 20 * gui.scale) fields.add(rect) if coll_point(mouse_position, rect) and mouse_change: if self.force_select != p: self.force_select = p gui.update = 2 - if input.mouse_click: + if gui.level_2_click: self.click_genre(item[1]) self.active = False self.search_text.text = "" @@ -17615,7 +17625,7 @@ def render(self): if i > 15: break - yy += 22 + yy += 22 * gui.scale search_over = SearchOverlay() @@ -18802,9 +18812,11 @@ def save_state(): input.mouse_click = False ab_click = True - if input.mouse_click and (radiobox or gui.rename_folder_box or rename_playlist_box or renamebox or view_box.active) and not gui.message_box: + if input.mouse_click and (radiobox or search_over.active or gui.rename_folder_box or rename_playlist_box or renamebox or view_box.active) and not gui.message_box: input.mouse_click = False gui.level_2_click = True + else: + gui.level_2_click = False if track_box and input.mouse_click: w = 540