support sending upnp events

This commit is contained in:
Luke Pulverenti
2014-04-21 12:02:30 -04:00
parent 3b4be92038
commit 4331700747
22 changed files with 526 additions and 150 deletions

View File

@@ -0,0 +1,17 @@
using System.Collections.Generic;
namespace MediaBrowser.Controller.Dlna
{
public class EventSubscriptionResponse
{
public string Content { get; set; }
public string ContentType { get; set; }
public Dictionary<string, string> Headers { get; set; }
public EventSubscriptionResponse()
{
Headers = new Dictionary<string, string>();
}
}
}

View File

@@ -0,0 +1,21 @@
using System.Collections.Generic;
namespace MediaBrowser.Controller.Dlna
{
public interface IContentDirectory
{
/// <summary>
/// Gets the content directory XML.
/// </summary>
/// <param name="headers">The headers.</param>
/// <returns>System.String.</returns>
string GetContentDirectoryXml(IDictionary<string, string> headers);
/// <summary>
/// Processes the control request.
/// </summary>
/// <param name="request">The request.</param>
/// <returns>ControlResponse.</returns>
ControlResponse ProcessControlRequest(ControlRequest request);
}
}

View File

@@ -64,20 +64,6 @@ namespace MediaBrowser.Controller.Dlna
/// <returns>System.String.</returns>
string GetServerDescriptionXml(IDictionary<string, string> headers, string serverUuId);
/// <summary>
/// Gets the content directory XML.
/// </summary>
/// <param name="headers">The headers.</param>
/// <returns>System.String.</returns>
string GetContentDirectoryXml(IDictionary<string, string> headers);
/// <summary>
/// Processes the control request.
/// </summary>
/// <param name="request">The request.</param>
/// <returns>ControlResponse.</returns>
ControlResponse ProcessControlRequest(ControlRequest request);
/// <summary>
/// Gets the icon.
/// </summary>

View File

@@ -0,0 +1,47 @@
using MediaBrowser.Model.Dlna;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Dlna
{
public interface IEventManager
{
/// <summary>
/// Cancels the event subscription.
/// </summary>
/// <param name="subscriptionId">The subscription identifier.</param>
EventSubscriptionResponse CancelEventSubscription(string subscriptionId);
/// <summary>
/// Renews the event subscription.
/// </summary>
/// <param name="subscriptionId">The subscription identifier.</param>
/// <param name="timeoutSeconds">The timeout seconds.</param>
/// <returns>EventSubscriptionResponse.</returns>
EventSubscriptionResponse RenewEventSubscription(string subscriptionId, int? timeoutSeconds);
/// <summary>
/// Creates the event subscription.
/// </summary>
/// <param name="notificationType">Type of the notification.</param>
/// <param name="timeoutSeconds">The timeout seconds.</param>
/// <param name="callbackUrl">The callback URL.</param>
/// <returns>EventSubscriptionResponse.</returns>
EventSubscriptionResponse CreateEventSubscription(string notificationType, int? timeoutSeconds, string callbackUrl);
/// <summary>
/// Gets the subscription.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>EventSubscription.</returns>
EventSubscription GetSubscription(string id);
/// <summary>
/// Triggers the event.
/// </summary>
/// <param name="notificationType">Type of the notification.</param>
/// <param name="stateVariables">The state variables.</param>
/// <returns>Task.</returns>
Task TriggerEvent(string notificationType, IDictionary<string,string> stateVariables);
}
}

View File

@@ -80,7 +80,10 @@
<Compile Include="Collections\ICollectionManager.cs" />
<Compile Include="Dlna\ControlRequest.cs" />
<Compile Include="Dlna\DlnaIconResponse.cs" />
<Compile Include="Dlna\EventSubscriptionResponse.cs" />
<Compile Include="Dlna\IContentDirectory.cs" />
<Compile Include="Dlna\IDlnaManager.cs" />
<Compile Include="Dlna\IEventManager.cs" />
<Compile Include="Drawing\IImageProcessor.cs" />
<Compile Include="Drawing\ImageFormat.cs" />
<Compile Include="Drawing\ImageProcessingOptions.cs" />