banshee r3195 - in trunk/banshee: . build src/Dap src/Dap/Banshee.Dap.MassStorage src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage src/Dap/Banshee.DapCore src/Dap/Banshee.DapCore/Banshee.DapCore
- From: rubenv svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r3195 - in trunk/banshee: . build src/Dap src/Dap/Banshee.Dap.MassStorage src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage src/Dap/Banshee.DapCore src/Dap/Banshee.DapCore/Banshee.DapCore
- Date: Sat, 9 Feb 2008 23:07:37 +0000 (GMT)
Author: rubenv
Date: Sat Feb 9 23:07:36 2008
New Revision: 3195
URL: http://svn.gnome.org/viewvc/banshee?rev=3195&view=rev
Log:
2008-02-10 Ruben Vermeersch <ruben savanne be>
* src/Dap/Banshee.Dap.MassStorage: Added.
* src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage: Added.
* src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.addin.xml: Added.
* src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.mdp: Added.
* src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/Device.cs: Added.
* src/Dap/Banshee.Dap.MassStorage/Makefile.am: Added.
Added a basic Banshee.Dap.MassStorage extension which will be the first
device class to be ported, used to test the stack.
* src/Dap/Banshee.DapCore/Banshee.DapCore/AbstractDevice.cs: Added.
* src/Dap/Banshee.DapCore/Banshee.DapCore/DapCore.cs: Store the extension
nodes, not the types themselves.
Added:
trunk/banshee/src/Dap/Banshee.Dap.MassStorage/
trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/
trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.addin.xml
trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.mdp
trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/Device.cs
trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Makefile.am
trunk/banshee/src/Dap/Banshee.DapCore/Banshee.DapCore/AbstractDevice.cs
Modified:
trunk/banshee/ChangeLog
trunk/banshee/build/build.environment.mk
trunk/banshee/configure.ac
trunk/banshee/src/Dap/Banshee.DapCore/Banshee.DapCore/DapCore.cs
trunk/banshee/src/Dap/Banshee.DapCore/Banshee.DapCore/IDevice.cs
trunk/banshee/src/Dap/Banshee.DapCore/Makefile.am
trunk/banshee/src/Dap/Makefile.am
Modified: trunk/banshee/build/build.environment.mk
==============================================================================
--- trunk/banshee/build/build.environment.mk (original)
+++ trunk/banshee/build/build.environment.mk Sat Feb 9 23:07:36 2008
@@ -92,6 +92,10 @@
REF_NEREID = $(LINK_BANSHEE_THICKCLIENT_DEPS)
+# Dap
+REF_DAP_DAPCORE = $(LINK_BANSHEE_SERVICES_DEPS)
+LINK_DAP_DAPCORE = -r:$(DIR_BIN)/Banshee.DapCore.dll
+LINK_DAP_DAPCORE_DEPS = $(REF_DAP_DAPCORE) $(LINK_DAP_DAPCORE)
# Backends
REF_BACKEND_GNOME = $(LINK_BANSHEE_CORE_DEPS) $(LINK_GCONF)
@@ -101,7 +105,6 @@
# Extensions
REF_EXTENSION_AUDIOSCROBBLER = $(LINK_BANSHEE_SERVICES_DEPS)
-REF_EXTENSION_DAPCORE = $(LINK_BANSHEE_SERVICES_DEPS)
REF_EXTENSION_MULTIMEDIAKEYS = $(LINK_BANSHEE_SERVICES_DEPS)
REF_EXTENSION_NOTIFICATIONAREA = $(LINK_BANSHEE_THICKCLIENT_DEPS)
REF_EXTENSION_PLAYQUEUE = $(LINK_BANSHEE_THICKCLIENT_DEPS)
Modified: trunk/banshee/configure.ac
==============================================================================
--- trunk/banshee/configure.ac (original)
+++ trunk/banshee/configure.ac Sat Feb 9 23:07:36 2008
@@ -132,6 +132,7 @@
src/Dap/Makefile
src/Dap/Banshee.DapCore/Makefile
+src/Dap/Banshee.Dap.MassStorage/Makefile
src/Backends/Makefile
src/Backends/Banshee.Gnome/Makefile
Added: trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.addin.xml
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.addin.xml Sat Feb 9 23:07:36 2008
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Addin
+ id="Banshee.Dap.MassStorage"
+ version="1.0"
+ compatVersion="1.0"
+ copyright="Â 2008 Novell Inc. Licensed under the MIT X11 license."
+ name=""
+ category=""
+ description=""
+ author=""
+ url="http://banshee-project.org/"
+ defaultEnabled="true">
+
+ <Dependencies>
+ <Addin id="Banshee.DapCore" version="1.0"/>
+ </Dependencies>
+
+ <Extension path="/Banshee/Dap/DeviceClass">
+ <DeviceClass id="Banshee.Dap.MassStorage.Device"/>
+ </Extension>
+
+</Addin>
Added: trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.mdp
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.mdp Sat Feb 9 23:07:36 2008
@@ -0,0 +1,28 @@
+<Project name="Banshee.Dap.MassStorage" fileversion="2.0" language="C#" clr-version="Net_2_0" ctype="DotNetProject">
+ <Configurations active="Debug">
+ <Configuration name="Debug" ctype="DotNetProjectConfiguration">
+ <Output directory="../../../bin" assemblyKeyFile="." assembly="Banshee.Dap.MassStorage" />
+ <Build debugmode="True" target="Library" />
+ <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ </Configuration>
+ </Configurations>
+ <Contents>
+ <File name="Banshee.Dap.MassStorage.addin.xml" subtype="Code" buildaction="EmbedAsResource" />
+ </Contents>
+ <References>
+ <ProjectReference type="Project" localcopy="True" refto="Banshee.Core" />
+ <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" />
+ </References>
+ <MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" RelativeMakefileName="./Makefile.am">
+ <BuildFilesVar Sync="True" Name="SOURCES" />
+ <DeployFilesVar />
+ <ResourcesVar Sync="True" Name="RESOURCES" />
+ <OthersVar />
+ <GacRefVar />
+ <AsmRefVar />
+ <ProjectRefVar />
+ </MonoDevelop.Autotools.MakefileInfo>
+</Project>
Added: trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/Device.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/Device.cs Sat Feb 9 23:07:36 2008
@@ -0,0 +1,35 @@
+//
+// Device.cs
+//
+// Author:
+// Ruben Vermeersch <ruben savanne be>
+//
+// Copyright (C) 2007-2008 Novell, Inc.
+//
+// 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.
+//
+// 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 Banshee.Dap;
+
+namespace Banshee.Dap.MassStorage {
+ class Device /*: IDevice*/ {
+
+ }
+}
Added: trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Makefile.am Sat Feb 9 23:07:36 2008
@@ -0,0 +1,11 @@
+ASSEMBLY = Banshee.Dap.MassStorage
+TARGET = library
+LINK = $(LINK_DAP_DAPCORE_DEPS)
+
+SOURCES = \
+ Banshee.Dap.MassStorage/Device.cs
+
+RESOURCES = Banshee.Dap.MassStorage.addin.xml
+
+include $(top_srcdir)/build/build.mk
+
Added: trunk/banshee/src/Dap/Banshee.DapCore/Banshee.DapCore/AbstractDevice.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Dap/Banshee.DapCore/Banshee.DapCore/AbstractDevice.cs Sat Feb 9 23:07:36 2008
@@ -0,0 +1,35 @@
+//
+// Device.cs
+//
+// Author:
+// Ruben Vermeersch <ruben savanne be>
+//
+// Copyright (C) 2007-2008 Novell, Inc.
+//
+// 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.
+//
+// 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.
+//
+
+namespace Banshee.Dap
+{
+ public abstract class AbstractDevice/*: IDevice*/
+ {
+
+ }
+}
Modified: trunk/banshee/src/Dap/Banshee.DapCore/Banshee.DapCore/DapCore.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.DapCore/Banshee.DapCore/DapCore.cs (original)
+++ trunk/banshee/src/Dap/Banshee.DapCore/Banshee.DapCore/DapCore.cs Sat Feb 9 23:07:36 2008
@@ -27,6 +27,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+
using Banshee.Base;
using Banshee.Hal;
using Banshee.ServiceStack;
@@ -43,8 +44,8 @@
public class DapCore : IExtensionService
{
private HalCore halCore;
- private List<Type> supported_dap_types = new List<Type>();
- private Dictionary<string, IDevice> device_table = new Dictionary<string, IDevice>();
+ private List<TypeExtensionNode> supported_dap_types = new List<TypeExtensionNode>();
+ private Dictionary<string, AbstractDevice> device_table = new Dictionary<string, AbstractDevice>();
private HalCore HalCore {
get { return halCore; }
@@ -66,15 +67,13 @@
private void OnExtensionChanged (object s, ExtensionNodeEventArgs args) {
TypeExtensionNode node = (TypeExtensionNode) args.ExtensionNode;
- Console.WriteLine(">>> Found Node ID: {0}", node.Id);
- Type device_type = Type.GetType (node.Id);
if (args.Change == ExtensionChange.Add) {
// Register device plugin
- supported_dap_types.Add (device_type);
+ supported_dap_types.Add (node);
} else {
// Unregister device plugin
- supported_dap_types.Remove (device_type);
+ supported_dap_types.Remove (node);
}
}
@@ -132,20 +131,33 @@
});
}
- private void AddDevice(Device device)
+ private void AddDevice (Device device)
{
lock (device_table) {
if (device_table.ContainsKey (device.Udi)) {
return;
}
+ AbstractDevice dap_device = FindDeviceType (device);
+ if (dap_device != null) {
+ device_table.Add (device.Udi, dap_device);
+ }
+ }
+ }
+
+ private AbstractDevice FindDeviceType (Device device)
+ {
+ foreach (TypeExtensionNode node in supported_dap_types) {
try {
- //DapDevice dap_device = new DapDevice (device);
- //device_table.Add (device.Udi, dap_device);
+ AbstractDevice dap_device = (AbstractDevice) node.CreateInstance ();
+ /* if (dap_device.Initialize (device)) {
+ return dap_device;
+ }*/
} catch (Exception e) {
Console.WriteLine (e);
}
}
+ return null;
}
private void OnHalDeviceRemoved(object o, DeviceRemovedArgs args)
Modified: trunk/banshee/src/Dap/Banshee.DapCore/Banshee.DapCore/IDevice.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.DapCore/Banshee.DapCore/IDevice.cs (original)
+++ trunk/banshee/src/Dap/Banshee.DapCore/Banshee.DapCore/IDevice.cs Sat Feb 9 23:07:36 2008
@@ -32,7 +32,8 @@
namespace Banshee.Dap
{
- public interface IDevice: IDisposable {
+ public interface IDevice: IDisposable
+ {
event EventHandler Ejected;
event EventHandler Initialized;
Modified: trunk/banshee/src/Dap/Banshee.DapCore/Makefile.am
==============================================================================
--- trunk/banshee/src/Dap/Banshee.DapCore/Makefile.am (original)
+++ trunk/banshee/src/Dap/Banshee.DapCore/Makefile.am Sat Feb 9 23:07:36 2008
@@ -1,10 +1,10 @@
ASSEMBLY = Banshee.DapCore
TARGET = library
-LINK = $(REF_EXTENSION_DAPCORE)
+LINK = $(REF_DAP_DAPCORE)
SOURCES = \
+ Banshee.DapCore/AbstractDevice.cs \
Banshee.DapCore/DapCore.cs \
- Banshee.DapCore/DeviceClassNode.cs \
Banshee.DapCore/HalCore.cs \
Banshee.DapCore/IDevice.cs \
hal-sharp/Device.cs \
Modified: trunk/banshee/src/Dap/Makefile.am
==============================================================================
--- trunk/banshee/src/Dap/Makefile.am (original)
+++ trunk/banshee/src/Dap/Makefile.am Sat Feb 9 23:07:36 2008
@@ -1,5 +1,6 @@
SUBDIRS = \
- Banshee.DapCore
+ Banshee.DapCore \
+ Banshee.Dap.MassStorage
run:
@pushd $(top_builddir); \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]