banshee r3825 - in trunk/banshee: . src/Dap/Banshee.Dap.Ipod src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod src/Dap/Banshee.Dap.Ipod/ThemeIcons src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16 src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22 src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices src/Dap/Banshee.Dap/Banshee.Dap



Author: abock
Date: Thu Apr 24 23:07:51 2008
New Revision: 3825
URL: http://svn.gnome.org/viewvc/banshee?rev=3825&view=rev

Log:
2008-04-24  Aaron Bockover  <abock gnome org>

    * src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs: Some more
    cleanup, organizing, and implemeneted icon name support

    * src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs: Whitespace



Added:
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-U2-color.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-U2-monochrome.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-mini-blue.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-mini-gold.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-mini-green.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-mini-pink.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-mini-silver.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-nano-black.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-nano-white.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-shuffle.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-standard-color.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-standard-monochrome.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-video-black.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-video-white.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-U2-color.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-U2-monochrome.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-mini-blue.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-mini-gold.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-mini-green.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-mini-pink.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-mini-silver.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-nano-black.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-nano-white.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-shuffle.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-standard-color.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-standard-monochrome.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-video-black.png   (contents, props changed)
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-video-white.png   (contents, props changed)
Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod.mdp
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs
   trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs

Modified: trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod.mdp
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod.mdp	(original)
+++ trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod.mdp	Thu Apr 24 23:07:51 2008
@@ -18,6 +18,7 @@
     <ProjectReference type="Project" localcopy="True" refto="Banshee.Services" />
     <ProjectReference type="Project" localcopy="True" refto="Hyena" />
     <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+    <ProjectReference type="Assembly" localcopy="True" refto="../../../bin/ipod-sharp.dll" />
   </References>
   <MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" RelativeMakefileName="./Makefile.am">
     <BuildFilesVar Sync="True" Name="SOURCES" />

Modified: trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs	(original)
+++ trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs	Thu Apr 24 23:07:51 2008
@@ -53,7 +53,7 @@
             get { return database_supported; }
         }
         
-#region Device Initialization
+#region Device Setup/Dispose
         
         public IpodSource (IDevice device) : base (device)
         {
@@ -68,7 +68,21 @@
             
             Initialize ();
         }
+                
+        public override void Dispose ()
+        {
+            base.Dispose ();
+        }
+
+        protected override void Eject ()
+        {
+            Dispose ();
+        }
         
+#endregion
+
+#region Database Loading
+
         private bool LoadIpod ()
         {
             try {
@@ -112,6 +126,84 @@
         }
         
 #endregion
+
+#region Source Cosmetics
+
+        protected override string [] GetIconNames ()
+        {
+            string [] names = new string[4];
+            string prefix = "multimedia-player-";
+            string shell_color = ipod_device.ModelInfo.ShellColor;
+            
+            names[0] = ipod_device.ModelInfo.IconName;
+            names[2] = "ipod-standard-color";
+            names[3] = "multimedia-player";
+            
+            switch (ipod_device.ModelInfo.DeviceClass) {
+                case "grayscale": 
+                    names[1] = "ipod-standard-monochrome";
+                    break;
+                case "color": 
+                    names[1] = "ipod-standard-color"; 
+                    break;
+                case "mini": 
+                    names[1] = String.Format ("ipod-mini-{0}", shell_color);
+                    names[2] = "ipod-mini-silver";
+                    break;
+                case "shuffle": 
+                    names[1] = String.Format ("ipod-shuffle-{0}", shell_color);
+                    names[2] = "ipod-shuffle";
+                    break;
+                case "nano":
+                case "nano3":
+                    names[1] = String.Format ("ipod-nano-{0}", shell_color);
+                    names[2] = "ipod-nano-white";
+                    break;
+                case "video":
+                    names[1] = String.Format ("ipod-video-{0}", shell_color);
+                    names[2] = "ipod-video-white";
+                    break;
+                case "classic":
+                case "touch":
+                case "phone":
+                default:
+                    break;
+            }
+            
+            names[1] = names[1] ?? names[2];
+            names[1] = prefix + names[1];
+            names[2] = prefix + names[2];
+            
+            foreach (string name in names) {
+                Console.WriteLine (name);
+            }
+            
+            return names;
+        }
+        
+        public override void Rename (string name)
+        {
+            if (!CanRename) {
+                return;
+            }
+        
+            try {
+                if (name_path != null) {
+                    Directory.CreateDirectory (Path.GetDirectoryName (name_path));
+                
+                    using (StreamWriter writer = new StreamWriter (File.Open (name_path, FileMode.Create), 
+                        System.Text.Encoding.Unicode)) {
+                        writer.Write (name);
+                    }
+                }
+            } catch (Exception e) {
+                Log.Exception (e);
+            }
+            
+            this.name = null;
+            ipod_device.Name = name;
+            base.Rename (name);
+        }
         
         private string name;
         public override string Name {
@@ -144,44 +236,10 @@
             }
         }
         
