static void Main(string[] args) { Console.Write("Starting..."); //PhotoEncoderService p = new PhotoEncoderService(); //p.Start(); //while (true) { System.Threading.Thread.Sleep(1000); } PhotoEncoder Encoder = new PhotoEncoder(); //TurbineEncoder Encoder = new TurbineEncoder(); Photo CurrentPhoto = null; bool Success = true; do { CurrentPhoto = EncoderBase.GetNextPhoto(new Q(Photo.Columns.MediaType, Photo.MediaTypes.Image), 10); //CurrentPhoto = EncoderBase.GetNextPhoto(new Q(Photo.Columns.K, 12102040), 10); //CurrentPhoto = EncoderBase.GetNextPhoto(new Q(Photo.Columns.MediaType, Photo.MediaTypes.Video), 3); if (CurrentPhoto != null) { ConsoleWriteLine(""); ConsoleWriteLine(">>>>>>>>>>>>>>Encoding PhotoK " + CurrentPhoto.K.ToString()); Success = EncoderBase.ProcessPhoto(Encoder, CurrentPhoto, new Photo.EncoderStatusDelegate(ConsoleWriteLine), new Photo.MeaningfulActivityDelegate(ConsoleActive), 8); } Console.Write("."); System.Threading.Thread.Sleep(300); } while (true);//CurrentPhoto != null); }
public override int GetEncoder() { //#region to test... //if (Encoders[0] == null) // Encoders[0] = new TurbineEncoder(); //if (Encoders[0].Idle) //{ // Encoders[0].Idle = false; // return 0; //} //return -1; //#endregion for (int i = 0; i < Encoders.Length; i++) { if (Encoders[i] == null) { Encoders[i] = new PhotoEncoder(); } if (Encoders[i].TakeIfIdle()) return i; } return -1; }