[mythtv] Depreciated calls to MythUIButtonListItem::setImage (MythImage *image, const QString &name="")

Jeremy Palenchar jeremy at palenchar.net
Wed Oct 15 21:55:06 UTC 2008


....It's obvious I haven't seen the code....

But,

Perhaps, then, the cache needs to provide an extensible interface so that
new object types can be added to the cache. In this way, the developer below
would simply say cacheReference = cache.getItem(MythZMSocketImageThingy) and
button.Image = cacheReference->CachedItem.

Hence, all items are now going through the cache and the cache can be smart
enough to know if the item is already in the cache, if it needs to be
loaded, or if it has expired.

Now, everyone who wants to use the button in the UI is forced to go through
the cache but it should be as easy as adding a new implementation of the
cache entry interface to get their items in there.

The code can get a reference to the cached item and the cache can be smart
enough to wait until the item is needed to fetch it the first time or there
could be an option to pre-fetch the item to the cache.


-J

-----Original Message-----
From: mythtv-dev-bounces at mythtv.org [mailto:mythtv-dev-bounces at mythtv.org]
On Behalf Of Stuart Morgan
Sent: Wednesday, October 15, 2008 11:29 AM
To: Development of mythtv
Subject: Re: [mythtv] Depreciated calls to MythUIButtonListItem::setImage
(MythImage *image, const QString &name="")

On Wednesday 15 October 2008 18:42:48 Paul Harrison wrote:
> In MythZoneMinder the analysis images shown on the event screen are only
> available on the server running ZM which is usually a separate machine
> on the network. MythZM gets these images over a socket from the server
> so there is no need for these images to ever hit the hard drive, whats
> more  it's not uncommon for there to be 10,000+ events available. It's
> not practical to copy and store all these on each FE that accesses them.
> Most users will probably only ever look at the images once anyway so
> there is no advantage to caching  them. What I do now is I get the
> images on demand from the server as the user scrolls in the grid. Even a
> slow celeron has no problem keeping up so there is really no need to
> cache these images. I'd really appreciate it if we could keep the
> ability to load images directly into MythUIButtonListItems.

I was aware that there maybe exceptions. I've no problem keeping the ability

to load images directly, adding the deprecated attribute was more a reminder

to myself that some plugins needed changing. Also as a note to others 
currently working with mythui that loading images directly should be 
discouraged.

I'd like if possible to think of a way to discourages it's use though even
if 
we don't keep the attribute, that might be as simple as adding warnings to
the 
documentation.

I can't think of many times when we wouldn't want to use the cache, even for

images that don't have a long lifespan since the cache will eventually have 
the ability to cleanup behind itself based on frequency of access and last 
access times combined with a user modifiable cap on cache sizes (both memory

and filesystem caches).

The speed gains of the cache are not just in the loading, but avoiding 
repeating transformations and scaling on every image. In addition to the 
reflection on offer now it's planned that to allow a range of static image 
effects and transformations e.g. Rotation, shear, warping.
-- 
Stuart Morgan
_______________________________________________
mythtv-dev mailing list
mythtv-dev at mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev



More information about the mythtv-dev mailing list