Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'topfs2/gsoc_2011'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkay committed Jan 17, 2012
2 parents 95eeda3 + 4dfe70d commit 68f45f4
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 18 deletions.
1 change: 0 additions & 1 deletion src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp.csproj
Expand Up @@ -22,7 +22,6 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
Expand Down
Expand Up @@ -9,7 +9,6 @@
<OutputType>Library</OutputType>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<RootNamespace>Mono.Upnp.Dcp.MSMediaReceiverRegistrar1</RootNamespace>
<BaseDirectory>.</BaseDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -19,7 +18,6 @@
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<ConsolePause>false</ConsolePause>
<AssemblyName>Mono.Upnp.Dcp.MSMediaReceiverRegistrar1</AssemblyName>
</PropertyGroup>
Expand Down
Expand Up @@ -19,7 +19,6 @@
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Commandlineparameters>-f "mac2: upnp" -n "Windows Media Connect" "/Users/lunchtimemama/Music/Rdio Downloads"</Commandlineparameters>
<Externalconsole>true</Externalconsole>
<EnvironmentVariables>
Expand Down
Expand Up @@ -22,7 +22,6 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
Expand Down
Expand Up @@ -156,7 +156,7 @@ protected static int VisitResults<T> (Action<T> consumer, IList<T> objects, int
throw new ArgumentNullException ("objects");
}

var endIndex = System.Math.Min (startIndex + requestCount, objects.Count);
var endIndex = requestCount > 0 ? System.Math.Min (startIndex + requestCount, objects.Count) : objects.Count;
for (var i = startIndex; i < endIndex; i++) {
consumer (objects[i]);
}
Expand Down
Expand Up @@ -168,7 +168,7 @@ void HandleObjectsSelectionChanged (object sender, EventArgs e)
}
}

struct ItemRow
class ItemRow
{
public ItemRow (Item item, TreePath path)
{
Expand Down
Expand Up @@ -98,7 +98,7 @@ public ResourceOptions GetOptions ()
[XmlAttribute ("bitrate", OmitIfNull = true)]
public virtual uint? BitRate { get; protected set; }

[XmlAttribute ("samplyFrequency", OmitIfNull = true)]
[XmlAttribute ("sampleFrequency", OmitIfNull = true)]
public virtual uint? SampleFrequency { get; protected set; }

[XmlAttribute ("bitsPerSample", OmitIfNull = true)]
Expand All @@ -107,7 +107,7 @@ public ResourceOptions GetOptions ()
[XmlAttribute ("nrAudioChannels", OmitIfNull = true)]
public virtual uint? NrAudioChannels { get; protected set; }

[XmlAttribute ("resolution", OmitIfNull = true)]
//[XmlAttribute ("resolution", OmitIfNull = true)]
public virtual Resolution? Resolution { get; protected set; }

[XmlAttribute ("colorDepth", OmitIfNull = true)]
Expand Down
Expand Up @@ -22,7 +22,6 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
Expand Down
Expand Up @@ -19,7 +19,6 @@
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<EnvironmentVariables>
<EnvironmentVariables>
<Variable name="MONO_UPNP_DEBUG" value="TRUE" />
Expand Down
Expand Up @@ -93,22 +93,35 @@ protected override Deserializer CreateDeserializer ()
return context => context.Reader.ReadElementContentAsString ();
} else if (Type == typeof (int)) {
return context => context.Reader.ReadElementContentAsInt ();
} else if (Type == typeof (uint)) {
return context => uint.Parse (context.Reader.ReadElementContentAsString ());
} else if (Type == typeof (double)) {
return context => context.Reader.ReadElementContentAsDouble ();
} else if (Type == typeof (bool)) {
return context => context.Reader.ReadElementContentAsBoolean ();
} else if (Type == typeof (long)) {
return context => context.Reader.ReadElementContentAsLong ();
} else if (Type == typeof (ulong)) {
return context => ulong.Parse (context.Reader.ReadElementContentAsString ());
} else if (Type == typeof (float)) {
return context => context.Reader.ReadElementContentAsFloat ();
} else if (Type == typeof (decimal)) {
return context => context.Reader.ReadElementContentAsDecimal ();
} else if (Type == typeof (DateTime)) {
return context => context.Reader.ReadElementContentAsDateTime ();
} else if (Type == typeof (TimeSpan)) {
return context => TimeSpan.Parse (context.Reader.ReadElementContentAsString ());
} else if (Type == typeof (Uri)) {
return context => {
var url = context.Reader.ReadElementContentAsString ();
return url.Length == 0 ? null : new Uri (url);
if (url.Length != 0) {
try {
Uri uri = new Uri (url);
return uri;
} catch (Exception e) {
}
}
return null;
};
} else if (Type.IsEnum) {
var map = GetEnumMap (Type);
Expand Down Expand Up @@ -397,20 +410,36 @@ static Deserializer CreateAttributeDeserializer (Type type)
return context => context.Reader.ReadContentAsString ();
} else if (type == typeof (int)) {
return context => context.Reader.ReadContentAsInt ();
} else if (type == typeof (uint)) {
return context => uint.Parse (context.Reader.ReadContentAsString ());
} else if (type == typeof (double)) {
return context => context.Reader.ReadContentAsDouble ();
} else if (type == typeof (bool)) {
return context => context.Reader.ReadContentAsBoolean ();
} else if (type == typeof (long)) {
return context => context.Reader.ReadContentAsLong ();
} else if (type == typeof (ulong)) {
return context => ulong.Parse (context.Reader.ReadContentAsString ());
} else if (type == typeof (float)) {
return context => context.Reader.ReadContentAsFloat ();
} else if (type == typeof (decimal)) {
return context => context.Reader.ReadContentAsDecimal ();
} else if (type == typeof (DateTime)) {
return context => context.Reader.ReadContentAsDateTime ();
} else if (type == typeof (TimeSpan)) {
return context => TimeSpan.Parse (context.Reader.ReadContentAsString ());
} else if (type == typeof (Uri)) {
return context => new Uri (context.Reader.ReadContentAsString ());
return context => {
var url = context.Reader.ReadContentAsString ();
if (url.Length != 0) {
try {
Uri uri = new Uri (url);
return uri;
} catch (Exception e) {
}
}
return null;
};
} else if (type.IsEnum) {
var map = GetEnumMap (type);
return context => map[context.Reader.ReadContentAsString ()];
Expand Down
1 change: 0 additions & 1 deletion src/Mono.Upnp/Mono.Upnp/Mono.Upnp.csproj
Expand Up @@ -22,7 +22,6 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
Expand Down
1 change: 0 additions & 1 deletion tests/Mono.Ssdp.Tests/Mono.Ssdp.Tests.csproj
Expand Up @@ -19,7 +19,6 @@
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
Expand Down
Expand Up @@ -19,7 +19,6 @@
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
Expand Down
Expand Up @@ -21,7 +21,6 @@
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
Expand Down
1 change: 0 additions & 1 deletion tests/Mono.Upnp.Tests/Mono.Upnp.Tests.csproj
Expand Up @@ -20,7 +20,6 @@
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
Expand Down

0 comments on commit 68f45f4

Please sign in to comment.