@@ -198,7 +198,7 @@ let x = _("Playing");
198198x = _ ( "Paused" ) ;
199199x = _ ( "Stopped" ) ;
200200
201- let VOLUME_ADJUSTMENT_STEP = 0.02 ; /* Volume adjustment step in % */
201+ let VOLUME_ADJUSTMENT_STEP = 0.05 ; /* Volume adjustment step in % */
202202
203203const ICON_SIZE = Math . trunc ( 28 * global . ui_scale ) ;
204204
@@ -807,7 +807,7 @@ class Seeker extends Slider.Slider {
807807 }
808808
809809 _updateValue ( ) {
810- if ( this . destroyed ) return ; // GLib.SOURCE_REMOVE; //???
810+ if ( this . destroyed ) return ;
811811 //~ this._currentTime = (Date.now() - this.startingDate) / 1000;
812812
813813 if ( this . canSeek ) {
@@ -852,8 +852,8 @@ class Seeker extends Slider.Slider {
852852 this . _timeoutId_timerCallback = null ;
853853
854854 if ( ! this . destroyed ) {
855- this . _timeoutId = timeout_add_seconds ( 1 , this . _updateValue . bind ( this ) ) ;
856- this . _timeoutId_timerCallback = timeout_add_seconds ( 1 , this . _timerCallback . bind ( this ) ) ;
855+ this . _timeoutId = timeout_add_seconds ( 1 , ( ) => { this . _updateValue ( ) ; return ! this . destroyed } ) ;
856+ this . _timeoutId_timerCallback = timeout_add_seconds ( 1 , ( ) => { return this . _timerCallback ( ) } ) ;
857857 }
858858 //return (!this.destroyed && this.status === "Playing") ? GLib.SOURCE_CONTINUE : GLib.SOURCE_REMOVE; //???
859859 }
@@ -899,11 +899,11 @@ class Seeker extends Slider.Slider {
899899 if ( this . canSeek ) {
900900 this . _getPosition ( ) ;
901901 this . _timerTicker = 0 ;
902- this . _timeoutId_timerCallback = timeout_add_seconds ( 1 , this . _timerCallback . bind ( this ) ) ;
902+ this . _timeoutId_timerCallback = timeout_add_seconds ( 1 , ( ) => { return this . _timerCallback ( ) } ) ;
903903 } else if ( this . _length > 0 ) {
904904 this . _getPosition ( ) ;
905905 this . _timerTicker = 0 ;
906- this . _timeoutId_timerCallback = timeout_add_seconds ( 1 , this . _timerCallback . bind ( this ) ) ;
906+ this . _timeoutId_timerCallback = timeout_add_seconds ( 1 , ( ) => { return this . _timerCallback ( ) } ) ;
907907 }
908908 } else {
909909 if ( this . status === "Stopped" ) {
@@ -1089,7 +1089,7 @@ class Player extends PopupMenu.PopupMenuSection {
10891089
10901090 let asyncReadyCb = ( proxy , error , property ) => {
10911091 if ( error )
1092- log ( error ) ;
1092+ logError ( error ) ;
10931093 else {
10941094 this [ property ] = proxy ;
10951095 this . _dbus_acquired ( ) ;
@@ -1123,14 +1123,15 @@ class Player extends PopupMenu.PopupMenuSection {
11231123 }
11241124
11251125 let mainBox = new PopupMenu . PopupMenuSection ( ) ;
1126- this . addMenuItem ( mainBox ) ;
1126+ //~ this.addMenuItem(mainBox);
11271127
11281128 this . vertBox = new St . BoxLayout ( {
11291129 style_class : "sound-player" ,
11301130 important : true ,
11311131 vertical : true
11321132 } ) ;
11331133 mainBox . addActor ( this . vertBox , { expand : false } ) ;
1134+ this . addMenuItem ( mainBox ) ;
11341135
11351136 // Player info
11361137 this . _playerBox = new St . BoxLayout ( ) ;
@@ -1725,7 +1726,7 @@ class Player extends PopupMenu.PopupMenuSection {
17251726 cover_path ,
17261727 Math . trunc ( 300 * global . ui_scale ) ,
17271728 Math . trunc ( 300 * global . ui_scale ) ,
1728- this . _on_cover_loaded . bind ( this )
1729+ ( cache , handle , actor ) => { this . _on_cover_loaded ( cache , handle , actor ) }
17291730 ) ;
17301731 this . _applet . setIcon ( ) ;
17311732
@@ -1819,6 +1820,7 @@ class Player extends PopupMenu.PopupMenuSection {
18191820 if ( this . _seeker )
18201821 this . _seeker . destroy ( ) ;
18211822
1823+ //FIXME!!! Error when a media is playing:
18221824 try {
18231825 PopupMenu . PopupMenuSection . prototype . destroy . call ( this ) ;
18241826 } catch ( e ) { logError ( "Error destroying Player!!!: " + e ) }
@@ -1918,13 +1920,6 @@ class Sound150Applet extends Applet.TextIconApplet {
19181920 this . settings . bind ( "keyOpen" , "keyOpen" , ( ) => { this . _setKeybinding ( ) } ) ;
19191921 this . settings . bind ( "keySwitchPlayer" , "keySwitchPlayer" , ( ) => { this . _setKeybinding ( ) } ) ;
19201922
1921- this . settings . bind ( "stepVolume" , "stepVolume" , ( ) => {
1922- VOLUME_ADJUSTMENT_STEP = this . settings . getValue ( "stepVolume" ) / 100 ;
1923- //~ log("VOLUME_ADJUSTMENT_STEP = " + VOLUME_ADJUSTMENT_STEP);
1924- } ) ;
1925- VOLUME_ADJUSTMENT_STEP = this . settings . getValue ( "stepVolume" ) / 100 ;
1926- //~ log("VOLUME_ADJUSTMENT_STEP = " + VOLUME_ADJUSTMENT_STEP);
1927-
19281923 this . settings . bind ( "magneticOn" , "magneticOn" , ( ) => this . _on_sound_settings_change ( ) ) ;
19291924 this . settings . bind ( "magnetic25On" , "magnetic25On" , ( ) => this . _on_sound_settings_change ( ) ) ;
19301925
@@ -1968,6 +1963,21 @@ class Sound150Applet extends Applet.TextIconApplet {
19681963 this . settings . bind ( "audio-next" , "audio_next" , ( ) => { this . _setKeybinding ( ) } ) ;
19691964 this . settings . bind ( "audio-prev" , "audio_prev" , ( ) => { this . _setKeybinding ( ) } ) ;
19701965
1966+ this . settings . bind ( "stepVolume" , "stepVolume" , ( ) => {
1967+ let sv = this . settings . getValue ( "stepVolume" ) ;
1968+ let vu = this . settings . getValue ( "volume-up" ) ;
1969+ let old_VAS = Math . round ( VOLUME_ADJUSTMENT_STEP * 100 ) ;
1970+ VOLUME_ADJUSTMENT_STEP = sv / 100 ;
1971+ if ( old_VAS == 5 && sv != 5 && vu . length <= 2 ) {
1972+ this . settings . setValue ( "redefine-volume-keybindings" , true ) ;
1973+ this . _set_shortcuts_as_default ( ) ;
1974+ this . _setKeybinding ( ) ;
1975+ }
1976+ //~ log("VOLUME_ADJUSTMENT_STEP = " + VOLUME_ADJUSTMENT_STEP);
1977+ } ) ;
1978+ VOLUME_ADJUSTMENT_STEP = this . settings . getValue ( "stepVolume" ) / 100 ;
1979+ //~ log("VOLUME_ADJUSTMENT_STEP = " + VOLUME_ADJUSTMENT_STEP);
1980+
19711981 // Whether sound@cinnamon .org is loaded:
19721982 let enabledApplets = global . settings . get_strv ( ENABLED_APPLETS_KEY ) ;
19731983 var _soundATcinnamonDOTorg_is_loaded = false ;
@@ -2428,6 +2438,9 @@ class Sound150Applet extends Applet.TextIconApplet {
24282438 this . _iconLooping = false ;
24292439 this . _artLooping = false ;
24302440 this . startingUp = true ;
2441+ //~ if (GLib.file_test(R30MPVSOCKET, GLib.FileTest.EXISTS)) {
2442+ //~ GLib.file_set_contents(RUNTIME_DIR + "/R30Stop", "");
2443+ //~ }
24312444
24322445
24332446 if ( this . actor && ( this . actor . get_stage ( ) != null ) && this . _control && ( this . _control . get_state ( ) != Cvc . MixerControlState . CLOSED ) ) {
@@ -2495,6 +2508,14 @@ class Sound150Applet extends Applet.TextIconApplet {
24952508 //~ logDebug("this._iconLooping = false;");
24962509 this . _artLooping = false ;
24972510 //~ logDebug("this._artLooping = false;");
2511+
2512+ if ( this . _control ) {
2513+ for ( let i = 0 , l = this . _streams . length ; i < l ; ++ i ) {
2514+ let id = this . _streams [ i ] . id ;
2515+ this . _control . emit ( "stream-removed" , id ) ;
2516+ }
2517+ }
2518+
24982519 if ( this . _seeker ) {
24992520 this . _seeker . destroy ( ) ;
25002521 //~ logDebug("Seeker destroyed");
0 commit comments