Skip to content

Commit

Permalink
v2.3.1 - Adds an optional fade effect to Album Art (#6658)
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiux authored Dec 1, 2024
1 parent 9e7d9eb commit 98b71bc
Show file tree
Hide file tree
Showing 27 changed files with 1,026 additions and 52 deletions.
3 changes: 3 additions & 0 deletions Radio3.0@claudiux/files/Radio3.0@claudiux/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### v2.3.1~20241201
* Adds an optional fade effect to the Album Art. See the Behavior tab of this applet settings.

### v2.3.0~20241129
* Adds the ability to display on desktop the Album (or Song) Art.
* Solves the problem with pulseaudio/pipewire.
Expand Down
1 change: 1 addition & 0 deletions Radio3.0@claudiux/files/Radio3.0@claudiux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ With Radio3.0 you can:

* Modify the volume of the radio, independent of the general sound volume. This volume level can be displayed near the icon.

* Display (in a frame on the desktop) the album art of the song currently playing, if available.

Details, help and FAQ can be found in the [Manual](https://github.com/linuxmint/cinnamon-spices-applets/blob/master/Radio3.0%40claudiux/files/Radio3.0%40claudiux/help/MANUAL.md).

Expand Down
5 changes: 5 additions & 0 deletions Radio3.0@claudiux/files/Radio3.0@claudiux/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -3835,6 +3835,7 @@ class WebRadioReceiverAndRecorder extends TextIconApplet {
if (!are_translations_installed()) install_translations();

spawnCommandLineAsync("bash -c '"+DEL_SONG_ARTS_SCRIPT+"'");
spawnCommandLineAsync("bash -c '%s/fix-desklet-translations.sh'".format(SCRIPTS_DIR));

let subProcess = spawnCommandLineAsyncIO(SCRIPTS_DIR+"/get-score.sh", Lang.bind(this, (stdout, err, exitCode) => {
try {
Expand Down Expand Up @@ -5821,6 +5822,10 @@ class WebRadioReceiverAndRecorder extends TextIconApplet {
this.finalizeContextMenu();
}

on_desklet_open_settings_button_clicked() {
spawnCommandLineAsync("cinnamon-settings desklets AlbumArt3.0@claudiux");
}

_is_desklet_activated() {
let enabledDesklets = global.settings.get_strv(ENABLED_DESKLETS_KEY);
var ret = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ const GLib = imports.gi.GLib;
const Tweener = imports.ui.tweener;
const Util = imports.misc.util;
const Settings = imports.ui.settings;
const Gettext = imports.gettext;

Gettext.bindtextdomain("Radio3.0@claudiux", GLib.get_home_dir() + "/.local/share/locale")
Gettext.bindtextdomain("cinnamon", "/usr/share/locale");

class AlbumArtRadio30 extends Desklet.Desklet {
constructor(metadata, desklet_id) {
Expand All @@ -20,11 +24,13 @@ class AlbumArtRadio30 extends Desklet.Desklet {
this.dir = "file://"+GLib.get_home_dir()+"/.config/Radio3.0/song-art";
this.shuffle = false;
this.delay = 3;
this.fade_delay = 0;
//this.fade_delay = 0;
this.effect = "";
this.settings = new Settings.DeskletSettings(this, this.metadata.uuid, this.instance_id);
this.settings.bind('height', 'height', this.on_setting_changed);
this.settings.bind('width', 'width', this.on_setting_changed);
this.settings.bind('fade-delay', 'fade_delay', this.on_setting_changed);
this.settings.bind('fade-effect', 'fade_effect', this.on_setting_changed);

this.dir_monitor_id = 0;
this.dir_monitor = null;
Expand Down Expand Up @@ -207,16 +213,19 @@ class AlbumArtRadio30 extends Desklet.Desklet {
this.currentPicture.path = image_path;

if (this.fade_delay > 0) {
let _transition = "easeNone";
if (this.fade_effect != "None")
_transition = "easeOut"+this.fade_effect;
Tweener.addTween(this._bin, {
opacity: 0,
time: this.fade_delay,
transition: 'easeInSine',
opacity: 255, //0,
time: 0, //this.fade_delay,
transition: _transition, //'easeInSine',
onComplete: () => {
this._bin.set_child(this.currentPicture);
Tweener.addTween(this._bin, {
opacity: 255,
opacity: 0, //255,
time: this.fade_delay,
transition: 'easeInSine'
transition: _transition, //'easeInSine',
});
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,33 @@
"description" : "Width",
"units" : "pixels",
"step": 50
}
},
"fade-effect": {
"default": "None",
"type": "combobox",
"description" : "Fade",
"options": {
"None": "None",
"Quad": "Quad",
"Cubic": "Cubic",
"Quart": "Quart",
"Quint": "Quint",
"Sine": "Sine",
"Expo": "Expo",
"Circ": "Circ",
"Elastic": "Elastic",
"Back": "Back",
"Bounce": "Bounce"
}
},
"fade-delay": {
"default": 0,
"type": "scale",
"min": 0,
"max": 300,
"description" : "Fade delay",
"units" : "seconds",
"step": 5,
"tooltip": "0 means no fade"
}
}
2 changes: 1 addition & 1 deletion Radio3.0@claudiux/files/Radio3.0@claudiux/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"description": "The Ultimate Internet Radio Receiver & Recorder for Cinnamon",
"max-instances": 1,
"version": "2.3.0",
"version": "2.3.1",
"uuid": "Radio3.0@claudiux",
"name": "Radio3.0",
"author": "claudiux",
Expand Down
71 changes: 67 additions & 4 deletions Radio3.0@claudiux/files/Radio3.0@claudiux/po/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Radio3.0@claudiux 2.3.0\n"
"Project-Id-Version: Radio3.0@claudiux 2.3.1\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2024-11-29 22:18+0100\n"
"POT-Creation-Date: 2024-12-01 02:43+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
Expand Down Expand Up @@ -476,12 +476,12 @@ msgstr ""
msgid "%s new stations have been added to the Radio3.0 applet menu"
msgstr ""

#. applet.js:5951
#. applet.js:5955
#, javascript-format
msgid "%s kbps"
msgstr ""

#. desklet/AlbumArt3.0@claudiux/desklet.js:33
#. desklet/AlbumArt3.0@claudiux/desklet.js:38
msgid "Radio3.0 Album Art"
msgstr ""

Expand Down Expand Up @@ -1290,6 +1290,7 @@ msgid ""
msgstr ""

#. settings-schema.json->notif-song-duration->units
#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-delay->units
msgid "seconds"
msgstr ""

Expand Down Expand Up @@ -3009,6 +3010,10 @@ msgstr ""
msgid "The desklet displaying the Radio3.0 Album Art is activated"
msgstr ""

#. settings-schema.json->desklet-open-settings-button->description
msgid "Album Art desklet settings"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->metadata.json->name
msgid "Album Art for Radio3.0"
msgstr ""
Expand All @@ -3029,3 +3034,61 @@ msgstr ""
#. desklet->AlbumArt3.0@claudiux->settings-schema.json->width->description
msgid "Width"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-
#. effect->description
msgid "Fade"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "None"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Quad"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Cubic"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Quart"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Quint"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Sine"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Expo"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Circ"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Elastic"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Back"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Bounce"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-
#. delay->description
msgid "Fade delay"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-delay->tooltip
msgid "0 means no fade"
msgstr ""
70 changes: 67 additions & 3 deletions Radio3.0@claudiux/files/Radio3.0@claudiux/po/ca.po
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2024-11-29 22:18+0100\n"
"POT-Creation-Date: 2024-12-01 02:43+0100\n"
"PO-Revision-Date: 2024-09-14 03:06+0200\n"
"Last-Translator: Odyssey <[email protected]>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -523,12 +523,12 @@ msgid "%s new stations have been added to the Radio3.0 applet menu"
msgstr ""
"%s noves emissores de ràdio s'han afegir al menú de la miniaplicació Radio3.0"

#. applet.js:5951
#. applet.js:5955
#, javascript-format
msgid "%s kbps"
msgstr "%s kbps"

#. desklet/AlbumArt3.0@claudiux/desklet.js:33
#. desklet/AlbumArt3.0@claudiux/desklet.js:38
#, fuzzy
msgid "Radio3.0 Album Art"
msgstr "Radio3.0"
Expand Down Expand Up @@ -1375,6 +1375,7 @@ msgstr ""
"programa."

#. settings-schema.json->notif-song-duration->units
#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-delay->units
msgid "seconds"
msgstr "segons"

Expand Down Expand Up @@ -3142,6 +3143,10 @@ msgstr ""
msgid "The desklet displaying the Radio3.0 Album Art is activated"
msgstr ""

#. settings-schema.json->desklet-open-settings-button->description
msgid "Album Art desklet settings"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->metadata.json->name
msgid "Album Art for Radio3.0"
msgstr ""
Expand All @@ -3162,3 +3167,62 @@ msgstr ""
#. desklet->AlbumArt3.0@claudiux->settings-schema.json->width->description
msgid "Width"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-
#. effect->description
msgid "Fade"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
#, fuzzy
msgid "None"
msgstr "(Cap)"

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Quad"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Cubic"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Quart"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Quint"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Sine"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Expo"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Circ"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Elastic"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Back"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-effect->options
msgid "Bounce"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-
#. delay->description
msgid "Fade delay"
msgstr ""

#. desklet->AlbumArt3.0@claudiux->settings-schema.json->fade-delay->tooltip
msgid "0 means no fade"
msgstr ""
Loading

0 comments on commit 98b71bc

Please sign in to comment.