Skip to content

Commit

Permalink
Release 1.5
Browse files Browse the repository at this point in the history
+semver: feature
  • Loading branch information
sebastienwarin committed May 19, 2020
2 parents 9dbffb6 + 5d2ca7f commit 27e8167
Show file tree
Hide file tree
Showing 34 changed files with 898 additions and 173 deletions.
26 changes: 22 additions & 4 deletions DeveloperToolsForUPnPTechnologies/UPnP/UPnPDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -764,8 +764,6 @@ private void NewDeviceInterface(NetworkInfo sender, IPAddress ip)
{
try
{
//String tmp = ip.ToString();

MiniWebServer WebServer;
WebServer = new MiniWebServer(new IPEndPoint(ip, UseThisPort));
if ((this.OnSniff != null) || (this.OnSniffPacket != null)) WebServer.OnSession += new MiniWebServer.NewSessionHandler(SniffSessionSink);
Expand All @@ -774,6 +772,12 @@ private void NewDeviceInterface(NetworkInfo sender, IPAddress ip)
WebServer.OnHeader += new MiniWebServer.HTTPReceiveHandler(HandleHeaderRequest);
WebServerTable[ip.ToString()] = WebServer;
SendNotify(ip);

// Use the same port for all network interfaces
if (UseThisPort == 0)
{
UseThisPort = WebServer.LocalIPEndPoint.Port;
}
}
catch (SocketException ex)
{
Expand Down Expand Up @@ -1412,6 +1416,12 @@ private void HandleSearch(String ST, IPEndPoint src, IPEndPoint local)
ArrayList ResponseList = new ArrayList();
HTTPMessage msg;
string Location = null;

if (!WebServerTable.ContainsKey(local.Address.ToString()))
{
NewDeviceInterface(null, local.Address);
}

if (local.AddressFamily == AddressFamily.InterNetwork)
{
Location = "http://" + local.Address.ToString() + ":" + ((MiniWebServer)WebServerTable[local.Address.ToString()]).LocalIPEndPoint.Port.ToString() + "/";
Expand Down Expand Up @@ -2596,8 +2606,16 @@ void HandleIcon(HttpRequestor sender, bool success, object tag, string url, byte
InitialEventTable.Remove(sender);
if (success)
{
System.Drawing.Image i = System.Drawing.Image.FromStream(new MemoryStream(data));
if (i != null) _icon = i;
System.Drawing.Image icon = null;
try
{
icon = System.Drawing.Image.FromStream(new MemoryStream(data));
}
catch
{
System.Diagnostics.Debug.WriteLine("Unable to load icon for " + url);
}
if (icon != null) _icon = icon;
}
}

Expand Down
7 changes: 7 additions & 0 deletions Gitversion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mode: ContinuousDeployment
continuous-delivery-fallback-tag: ''
assembly-informational-format: "{NuGetVersionV2}+{ShortSha}"
assembly-file-versioning-scheme: MajorMinorPatchTag
branches:
develop:
tag: beta
21 changes: 7 additions & 14 deletions SWYH Installer.iss
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Stream What You Hear (SWYH)"
#define MyAppVersion "1.4"
#define MyAppPublisher "Sebastien.warin.fr"
#define MyAppURL "http://www.streamwhatyouhear.com"
#define MyAppExeName "SWYH.exe"

; Updated by the build server
#define ShortVersion "1.0"
#define FullVersion "1.0-dev"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{5FBEA9D3-668E-4B88-BF6C-E1BCF441ECFD}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppVersion={#ShortVersion}
AppVerName={#MyAppName} {#FullVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
Expand All @@ -23,7 +20,7 @@ DefaultDirName={pf}\Stream What You Hear
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
OutputDir=SWYH\bin\Release
OutputBaseFilename=SWYH_{#MyAppVersion}
OutputBaseFilename=SWYH_{#FullVersion}
SetupIconFile=SWYH\Resources\Icons\swyh128.ico
Compression=lzma
SolidCompression=yes
Expand All @@ -38,17 +35,13 @@ Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "greek"; MessagesFile: "compiler:Languages\Greek.isl"
Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "serbiancyrillic"; MessagesFile: "compiler:Languages\SerbianCyrillic.isl"
Name: "serbianlatin"; MessagesFile: "compiler:Languages\SerbianLatin.isl"
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"
Expand Down
4 changes: 2 additions & 2 deletions SWYH.licenseheader
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extensions: .cs
* Assembly: %Project%
* File: %FileName%
* Web site: http://www.streamwhatyouhear.com
* Copyright (C) 2012-%CurrentYear% - Sebastien Warin <http://sebastien.warin.fr>
* Copyright (C) 2012-%CurrentYear% - Sebastien Warin <http://sebastien.warin.fr> and others
*
* This file is part of Stream What Your Hear.
*
Expand All @@ -21,4 +21,4 @@ extensions: .cs
*
* You should have received a copy of the GNU General Public License
* along with Stream What Your Hear. If not, see <http://www.gnu.org/licenses/>.
*/
*/
36 changes: 22 additions & 14 deletions SWYH.sln
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30501.0
# Visual Studio 15
VisualStudioVersion = 15.0.28307.645
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SWYH", "SWYH\SWYH.csproj", "{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8695E10C-61B7-4E32-9326-6F896D493597}"
ProjectSection(SolutionItems) = preProject
CONTRIBUTING.md = CONTRIBUTING.md
Gitversion.yml = Gitversion.yml
LICENSE = LICENSE
README.md = README.md
SWYH Installer.iss = SWYH Installer.iss
Expand Down Expand Up @@ -35,18 +36,22 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Debug|Any CPU.ActiveCfg = Debug|x86
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Debug|Mixed Platforms.Build.0 = Debug|x86
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Debug|x64.ActiveCfg = Debug|x86
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Debug|x86.ActiveCfg = Debug|x86
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Debug|x86.Build.0 = Debug|x86
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Release|Any CPU.ActiveCfg = Release|x86
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Release|Mixed Platforms.ActiveCfg = Release|x86
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Release|Mixed Platforms.Build.0 = Release|x86
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Release|x64.ActiveCfg = Release|x86
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Release|x86.ActiveCfg = Release|x86
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Release|x86.Build.0 = Release|x86
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Debug|x64.ActiveCfg = Debug|Any CPU
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Debug|x64.Build.0 = Debug|Any CPU
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Debug|x86.ActiveCfg = Debug|Any CPU
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Debug|x86.Build.0 = Debug|Any CPU
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Release|Any CPU.Build.0 = Release|Any CPU
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Release|x64.ActiveCfg = Release|Any CPU
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Release|x64.Build.0 = Release|Any CPU
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Release|x86.ActiveCfg = Release|Any CPU
{9F7F5728-3DC1-4FA2-8D4B-F91AA3ABA754}.Release|x86.Build.0 = Release|Any CPU
{584ED187-8F2A-4B58-A266-85F3F212B092}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{584ED187-8F2A-4B58-A266-85F3F212B092}.Debug|Any CPU.Build.0 = Debug|Any CPU
{584ED187-8F2A-4B58-A266-85F3F212B092}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -107,4 +112,7 @@ Global
{E01B6019-ACC6-40A6-A511-48D285D51C40} = {D1A9AE0B-AAC3-402B-A9BE-42F881FCC9B8}
{8EA0E595-45EC-40C1-82CE-269F4FA9EBB3} = {D1A9AE0B-AAC3-402B-A9BE-42F881FCC9B8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2367C55F-27F9-4D0D-97E6-D66076184A94}
EndGlobalSection
EndGlobal
7 changes: 4 additions & 3 deletions SWYH/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Assembly: SWYH
* File: App.xaml.cs
* Web site: http://www.streamwhatyouhear.com
* Copyright (C) 2012-2015 - Sebastien Warin <http://sebastien.warin.fr>
* Copyright (C) 2012-2019 - Sebastien Warin <http://sebastien.warin.fr> and others
*
* This file is part of Stream What Your Hear.
*
Expand All @@ -24,6 +24,7 @@
namespace SWYH
{
using OpenSource.UPnP.AV.RENDERER.CP;
using Semver;
using SWYH.Audio;
using SWYH.UPnP;
using System;
Expand Down Expand Up @@ -164,8 +165,8 @@ private void CheckNewVersion()
string lastVersionStr = wc.DownloadString(Constants.UPDATE_VERSION_URL);
if (!string.IsNullOrEmpty(lastVersionStr))
{
Version lastVersion = new Version(lastVersionStr);
Version currentVersion = new Version(fileVersion.FileVersion);
SemVersion lastVersion = SemVersion.Parse(lastVersionStr);
SemVersion currentVersion = SemVersion.Parse(fileVersion.FileVersion);
App.NeedUpdate = (lastVersion > currentVersion);
if (App.NeedUpdate)
{
Expand Down
2 changes: 1 addition & 1 deletion SWYH/Audio/AudioSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Assembly: SWYH
* File: AudioSettings.cs
* Web site: http://www.streamwhatyouhear.com
* Copyright (C) 2012-2015 - Sebastien Warin <http://sebastien.warin.fr>
* Copyright (C) 2012-2019 - Sebastien Warin <http://sebastien.warin.fr> and others
*
* This file is part of Stream What Your Hear.
*
Expand Down
2 changes: 1 addition & 1 deletion SWYH/Audio/PipeStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Assembly: SWYH
* File: PipeStream.cs
* Web site: http://www.streamwhatyouhear.com
* Copyright (C) 2012-2015 - Sebastien Warin <http://sebastien.warin.fr>
* Copyright (C) 2012-2019 - Sebastien Warin <http://sebastien.warin.fr> and others
*
* This file is part of Stream What Your Hear.
*
Expand Down
33 changes: 30 additions & 3 deletions SWYH/Audio/WasapiProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Assembly: SWYH
* File: WasapiProvider.cs
* Web site: http://www.streamwhatyouhear.com
* Copyright (C) 2012-2015 - Sebastien Warin <http://sebastien.warin.fr>
* Copyright (C) 2012-2019 - Sebastien Warin <http://sebastien.warin.fr> and others
*
* This file is part of Stream What Your Hear.
*
Expand All @@ -25,6 +25,7 @@ namespace SWYH.Audio
{
using NAudio.Lame;
using NAudio.Wave;
using NAudio.CoreAudioApi;
using System;
using System.Threading;

Expand All @@ -36,7 +37,7 @@ internal class WasapiProvider
private bool hasMP3Clients = false;
private bool hasPCMClients = false;

private WasapiLoopbackCapture loopbackWaveIn = null;
private WasapiCapture loopbackWaveIn = null;
private PipeStream recordingStream = null;
private WaveStream rawConvertedStream = null;
private WaveStream pcmStream = null;
Expand All @@ -55,8 +56,34 @@ public WasapiProvider()
// Init Wave Processor thread
Thread waveProcessorThread = new Thread(new ThreadStart(this.waveProcessor)) { Priority = ThreadPriority.Highest };

// Init capture audio device
MMDevice captureDevice = null;
var enumerator = new MMDeviceEnumerator();
string captureDeviceID = SWYH.Properties.Settings.Default.AudioDevice;
if (captureDeviceID != "")
{
foreach (var wasapi in enumerator.EnumerateAudioEndPoints(DataFlow.All, DeviceState.Active))
{
if (wasapi.ID == captureDeviceID)
{
captureDevice = wasapi;
}
}
}
if (captureDevice == null)
{
captureDevice = enumerator.GetDefaultAudioEndpoint(DataFlow.Render, Role.Multimedia);
}

// Init Wasapi Capture
this.loopbackWaveIn = new WasapiLoopbackCapture();
if (captureDevice.DataFlow == DataFlow.Render)
{
this.loopbackWaveIn = new WasapiLoopbackCapture(captureDevice);
}
else
{
this.loopbackWaveIn = new WasapiCapture(captureDevice);
}
this.loopbackWaveIn.DataAvailable += new EventHandler<WaveInEventArgs>(this.loopbackWaveIn_DataAvailable);

// Init Raw Wav (16bit)
Expand Down
2 changes: 1 addition & 1 deletion SWYH/Audio/WaveProviderToWaveStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Assembly: SWYH
* File: WaveProviderToWaveStream.cs
* Web site: http://www.streamwhatyouhear.com
* Copyright (C) 2012-2015 - Sebastien Warin <http://sebastien.warin.fr>
* Copyright (C) 2012-2019 - Sebastien Warin <http://sebastien.warin.fr> and others
*
* This file is part of Stream What Your Hear.
*
Expand Down
2 changes: 1 addition & 1 deletion SWYH/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Assembly: SWYH
* File: Constants.cs
* Web site: http://www.streamwhatyouhear.com
* Copyright (C) 2012-2015 - Sebastien Warin <http://sebastien.warin.fr>
* Copyright (C) 2012-2019 - Sebastien Warin <http://sebastien.warin.fr> and others
*
* This file is part of Stream What Your Hear.
*
Expand Down
50 changes: 11 additions & 39 deletions SWYH/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Assembly: SWYH
* File: AssemblyInfo.cs
* Web site: http://www.streamwhatyouhear.com
* Copyright (C) 2012-2015 - Sebastien Warin <http://sebastien.warin.fr>
* Copyright (C) 2012-2019 - Sebastien Warin <http://sebastien.warin.fr> and others
*
* This file is part of Stream What Your Hear.
*
Expand All @@ -22,58 +22,30 @@
*/

using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: Guid("2ecd245f-4268-48ee-b0f1-0706ead1ba42")]
[assembly: AssemblyTitle("Stream What You Hear")]
[assembly: AssemblyDescription("Stream What You Hear (SWYH) is a Windows application to stream the sound from your PC to an UPnP / DLNA device")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sebastien.warin.fr")]
[assembly: AssemblyProduct("Stream What You Hear (SWYH)")]
[assembly: AssemblyCopyright("Copyright © 2012-2016 Sebastien.warin.fr")]
[assembly: AssemblyCopyright("Copyright © 2012-2019 Sebastien.warin.fr ans others")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.

//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]


[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]


// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyFileVersion("1.4.16069.0")] // MAJOR.minor.BuildDate.Release (Si Release impaire = BETA) || http://www.epochconverter.com/epoch/daynumbers.php
[assembly: GuidAttribute("2ecd245f-4268-48ee-b0f1-0706ead1ba42")]
// Version 10.0 for local development
// Automatically update by the build pipeline with GitVersion
[assembly: AssemblyVersion("10.0.0.0")]
[assembly: AssemblyFileVersion("10.0.0.0")]

0 comments on commit 27e8167

Please sign in to comment.