-        public override void Import ()
-        {
-            Log.Information ("Import to Library is not implemented for iPods yet", true);
-        }
-
         public override bool CanRename {
             get { return !(IsAdding || IsDeleting || IsReadOnly); }
         }
-
-        protected override void OnTracksDeleted ()
-        {
-            base.OnTracksDeleted ();
-        }
-
-        public override void Rename (string name)
-        {
-            if (!CanRename) {
-                return;
-            }
         
-            try {
-                if (name_path != null) {
-                    Directory.CreateDirectory (Path.GetDirectoryName (name_path));
-                
-                    using (StreamWriter writer = new StreamWriter (File.Open (name_path, FileMode.Create), 
-                        System.Text.Encoding.Unicode)) {
-                        writer.Write (name);
-                    }
-                }
-            } catch (Exception e) {
-                Log.Exception (e);
-            }
-            
-            this.name = null;
-            ipod_device.Name = name;
-            base.Rename (name);
-        }
-
         public override long BytesUsed {
             get { return (long)ipod_device.VolumeInfo.SpaceUsed; }
         }
@@ -189,10 +247,28 @@
         public override long BytesCapacity {
             get { return (long)ipod_device.VolumeInfo.Size; }
         }
+        
+#endregion
 
+#region Syncing
+        
         public override bool IsReadOnly {
             get { return ipod_device.IsReadOnly; }
         }
+        
+        public override void Import ()
+        {
+            Log.Information ("Import to Library is not implemented for iPods yet", true);
+        }
+
+        protected override void DeleteTrack (DatabaseTrackInfo track)
+        {
+        }
+        
+        protected override void OnTracksDeleted ()
+        {
+            base.OnTracksDeleted ();
+        }
 
         protected override void AddTrackToDevice (DatabaseTrackInfo track, SafeUri fromUri)
         {
@@ -207,18 +283,7 @@
             return 0;
         }*/
 
-        protected override void DeleteTrack (DatabaseTrackInfo track)
-        {
-        }
-
-        public override void Dispose ()
-        {
-            base.Dispose ();
-        }
-
-        protected override void Eject ()
-        {
-            Dispose ();
-        }
+#endregion
+        
     }
 }

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-U2-color.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-U2-monochrome.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-mini-blue.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-mini-gold.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-mini-green.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-mini-pink.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-mini-silver.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-nano-black.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-nano-white.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-shuffle.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-standard-color.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-standard-monochrome.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-video-black.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/16x16/devices/multimedia-player-ipod-video-white.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-U2-color.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-U2-monochrome.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-mini-blue.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-mini-gold.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-mini-green.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-mini-pink.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-mini-silver.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-nano-black.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-nano-white.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-shuffle.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-standard-color.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-standard-monochrome.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-video-black.png
==============================================================================
Binary file. No diff available.

Added: trunk/banshee/src/Dap/Banshee.Dap.Ipod/ThemeIcons/22x22/devices/multimedia-player-ipod-video-white.png
==============================================================================
Binary file. No diff available.

Modified: trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs	(original)
+++ trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs	Thu Apr 24 23:07:51 2008
@@ -3,6 +3,7 @@
 //
 // Author:
 //   Gabriel Burt <gburt novell com>
+//   Aaron Bockover <abockover novell com>
 //
 // Copyright (C) 2008 Novell, Inc.
 //
@@ -46,7 +47,6 @@
     public abstract class DapSource : RemovableSource
     {
         private IDevice device;
-        
         internal IDevice Device {
             get { return device; }
         }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]