Ejemplo n.º 1
0
        private TvResult AfterTune(IUser user, int idChannel, ITvSubChannel result)
        {
            bool isLocked = _cardHandler.Card.IsTunerLocked;

            Log.Debug("card: Tuner locked: {0}", isLocked);

            Log.Info("**************************************************");
            Log.Info("***** SIGNAL LEVEL: {0}, SIGNAL QUALITY: {1} *****", _cardHandler.Card.SignalLevel,
                     _cardHandler.Card.SignalQuality);
            Log.Info("**************************************************");

            ITvCardContext context = _cardHandler.Card.Context as ITvCardContext;

            if (result != null)
            {
                Log.Debug("card: tuned user: {0} subchannel: {1}", user.Name, result.SubChannelId);
                user.SubChannel = result.SubChannelId;
                user.IdChannel  = idChannel;
                context.Add(user);
            }
            else
            {
                return(TvResult.AllCardsBusy);
            }

            if (result.IsTimeShifting || result.IsRecording)
            {
                context.OnZap(user);
            }
            return(TvResult.Succeeded);
        }