Пример #1
0
        /**
        // \fn public bool DeleteTranscoder(WebradioTranscoder transcoder, int webradioId)
        //
        // \brief Deletes the transcoder.
        //
        // \author Simon Menetrey
        // \date 26.05.2014
        //
        // \param transcoder The transcoder.
        // \param webradioId Identifier for the webradio.
        //
        // \return true if it succeeds, false if it fails.
        **/
        public bool DeleteTranscoder(WebradioTranscoder transcoder, int webradioId)
        {
            if (transcoder.IsRunning())
                transcoder.Stop();

            if (this.Bdd.DeleteTranscoder(transcoder.Id))
            {
                System.IO.File.Delete(transcoder.ConfigFilename);
                if (System.IO.File.Exists(transcoder.LogFilename))
                    System.IO.File.Delete(transcoder.LogFilename);
                this.Webradios[webradioId].Transcoders.Remove(transcoder);
                this.UpdateObservers(webradioId);
                return true;
            }
            else
                return false;
        }
Пример #2
0
 /**
 // \fn public bool StopTranscoder(WebradioTranscoder transcoder, int webradioId)
 //
 // \brief Stops a transcoder.
 //
 // \author Simon Menetrey
 // \date 26.05.2014
 //
 // \param transcoder The transcoder.
 // \param webradioId Identifier for the webradio.
 //
 // \return true if it succeeds, false if it fails.
 **/
 public bool StopTranscoder(WebradioTranscoder transcoder, int webradioId)
 {
     try
     {
         if (transcoder.Stop())
         {
             this.ActiveTranscoders.Remove(transcoder);
             this.Webradios[webradioId].Calendar.GenerateConfigFile();
             this.UpdateObservers(webradioId);
             return true;
         }
         else
             return false;
     }
     catch
     {
         return false;
     }
 }