public override void DeviceInitialize (IDevice device)
        {
            base.DeviceInitialize (device);

            ipod_device = device as PodSleuthDevice;
            if (ipod_device == null) {
                throw new InvalidDeviceException ();
            }

            name_path = Path.Combine (Path.GetDirectoryName (ipod_device.TrackDatabasePath), "BansheeIPodName");
            music_path = Path.Combine (ipod_device.ControlPath, "Music");
            Name = GetDeviceName ();

            SupportsPlaylists = ipod_device.ModelInfo.DeviceClass != "shuffle";

            // TODO disable this later, but right now it won't disable it in Sync, so might as well
            // leave it enabled
            SupportsPodcasts = ipod_device.ModelInfo.HasCapability ("podcast");
            SupportsVideo = ipod_device.ModelInfo.DeviceClass == "video" ||
                            ipod_device.ModelInfo.DeviceClass == "classic" ||
                            (ipod_device.ModelInfo.DeviceClass == "nano" && ipod_device.ModelInfo.Generation >= 3);

            Initialize ();

            AddDapProperty (Catalog.GetString ("Device"), ipod_device.ModelInfo.DeviceClass);
            AddDapProperty (Catalog.GetString ("Color"), ipod_device.ModelInfo.ShellColor);
            AddDapProperty (Catalog.GetString ("Generation"), ipod_device.ModelInfo.Generation.ToString ());
            AddDapProperty (Catalog.GetString ("Capacity"), ipod_device.ModelInfo.AdvertisedCapacity);
            AddDapProperty (Catalog.GetString ("Serial number"), ipod_device.Serial);
            AddDapProperty (Catalog.GetString ("Produced on"), ipod_device.ProductionInfo.DisplayDate);
            AddDapProperty (Catalog.GetString ("Firmware"), ipod_device.FirmwareVersion);

            string [] capabilities = new string [ipod_device.ModelInfo.Capabilities.Count];
            ipod_device.ModelInfo.Capabilities.CopyTo (capabilities, 0);
            AddDapProperty (Catalog.GetString ("Capabilities"), String.Join (", ", capabilities));
            AddYesNoDapProperty (Catalog.GetString ("Supports cover art"), ipod_device.ModelInfo.AlbumArtSupported);
            AddYesNoDapProperty (Catalog.GetString ("Supports photos"), ipod_device.ModelInfo.PhotosSupported);
        }
Esempio n. 2
0
        public override void DeviceInitialize(IDevice device)
        {
            base.DeviceInitialize(device);

            ipod_device = device as PodSleuthDevice;
            if (ipod_device == null)
            {
                throw new InvalidDeviceException();
            }

            name_path = Path.Combine(Path.GetDirectoryName(ipod_device.TrackDatabasePath), "BansheeIPodName");
            Name      = GetDeviceName();

            SupportsPlaylists = ipod_device.ModelInfo.DeviceClass != "shuffle";

            // TODO disable this later, but right now it won't disable it in Sync, so might as well
            // leave it enabled
            SupportsPodcasts = ipod_device.ModelInfo.HasCapability("podcast");
            SupportsVideo    = ipod_device.ModelInfo.DeviceClass == "video" ||
                               ipod_device.ModelInfo.DeviceClass == "classic" ||
                               (ipod_device.ModelInfo.DeviceClass == "nano" && ipod_device.ModelInfo.Generation >= 3);

            Initialize();

            AddDapProperty(Catalog.GetString("Device"), ipod_device.ModelInfo.DeviceClass);
            AddDapProperty(Catalog.GetString("Color"), ipod_device.ModelInfo.ShellColor);
            AddDapProperty(Catalog.GetString("Generation"), ipod_device.ModelInfo.Generation.ToString());
            AddDapProperty(Catalog.GetString("Capacity"), ipod_device.ModelInfo.AdvertisedCapacity);
            AddDapProperty(Catalog.GetString("Serial number"), ipod_device.Serial);
            AddDapProperty(Catalog.GetString("Produced on"), ipod_device.ProductionInfo.DisplayDate);
            AddDapProperty(Catalog.GetString("Firmware"), ipod_device.FirmwareVersion);

            string [] capabilities = new string [ipod_device.ModelInfo.Capabilities.Count];
            ipod_device.ModelInfo.Capabilities.CopyTo(capabilities, 0);
            AddDapProperty(Catalog.GetString("Capabilities"), String.Join(", ", capabilities));
            AddYesNoDapProperty(Catalog.GetString("Supports cover art"), ipod_device.ModelInfo.AlbumArtSupported);
            AddYesNoDapProperty(Catalog.GetString("Supports photos"), ipod_device.ModelInfo.PhotosSupported);
        }