Exemplo n.º 1
0
        private void vMaster_Load(object sender, EventArgs e)
        {
            settings = new vMixPreferences();

            EventListLock = new Semaphore(1, 1);
            EventList     = new List <vMixEvent>();
            Workload      = new BlockingCollection <vMixMicroEvent>();

            MasterClock = new vMixScheduler(100, settings.vMixPreload, settings.vMixLinger, Workload);
            WebClient   = new vMixWebClient(settings.vMixURL);

            ThreadStart workstart = new ThreadStart(WorkloadFunc);

            WorkloadThread = new Thread(workstart);
            WorkloadThread.Start();

            ScheduleFolder = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\vMixScheduler";
            if (!Directory.Exists(ScheduleFolder))
            {
                Directory.CreateDirectory(ScheduleFolder);
            }
            WatchDog = new FileSystemWatcher(ScheduleFolder, "vMixSchedule.xml");
            WatchDog.NotifyFilter        = NotifyFilters.LastWrite | NotifyFilters.CreationTime | NotifyFilters.FileName;
            WatchDog.Changed            += new FileSystemEventHandler(WatchDogBark);
            WatchDog.Created            += new FileSystemEventHandler(WatchDogBark);
            WatchDog.Deleted            += new FileSystemEventHandler(WatchDogBark);
            WatchDog.EnableRaisingEvents = true;

            if (settings.vMixAutoLoad)
            {
                ReloadSchedule();
            }
        }
Exemplo n.º 2
0
        private void vMaster_Load(object sender, EventArgs e)
        {
            settings = new vMixPreferences();

            EventListLock = new Semaphore(1, 1);
            EventList = new List<vMixEvent>();
            Workload = new BlockingCollection<vMixMicroEvent>();

            MasterClock = new vMixScheduler(100, settings.vMixPreload , settings.vMixLinger, Workload);
            WebClient = new vMixWebClient(settings.vMixURL);

            ThreadStart workstart = new ThreadStart(WorkloadFunc);
            WorkloadThread = new Thread(workstart);
            WorkloadThread.Start();

            ScheduleFolder = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\vMixScheduler";
            if (!Directory.Exists (ScheduleFolder)) Directory.CreateDirectory (ScheduleFolder);
            WatchDog = new FileSystemWatcher(ScheduleFolder, "vMixSchedule.xml");
            WatchDog.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.CreationTime | NotifyFilters.FileName;
            WatchDog.Changed += new FileSystemEventHandler(WatchDogBark);
            WatchDog.Created += new FileSystemEventHandler(WatchDogBark);
            WatchDog.Deleted += new FileSystemEventHandler(WatchDogBark);
            WatchDog.EnableRaisingEvents = true;

            if(settings.vMixAutoLoad)
                ReloadSchedule();
        }