Add a Scheduler::OpenEndType enum.
Change the scheduler to partly use best-fit based on tuner affinity.

If one or more programs on a multiplex or chanid are scheduled to
record on a virtual tuner, the scheduler now tries to schedule other,
overlapping programs on the same multiplex or chanid on related
virtual tuners.  In the past, the scheduler always used the first
available tuner even if doing so caused it to paint itself into a
corner.  The intent of this change is to make better use of virtual
tuners by grouping compatible recordings together when possible.

The scheduler currently does this best-fit scheduling in two places.
In the first pass, it checks all showings of the program at the given
time.  Later showing of the program are not considered at this time.
In the retry passes when trying to move already scheduled programs,
all showings of a program, even later ones, are checked.

Note that this change also makes subtle changes in the order programs
are tried and retried.  In the first pass, programs in the same
priority/subpriority (aks recpriority2) sublevel are scheduled.  In
the first retry pass, programs in the same priority/subpriority
sublevel are scheduled by moving other programs as long as their
priority is not lowered.  In the second retyr pass, Programs in the
same priority level are scheduled by moveing other programs even if
their priorities get lowered.  The intent of this change is to try a
little harder to schedule the highest priority for a given program.
Previously, the scheduler was a little too quick to fall back to lower
priority showings.

Note that there are more changes that will be considered in the
future, possibly even adding more levels of retries.  Those won't be
started, though, until after some infrastructure changes are made and
those are expected to take a while.
Merge branch 'master' into devel/scheduler
Some fixes for new tuner affinity scheduling.

Re-sort the entries during the retry passes.  The changes resulted in
more recordings getting deferred to later than intended.

Includ more specificity in the priority and retry sorting.  There are
some unanticipated cases that could lead to non-deterministic results.

Re-allow the live TV pass to move programs to lower priority showings.
Merge branch 'master' into devel/scheduler