Mailing List Archive

Small patch for mythtv? (European (?) channel names)
Hello again.

Well, I basically gave up on qmake and freetype1/2. I figure the best thing
to do is to port mythtv to freetype2 at some point (and get anti-aliased
fonts etc..).

... So I read a few more posts and noticed that the database structure
apparently isn't well suited for european channel names like "S9" and "E38",
since channum is an int and not a String.

So I began hacking it up, and created a small script to modify the database
table "channel" - adding a column "channel" (should work even with data in
the table):

USE mythconverg;
ALTER TABLE channel ADD channel VARCHAR(5);
UPDATE channel SET channel = channum;
ALTER TABLE channel MODIFY channel VARCHAR(5) NOT NULL UNIQUE KEY;

... And a very small patch to look up the information (but not using it)
(while making the routine use a join and not a C++ inner loop lookup):

1377a1378
>
1401,1405c1402,1412
< QString thequery = QString("SELECT channum,starttime,endtime,title,"
< "subtitle,description,category FROM program
"
< "WHERE channum = %1 AND starttime < %2 AND
"
< "endtime >
%3;").arg(lchannel).arg(curtimestr)
< .arg(curtimestr);
---
> QString thequery = QString("SELECT prg.channum,"
> "prg.starttime,prg.endtime,"
> "prg.title,prg.subtitle,"
> "prg.description,prg.category,"
> "chn.callsign,chn.icon,chn.channel "
> "FROM channel chn,program prg "
> "WHERE chn.channum = prg.channum "
> "AND prg.channum = %1 "
> "AND prg.starttime < %2 "
> "AND prg.endtime > %3;")
> .arg(lchannel).arg(curtimestr).arg(curtimestr);
1428,1438c1435
< }
<
< thequery = QString("SELECT callsign,icon FROM channel WHERE channum "
< "= %1;").arg(lchannel);
<
< query = db_conn->exec(thequery);
< if (query.isActive() && query.numRowsAffected() > 0)
< {
< query.next();
<
< test = query.value(0).toString();
---
> test = query.value(7).toString();
1441c1438
< test = query.value(1).toString();
---
> test = query.value(8).toString();
1445a1443
>

The above is untested - it compiles, however.

So is this the way to go, or are you/we going for the approach posted last
month about multiple broadcasters, capturecards and cardinputs?

One last thing: Am I babbling too much? Are you interested in my
suggestions?

/Jens
Re: Small patch for mythtv? (European (?) channel names) [ In reply to ]
On Sunday 15 September 2002 03:35 pm, Jens Lohmann-Hansen wrote:
> Hello again.
>
> Well, I basically gave up on qmake and freetype1/2. I figure the best thing
> to do is to port mythtv to freetype2 at some point (and get anti-aliased
> fonts etc..).

freetype 2 won't get you AA fonts anymore than freetype 1 does. It's all up
to whatever draws the font to do any antialiasing. The major reason the osd
text doesn't look as good as it could is how I'm drawing the black outline.

> ... So I read a few more posts and noticed that the database structure
> apparently isn't well suited for european channel names like "S9" and
> "E38", since channum is an int and not a String.
>
> So I began hacking it up, and created a small script to modify the database
> table "channel" - adding a column "channel" (should work even with data in
> the table):

I'd rather just make channum a string instead of having the data duplicated.
So, I won't apply your change as it is.

> So is this the way to go, or are you/we going for the approach posted last
> month about multiple broadcasters, capturecards and cardinputs?

Well, hopefully the guy who put for that proposal's working on things.
Otherwise, I suppose I'll do something similar..

> One last thing: Am I babbling too much? Are you interested in my
> suggestions?

As long as they're sent along with patches, sure =) Just sent unified diffs
(diff -u) instead.. Easier to read, etc.

Isaac