[banshee] [Dap.MassStorage] Add support for the Nokia N900



commit 3c9fa04d1715df8c0bd5e55009ef9948c864d73f
Author: Pavel Antonov <pavelantonov richmd ru>
Date:   Tue Feb 23 10:35:42 2010 -0800

    [Dap.MassStorage] Add support for the Nokia N900
    
    Signed-off-by: Gabriel Burt <gabriel burt gmail com>

 .../Banshee.Dap.MassStorage.addin.xml              |    3 +
 .../Banshee.Dap.MassStorage/MaemoDevice.cs         |  151 ++++++++++++++++++++
 src/Dap/Banshee.Dap.MassStorage/Makefile.am        |    1 +
 3 files changed, 155 insertions(+), 0 deletions(-)
---
diff --git a/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.addin.xml b/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.addin.xml
index 45c8dd0..977ca8c 100644
--- a/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.addin.xml
+++ b/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.addin.xml
@@ -25,6 +25,9 @@
   
   <!-- Any devices we wish to special case and support out of the box -->
   <Extension path="/Banshee/Dap/MassStorage/Device">
+    <MassStorageDevice class="Banshee.Dap.MassStorage.MaemoDevice"
+        vendor-name="Nokia" product-name="Nokia N900 Phone"
+        vendor-id="0x0421" product-id="0x01c7"/>
     <MassStorageDevice class="Banshee.Dap.MassStorage.AndroidDevice" 
         vendor-name="HTC" product-name="HTC Android Phone"
         vendor-id="0x0bb4" product-id="0x0c01,0x0c02"/>
diff --git a/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/MaemoDevice.cs b/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/MaemoDevice.cs
new file mode 100644
index 0000000..587efe3
--- /dev/null
+++ b/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/MaemoDevice.cs
@@ -0,0 +1,151 @@
+//
+// MaemoDevice.cs
+//
+// Author:
+//   Pavel Antonov <pavelantonov richmd ru>
+//
+// Copyright (C) 2009 Pavel Antonov
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//n900 vendor product id
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Mono.Unix;
+
+using Banshee.Base;
+using Banshee.Hardware;
+using Banshee.Library;
+using Banshee.Collection;
+using Banshee.Collection.Database;
+
+namespace Banshee.Dap.MassStorage
+{
+    public class MaemoDevice : CustomMassStorageDevice
+    {
+        private static string [] playback_mime_types = new string [] {
+            // Video
+            "video/mp4-generic",
+            "video/quicktime",
+            "video/mp4",
+            "video/mpeg4",
+            "video/3gp",
+            "video/3gpp2",
+            "application/sdp",
+
+            // Audio
+            "audio/3gpp",
+            "audio/3ga",
+            "audio/3gpp2",
+            "audio/amr",
+            "audio/x-amr",
+            "audio/mpa",
+            "audio/mp3",
+            "audio/x-mp3",
+            "audio/x-mpg",
+            "audio/mpeg",
+            "audio/mpeg3",
+            "audio/mpg3",
+            "audio/mpg",
+            "audio/mp4",
+            "audio/m4a",
+            "audio/aac",
+            "audio/x-aac",
+            "audio/mp4a-latm",
+            "audio/wav"
+        };
+
+        private static string [] playlist_formats = new string [] {
+            "audio/x-scpls",
+            "audio/mpegurl",
+            "audio/x-mpegurl"
+        };
+
+        private static string [] audio_folders = new string [] {
+            ".sounds/",
+            ".videos/",
+            "Music/"
+        };
+
+        private static string [] video_folders = new string [] {
+            ".videos/",
+            "Video/"
+        };
+
+        private static string [] icon_names = new string [] {
+            "phone-nokia-n900", DapSource.FallbackIcon
+        };
+
+
+        public override void SourceInitialize ()
+        {
+        }
+
+        public override bool LoadDeviceConfiguration ()
+        {
+            return true;
+        }
+
+        public override string Name {
+            get { return VendorProductInfo.ProductName; }
+        }
+
+        public override string [] AudioFolders {
+            get { return audio_folders; }
+        }
+
+        public override string [] VideoFolders {
+            get { return video_folders; }
+        }
+
+        public override string [] PlaybackMimeTypes {
+            get { return playback_mime_types; }
+        }
+
+        public override int FolderDepth {
+            get { return 2; }
+        }
+
+        public override string CoverArtFileName {
+            get { return "cover.jpg"; }
+        }
+
+        public override string CoverArtFileType {
+            get { return "jpeg"; }
+        }
+
+        public override int CoverArtSize {
+            get { return 200; }
+        }
+
+        public override string [] PlaylistFormats {
+            get { return playlist_formats; }
+        }
+
+        public override string [] GetIconNames ()
+        {
+            return icon_names;
+        }
+
+        public override bool DeleteTrackHook (DatabaseTrackInfo track)
+        {
+            return true;
+        }
+    }
+}
diff --git a/src/Dap/Banshee.Dap.MassStorage/Makefile.am b/src/Dap/Banshee.Dap.MassStorage/Makefile.am
index ebe8018..78eb8cd 100644
--- a/src/Dap/Banshee.Dap.MassStorage/Makefile.am
+++ b/src/Dap/Banshee.Dap.MassStorage/Makefile.am
@@ -9,6 +9,7 @@ SOURCES =  \
 	Banshee.Dap.MassStorage/CustomMassStorageDevice.cs \
 	Banshee.Dap.MassStorage/DeviceMapper.cs \
 	Banshee.Dap.MassStorage/KeyValueParser.cs \
+	Banshee.Dap.MassStorage/MaemoDevice.cs \
 	Banshee.Dap.MassStorage/MassStorageDevice.cs \
 	Banshee.Dap.MassStorage/MassStorageSource.cs \
 	Banshee.Dap.MassStorage/WebOSDevice.cs



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