[vdr] Updating menu items from separate thread
Tobias Grimm
listaccount at e-tobi.net
Fri Oct 7 23:03:55 CEST 2005
Udo Richter wrote:
> I don't think that updating menus from other threads is allowed by design.
Surly not, I just thought, there might be an easy way to make this
thread safe.
> My suggestion is to take a look on how the dynamic updating recordings
> menu works in vdr-1.3.33 and newer. Basically, a background thread
> collects the data, and the foreground thread updates the menu on the
> next ProcessKey(kNone) call.
Ok, I see - I already thought about this. It just didn't felt right,
because I see ProcessKey() as some kind of message loop, which I don't
want to give too much responsibilities. In my current design, the menu
has a presenter (MVP), which is an observer that get's notified by the
thread. I will probably let the presenter collect the items to be
updated and when the menu comes across a kNone in ProcessKey, it lets
the presenter update any items it may have in it's "update queue".
Surely not the best solution, but maybe I will find a better one later on.
Thanks,
Tobias
More information about the vdr
mailing list