public EmpegMediaLibrary() { Uri baseUri = new Uri("http://10.0.0.99/"); var source = new HijackDatabaseSource(baseUri); var reader = new EmpegCarDatabaseReader(source); _database = reader.ReadDatabase(); }
public IEnumerable<SynchronizationItem> GetCurrentItems() { Trace.TraceInformation("Getting current items in {0}", _deviceUri); Uri baseUri = new Uri(_deviceUri); // TODO: Factory that recognises http, ftp and empeg address prefixes (schemes). IEmpegCarDatabaseSource source = new HijackDatabaseSource(baseUri); var reader = new EmpegCarDatabaseReader(source); var database = reader.ReadDatabase(); var playlists = reader.ReadPlaylists(database.Items); return database.Items.Select(x => new EmpegSynchronizationItem(playlists, x)); }
static void Main(string[] args) { // TODO: Invent EmpegCarDatabaseSource.Create() factory method. string uriString = string.Format("http://{0}/", args[0]); Uri baseUri = new Uri(uriString); IEmpegCarDatabaseSource source = new HijackDatabaseSource(baseUri); var reader = new EmpegCarDatabaseReader(source); var database = reader.ReadDatabase(); // TODO: For the purposes of this program (for now), we need a flat dump of everything on the player. foreach (var item in database.Items) { Console.WriteLine(item); } // TODO: Later, we'll need a heirarchical dump of everything on the player. Console.WriteLine(database); }