Open s4y opened 11 years ago
It's an interesting question. For my purposes, I kind of liked the interrupting behavior - when I fire this up, the channel I'm in tends to devolve to lots of spam. But I can definitely see the use.
Reading through the SO answer, I wonder if we use something like the decorator pattern? A function that returns a class which is passed to the setDelegate_ method, so it would be a new class each time rather than the same one? I'd have to poke at this a little, I guess. Interesting problem! Do you have a branch with the code you have so far?
This should be totally doable by adding a delegate to be notified when the
NSSpeechSynthesizer
is finished speaking and by keeping a queue of messages to be spoken.However, it looks like this breaks
/reload plugins
: the runtime complains about the new delegate class trying to replace the old one ("SpeechDelegate is overriding existing Objective-C class"). This StackOverflow answer discusses a tremendously unsupported workaround.Can you think a way to get around that problem? I'd be happy to work on it, I'm just super unfamiliar with PyObjC, having never used it before.