[mythtv] [patch] MythGame improvements

Barney Barumba b004908 at bsxl.com
Mon Mar 28 02:32:16 UTC 2005


Hi,

Here's a patch that does the first part of this. Basically, what it does is:

- hardcode "All Games" and "Favourites" as root nodes
- allow different levels/filters for each root node

This involved fairly fundamental change to the way gametree.cpp held its
data, and so it's pretty much a rewrite of gametree.cpp / gametree.h.
Other than that though, there's only a couple of lines touched in
gamesettings.cpp and main.cpp.

The internal structure now supports an arbitrary number of root nodes,
each with its own filter - I'll have a look at creating a user interface
for this at some point, but the two basic All + Favourites does everything
I need for now.

As there are so many changes to gametree, I'd be really grateful if
someone else could give it a quick test. I've given it a pretty good
hammering over the last couple of days - but I only have mame on my system
right now (at least until I get my ZX Spectrum emulator added in!) but the
changes are not mame specific, so it should be ok.

Hope this is useful to someone as well as me!

Cheers,

Barney

> Further to my last post, the basic ideas I'm working with for gametree.cpp
> are:
>
> - create a new GameTreeRoot to store root node settings:
>   levels - e.g. "system year genre gamename"
>   filter - e.g. "favourites = 1"
>
> - determine leaf nodes from the root node levels. i.e. do not hardcode
> "gamename" - use the rightmost value in the root node levels.
>
> - maintain a GameTreeItem at each tree node as before, including a generic
> RomInfo structure holding the common information as per the present
> implementation.
>
> - when selecting leaf nodes, select all fields - this is the main change I
> made to fix the "no system causes crash" bug - as at the game level all
> values are selected regardless of whether they were specified in the tree
> levels.
>
> What these all add up to, is the ability to specify a number of root
> nodes, each with their own paths and criteria. eg, one could have:
>
>   All Games: levels="system year genre gamename", filter=""
>   Favourites: levels="gamename", filter="favourites = 1"
>
> Or, if you had a full mame installation of 3000+ games, but only a handful
> of other games, you could have:
>
>   Mame: levels="year genre gamename", filter="system = 'mame'"
>   Other: levels="system gamename", filter="system <> 'mame'"
>   Favourites: levels="gamename", filter="favourites = 1"
>
> Initially, I'm thinking of a limited user interface - i.e. only entering
> "all levels" and "favourite levels" strings from the user interface, and
> hardcoding the two root nodes and associated filter strings.
>
> It would not be hard from there to expose the full configuration to the
> user, as long as sufficient care was taken when exposing the custom filter
> strings so as not to allow malicious activity on the database - probably
> implement it as a select criteria dialogue which creates the custom sql
> filter rather than allow direct SQL entry by the user.
>
> Anyway, those are my thoughts. Again, if anyone is interested I'd be happy
> to discuss. Apologies for any errors, but I'm just typing this straight
> out of my head - all my code is at home!
>
> Talking of which - better get back to my paid job now :-(
>
> Cheers,
>
> Barney
>
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mythgame.diff.gz
Type: application/x-gzip
Size: 6243 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20050328/1ae7d224/mythgame.diff-0001.bin


More information about the mythtv-dev mailing list