banshee r3202 - in trunk/banshee: . src/Dap/Banshee.Dap.MassStorage src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage src/Dap/Banshee.DapCore/Banshee.DapCore src/Extensions
- From: alanmc svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r3202 - in trunk/banshee: . src/Dap/Banshee.Dap.MassStorage src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage src/Dap/Banshee.DapCore/Banshee.DapCore src/Extensions
- Date: Sun, 10 Feb 2008 18:04:44 +0000 (GMT)
Author: alanmc
Date: Sun Feb 10 18:04:44 2008
New Revision: 3202
URL: http://svn.gnome.org/viewvc/banshee?rev=3202&view=rev
Log:
Updated the new DAP extension stuff
Modified:
trunk/banshee/ChangeLog
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.DapCore/Banshee.DapCore/AbstractDevice.cs
trunk/banshee/src/Dap/Banshee.DapCore/Banshee.DapCore/IDevice.cs
trunk/banshee/src/Extensions/Extensions.mds
Modified: trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.mdp
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.mdp (original)
+++ trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.mdp Sun Feb 10 18:04:44 2008
@@ -9,12 +9,14 @@
</Configurations>
<Contents>
<File name="Banshee.Dap.MassStorage.addin.xml" subtype="Code" buildaction="EmbedAsResource" />
+ <File name="Banshee.Dap.MassStorage/Device.cs" subtype="Code" buildaction="Compile" />
</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" />
+ <ProjectReference type="Project" localcopy="True" refto="Banshee.DapCore" />
</References>
<MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" RelativeMakefileName="./Makefile.am">
<BuildFilesVar Sync="True" Name="SOURCES" />
@@ -25,4 +27,4 @@
<AsmRefVar />
<ProjectRefVar />
</MonoDevelop.Autotools.MakefileInfo>
-</Project>
+</Project>
\ No newline at end of file
Modified: trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/Device.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/Device.cs (original)
+++ trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/Device.cs Sun Feb 10 18:04:44 2008
@@ -29,7 +29,42 @@
using Banshee.Dap;
namespace Banshee.Dap.MassStorage {
- class Device /*: IDevice*/ {
+ public class Device : AbstractDevice {
+
+ public override void DownloadTrack (TrackInfo track, string destination)
+ {
+ // Transfer the specified track from the device to the specified file path
+ throw new System.NotImplementedException ();
+ }
+ public override bool Initialize (Device device)
+ {
+ // Initialize the MassStorage from the hal device
+ throw new System.NotImplementedException ();
+ }
+
+ public override void LoadTracks ()
+ {
+ // Load all tracks from the device library
+ throw new System.NotImplementedException ();
+ }
+
+ public override void RemoveTrack (TrackInfo track)
+ {
+ // Remove the specified track from the device
+ throw new System.NotImplementedException ();
+ }
+
+ public override void UpdateMetadata (TrackInfo track)
+ {
+ // Update the metadata for the specified track
+ throw new System.NotImplementedException ();
+ }
+
+ public override void UploadTrack (TrackInfo track)
+ {
+ // Transfer the specified track onto the device
+ throw new System.NotImplementedException ();
+ }
}
}
Modified: trunk/banshee/src/Dap/Banshee.DapCore/Banshee.DapCore/AbstractDevice.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.DapCore/Banshee.DapCore/AbstractDevice.cs (original)
+++ trunk/banshee/src/Dap/Banshee.DapCore/Banshee.DapCore/AbstractDevice.cs Sun Feb 10 18:04:44 2008
@@ -26,10 +26,114 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System;
+using Hal;
+using Banshee.Collection;
+
namespace Banshee.Dap
{
- public abstract class AbstractDevice/*: IDevice*/
- {
-
- }
+ public abstract class AbstractDevice : IDevice
+ {
+ public event EventHandler Ejected;
+ public event EventHandler Initialized;
+ public event EventHandler MetadataUpdated;
+ public event EventHandler TrackDownloaded;
+ public event EventHandler TracksLoaded;
+ public event EventHandler TrackRemoved;
+ public event EventHandler TrackUploaded;
+
+
+ private string name = "DAP";
+ private string owner = "Owner";
+
+
+ public virtual bool CanSetName {
+ get { return false; }
+ }
+
+ public virtual bool CanSetOwner {
+ get { return false; }
+ }
+
+ public virtual string Name {
+ get { return name; }
+ set {
+ if (!CanSetName)
+ throw new InvalidOperationException ();
+ name = value;
+ }
+ }
+
+ public virtual string Owner {
+ get { return owner; }
+ set {
+ if (!CanSetOwner)
+ throw new InvalidOperationException ();
+ }
+ }
+
+ public virtual ulong Capacity {
+ get { return 0; }
+ }
+
+ public virtual ulong FreeSpace {
+ get { return 0; }
+ }
+
+ public virtual bool IsReadOnly {
+ get { return false; }
+ }
+
+ public virtual bool IsPlaybackSupported {
+ get { return false; }
+ }
+
+ public virtual void Dispose ()
+ {
+ }
+ public abstract void DownloadTrack (TrackInfo track, string destination);
+ public virtual void Eject ()
+ {
+ RaiseEjected();
+ }
+ public abstract bool Initialize (Device device);
+ public abstract void LoadTracks ();
+ public abstract void RemoveTrack (TrackInfo track);
+ public abstract void UpdateMetadata (TrackInfo track);
+ public abstract void UploadTrack (TrackInfo track);
+
+ protected virtual void RaiseEjected()
+ {
+ RaiseEvent(Ejected, EventArgs.Empty);
+ }
+ protected virtual void RaiseInitialized()
+ {
+ RaiseEvent(Initialized, EventArgs.Empty);
+ }
+ protected virtual void RaiseMetadataUpdated()
+ {
+ RaiseEvent(MetadataUpdated, EventArgs.Empty);
+ }
+ protected virtual void RaiseTrackDownloaded()
+ {
+ RaiseEvent(TrackDownloaded, EventArgs.Empty);
+ }
+ protected virtual void RaiseTracksLoaded()
+ {
+ RaiseEvent(TracksLoaded, EventArgs.Empty);
+ }
+ protected virtual void RaiseTrackUploaded()
+ {
+ RaiseEvent(TrackUploaded, EventArgs.Empty);
+ }
+ protected virtual void RaiseTrackRemoved()
+ {
+ RaiseEvent(TrackRemoved, EventArgs.Empty);
+ }
+ private void RaiseEvent(EventHandler h, EventArgs e)
+ {
+ if (h != null)
+ h (this, e);
+ }
+ }
}
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 Sun Feb 10 18:04:44 2008
@@ -34,7 +34,6 @@
{
public interface IDevice: IDisposable
{
-
event EventHandler Ejected;
event EventHandler Initialized;
@@ -45,17 +44,17 @@
event EventHandler TrackUploaded;
- void DownloadTrack (TrackInfo track); // Should be TrackInfo, not 'object'
- void LoadTracks (); // Should be TrackInfo, not 'object'
- void RemoveTrack (TrackInfo track); // Should be TrackInfo, not 'object'
- void UpdateMetadata (TrackInfo track); // Should be TrackInfo, not 'object'
- void UploadTrack (TrackInfo track); // Should be TrackInfo, not 'object'
+ void DownloadTrack (TrackInfo track, string destination);
+ void LoadTracks ();
+ void RemoveTrack (TrackInfo track);
+ void UpdateMetadata (TrackInfo track);
+ void UploadTrack (TrackInfo track);
void Eject ();
bool Initialize (Device device);
- //bool CanSetName { get; }
- //bool CanSetOwner { get; }
+ bool CanSetName { get; }
+ bool CanSetOwner { get; }
string Name { get; set; }
string Owner { get; set; }
ulong Capacity { get; }
Modified: trunk/banshee/src/Extensions/Extensions.mds
==============================================================================
--- trunk/banshee/src/Extensions/Extensions.mds (original)
+++ trunk/banshee/src/Extensions/Extensions.mds Sun Feb 10 18:04:44 2008
@@ -5,16 +5,20 @@
<Entry build="True" name="Banshee.MultimediaKeys" configuration="Debug" />
<Entry build="True" name="Banshee.PlayQueue" configuration="Debug" />
<Entry build="True" name="Banshee.DapCore" configuration="Debug" />
+ <Entry build="True" name="Banshee.Dap.MassStorage" configuration="Debug" />
</Configuration>
</Configurations>
<StartMode startupentry="Banshee.NotificationArea" single="True">
<Execute type="None" entry="Banshee.NotificationArea" />
<Execute type="None" entry="Banshee.DapCore" />
+ <Execute type="None" entry="Banshee.DapCore" />
+ <Execute type="None" entry="Banshee.Dap.MassStorage" />
</StartMode>
<Entries>
<Entry filename="Banshee.NotificationArea/Banshee.NotificationArea.mdp" />
<Entry filename="Banshee.MultimediaKeys/Banshee.MultimediaKeys.mdp" />
<Entry filename="Banshee.PlayQueue/Banshee.PlayQueue.mdp" />
- <Entry filename="Banshee.DapCore/Banshee.DapCore.mdp" />
+ <Entry filename="../Dap/Banshee.DapCore/Banshee.DapCore.mdp" />
+ <Entry filename="../Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.mdp" />
</Entries>
</Combine>
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]