Exemple #1
0
        static void Main(string[] args)
        {
            var srcDirectory = new DirectoryInfo(args[0]);
            //var dstDirectory = srcDirectory.Parent.CreateSubdirectory(srcDirectory.Name + "-converted");
            var dstDirectory = new DirectoryInfo("C:\\users\\user\\AIML-output");

            dstDirectory.Create();
            var input  = dstDirectory.CreateSubdirectory("Input");
            var output = dstDirectory.CreateSubdirectory("Output");

            var global = new GlobalData();

            global.AfterLoad(dstDirectory);
            EditorModelIO.Save(global);

            var copying = "";


            foreach (var e in srcDirectory.GetDirectories())
            {
                var model = new EditorModel(e, srcDirectory, srcDirectory);
                ObsoleteModelIO.LoadAndConvert(model);
                var modelDst = input.CreateSubdirectory(e.Name);
                model.HackLocations(srcDirectory, modelDst);
                model.Save();
                //copying += string.Format(@"copy ""{0}\{2}"" ""{1}\{2}"""+"\n", e.FullName, modelDst.FullName, "face.mp4");
                //copying += string.Format(@"copy ""{0}\{2}"" ""{1}\{2}"""+"\n", e.FullName, modelDst.FullName, "desktop.avi");
                var files = e.GetFiles();
                copying += string.Format(@"xcopy ""{0}\AIML*.avi"" ""{1}\""" + "\n", e.FullName, output.FullName);
            }

            File.WriteAllText(dstDirectory + "\\copy.bat", copying);
        }
Exemple #2
0
        public static void DoEditorJob(string[] args)
        {
            if (args.Length == 0)
            {
                MessageBox.Show("Pass the argument to the program: the directory with movies");
                return;
            }


            var model = EditorModelIO.Load(EditorModelIO.SubstituteDebugDirectories(args[0]));

            if (model.Montage.SoundIntervals == null || model.Montage.SoundIntervals.Count == 0)
            {
                try
                {
                    new Tuto.TutoServices.PraatService().DoWork(model);
                }
                catch (Exception e)
                {
                    MessageBox.Show("Praat failed. Separation by sound will not be available\n\n" + e.Message,
                                    "Tuto.Editor",
                                    MessageBoxButton.OK,
                                    MessageBoxImage.Exclamation);
                }
            }

            var window = new MainWindow();

            window.DataContext = model;
            new Application().Run(window);
        }
Exemple #3
0
        public static void Main()
        {
            var dirInfo = new DirectoryInfo(@"..\..\..\..\AIML\Publishing");
            var data    = EditorModelIO.ReadGlobalData(dirInfo);
            var model   = new PublishViewModel(data.TopicsRoot, data.VideoData);
            var wnd     = new PublishPanel();

            wnd.DataContext = model;
            new Application().Run(wnd);
        }
Exemple #4
0
        static void Main(string[] args)
        {
            var path = EditorModelIO.SubstituteDebugDirectories("debug\\10");

            Directory.CreateDirectory(path);
            File.Delete(path + "\\local.tuto");
            var model = EditorModelIO.Load(path);

            model.Save();
        }
Exemple #5
0
        static void Main(string[] args)
        {
            var directory = new DirectoryInfo(args[0]);
            var slides    = directory.CreateSubdirectory("LaTeXCompiledSlides");

            slides.Delete(true);
            slides.Create();

            var latexDirectory = directory.CreateSubdirectory("LaTeX");
            var files          = latexDirectory.GetFiles("L*.tex");
            var galleries      = new List <GalleryInfo>();
            var processor      = new LatexProcessor();

            foreach (var file in files)
            {
                var doc  = processor.Parse(file);
                var docs = doc.Sections.Select(z => new LatexDocument {
                    Preamble = doc.Preamble, Sections = new List <LatexSection> {
                        z
                    }
                }).ToList();
                int number = 0;
                foreach (var e in docs)
                {
                    var pdf             = processor.Compile(e, latexDirectory);
                    var targetDirectory = slides.CreateSubdirectory(file.Name + "." + number);
                    processor.ConvertToPng(pdf, targetDirectory);
                    galleries.Add(new GalleryInfo {
                        Name = e.LastSection.Name, Directory = targetDirectory
                    });
                    number++;
                }
            }

            var matcher =
                Matchers.ByName <VideoItem, GalleryInfo>(galleries, z => z.Name, (a, b) => a.Directory.FullName == b.Directory.FullName);

            var model = EditorModelIO.ReadGlobalData(directory);
            var root  = ItemTreeBuilder.Build <FolderItem, LectureItem, VideoItem>(model);

            matcher.Push(root);
            DataBinding <VideoItem> .SaveLayer <GalleryInfo>(root, directory);
        }
Exemple #6
0
        public static void Main(string[] args)
        {
            var currentDirectoryName = EditorModelIO.SubstituteDebugDirectories(args[0]);

            currentDirectory = new DirectoryInfo(currentDirectoryName);

            var oldFormatFile = new FileInfo(Path.Combine(currentDirectory.FullName, "project.tuto"));
            var newFormatFile = new FileInfo(Path.Combine(currentDirectory.FullName, GlobalData.VideoListName));

            if (oldFormatFile.Exists && !newFormatFile.Exists)
            {
                var globalData = EditorModelIO.ReadGlobalData(currentDirectory);
                var structure  = Convert(globalData);
                structure.Save();
            }


            Application = new System.Windows.Application();
            var model  = new MainViewModel(currentDirectory, () => SourcesFactory());
            var window = new MainWindow();

            window.DataContext = model;
            Application.Run(window);
        }