From e3567177c343218477b67ca84f192a97bad3be77 Mon Sep 17 00:00:00 2001 From: Paul Fryer Date: Thu, 9 Apr 2015 10:48:42 -0700 Subject: [PATCH] moved some files around. --- .gitattributes | 63 ++++++ .gitignore | 189 ++++++++++++++++++ .../SimpleSonos.sln => SimpleSonos.sln | 4 +- SimpleSonos/Program.cs | 137 ------------- SimpleSonos/SimpleSonos.csproj | 1 - 5 files changed, 254 insertions(+), 140 deletions(-) create mode 100644 .gitattributes create mode 100644 .gitignore rename SimpleSonos/SimpleSonos.sln => SimpleSonos.sln (87%) delete mode 100644 SimpleSonos/Program.cs diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7964536 --- /dev/null +++ b/.gitignore @@ -0,0 +1,189 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +x64/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Roslyn cache directories +*.ide/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +#NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding addin-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +## TODO: Comment the next line if you want to checkin your +## web deploy settings but do note that will include unencrypted +## passwords +#*.pubxml + +# NuGet Packages Directory +packages/* +## TODO: If the tool you use requires repositories.config +## uncomment the next line +#!packages/repositories.config + +# Enable "build/" folder in the NuGet Packages folder since +# NuGet packages use it for MSBuild targets. +# This line needs to be after the ignore of the build folder +# (and the packages folder if the line above has been uncommented) +!packages/build/ + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# LightSwitch generated files +GeneratedArtifacts/ +_Pvt_Extensions/ +ModelManifest.xml \ No newline at end of file diff --git a/SimpleSonos/SimpleSonos.sln b/SimpleSonos.sln similarity index 87% rename from SimpleSonos/SimpleSonos.sln rename to SimpleSonos.sln index b85127a..4aa3774 100644 --- a/SimpleSonos/SimpleSonos.sln +++ b/SimpleSonos.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 VisualStudioVersion = 12.0.31101.0 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleSonos", "SimpleSonos.csproj", "{BF8524BA-DC49-4A99-A040-5E2CF37CC8FD}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleSonos", "SimpleSonos\SimpleSonos.csproj", "{BF8524BA-DC49-4A99-A040-5E2CF37CC8FD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleSonos.ConsoleTest", "..\SimpleSonos.ConsoleTest\SimpleSonos.ConsoleTest.csproj", "{C3680770-5F56-4E00-B8F9-444669A2AAAF}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleSonos.ConsoleTest", "SimpleSonos.ConsoleTest\SimpleSonos.ConsoleTest.csproj", "{C3680770-5F56-4E00-B8F9-444669A2AAAF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/SimpleSonos/Program.cs b/SimpleSonos/Program.cs deleted file mode 100644 index 38e3da6..0000000 --- a/SimpleSonos/Program.cs +++ /dev/null @@ -1,137 +0,0 @@ -using System; -using System.Threading; -using System.Threading.Tasks; - -namespace DiscoverTest -{ - internal class Program - { - private static void Main(string[] args) - { - - - - - - - - var sonosController = new SonosController(); - - sonosController.IndexingStarted += OnIndexingStarted; - //sonosController.DeviceFound += OnDeviceFound; - sonosController.IndexingEnded += OnIndexingEnded; - sonosController.RoomFound += sonosController_RoomFound; - - sonosController.IndexRooms(); - - DoWork(sonosController); - - var key = Console.ReadKey(); - } - - private static async Task DoWork(SonosController sonosController) - { - - foreach (var room in sonosController.Rooms) - { - if (room.Name == "Office") - { - await room.SetVolumeAsync(40); - //while (true) - //{ - await room.PauseAsync(); - Thread.Sleep(1000); - await room.PlayAsync(); - Thread.Sleep(1000); - //} - } - } - } - - - private static void sonosController_RoomFound(IRoom room) - { - room.DeviceAdded += room_DeviceAdded; - room.VolumeChanged += room_VolumeChanged; - room.Muted += room_Muted; - room.Unmuted += room_Unmuted; - - room.Stopped += room_Stopped; - room.Transitioning += room_Transitioning; - room.Playing += room_Playing; - - - Console.WriteLine("ROOM FOUND: " + room.Name); - } - - static void room_Playing(IRoom room) - { - Console.WriteLine("ROOM PLAYING: " + room.Name); - } - - static void room_Transitioning(IRoom room) - { - Console.WriteLine("ROOM TRANSITIONING: " + room.Name); - } - - static void room_Stopped(IRoom room) - { - Console.WriteLine("ROOM STOPPED: " + room.Name); - } - - private static void room_Unmuted(IRoom room) - { - Console.WriteLine("ROOM Unmuted: " + room.Name); - } - - private static void room_Muted(IRoom room) - { - Console.WriteLine("ROOM Muted: " + room.Name); - } - - private static void room_VolumeChanged(IRoom room, int level) - { - Console.WriteLine("VOLUME CHANGE ROOM: " + room.Name + ", LEVEL: " + level); - } - - private static void room_DeviceAdded(IRoom room, IDevice device) - { - device.TrackUpdate += device_TrackUpdate; - // device.VolumeChanged += OnDeviceVolumeChanged; - //device.Muted += OnDeviceMuted; - //device.Unmuted += OnDeviceUnmuted; - //Console.WriteLine("DEVICE FOUND. Room: " + room.Name + ", Type: " + device.GetType().Name); - } - - static void device_TrackUpdate(IDevice sonosDevice, MusicTrack args) - { - Console.WriteLine("Device: " + sonosDevice.IpAddress + ", Track Update: " + args.Title + ", Album: " + args.Album.Name + ", Artist: " + args.Creator); - } - - - - private static void OnIndexingStarted(object s, EventArgs a) - { - Console.WriteLine("Indexing Started"); - } - - private static void OnIndexingEnded(object s, EventArgs a) - { - Console.WriteLine("Finished Indexing"); - } - - private static void OnDeviceVolumeChanged(Device device, int args) - { - Console.WriteLine(device.IpAddress + " Volume Changed: " + args); - } - private static void OnDeviceUnmuted(Device device) - { - Console.WriteLine("Device Unmuted, " + device.IpAddress); - } - - private static void OnDeviceMuted(Device device) - { - Console.WriteLine("Device Muted, " + device.IpAddress); - } - } -} \ No newline at end of file diff --git a/SimpleSonos/SimpleSonos.csproj b/SimpleSonos/SimpleSonos.csproj index fa667cb..f02cb9b 100644 --- a/SimpleSonos/SimpleSonos.csproj +++ b/SimpleSonos/SimpleSonos.csproj @@ -52,7 +52,6 @@ -