Vlastný vyhľadávací nástroj
 

Rhythmbox: resume on restart plugin

1 days and 2.98 hours since someone reset this sign. Record is 21 days and 18.88 hours.

Zaujímavé linky:
KSP
FMFI UK
GJH

------BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d- s+: a-- C++ UL+++ P+ L++ E--- W++ N? o? K? w-- O? M? V? PS+ PE+(-) Y+ PGP+ t>+ 5++ X+ R+ tv-- b+ DI+ D G++ e>+++ h-- r++ y?
------END GEEK CODE BLOCK------

This is fast dirty hack. But it works (only for library, nothing else). You can dowload plugin here. Just download it and extract it into ~/.gnome2/rhythmbox/plugins directory. Have fun!

Source code: resume_on_restart/__init__.py

  1. #!/usr/bin/python
  2. #
  3. # This program is under GPLv3 license --
  4. # http://www.gnu.org/licenses/gpl-3.0.html
  5. #
  6. # If you think, that this script is usefull, please send me a postcard to
  7. # adress:
  8. # Michal Nanasi
  9. # Azalkova 1
  10. # 82101 Bratislava
  11. # Slovakia
  12. import rb,rhythmdb,time
  13.  
  14.  
  15. class ResumeOnPlaying (rb.Plugin):
  16.     def __init__(self):
  17.         rb.Plugin.__init__(self)
  18.  
  19.     def activate(self, shell):
  20.         print "HALUZ"
  21.         self.shell = shell
  22.         self.db=shell.get_property("db")
  23.         self.player=shell.get_player()
  24.  
  25.         self.pec_id = self.player.connect('playing-song-changed',self.playing_song_changed)
  26.  
  27.         f=open(self.find_file("resume_on_restart.save"),"r")
  28.         self.to_change=f.readline()
  29.         f.close();
  30.  
  31.     def deactivate(self, shell):
  32.         del self.shell
  33.         self.player.disconnect(self.pec_id)
  34.         try:
  35.             location=self.db.entry_get(self.player.get_playing_entry(),rhythmdb.PROP_LOCATION)
  36.             print location
  37.             f=open(self.find_file("resume_on_restart.save"),'w')
  38.             f.write(location)
  39.             f.close()
  40.         except:
  41.             print "Error"
  42.  
  43.     def playing_song_changed(self, sp, entry):
  44.         if self.to_change is not "Not":
  45.             try:
  46.                 self.player.play_entry(self.db.entry_lookup_by_location(self.to_change))
  47.             except:
  48.                 print "Error"
  49.  
  50.             self.to_change="Not"
  51.  
  52.         if entry is not None:
  53.             try:
  54.                 location=self.db.entry_get(entry,rhythmdb.PROP_LOCATION)
  55.                 print location
  56.                 f=open(self.find_file("resume_on_restart.save"),'w')
  57.                 f.write(location)
  58.                 f.close()
  59.             except:
  60.                 print "ERROR"

Source code: resume_on_restart/resume_on_restart.rb-plugin

  1. [RB Plugin]
  2. Loader=python
  3. Module=resume_on_restart
  4. IAge=1
  5. Name=Resume on restart
  6. Description=Remember last played song and play it as first song after rhythmbox restarts.
  7. Authors=Michal Nánási (mic(at)rhythmboxplugin.ksp.sk)
  8. Copyright=This program is under GPLv3 license -- http://www.gnu.org/licenses/gpl-3.0.html
  9. Website=http://people.ksp.sk/~mic/Projects/RhythmboxROR

Source code: resume_on_restart/resume_on_restart.save

Dátum poslednej zmeny: 27 január, 2010, 13:34 CET
Created by Mic ( mic(at)ksp(dot)sk, ICQ: 281832795, jabber: mic47@jabber.sk) Tato stranka vyzera najlepsie na mojom monitore:-) A v prehliadacoch Chromium, Firefox, Opera, Epiphany. Odporúčaná šírka monitora je aspoň 1280 pixelov. Pri menších šírkach sa nemusia niektoré fotky v galérii zobraziť korektne. Použitý software: PmWiki, Gallery 2.