Exemple #1
0
        public Encoder(int iChannel, string WMVDirectory, ref CarverLab.Utility.Logger logger)
        {
            log = logger;
            log.Context = "OysterEncoder.Encoder.Encoder";
            log.Context = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName + "." + System.Reflection.MethodBase.GetCurrentMethod().Name;
            if (iChannel < 1 || iChannel > 4)
            {
                log.WriteLog("OysterEncoder.Encoder.Encoder:" + " Invalid channel number specified: " + iChannel);
                throw (new ArgumentOutOfRangeException("iChannel",iChannel,"iChannel can only be between 1 and 4"));
            }
            m_iChannel = iChannel;
            m_bIsEncoderStreaming = false;
            m_bIsEncoderArchiving = false;
            m_sWMVDirectory = WMVDirectory;
            m_sWMVDefaultDirectory = m_sWMVDirectory;
            m_sProfileDirectory = MyPath + PROFILEDIRECTORY;
            if (!System.IO.Directory.Exists(m_sProfileDirectory))
            {
                throw (new ApplicationException("Profiles directory does not exist in " + m_sProfileDirectory + "."));
            }
            m_encoder = new WMEncoderLib.WMEncoderClass();
            m_encoder.OnError += new WMEncoderLib._IWMEncoderEvents_OnErrorEventHandler(m_encoder_OnError);
            m_encoder.OnClientConnect += new WMEncoderLib._IWMEncoderEvents_OnClientConnectEventHandler(m_encoder_OnClientConnect);
            m_encoder.OnClientDisconnect += new WMEncoderLib._IWMEncoderEvents_OnClientDisconnectEventHandler(m_encoder_OnClientDisconnect);

            try
            {
                UploadServer =
                    System.Configuration.ConfigurationSettings.AppSettings["UploadServer"];
                UploadPort = Convert.ToInt32(
                    System.Configuration.ConfigurationSettings.AppSettings["UploadPort"]);
                UploadUser =
                    System.Configuration.ConfigurationSettings.AppSettings["UploadUser"];
                UploadPassword =
                    System.Configuration.ConfigurationSettings.AppSettings["UploadPassword"];
            }
            catch (System.Exception e)
            {
                log.WriteLog("AppConfig is invalid. Exiting. Error: " + e.Message);
                throw new ApplicationException("AppConfig file information is invalid. Parts may be missing or the wrong type.");
            }

            log.WriteLog("Upload Server set at: " + UploadServer);
            log.WriteLog("Upload Port set at:" + UploadPort);
        }
Exemple #2
0
        //private System.Runtime.Remoting.Channels.Http.HttpChannel httpchannel = null;
        public ODService()
        {
            // This call is required by the Windows.Forms Component Designer.
            InitializeComponent();
            Logger = new CarverLab.Utility.Logger(CarverLab.Utility.AppInfo.Title);

            DelayTimer = new System.Timers.Timer();
            DelayTimer.Enabled = false;
            DelayTimer.Interval = 500;
            DelayTimer.Elapsed +=new System.Timers.ElapsedEventHandler(DelayTimer_Elapsed);
            Logger.WriteLog("Service Initialized.");
        }
Exemple #3
0
 public frmDisplay()
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     //
     // TODO: Add any constructor code after InitializeComponent call
     //
     mLogger = new CarverLab.Utility.Logger(CarverLab.Utility.AppInfo.Title);
     //#if(Debug)
         mLogger.bDebugMode = true;
     //#endif
     mLogger.WriteLog(" Started Application at " + DateTime.Now.ToString());
 }