private void button1_Click(object sender, EventArgs e) { FFmpeg.Initialize(@"C:\Program Files (x86)\ffmpeg\ffmpeg.exe","metaflac.exe"); /*FileData d = FileService.ReadFile("test.txt"); if (d.Type == FileDataType.IndexFile) { IndexFile ii = d.o._Cast<IndexFile>(); ii.Update(); }*/ FileSystemPlusLoadOption lo = new FileSystemPlusLoadOption(); lo.IgnoreException = true; lo.RestrictExtensionEnable = true; lo.RestrictExtension.AddToLower("flac"); lo.RestrictExtension.AddToLower("mp3"); FFmpeg.Initialize(@"C:\Program Files (x86)\ffmpeg\ffmpeg.exe", "metaflac.exe"); //IndexFile I = IndexFile i = new IndexFile(); i.OnEnd += I_OnEnd; i.BeginLoadFromPath(@"F:\MUSICA FLAC\ORATORIO\", lo); }
private void button2_Click(object sender, EventArgs e) { FFmpeg.Initialize(@"C:\Program Files (x86)\ffmpeg\ffmpeg.exe", "metaflac.exe"); FileSystemPlusLoadOption lo = new FileSystemPlusLoadOption(); lo.IgnoreException = true; lo.RestrictExtensionEnable = true; lo.RestrictExtension.AddToLower("flac"); lo.RestrictExtension.AddToLower("mp3"); IndexFile i = new IndexFile(); i.OnEnd += I_OnEnd2; i.BeginLoadFromPath(@"D:\Musica\DJ CAVA Mashups\", lo); /* Wrapper w = new Wrapper(new FFMpegMediaMetadataFlac()); String ser = Json.Serialize(w); Wrapper tret = Json.Deserialize<Wrapper>(ser);*/ //D:\Musica\DJ CAVA Mashups }
public FileSystemPlusLoadOption LoadMediaOption() { FileSystemPlusLoadOption lo = new FileSystemPlusLoadOption(); lo.IgnoreException = true; lo.RestrictExtensionEnable = true; if (Extensions != null) foreach (string s in Extensions) lo.RestrictExtension.AddToLower(s); return lo; }
private void _CreateIndexFile(String Path, FileSystemPlusLoadOption lo) { if (GUI) StartGui(); if (CanUseGui) IFForm.SetMessage("Lettura media..."); MyFileSystemPlus t = new MyFileSystemPlus(Path, lo); if (CanUseGui) IFForm.SetMessage("Inclusione Metadata..."); _IncorporaMetadata(t); if (CanUseGui) IFForm.SetMessage("Finalizzazione Index File"); RootFileSystem = t; RootFileSystem.Root.SetParentOnAllChild(FileSystemNodePlusLevelType.AllNode); Completed = true; if (CanUseGui) IFForm.SetMessage("Fine!"); }
public bool BeginLoadFromPath(String Path, FileSystemPlusLoadOption lo) { if (GetIndexFileStatus() == IndexFileAsyncStatus.nul) { WorkerThread = new Thread(() => { _CreateIndexFile(Path, lo); if (CanUseGui) WaitGUIClose(); OnEnd?.Invoke(this); }); WorkerThread.Start(); return true; } else { return false; } }
void Index_UpdateAndSave(String PathIndexFile,String PathMediaLibrary = null, FileSystemPlusLoadOption lo = null) { if (IndexMediaLibrary == null) { IndexMediaLibrary = new IndexFile(); } if (lo != null) { IndexMediaLibrary.LoadOption = lo; } if (PathMediaLibrary != null) IndexMediaLibrary.Update(PathMediaLibrary); FileService.WriteFile(PathIndexFile, IndexMediaLibrary, FileDataType.IndexFile); }
void LoadIndexFromFile(String PathIndexFile, bool Update = false, String PathMediaLibrary = null, FileSystemPlusLoadOption lo = null, bool GUI = true) { FileData FD = FileService.ReadFile(PathIndexFile); if (FD == null) { if (GUI) MessageBox.Show("File di Index: " + PathIndexFile + " Non trovato.\r\nVerrà creato un nuovo file Indice"); IndexMediaLibrary = new IndexFile(); IndexMediaLibrary.LoadOption = lo; FileService.WriteFile(PathIndexFile, IndexMediaLibrary, FileDataType.IndexFile); } else if (FD.o == null || !(FD.o is IndexFile)) { if (GUI) MessageBox.Show("File di Index: " + PathIndexFile + " non caricato correttamente.\r\nVerrà creato un nuovo file Indice"); IndexMediaLibrary = new IndexFile(); IndexMediaLibrary.LoadOption = lo; FileService.WriteFile(PathIndexFile, IndexMediaLibrary, FileDataType.IndexFile); } else { IndexMediaLibrary = FD.o._Cast<IndexFile>(); if(lo!=null) IndexMediaLibrary.LoadOption = lo; } if (Update) { Index_UpdateAndSave(PathIndexFile, PathMediaLibrary, null); } }