@@ -768,7 +768,8 @@ class Sound150Applet extends Applet.TextIconApplet {
768768
769769 on_leave_event ( actor , event ) {
770770 this . isActorEntered = false ;
771- if ( this . playerControl && this . _activePlayer )
771+ //~ if (this.playerControl && this._activePlayer)
772+ if ( this . _activePlayer && this . _players [ this . _activePlayer ] )
772773 this . setAppletTextIcon ( this . _players [ this . _activePlayer ] , true ) ;
773774 else
774775 this . setAppletTextIcon ( ) ;
@@ -876,7 +877,7 @@ class Sound150Applet extends Applet.TextIconApplet {
876877 `notify-send -u critical --icon="audio-volume-overamplified-symbolic" --action="opt1=${ Button1 } " --action="opt2=${ Button2 } " "${ summary } " "${ body } "` ,
877878 ( stdout , stderr , exitCode ) => {
878879 if ( exitCode === 0 ) {
879- logDebug ( "stdout: " + stdout + " " + typeof stdout ) ;
880+ //~ logDebug("stdout: " + stdout + " " + typeof stdout);
880881 if ( stdout . startsWith ( "opt1" ) ) {
881882 //~ Util.spawnCommandLineAsync("cinnamon-settings extensions -t download");
882883 Util . spawnCommandLineAsync ( "cinnamon-settings extensions -t 1" ) ;
@@ -1116,7 +1117,12 @@ class Sound150Applet extends Applet.TextIconApplet {
11161117 if ( ! this . _sound_settings . get_boolean ( OVERAMPLIFICATION_KEY ) && this . maxVolume > 100 ) {
11171118 this . maxVolume = 100 ;
11181119 }
1119-
1120+
1121+ if ( ! this . showalbum ) {
1122+ this . keepAlbumArtIcon = false ;
1123+ }
1124+ this . _iconLooping = this . showalbum ;
1125+
11201126 this . _volumeMax = this . maxVolume / 100 * this . _volumeNorm ;
11211127 if ( this . maxVolume > 100 ) {
11221128 if ( this . _outputVolumeSection )
@@ -1193,7 +1199,7 @@ class Sound150Applet extends Applet.TextIconApplet {
11931199 }
11941200 this . color0_100 = color ;
11951201
1196- this . _iconLooping = true ;
1202+ this . _iconLooping = this . showalbum ;
11971203
11981204 if ( this . _output && this . _output . is_muted ) {
11991205 this . old_volume = this . volume ;
@@ -1204,12 +1210,12 @@ class Sound150Applet extends Applet.TextIconApplet {
12041210 this . _on_sound_settings_change ( ) ;
12051211
12061212 this . _loopArtId = null ;
1207- this . _artLooping = true ;
1213+ this . _artLooping = this . showalbum ;
12081214 this . _loopArtId = timeout_add_seconds ( 10 , ( ) => {
12091215 this . loopArt ( ) ;
12101216 } ) ;
12111217
1212- this . iconsMonitor = null ;
1218+ this . iconsMonitor = null ;
12131219 this . iconsMonitorId == null ;
12141220 this . monitor_icon_dir ( ) ;
12151221
@@ -1659,7 +1665,10 @@ class Sound150Applet extends Applet.TextIconApplet {
16591665 this . _playerIcon = [ icon , source === "player-path" ] ;
16601666 }
16611667
1662- if ( ! this . showalbum ) this . keepAlbumArtIcon = false ;
1668+ if ( ! this . showalbum ) {
1669+ this . keepAlbumArtIcon = false ;
1670+ this . _iconLooping = false ;
1671+ }
16631672
16641673 if ( this . playerControl && this . _activePlayer && this . _playerIcon && this . _playerIcon [ 0 ] ) {
16651674 if ( source === "output" ) {
@@ -1672,8 +1681,8 @@ class Sound150Applet extends Applet.TextIconApplet {
16721681 //~ this._iconTimeoutId = timeout_add_seconds(OUTPUT_ICON_SHOW_TIME_SECONDS, () => {
16731682 this . _iconTimeoutId = timeout_add_seconds ( 0 , ( ) => {
16741683 this . setAppletTextIcon ( this . _players [ this . _activePlayer ] , true ) ;
1675- //~ return false;
1676- return this . _iconLooping ;
1684+ return false ;
1685+ //~ return this._iconLooping;
16771686 } ) ;
16781687 }
16791688 } else {
@@ -1731,7 +1740,7 @@ class Sound150Applet extends Applet.TextIconApplet {
17311740 }
17321741
17331742 loopArt ( ) {
1734- source_remove ( this . _loopArtId ) ;
1743+ if ( this . _loopArtId != null ) source_remove ( this . _loopArtId ) ;
17351744 this . _loopArtId = null ;
17361745 if ( ! this . _artLooping ) return ;
17371746
@@ -1813,6 +1822,14 @@ class Sound150Applet extends Applet.TextIconApplet {
18131822 path = null ;
18141823 }
18151824
1825+ //~ if (this.old_player === player && this.old_path === path) return;
1826+ if ( ( this . old_player === player &&
1827+ ( typeof ( this . old_path ) === "string" && typeof ( path ) === "string" && this . old_path . split ( "/" ) . pop ( ) === path . split ( "/" ) . pop ( ) ) ) )
1828+ return ;
1829+ this . old_player = player ;
1830+ this . old_path = path ;
1831+ //~ logDebug("setAppletIcon(" + player + ", " + path +")");
1832+
18161833 if ( ! this . allowChangeArt ) return ;
18171834
18181835 if ( this . showalbum ) {
@@ -2237,22 +2254,22 @@ class Sound150Applet extends Applet.TextIconApplet {
22372254 }
22382255
22392256 _theme_set ( ) {
2240- logDebug ( "_theme_set()" ) ;
2257+ //~ logDebug("_theme_set()");
22412258 let color = this . color0_100 ;
22422259 try {
22432260 if ( ! this . themeNode ) {
2244- logDebug ( "this.themeNode was not defined." ) ;
2261+ //~ logDebug("this.themeNode was not defined.");
22452262 this . themeNode = this . actor . get_theme_node ( ) ;
22462263 }
22472264 let defaultColor = this . themeNode . get_foreground_color ( ) ;
2248- logDebug ( "defaultColor: " + defaultColor . to_string ( ) ) ;
2265+ //~ logDebug("defaultColor: "+defaultColor.to_string());
22492266 color = defaultColor . to_string ( ) ;
22502267 } catch ( e ) {
22512268 color = this . color0_100 ;
22522269 }
22532270 this . color0_100 = color ;
22542271 let _style = `color: ${ color } ;` ;
2255- logDebug ( "_style: " + _style ) ;
2272+ //~ logDebug("_style: "+_style);
22562273 this . actor . style = _style ;
22572274 this . _setStyle ( ) ;
22582275 }
0 commit comments