Beispiel #1
0
        void MovieFileController_OnStatusUpdateFromPlayerEvent(string file, MovieFiles.VIRTUAL_CHANNEL.PLAY_STATUS_UPDATE status, MovieFiles.VIRTUAL_CHANNEL.PlayNextFileDelegate playnext)
        {
            if (m_DataGridRowIndex.Contains(file))
            {
                int rowIndex = (int)m_DataGridRowIndex[file];
                dataGridViewFilesInProcess.Rows[rowIndex].Cells[1].Value = status.ToString();
            }

            if (playnext != null)
            {
                // the playnext delegate will be called from a UI thread, so that the Directshow movie player will run on the UI thread to eable painting on the UI owned panel
                this.BeginInvoke((MethodInvoker) delegate { playnext(); });
            }
        }
Beispiel #2
0
 public int GetNextOpenDeviceValue()
 {
     for (int i = nextHandle; i < MaxHandleNumber; i++)
     {
         if (!handleHashTable.Contains(i))
         {
             nextHandle = i + 1; // remeber were we left off
             if (nextHandle >= MaxHandleNumber)
             {
                 nextHandle = 0;
             }
             return(i);
         }
     }
     return(-1);
 }
Beispiel #3
0
        public void StartThreads()
        {
            IPAddress[] ipAddresses = ConnectionServer.GetValidLocalAddress();
            if (ipAddresses == null)
            {
                m_Log.Log(" no local IP addresses found, exiting", ErrorLog.LOG_TYPE.FATAL);
                return;
            }

            bool loopBackAddressFound = false;


            foreach (IPAddress addr in ipAddresses)
            {
                try
                {
                    // eliminate duplicates
                    if (!m_LocalHostPortsTable.Contains(addr.ToString()))
                    {
                        if (addr.ToString().Contains("127.0"))
                        {
                            loopBackAddressFound = true;
                        }

                        m_LocalHostPortsTable.Add(addr.ToString(), addr.ToString());

                        m_Log.Log("IP Server listening on host addr: " + addr.ToString(), ErrorLog.LOG_TYPE.INFORMATIONAL);

                        ConnectionServer con = new ConnectionServer(addr, 13000, HandleReceivedMessage, m_AppData);
                        m_Server.Add(con);
                    }
                }
                catch (Exception ex) { m_Log.Trace(ex, ErrorLog.LOG_TYPE.FATAL); }
            }

            // ensure we are listening to the loop back 127.0.0.1
            if (!loopBackAddressFound)
            {
                try
                {
                    ConnectionServer con = new ConnectionServer(IPAddress.Loopback, 13000, HandleReceivedMessage, m_AppData);
                    m_Server.Add(con);
                }
                catch (Exception ex) { m_Log.Trace(ex, ErrorLog.LOG_TYPE.FATAL); }
            }
        }