Advertisement
aries-soft

extension.js.diff

Sep 4th, 2011
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.37 KB | None | 0 0
  1. *** /home/aries/Загрузки/arch_aur/gnome-shell-extension-mediaplayer-git/pkg/usr/share/gnome-shell/extensions/mediaplayer@patapon.info/extension.js  2011-09-04 04:11:26.796910942 +0400
  2. --- /usr/share/gnome-shell/extensions/mediaplayer@patapon.info/extension.js 2011-09-04 03:53:59.095920159 +0400
  3. ***************
  4. *** 371,377 ****
  5.           this._playButton = new ControlButton('media-playback-start',
  6.               Lang.bind(this, function () { this._mediaServerPlayer.PlayPauseRemote(); }));
  7.           this._stopButton = new ControlButton('media-playback-stop',
  8. !             Lang.bind(this, function () { this._mediaServerPlayer.StopRemote(); }));
  9.           this._nextButton = new ControlButton('media-skip-forward',
  10.               Lang.bind(this, function () { this._mediaServerPlayer.NextRemote(); }));
  11.  
  12. --- 371,377 ----
  13.           this._playButton = new ControlButton('media-playback-start',
  14.               Lang.bind(this, function () { this._mediaServerPlayer.PlayPauseRemote(); }));
  15.           this._stopButton = new ControlButton('media-playback-stop',
  16. !             Lang.bind(this, function () { this._mediaServerPlayer.PauseRemote(); this._mediaServerPlayer.StopRemote(); }));
  17.           this._nextButton = new ControlButton('media-skip-forward',
  18.               Lang.bind(this, function () { this._mediaServerPlayer.NextRemote(); }));
  19.  
  20. ***************
  21. *** 395,400 ****
  22. --- 395,401 ----
  23.           this._volume = new PopupMenu.PopupSliderMenuItem(0, {style_class: 'volume-slider'});
  24.           this._volume.connect('value-changed', Lang.bind(this, function(item) {
  25.               this._mediaServerPlayer.setVolume(item._value);
  26. +             this._setVolume(this,item._value);
  27.           }));
  28.           this.addMenuItem(this._volumeInfo);
  29.           this.addMenuItem(this._volume);
  30. ***************
  31. *** 422,427 ****
  32. --- 423,433 ----
  33.                   this._setStatus(iface, value["PlaybackStatus"]);
  34.               if (value["Metadata"])
  35.                   this._setMetadata(iface, value["Metadata"]);
  36. +             this._getStatus();
  37. +             this._getMetadata();
  38. +             this._getVolume();
  39. +             this._currentTime = 0;
  40. +             this._getPosition();
  41.           }));
  42.  
  43.           this._mediaServerPlayer.connect('Seeked', Lang.bind(this, function(sender, value) {
  44. ***************
  45. *** 462,467 ****
  46. --- 468,475 ----
  47.           if (metadata["mpris:length"]) {
  48.               // song length in secs
  49.               this._songLength = metadata["mpris:length"] / 1000000;
  50. +         if(this._name === "quodlibet")
  51. +             this._songLength = metadata["mpris:length"] / 1000;
  52.               // reset timer
  53.               this._stopTimer();
  54.               this._runTimer();
  55. ***************
  56. *** 493,498 ****
  57. --- 501,512 ----
  58.           if (metadata["mpris:artUrl"]) {
  59.               let cover = metadata["mpris:artUrl"].toString();
  60.               cover = decodeURIComponent(cover.substr(7));
  61. +         /* FIXME
  62. +            fix for quodlibet + picture saver plugin
  63. +            File: .quodlibet/current.cover */
  64. +         if (!GLib.file_test(cover, GLib.FileTest.EXISTS))
  65. +             if(this._name === "quodlibet")
  66. +             cover = decodeURIComponent(".quodlibet/current.cover");
  67.               if (! GLib.file_test(cover, GLib.FileTest.EXISTS))
  68.                   this._trackCover.set_child(new St.Icon({icon_name: "media-optical-cd-audio", icon_size: 100, icon_type: St.IconType.FULLCOLOR}));
  69.               else {
  70. ***************
  71. *** 516,528 ****
  72.       },
  73.  
  74.       _setVolume: function(sender, value) {
  75. !         if (value === 0)
  76. !             this._volumeInfo.setIcon("audio-volume-muted");
  77.           if (value > 0)
  78.               this._volumeInfo.setIcon("audio-volume-low");
  79. !         if (value > 0.30)
  80.               this._volumeInfo.setIcon("audio-volume-medium");
  81. !         if (value > 0.80)
  82.               this._volumeInfo.setIcon("audio-volume-high");
  83.           this._volume.setValue(value);
  84.       },
  85. --- 530,541 ----
  86.       },
  87.  
  88.       _setVolume: function(sender, value) {
  89. !         this._volumeInfo.setIcon("audio-volume-muted");
  90.           if (value > 0)
  91.               this._volumeInfo.setIcon("audio-volume-low");
  92. !         if (value > 0.33)
  93.               this._volumeInfo.setIcon("audio-volume-medium");
  94. !         if (value > 0.66)
  95.               this._volumeInfo.setIcon("audio-volume-high");
  96.           this._volume.setValue(value);
  97.       },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement