ArgusTV.Recorder.MediaPortalTvServer.TvServerPlugin.TvController_StopRecording C# (CSharp) Method

TvController_StopRecording() public static method

public static TvController_StopRecording ( IUser &user ) : bool
user IUser
return bool
        public static bool TvController_StopRecording(ref IUser user)
        {
            lock (_tvControllerLock)
            {
                return _controller.StopRecording(ref user);
            }
        }

Usage Example

 private bool EnsureCardFree(bool allowOtherArgusUser, ref string errorMessage, out bool argusIsRecordingOnCard)
 {
     argusIsRecordingOnCard = false;
     IUser[] cardUsers = TvServerPlugin.TvController_GetUsersForCard(_recordOnCard.IdCard);
     if (cardUsers != null)
     {
         TvDatabase.TuningDetail tuning = Utility.FindTuningDetailOnCard(_channel, _recordOnCard.IdCard);
         foreach (IUser cardUser in cardUsers)
         {
             if (!cardUser.Name.Equals("epg", StringComparison.InvariantCultureIgnoreCase))
             {
                 if (cardUser.Name.StartsWith("ArgusTV"))
                 {
                     if (!allowOtherArgusUser &&
                         !Utility.IsSameTransponder(_recordOnCard.IdCard, tuning, cardUser.IdChannel))
                     {
                         // Seems another ARGUS TV user is using this card, but on a different
                         // transponder!  Normally this should never happen, but in rare conditions
                         // we need to be able to handle this.
                         errorMessage           = "Card is in use by previous recording";
                         argusIsRecordingOnCard = true;
                         return(false);
                     }
                 }
                 else
                 {
                     IUser tmpUser = cardUser;
                     if (TvServerPlugin.TvController_IsRecording(ref tmpUser))
                     {
                         if (!TvServerPlugin.TvController_StopRecording(ref tmpUser))
                         {
                             errorMessage = "Failed to stop recording on channel " + _channel.DisplayName;
                             return(false);
                         }
                     }
                     else if (TvServerPlugin.TvController_IsTimeShifting(ref tmpUser))
                     {
                         if (!Utility.IsSameTransponder(_recordOnCard.IdCard, tuning, tmpUser.IdChannel))
                         {
                             if (!TvServerPlugin.TvController_StopTimeShifting(ref tmpUser, TvStoppedReason.RecordingStarted))
                             {
                                 errorMessage = "Failed to stop timeshifting on channel " + _channel.DisplayName;
                                 return(false);
                             }
                         }
                     }
                 }
             }
         }
     }
     return(true);
 }
All Usage Examples Of ArgusTV.Recorder.MediaPortalTvServer.TvServerPlugin::TvController_StopRecording