├── .github └── workflows │ ├── flatpak.yml │ └── windows.yml ├── .gitignore ├── LICENSE ├── README.md ├── data ├── io.github.Miqueas.TapeDeck.gresources.xml ├── meson.build └── ui │ └── app-window.blp ├── io.github.Miqueas.TapeDeck.yml ├── meson.build ├── src ├── app-window.vala ├── app.vala ├── meson.build ├── track-info.vala └── vapi │ └── mpd.vapi └── subprojects ├── blueprint-compiler.wrap └── libmpdclient.wrap /.github/workflows/flatpak.yml: -------------------------------------------------------------------------------- 1 | name: Flatpak 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | paths-ignore: 8 | - '**.md' 9 | - '**/LICENSE' 10 | - '**.jpg' 11 | - '**.jpeg' 12 | - '**.png' 13 | - '**.blp' 14 | - '**.svg' 15 | - '**/.gitpod.yml' 16 | - '**/.gitpod/**' 17 | - '.github/workflows/windows.yml' 18 | pull_request: 19 | 20 | jobs: 21 | flatpak: 22 | name: Build 23 | runs-on: ubuntu-latest 24 | 25 | container: 26 | image: bilelmoussaoui/flatpak-github-actions 27 | options: --privileged 28 | 29 | steps: 30 | - name: Checkout 31 | uses: actions/checkout@v2 32 | 33 | - name: Build Flatpak 34 | uses: flatpak/flatpak-github-actions/flatpak-builder@v4 35 | with: 36 | manifest-path: io.github.Miqueas.TapeDeck.yml 37 | bundle: io.github.Miqueas.TapeDeck.flatpak 38 | -------------------------------------------------------------------------------- /.github/workflows/windows.yml: -------------------------------------------------------------------------------- 1 | name: Windows 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | paths-ignore: 8 | - '**.md' 9 | - '**/LICENSE' 10 | - '**.jpg' 11 | - '**.jpeg' 12 | - '**.png' 13 | - '**.ui' 14 | - '**.svg' 15 | - '**/.gitpod.yml' 16 | - '**/.gitpod/**' 17 | - 'flatpak/com.github.Miqueas.TapeDeck.yml' 18 | - '.github/workflows/flatpak.yml' 19 | 20 | jobs: 21 | windows: 22 | name: Build 23 | runs-on: windows-latest 24 | 25 | defaults: 26 | run: 27 | # Sets the default shell where commands will be executed 28 | shell: msys2 {0} 29 | 30 | steps: 31 | - name: Setup MSYS 32 | uses: msys2/setup-msys2@v2 33 | with: 34 | path-type: strict 35 | msystem: MINGW64 36 | update: true 37 | install: git base-devel 38 | pacboy: > 39 | gcc:x gtk4:x vala:x meson:x 40 | ninja:x gobject-introspection:x 41 | libadwaita:x python-gobject:x 42 | 43 | - name: Clone, build and install libmpdclient 44 | run: | 45 | git clone https://github.com/MusicPlayerDaemon/libmpdclient.git 46 | cd libmpdclient 47 | CC=gcc meson BUILD 48 | ninja -C BUILD install 49 | cd ..; rm -rf libmpdclient 50 | 51 | - name: Setup repo 52 | uses: actions/checkout@v2 53 | 54 | - name: Build Tape Deck 55 | run: | 56 | CC=gcc meson BUILD 57 | ninja -C BUILD 58 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /subprojects/blueprint-compiler -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | zlib License 2 | 3 | Copyright (c) 2020 - 2023 Miqueas Martinez 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![License][LicenseBadge]][LicenseURL] 2 | ![Github Actions status, Windows][WinBuildBadge] 3 | ![Github Actions status, Flatpak][FlatpakBuildBadge] 4 | 5 | # Tape Deck (WIP) 6 | 7 | MPD client, done right. 8 | 9 | ## Building 10 | 11 | You'll need: 12 | 13 | * `meson >=0.56.0` 14 | * `libadwaita-1 >=1.0` 15 | * `libmpdclient >=2.19` 16 | 17 | Then: 18 | 19 | ``` 20 | git clone https://github.com/Miqueas/TapeDeck.git 21 | cd TapeDeck 22 | meson _BUILD 23 | ninja -C _BUILD 24 | ``` 25 | 26 | [LicenseBadge]: https://img.shields.io/github/license/Miqueas/TapeDeck?label=License 27 | [LicenseURL]: https://opensource.org/licenses/Zlib 28 | [WinBuildBadge]: https://img.shields.io/github/actions/workflow/status/Miqueas/TapeDeck/windows.yml?label=Build&logo=windows 29 | [FlatpakBuildBadge]: https://img.shields.io/github/actions/workflow/status/Miqueas/TapeDeck/flatpak.yml?label=Build&logo=linux&logoColor=white -------------------------------------------------------------------------------- /data/io.github.Miqueas.TapeDeck.gresources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ui/app-window.ui 7 | 8 | 9 | -------------------------------------------------------------------------------- /data/meson.build: -------------------------------------------------------------------------------- 1 | gnome = import('gnome') 2 | 3 | blp_compiler = find_program('blueprint-compiler') 4 | blp_src = [ 5 | 'ui/app-window.blp' 6 | ] 7 | 8 | blp = custom_target('blp', 9 | input: blp_src, 10 | output: '.', 11 | command: [ blp_compiler, 'batch-compile', '@OUTDIR@', '@CURRENT_SOURCE_DIR@', '@INPUT@' ] 12 | ) 13 | 14 | gres_dir = meson.current_build_dir() 15 | gres = gnome.compile_resources( 16 | meson.project_name(), 17 | meson.project_name() + '.gresources.xml', 18 | dependencies: blp, 19 | source_dir: [ gres_dir ] 20 | ) -------------------------------------------------------------------------------- /data/ui/app-window.blp: -------------------------------------------------------------------------------- 1 | using Gtk 4.0; 2 | using Adw 1; 3 | 4 | template TpdAppWindow : Adw.ApplicationWindow { 5 | default-width: 400; 6 | default-height: 600; 7 | } -------------------------------------------------------------------------------- /io.github.Miqueas.TapeDeck.yml: -------------------------------------------------------------------------------- 1 | app-id: io.github.Miqueas.TapeDeck 2 | command: io.github.Miqueas.TapeDeck 3 | 4 | runtime: org.gnome.Platform 5 | runtime-version: "43" 6 | sdk: org.gnome.Sdk//43 7 | 8 | finish-args: 9 | - --share=network 10 | - --share=ipc 11 | - --device=dri 12 | - --socket=fallback-x11 13 | - --socket=wayland 14 | 15 | cleanup: 16 | - /include 17 | - /lib/pkgconfig 18 | - /man 19 | - /share/doc 20 | - /share/gtk-doc 21 | - /share/man 22 | - /share/pkgconfig 23 | - /share/vala 24 | - "*.la" 25 | - "*.a" 26 | 27 | modules: 28 | - name: libmpdclient 29 | buildsystem: meson 30 | sources: 31 | - type: git 32 | url: https://github.com/MusicPlayerDaemon/libmpdclient.git 33 | - name: blueprint-compiler 34 | buildsystem: meson 35 | sources: 36 | - type: git 37 | url: https://gitlab.gnome.org/jwestman/blueprint-compiler.git 38 | branch: main 39 | - name: TapeDeck 40 | buildsystem: meson 41 | sources: 42 | - type: dir 43 | path: "." -------------------------------------------------------------------------------- /meson.build: -------------------------------------------------------------------------------- 1 | project('io.github.Miqueas.TapeDeck', 'vala', 'c', 2 | version: '0.1.0', 3 | license: 'Zlib' 4 | ) 5 | 6 | subdir('data') 7 | subdir('src') -------------------------------------------------------------------------------- /src/app-window.vala: -------------------------------------------------------------------------------- 1 | [GtkTemplate(ui = "/io/github/Miqueas/TapeDeck/ui/app-window.ui")] 2 | public class Tpd.AppWindow : Adw.ApplicationWindow { 3 | public AppWindow(App app) { 4 | Object(application: app); 5 | } 6 | } -------------------------------------------------------------------------------- /src/app.vala: -------------------------------------------------------------------------------- 1 | public class Tpd.App : Adw.Application { 2 | public App() { 3 | Object(application_id: "io.github.Miqueas.TapeDeck"); 4 | } 5 | 6 | static int main(string[] args) { 7 | return new App().run(args); 8 | } 9 | 10 | protected override void activate() { 11 | this.active_window?.present(); 12 | } 13 | 14 | protected override void startup() { 15 | base.startup(); 16 | this.style_manager.color_scheme = Adw.ColorScheme.PREFER_DARK; 17 | 18 | new AppWindow(this); 19 | } 20 | } -------------------------------------------------------------------------------- /src/meson.build: -------------------------------------------------------------------------------- 1 | deps = [ 2 | dependency('libadwaita-1', version: '>=1.0'), 3 | dependency('libmpdclient') 4 | ] 5 | 6 | src = [ 7 | # Vala sources 8 | 'app.vala', 9 | 'app-window.vala', 10 | 'track-info.vala', 11 | # GResources 12 | gres 13 | ] 14 | 15 | executable(meson.project_name(), src, 16 | vala_args: [ 17 | '--target-glib=2.50', 18 | '--gresourcesdir=' + gres_dir 19 | ], 20 | dependencies: deps, 21 | install: true, 22 | # Windows specific, see the Meson doc for details 23 | # win_subsystem: 'windows' 24 | ) -------------------------------------------------------------------------------- /src/track-info.vala: -------------------------------------------------------------------------------- 1 | public class Tpd.TrackInfo : Gtk.Widget { 2 | } -------------------------------------------------------------------------------- /src/vapi/mpd.vapi: -------------------------------------------------------------------------------- 1 | [CCode (cprefix = "mpd_", cheader_filename = "mpd/mpd.h")] 2 | namespace Mpd { 3 | [CCode (cname = "enum mpd_error")] 4 | public enum Error { 5 | SUCCESS = 0, 6 | OOM, 7 | ARGUMENT, 8 | STATE, 9 | TIMEOUT, 10 | SYSTEM, 11 | RESOLVER, 12 | MALFORMED, 13 | CLOSED, 14 | SERVER 15 | } 16 | 17 | [CCode (cname = "enum mpd_async_event")] 18 | public enum AsyncEvent { 19 | READ = 1 , 20 | WRITE = 2, 21 | HUP = 4, 22 | ERROR = 8 23 | } 24 | 25 | [CCode (cname = "enum mpd_entity_type")] 26 | public enum EntityType { 27 | UNKNOWN, 28 | DIRECTORY, 29 | SONG, 30 | PLAYLIST 31 | } 32 | 33 | [CCode (cname = "enum mpd_fingerprint_type")] 34 | public enum FingerprintType { 35 | UNKNOWN, 36 | CHROMAPRINT 37 | } 38 | 39 | [CCode (cname = "enum mpd_idle")] 40 | public enum Idle { 41 | DATABASE = 0x1, 42 | STORED_PLAYLIST = 0x2, 43 | QUEUE = 0x4, 44 | PLAYLIST = QUEUE, 45 | PLAYER = 0x8, 46 | MIXER = 0x10, 47 | OUTPUT = 0x20, 48 | OPTIONS = 0x40, 49 | UPDATE = 0x80, 50 | STICKER = 0x100, 51 | SUBSCRIPTION = 0x200, 52 | MESSAGE = 0x400, 53 | PARTITION = 0x800, 54 | NEIGHBOR = 0x1000, 55 | MOUNT = 0x2000, 56 | } 57 | 58 | [CCode (cname = "enum mpd_parser_result")] 59 | public enum ParserResult { 60 | MALFORMED, 61 | SUCCESS, 62 | ERROR, 63 | PAIR 64 | } 65 | 66 | [CCode (cname = "enum mpd_server_error")] 67 | public enum ServerError { 68 | UNK = -1, 69 | NOT_LIST = 1, 70 | ARG = 2, 71 | PASSWORD = 3, 72 | PERMISSION = 4, 73 | UNKNOWN_CMD = 5, 74 | NO_EXIST = 50, 75 | PLAYLIST_MAX = 51, 76 | SYSTEM = 52, 77 | PLAYLIST_LOAD = 53, 78 | UPDATE_ALREADY = 54, 79 | PLAYER_SYNC = 55, 80 | EXIST = 56 81 | } 82 | 83 | [CCode (cname = "enum mpd_replay_gain_mode")] 84 | public enum ReplayGainMode { 85 | OFF = 0, 86 | TRACK, 87 | ALBUM, 88 | AUTO, 89 | UNKNOWN 90 | } 91 | 92 | [CCode (cname = "enum mpd_operator")] 93 | public enum Operator { 94 | DEFAULT 95 | } 96 | 97 | [CCode (cname = "enum mpd_state")] 98 | public enum State { 99 | UNKNOWN = 0, 100 | STOP = 1, 101 | PLAY = 2, 102 | PAUSE = 3 103 | } 104 | 105 | [CCode (cname = "enum mpd_single_state")] 106 | public enum SingleState { 107 | OFF = 0, 108 | ON, 109 | ONESHOT, 110 | UNKNOWN 111 | } 112 | 113 | [CCode (cname = "enum mpd_tag_type", cprefix = "MPD_TAG_")] 114 | public enum TagType { 115 | UNKNOWN = -1, 116 | ARTIST, 117 | ALBUM, 118 | ALBUM_ARTIST, 119 | TITLE, 120 | TRACK, 121 | NAME, 122 | GENRE, 123 | DATE, 124 | COMPOSER, 125 | PERFORMER, 126 | COMMENT, 127 | DISC, 128 | MUSICBRAINZ_ARTISTID, 129 | MUSICBRAINZ_ALBUMID, 130 | MUSICBRAINZ_ALBUMARTISTID, 131 | MUSICBRAINZ_TRACKID, 132 | MUSICBRAINZ_RELEASETRACKID, 133 | ORIGINAL_DATE, 134 | ARTIST_SORT, 135 | ALBUM_ARTIST_SORT, 136 | ALBUM_SORT, 137 | LABEL, 138 | MUSICBRAINZ_WORKID, 139 | GROUPING, 140 | WORK, 141 | CONDUCTOR, 142 | COUNT 143 | } 144 | 145 | [Compact] 146 | [CCode (cname = "struct mpd_async", free_function = "mpd_async_free", cprefix = "mpd_async_")] 147 | public class Async { 148 | public Async(int fd); 149 | public Mpd.Error get_error(); 150 | public unowned string? get_error_message(); 151 | public int get_system_error(); 152 | public int get_fd(); 153 | public bool set_keepalive(bool keepalive); 154 | public Mpd.AsyncEvent events(); 155 | public bool io(Mpd.AsyncEvent events); 156 | public bool send_command_v(string command, va_list args); 157 | public bool send_command(string command, ...); 158 | public string? recv_line(); 159 | // Not sure how to translate this one 160 | // public size_t recv_raw(void *dest, size_t length); 161 | } 162 | } -------------------------------------------------------------------------------- /subprojects/blueprint-compiler.wrap: -------------------------------------------------------------------------------- 1 | [wrap-git] 2 | directory = blueprint-compiler 3 | url = https://gitlab.gnome.org/jwestman/blueprint-compiler.git 4 | revision = main 5 | depth = 1 6 | 7 | [provide] 8 | program_names = blueprint-compiler -------------------------------------------------------------------------------- /subprojects/libmpdclient.wrap: -------------------------------------------------------------------------------- 1 | [wrap-git] 2 | directory = libmpdclient 3 | url = https://github.com/MusicPlayerDaemon/libmpdclient.git 4 | revision = master 5 | depth = 1 6 | 7 | [provide] 8 | dependency_names = libmpdclient --------------------------------------------------------------------------------