Skip to content

Commit

Permalink
Merge branch 'main' into search-in-playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored May 14, 2024
2 parents 19ab863 + 8a09fc6 commit faf204f
Show file tree
Hide file tree
Showing 17 changed files with 104 additions and 107 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-fast: false

container:
image: ghcr.io/elementary/flatpak-platform/runtime:7.2-${{ matrix.arch }}
image: ghcr.io/elementary/flatpak-platform/runtime:8-${{ matrix.arch }}
options: --privileged

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Gettext
runs-on: ubuntu-latest
container:
image: ghcr.io/elementary/flatpak-platform/runtime:7.2-x86_64
image: ghcr.io/elementary/flatpak-platform/runtime:8-x86_64
options: --privileged

steps:
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
fail-fast: false

container:
image: ghcr.io/elementary/flatpak-platform/runtime:7.2-${{ matrix.arch }}
image: ghcr.io/elementary/flatpak-platform/runtime:8-${{ matrix.arch }}
options: --privileged

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
fail-fast: false

container:
image: ghcr.io/elementary/flatpak-platform/runtime:7.2-${{ matrix.arch }}
image: ghcr.io/elementary/flatpak-platform/runtime:8-${{ matrix.arch }}
options: --privileged

steps:
Expand Down
33 changes: 0 additions & 33 deletions data/AlbumImage.css

This file was deleted.

