public void Read(string path) { RecordListener listener = new RecordListener(); listener.Initialization(numOfFramesPerRead, this); Controller controller = new Controller(); controller.AddListener(listener); actualNumOfReads = 0; Console.WriteLine("Press enter to start reading frames to file " + path); Console.ReadLine(); state = RecorderState.Idle; while (state != RecorderState.Saving) { Console.WriteLine("num: " + (actualNumOfReads + 1) + " in " + numOfReads); if (!isAuto) { Console.ReadLine(); } state = RecorderState.Reading; Console.WriteLine("Reading..."); while (state == RecorderState.Reading) { if (numOfFramesPerRead == 0) { Console.ReadLine(); listener.GetSequence(); } } while (state == RecorderState.Storing) { } } while (state != RecorderState.Saving) { } Utils.SaveListListFrame(sequencesToRead, path); controller.RemoveListener(listener); controller.Dispose(); }