Hi Kurt, On 13.11.05, K G wrote:
First of all, thanks for pytone!
Bitte!
For my amusement this Sunday afternoon, I have written the attached plugin, which starts the mp3info tag editor on the selected song if you hit the 'e' or 'E' key.
Current limitations: - It is runnning in an xterm, so you must be running pytone under X - I have not been able to convince pytone to update the info after editing the tags (item.song.rescan() crashes with an Attribute error (see log at the end)
Your item.song is a dbitem.song instance and as a such it does not know in which db it is stored. Correspondingly, it cannot update itself, and a rescan method does not exist. You need an item.song instance to do that. Normally, this is what you deal with anyway, so this should not be a problem.
- mp3info is really unwieldy as tag editor, but it is nice and simple
Please tell me what you think of this (it is not that big... :-) ).
Currently, I´m a bit in a hurry, but I will have a look later. In principle, I like the idea, though.
I also have a proposition for the plugin framework: Would it be possible to define an event to subscribe to which already includes a list of keys?
I.e. self.channel.subscribe(events.keypressed([ord('e'),ord('E'),self.keypressed) instead of self.channel.subscribe(events.keypressed,self.keypressed) and the check at the beginning of the plugin?
So far, when you subscribe to an event, the corresponding class has to be used and the event dispatcher code is correspondingly trivial. In the very beginning, I thought I should add something like a filter, but since checking at the begin of the event handler method is so simple, I didn´t follow this idea further.
Best regards to all, and may the fog outside lift soon!
Hey, here in Basel we have the most beautiful weather, I really cannot complain :-) Jörg