41 changes: 37 additions & 4 deletions data/PlaybackIndicator.css → data/Application.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,50 @@
spinner {
/*
* SPDX-License-Identifier: LGPL-3.0-or-later
* SPDX-FileCopyrightText: 2021 elementary, Inc. (https://elementary.io)
*/

album {
background-image:
linear-gradient(
170deg,
alpha(
@highlight_color,
0.1
),
alpha(
@highlight_color,
0.15
) 43%,
alpha(
@highlight_color,
0
) 44%
),
-gtk-icontheme("audio-x-generic-symbolic"),
linear-gradient(
to bottom,
@base_color,
@base_color
);
background-size: cover, 50%, cover;
background-repeat: no-repeat;
background-position: center center;
color: alpha(@insensitive_fg_color, 0.75);
}

spinner.play-indicator {
animation: none;
color: @accent_color;
min-width: 16px;
transition: none;
}

spinner:checked {
spinner.play-indicator:checked {
opacity: 1;
-gtk-icon-source: -gtk-icontheme("playback-paused-symbolic");
}

spinner:checked.playing {
spinner.play-indicator:checked.playing {
animation: playing 1.1s linear infinite;
-gtk-icon-source: -gtk-icontheme("playback-playing-00-symbolic");
}
Expand All @@ -36,4 +70,3 @@ spinner:checked.playing {
95% { -gtk-icon-source: -gtk-icontheme("playback-playing-17-symbolic"); }
100% { -gtk-icon-source: -gtk-icontheme("playback-playing-00-symbolic"); }
}

6 changes: 3 additions & 3 deletions data/meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
gresource = gnome.compile_resources(
'music-resources',
'music.gresource.xml',
source_dir: join_paths(meson.source_root(), 'data')
source_dir: join_paths(meson.project_source_root(), 'data')
)

install_data(
Expand All @@ -13,7 +13,7 @@ install_data(
i18n.merge_file(
input: 'music.desktop.in',
output: meson.project_name() + '.desktop',
po_dir: join_paths(meson.source_root(), 'po', 'extra'),
po_dir: join_paths(meson.project_source_root(), 'po', 'extra'),
type: 'desktop',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
Expand All @@ -22,7 +22,7 @@ i18n.merge_file(
i18n.merge_file(
input: 'music.metainfo.xml.in',
output: meson.project_name() + '.metainfo.xml',
po_dir: meson.source_root() / 'po' / 'extra',
po_dir: meson.project_source_root() / 'po' / 'extra',
type: 'xml',
install: true,
install_dir: get_option('datadir') / 'metainfo',
Expand Down
15 changes: 10 additions & 5 deletions data/music.desktop.in
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
[Desktop Entry]
Version=1.5
Type=Application

Name=Music
GenericName=Music Player
Comment=Listen to music
Exec=io.elementary.music %U
Categories=Audio;Music;Player;AudioVideo;GTK;
Keywords=Noise;Audio;Player;MP3;Play;Playlist;Media;Songs;

Icon=io.elementary.music
Exec=io.elementary.music %U
SingleMainWindow=true
StartupNotify=true
Terminal=false
Categories=Audio;Music;Player;AudioVideo;GTK;

MimeType=x-content/audio-player;x-content/audio-cdda;application/ogg;application/x-extension-m4a;application/x-extension-mp4;application/x-flac;application/x-ogg;audio/3gpp;audio/aac;audio/ac3;audio/AMR;audio/AMR-WB;audio/basic;audio/flac;audio/midi;audio/mp2;audio/mp4;audio/mpeg;audio/ogg;audio/vnd.rn-realaudio;audio/x-aiff;audio/x-ape;audio/x-flac;audio/x-gsm;audio/x-it;audio/x-m4a;audio/x-matroska;audio/x-mod;audio/x-mp3;audio/x-mpeg;audio/x-mpegurl;audio/x-ms-asf;audio/x-ms-asx;audio/x-ms-wax;audio/x-ms-wma;audio/x-musepack;audio/x-opus+ogg;audio/x-pn-aiff;audio/x-pn-au;audio/x-pn-realaudio;audio/x-pn-realaudio-plugin;audio/x-pn-wav;audio/x-pn-windows-acm;audio/x-realaudio;audio/x-real-audio;audio/x-sbc;audio/x-scpls;audio/x-speex;audio/x-tta;audio/x-vorbis;audio/x-vorbis+ogg;audio/x-wav;audio/x-wavpack;audio/x-xm;audio/x-s3m;inode/directory;
StartupNotify=true
Keywords=Noise;Audio;Player;MP3;Play;Playlist;Media;Songs;

X-GNOME-UsesNotifications=true
X-PulseAudio-Properties=media.role=music
6 changes: 3 additions & 3 deletions data/music.gresource.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/io/elementary/music">
<file compressed="true">AlbumImage.css</file>

<file compressed="true">PlaybackIndicator.css</file>
<file compressed="true">Application.css</file>
</gresource>
<gresource prefix="/io/elementary/music/icons">
<file alias="16x16/status/playback-paused-symbolic.svg" compressed="true">playback-indicator/paused.svg</file>
<file alias="16x16/status/playback-playing-00-symbolic.svg" compressed="true">playback-indicator/playing-00.svg</file>
<file alias="16x16/status/playback-playing-01-symbolic.svg" compressed="true">playback-indicator/playing-01.svg</file>
Expand Down
4 changes: 3 additions & 1 deletion data/music.metainfo.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
<url type="help">https://github.com/elementary/music/discussions</url>
<url type="translate">https://l10n.elementary.io/projects/music</url>

<developer_name>elementary, Inc.</developer_name>
<developer id="org.elementaryos">
<name>elementary, Inc.</name>
</developer>
<project_group>elementary</project_group>
<update_contact>contact_at_elementary.io</update_contact>

Expand Down
2 changes: 1 addition & 1 deletion io.elementary.music.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
app-id: io.elementary.music
runtime: io.elementary.Platform
runtime-version: '7.2'
runtime-version: '8'
sdk: io.elementary.Sdk
command: io.elementary.music
finish-args:
Expand Down
12 changes: 6 additions & 6 deletions po/extra/ja.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ msgstr ""
"Project-Id-Version: noise\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-05-31 15:44+0000\n"
"PO-Revision-Date: 2023-04-06 19:59+0000\n"
"PO-Revision-Date: 2024-05-09 14:13+0000\n"
"Last-Translator: Ryo Nakano <[email protected]>\n"
"Language-Team: Japanese <https://l10n.elementary.io/projects/music/extra/ja/"
">\n"
"Language-Team: Japanese <https://l10n.elementary.io/projects/music/extra/ja/>"
"\n"
"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 4.16.4\n"
"X-Generator: Weblate 5.5\n"
"X-Launchpad-Export-Date: 2017-03-07 05:56+0000\n"

#: data/music.metainfo.xml.in:10 data/music.desktop.in:4
Expand All @@ -36,8 +36,8 @@ msgid ""
msgstr ""
"手持ちの音声ファイルを簡単にキューに追加して再生しましょう。機能は至ってシン"
"プルです。また、ファイルに埋め込まれたアルバムアートワークを表示できます。メ"
"ディアキーやシステム音声インジケーターを使うことで、曲の再生/停止/切り替え"
"も可能です。"
"ディアキーやシステム音声インジケーターを使うことで、曲の再生/停止/切り替えも"
"可能です。"

#: data/music.metainfo.xml.in:18
msgid "Quickly queue up your favorite tracks"
Expand Down
2 changes: 1 addition & 1 deletion po/extra/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
i18n.gettext('extra',
args: '--directory='+meson.source_root(),
args: '--directory='+meson.project_source_root(),
install: false,
preset: 'glib'
)
12 changes: 6 additions & 6 deletions po/ja.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ msgstr ""
"Project-Id-Version: noise\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-05-31 15:44+0000\n"
"PO-Revision-Date: 2022-11-19 05:10+0000\n"
"PO-Revision-Date: 2024-05-07 04:13+0000\n"
"Last-Translator: Ryo Nakano <[email protected]>\n"
"Language-Team: Japanese <https://l10n.elementary.io/projects/music/music/ja/"
">\n"
"Language-Team: Japanese <https://l10n.elementary.io/projects/music/music/ja/>"
"\n"
"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 4.14.2\n"
"X-Generator: Weblate 5.5\n"
"X-Launchpad-Export-Date: 2017-03-07 05:53+0000\n"

#: src/Application.vala:66 src/Views/NowPlayingView.vala:18
Expand All @@ -41,7 +41,7 @@ msgstr "“ファイル”から開いた音声ファイルがここに表示さ
#, c-format
msgid "%d invalid file was not added to the queue"
msgid_plural "%d invalid files were not added to the queue"
msgstr[0] "無効な%d項目のファイルはキューに追加されませんでした"
msgstr[0] "無効な %d 項目のファイルはキューに追加されませんでした"

#: src/MainWindow.vala:191
msgid "Repeat None"
Expand All @@ -59,7 +59,7 @@ msgstr "一曲リピート"
#, c-format
msgid "%d track was added to the queue"
msgid_plural "%d tracks were added to the queue"
msgstr[0] "%d曲をキューに追加しました"
msgstr[0] "%d 曲をキューに追加しました"

#. Don't set artist for files without tags
#: src/PlaybackManager.vala:190
Expand Down
2 changes: 1 addition & 1 deletion po/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
i18n.gettext(meson.project_name(),
args: '--directory=' + meson.source_root(),
args: '--directory=' + meson.project_source_root(),
preset: 'glib'
)
subdir('extra')
52 changes: 28 additions & 24 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,43 @@ public class Music.Application : Gtk.Application {
GLib.Intl.textdomain (Constants.GETTEXT_PACKAGE);
}

protected override void activate () {
if (active_window != null) {
active_window.present_with_time (Gdk.CURRENT_TIME);
return;
}
protected override void startup () {
base.startup ();

Granite.init ();

add_action_entries (ACTION_ENTRIES, this);

set_accels_for_action (ACTION_PREFIX + ACTION_FIND, {"<Ctrl>F"});

((SimpleAction) lookup_action (ACTION_PLAY_PAUSE)).set_enabled (false);
((SimpleAction) lookup_action (ACTION_PLAY_PAUSE)).set_state (false);
((SimpleAction) lookup_action (ACTION_NEXT)).set_enabled (false);
((SimpleAction) lookup_action (ACTION_PREVIOUS)).set_enabled (false);
((SimpleAction) lookup_action (ACTION_SHUFFLE)).set_enabled (false);

set_accels_for_action (ACTION_PREFIX + ACTION_FIND, {"<Ctrl>F"});
var granite_settings = Granite.Settings.get_default ();
var gtk_settings = Gtk.Settings.get_default ();

gtk_settings.gtk_icon_theme_name = "elementary";
gtk_settings.gtk_theme_name = "io.elementary.stylesheet.orange";

gtk_settings.gtk_application_prefer_dark_theme = (
granite_settings.prefers_color_scheme == DARK
);

granite_settings.notify["prefers-color-scheme"].connect (() => {
gtk_settings.gtk_application_prefer_dark_theme = (
granite_settings.prefers_color_scheme == DARK
);
});
}

protected override void activate () {
if (active_window != null) {
active_window.present ();
return;
}

playback_manager = PlaybackManager.get_default ();

Expand All @@ -73,24 +95,6 @@ public class Music.Application : Gtk.Application {

add_window (main_window);

Gtk.IconTheme.get_for_display (Gdk.Display.get_default ()).add_resource_path ("/io/elementary/music");

var granite_settings = Granite.Settings.get_default ();
var gtk_settings = Gtk.Settings.get_default ();

gtk_settings.gtk_icon_theme_name = "elementary";
gtk_settings.gtk_theme_name = "io.elementary.stylesheet.orange";

gtk_settings.gtk_application_prefer_dark_theme = (
granite_settings.prefers_color_scheme == Granite.Settings.ColorScheme.DARK
);

granite_settings.notify["prefers-color-scheme"].connect (() => {
gtk_settings.gtk_application_prefer_dark_theme = (
granite_settings.prefers_color_scheme == Granite.Settings.ColorScheme.DARK
);
});

/*
* This is very finicky. Bind size after present else set_titlebar gives us bad sizes
* Set maximize after height/width else window is min size on unmaximize
Expand Down
10 changes: 0 additions & 10 deletions src/Widgets/AlbumImage.vala
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,11 @@
public class Music.AlbumImage : Gtk.Grid {
public Gtk.Image image;

private static Gtk.CssProvider css_provider;

class construct {
set_css_name ("album");
}

static construct {
css_provider = new Gtk.CssProvider ();
css_provider.load_from_resource ("/io/elementary/music/AlbumImage.css");
}

construct {
unowned var style_context = get_style_context ();
style_context.add_provider (css_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);

image = new Gtk.Image ();

add_css_class (Granite.STYLE_CLASS_CARD);
Expand Down
Loading

0 comments on commit faf204f

Please sign in to comment.