private static void PrintFiles(FileSystem fs, string path, ref int count) { if(count == 16000) return; foreach(string s in fs.GetFolders(path)) PrintFiles(fs, FileSystem.CombinePath(path, s), ref count); if(count == 16000) return; long total = System.Environment.TickCount; File[] files = fs.GetFiles(path); foreach(File file in files) { if(count == 16000) return; count++; if(count % 500 == 0) { // Console.WriteLine("Took: {0:0.00}ms per track", (double)Gphoto2.Base.Camera.TIMETAKEN / count); Console.WriteLine("Took: {0:0.00}ms per total", ((double)TotalTime / count)); //Gphoto2.Base.Camera.TIMETAKEN = 0; //TotalTime = 0; //count = 0; } if(file.Filename.EndsWith(".wma") || file.Filename.EndsWith(".alb") || file.Filename.EndsWith("jpg") || file.Filename.EndsWith("mp3") || file.Filename.EndsWith(".pla")) continue; } if(count == 16000) return; TotalTime += System.Environment.TickCount - total; }
private static void TestUpload(Gphoto2.FileSystem fs) { MusicFile f = new MusicFile("/home/alan", "a.mp3"); f.Album = "AAAA"; f.Artist = "Band Of Horses"; f.Bitrate = 160; f.Duration = 60; f.Format = "MP3"; f.Genre = "Rock"; f.Year = 2000; Console.WriteLine("About to upload"); if (fs.CanUpload(f)) { string path = FileSystem.CombinePath("Music", "Test"); // if(!fs.Contains(path)) // fs.CreateDirectory("Music", "Test"); // // if(fs.Contains(path, "a.mp3")) // { // Console.WriteLine("Deleting existing"); // fs.DeleteFile(path, "a.mp3"); // } Console.WriteLine("Uploading"); try { MusicFile fa = (MusicFile)fs.Upload(f, path); Console.Write(fa.Album + fa.Artist + fa.Bitrate.ToString()); } catch { Console.WriteLine("Crashed uploading"); } Console.WriteLine("Uploaded"); } }
internal ImageFile(Camera camera, FileSystem fs, string metadata, string directory, string filename, bool local) : base(camera, fs, metadata, directory, filename, local) { }
internal GenericFile(Camera camera, FileSystem fs, string metadata, string path, string filename, bool local) : base(camera, fs, metadata, path, filename, local) { }