[mythtv] FW: [mythtv-commits] mythtv commits

Chris Pinkham cpinkham at bc2va.org
Thu Jul 31 12:15:16 EDT 2003


> Weekly timeslot recordings? Is this for manual schedules as well?
> 
> Because I was thinking of adding features like daily, weekdays and
> weekends to the manual scheduling but maybe somebody is already working
> on this?

The weekly timeslot stuff has been in for a while now.

Just to throw out an idea and stir up a little conversation, here's
another idea I've been tossing around in my head.

One option would be to just have a 'timeslot' recording and use a
bitmask to represent what days applied.  This would default to every
day but could be edited on the advanced recording screen.

Sunday    = 0x01
Monday    = 0x02
Tuesday   = 0x04
Wednesday = 0x08
Thursday  = 0x10
Friday    = 0x20
Saturday  = 0x40

So, Weekend mask would be 0x41, Weekday mask 0x3e, anyday mask 0x7f.
The mask field would default to 0xff which would match all days of
the week.

Checking to see if a recording should record would be just
getting the day of the week of the current program (0-6) and comparing
it against the mask. Something like this in scheduledrecording.cpp
('dow' = 'day of week'):

while(get_each_row_from_scheduled_recordings_query)
{
    int program_dow = (starttime DAYOFWEEK from 'program' table in sql query);
    int program_mask = 0x01 << program_dow;
    int record_mask = (record mask value from 'record' table in sql query);

    // skip program if it doesn't match the dow mask.
    if ( ! (program_mask & record_mask))
        continue;

    // add current program scheduled list as normal
    blah
    blah
    blah
}

This would also give us the potential of making an "anytime"
recording that would only apply on specific days of the week such
as weekends.  Since the field would default to 0xff meaning anyday
the existing anytime recording types would work as normal unless the
mask field was editted.

-- 

Chris



More information about the mythtv-dev mailing list