Opened 18 years ago
Closed 18 years ago
#655 closed patch (fixed)
Refactoring of addListener/dispatch code
Reported by: | Owned by: | Isaac Richards | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | mythtv | Version: | |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
While working on shoutcast/musictree code, I had to add another class that implemented the addListener/removeListener/dispatch API. This API was implemented by
- OutputListeners (inherited by AudioOutput)
- MythContext
- !Decoder (mythmusic)
instead to cut'n'pasting all that code again, I donned the refactoring hat and moved this into a MythObservable class, and changed the above classes to inherit from this. Submitting this as a separate patch to keep it reviewable.
The changes are
- add MythObservable in mythobservable.h/.cpp, implements add/removeListener, dispatch and dispatchNow.
- move MythEvent from mythcontext.h into mythevent.h
- make OutputEvent and DecoderEvent inherit from MythEvent (so I'm ensured that the event passed to !MythObservable::dispatch implemnets a clone method).
- make MythContext, OutputListeners and Decoder inherit MythObservable, remove their implementations of add/remove/dispatch.
- doxygen comments for MythObservable...
- Additionally, moved mythmusic/genres.c into a .h and .cpp file, since that makes the genre list accessible from other metadata editors.
Attachments (2)
Change History (3)
Changed 18 years ago by
Attachment: | observable.patch added |
---|
Changed 18 years ago by
Attachment: | observable.2.patch added |
---|
obligatory remove-cruft and fit coding style patch update...
Note: See
TracTickets for help on using
tickets.
patch that introduces MythObservable? and moves genres.c to genres.h/genres.cpp