Esempio n. 1
0
 ///
 ///	 <summary> * Constructor for AudioProcessor </summary>
 ///	 * <param name="desiredBufferSize"> </param>
 ///	 * <param name="desiredFPS"> </param>
 ///
 public AudioProcessor(int desiredBufferSize, int desiredFPS)
     : base()
 {
     this.desiredBufferSize = desiredBufferSize;
     this.waitForNanos      = 1000000000L / (long)desiredFPS;
     _processor             = new ProcessorTask(this);
 }
Esempio n. 2
0
        public void Run(string[] args)
        {
            string cfg_file = string.Empty;
            var    cmd      = new CommandLine(string.Join(" ", args).ToString());

            if (cmd.Contains("configuration"))
            {
                _logger.Send("Directory configuration...");
                try
                {
                    if (cmd.Contains("configuration"))
                    {
                        cfg_file = (string)cmd["configuration"].Value;
                    }
                }
                catch (Exception)
                {
                    throw new ArgumentException("'configuration' file of backup, option from command line is not parseable as string.");
                }
                if (cfg_file == string.Empty)
                {
                    // This will get the current WORKING directory (i.e. \bin\Debug)
                    string workingDirectory = Environment.CurrentDirectory;
                    // This will get the current PROJECT directory
                    string projectDirectory = Directory.GetParent(workingDirectory).Parent.Parent.FullName;
                    cfg_file = Path.Combine(projectDirectory, "backup_configuration.json");
                }
                Configure(cfg_file);
            }

            if (cmd.Contains("backup"))
            {
                _logger.Send("Performing backup...");

                ValueHolder taskList = GetAllBackupJobs();

                ProcessorTask processor = new ProcessorTask(taskList, 5000);

                processor.Execute();
            }

            _logger.Disconnect();
        }