Skip to content

Commit

Permalink
发布 2.0 版本
Browse files Browse the repository at this point in the history
  • Loading branch information
gmg137 committed Jun 28, 2022
1 parent c8bf7ae commit e6cd505
Show file tree
Hide file tree
Showing 63 changed files with 9,947 additions and 9 deletions.
13 changes: 13 additions & 0 deletions .buildconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[default]
name=Default
runtime=host
toolchain=default
config-opts=
run-opts=
prefix=/home/gmg/.cache/gnome-builder/install/netease-cloud-music-gtk4/host
app-id=
postbuild=
prebuild=
default=true

[default.environment]
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/target
/build
**/*.rs.bk
Cargo.lock
675 changes: 675 additions & 0 deletions COPYING

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "netease-cloud-music-gtk4"
version = "2.0.0"
edition = "2021"

[dependencies]
gettext-rs = { version = "0.7", features = ["gettext-system"] }
gtk = { version = "0.4.7", package = "gtk4" }
once_cell = "*"
qrcode-generator = "^4.1"
ncm-api = { git = "https://github.com/gmg137/netease-cloud-music-api.git", version = "*", package = "netease-cloud-music-api" }
anyhow = "*"
gstreamer = "*"
gstreamer-player = "*"
fragile = "*"
fastrand = "*"
mpris-player = "0.6.1"
regex = "*"

[dependencies.adw]
package = "libadwaita"
version = "0.1.1"
45 changes: 36 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
## NeteaseCloudMusicGtk4
# NeteaseCloudMusicGtk4
> netease-cloud-music-gtk4 是基于 GTK4 + Libadwaita 构造的网易云音乐播放器,专为 Linux 系统打造,已在 openSUSE Tumbleweed + GNOME 环境下测试。
> 基于 GTK4 + Libadwaita 的完全重构版本, 使用 Rust 开发,极速美观。
## 特点
- 稳定:专为 Linux 系统打造,相比官方版本拥有更好的兼容与稳定性。
- 极速:相比 Node/python 版,Rust + GTK 带给你如丝般的顺滑体验。
- 可靠:除了断网或网易 API 限制,不会出现运行时问题。
- 简洁:仿 GNOME Music 风格,GTK 原生界面,纯粹得令人发指。
- 轻量:安装文件不到 3 M,只需最简单的运行时依赖。

## 路线图
- [x] 发现页
- [x] 榜单页
- [x] 歌单详情页
Expand All @@ -11,15 +18,35 @@
- [x] 验证码登陆
- [x] 播放栏
- [x] 多语言支持
- [ ] 歌单页
- [ ] 搜索页
- [ ] 我的页
- [ ] 首选项
- [ ] Mpris2 绑定
- [ ] 播放列表
- [ ] 歌词
- [x] 歌单页
- [x] 搜索页
- [x] 我的页
- [x] 首选项
- [x] Mpris2 绑定
- [x] 播放列表
- [x] 歌词
- [ ] 桌面歌词

### FAQ
1. 为什么后台运行时没有托盘图标?
> 由于 GTK3 开始取消了托盘接口,所以目前不打算实现托盘功能。<br>
> **替代方案:**
> - Mpris 插件: GNOME 推荐 [Mpris Indicator Button](https://extensions.gnome.org/extension/1379/mpris-indicator-button/),其它桌面可查找相应 Mpris 插件。
> - 直接点击启动图标,亦可唤醒程序。
2. 为什么点击歌曲后播放会有延迟?
> 对于未缓存歌曲会先缓存到本地后再进行播放,取决于音乐文件大小与网速,会有不同的播放延迟。
3. 音乐缓存目录在什么位置?
> 缓存位于用户主目录下 .cache/netease-cloud-music-gtk4 文件夹内。
## 截图
![](./screenshots/discover.png)
![](./screenshots/discover-dark.png)
![](./screenshots/toplist.png)


## License
This project's source code and documentation is licensed under the [GNU General Public License](COPYING) (GPL v3).

## 参考
- [Shortwave](https://gitlab.gnome.org/World/Shortwave)
- [gnome-music](https://gitlab.gnome.org/GNOME/gnome-music)
24 changes: 24 additions & 0 deletions build-aux/cargo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

export MESON_BUILD_ROOT="$1"
export MESON_SOURCE_ROOT="$2"
export CARGO_TARGET_DIR="$MESON_BUILD_ROOT"/target
export CARGO_HOME="$MESON_BUILD_ROOT"/cargo-home
export CARGO_HOME="$HOME"/.cargo
export OUTPUT="$3"
export BUILDTYPE="$4"
export APP_BIN="$5"

if [ $BUILDTYPE = "release" ]
then
echo "RELEASE MODE"
cargo build --manifest-path \
"$MESON_SOURCE_ROOT"/Cargo.toml --release && \
cp "$CARGO_TARGET_DIR"/release/"$APP_BIN" "$OUTPUT"
else
echo "DEBUG MODE"
cargo build --manifest-path \
"$MESON_SOURCE_ROOT"/Cargo.toml && \
cp "$CARGO_TARGET_DIR"/debug/"$APP_BIN" "$OUTPUT"
fi

55 changes: 55 additions & 0 deletions com.gitee.gmg137.NeteaseCloudMusicGtk4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"app-id" : "com.gitee.gmg137.NeteaseCloudMusicGtk4",
"runtime" : "org.gnome.Platform",
"runtime-version" : "42",
"sdk" : "org.gnome.Sdk",
"sdk-extensions" : [
"org.freedesktop.Sdk.Extension.rust-stable"
],
"command" : "netease-cloud-music-gtk4",
"finish-args" : [
"--share=network",
"--share=ipc",
"--socket=fallback-x11",
"--device=dri",
"--socket=wayland",
"--socket=pulseaudio",
"--persist=.lyrics",
"--own-name=org.mpris.MediaPlayer2.com.gitee.gmg137.NeteaseCloudMusicGtk4"
],
"build-options" : {
"append-path" : "/usr/lib/sdk/rust-stable/bin",
"build-args" : [
"--share=network"
],
"env" : {
"RUST_BACKTRACE" : "1",
"RUST_LOG" : "netease-cloud-music-gtk4=debug"
}
},
"cleanup" : [
"/include",
"/lib/pkgconfig",
"/man",
"/share/doc",
"/share/gtk-doc",
"/share/man",
"/share/pkgconfig",
"*.la",
"*.a"
],
"modules" : [
{
"name" : "netease-cloud-music-gtk4",
"builddir" : true,
"buildsystem" : "meson",
"sources" : [
{
"type" : "git",
"url" : "file:///home/gmg/projects/netease-cloud-music-gtk4"
}
],
"config-opts" : []
}
]
}
9 changes: 9 additions & 0 deletions data/com.gitee.gmg137.NeteaseCloudMusicGtk4.appdata.xml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>com.gitee.gmg137.NeteaseCloudMusicGtk4.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<description>
<p>No description</p>
</description>
</component>
13 changes: 13 additions & 0 deletions data/com.gitee.gmg137.NeteaseCloudMusicGtk4.desktop.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Desktop Entry]
Name=NetEase Cloud Music
Name[zh_CN]=网易云音乐
Name[zh_TW]=網易雲音樂
Comment=NetEase Cloud Music
Comment[zh_CN]=网易云音乐
Comment[zh_TW]=網易雲音樂
Exec=netease-cloud-music-gtk4
Icon=com.gitee.gmg137.NeteaseCloudMusicGtk4
Terminal=false
Type=Application
Categories=GTK;
StartupNotify=true
36 changes: 36 additions & 0 deletions data/com.gitee.gmg137.NeteaseCloudMusicGtk4.gschema.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="netease-cloud-music-gtk4">
<schema id="com.gitee.gmg137.NeteaseCloudMusicGtk4" path="/com/gitee/gmg137/NeteaseCloudMusicGtk4/">
<key name="style-variant" type="s">
<choices>
<choice value='system' />
<choice value='light' />
<choice value='dark' />
</choices>
<default>'system'</default>
<summary>Settings theme</summary>
</key>
<key name="repeat-variant" type="s">
<choices>
<choice value='none' />
<choice value='one' />
<choice value='loop' />
<choice value='shuffle' />
</choices>
<default>'none'</default>
<summary>Settings player loop</summary>
</key>
<key name="exit-switch" type="b">
<default>false</default>
<summary>Set exit key behavior</summary>
</key>
<key name="proxy-address" type="s">
<default>''</default>
<summary>Settings proxy address</summary>
</key>
<key name="music-rate" type="u">
<default>0</default>
<summary>Settings music rate</summary>
</key>
</schema>
</schemalist>
Loading

0 comments on commit e6cd505

Please sign in to comment.