[mythtv-commits] Ticket #655: Refactoring of addListener/dispatch code

MythTV mythtv at cvs.mythtv.org
Sun Nov 13 20:36:58 EST 2005


#655: Refactoring of addListener/dispatch code
------------------------------------+---------------------------------------
 Reporter:  eskil <myth at eskil.org>  |       Owner:  ijr
     Type:  patch                   |      Status:  new
 Priority:  minor                   |   Milestone:     
Component:  mythtv                  |     Version:     
 Severity:  medium                  |  
------------------------------------+---------------------------------------
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.

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/655>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list