TimeLineAnnotator / desktop

A GUI for graphical analysis and annotation of video and audio files.
https://tilia-app.com
Creative Commons Attribution Share Alike 4.0 International
8 stars 2 forks source link

Refactor subscriptions to a separate method in TImelineUIs__init__ #91

Closed azfoo closed 1 month ago

azfoo commented 3 months ago

TiLiA uses the subscriber/publisher pattern to reduce coupling between objects. It's main implementation is in the "requests" module. Some classes, like TimelineUIs, work like "routers" of requests, they listen for them and call the appropriate code on instances of other classes. Because of that, they may end with a lot of subscriptions (which are done via the listen and serve functions). It would be good to refactor those subscriptions to be in a separate function instead of in the __init__ method if possible. As a bonus we could do that to other classes as well.