Ver Fonte

Added two tests for sound

Kenneth Pouncey há 13 anos atrás
pai
commit
db3447e0c4
25 ficheiros alterados com 788 adições e 0 exclusões
  1. BIN
      Tests/MacOS/SoundTest/SoundTest/Content/DepositingIntoVat_Loop.wav
  2. BIN
      Tests/MacOS/SoundTest/SoundTest/Content/DepositingIntoVat_Loop.xnb
  3. BIN
      Tests/MacOS/SoundTest/SoundTest/Content/Explosion.xnb
  4. BIN
      Tests/MacOS/SoundTest/SoundTest/Content/ExplosionSound.xnb
  5. BIN
      Tests/MacOS/SoundTest/SoundTest/Content/FillingHoneyPot_Loop.wav
  6. BIN
      Tests/MacOS/SoundTest/SoundTest/Content/FillingHoneyPot_Loop.xnb
  7. BIN
      Tests/MacOS/SoundTest/SoundTest/Content/laser1.wav
  8. 113 0
      Tests/MacOS/SoundTest/SoundTest/Game1.cs
  9. 18 0
      Tests/MacOS/SoundTest/SoundTest/Info.plist
  10. 118 0
      Tests/MacOS/SoundTest/SoundTest/MainMenu.xib
  11. 59 0
      Tests/MacOS/SoundTest/SoundTest/Program.cs
  12. 73 0
      Tests/MacOS/SoundTest/SoundTest/SoundTest_MacOS.csproj
  13. BIN
      Tests/MacOS/SoundTest2/SoundTest2_MacOs/Content/DepositingIntoVat_Loop.wav
  14. BIN
      Tests/MacOS/SoundTest2/SoundTest2_MacOs/Content/DepositingIntoVat_Loop.xnb
  15. BIN
      Tests/MacOS/SoundTest2/SoundTest2_MacOs/Content/Explosion.xnb
  16. BIN
      Tests/MacOS/SoundTest2/SoundTest2_MacOs/Content/ExplosionSound.xnb
  17. BIN
      Tests/MacOS/SoundTest2/SoundTest2_MacOs/Content/FillingHoneyPot_Loop.wav
  18. BIN
      Tests/MacOS/SoundTest2/SoundTest2_MacOs/Content/FillingHoneyPot_Loop.xnb
  19. BIN
      Tests/MacOS/SoundTest2/SoundTest2_MacOs/Content/laser1.wav
  20. 127 0
      Tests/MacOS/SoundTest2/SoundTest2_MacOs/Game1.cs
  21. 18 0
      Tests/MacOS/SoundTest2/SoundTest2_MacOs/Info.plist
  22. 118 0
      Tests/MacOS/SoundTest2/SoundTest2_MacOs/MainMenu.xib
  23. 59 0
      Tests/MacOS/SoundTest2/SoundTest2_MacOs/Program.cs
  24. 69 0
      Tests/MacOS/SoundTest2/SoundTest2_MacOs/SoundTest2_MacOs.csproj
  25. 16 0
      Tests/MonoGame.Tests.MacOS.sln

BIN
Tests/MacOS/SoundTest/SoundTest/Content/DepositingIntoVat_Loop.wav


BIN
Tests/MacOS/SoundTest/SoundTest/Content/DepositingIntoVat_Loop.xnb


BIN
Tests/MacOS/SoundTest/SoundTest/Content/Explosion.xnb


BIN
Tests/MacOS/SoundTest/SoundTest/Content/ExplosionSound.xnb


BIN
Tests/MacOS/SoundTest/SoundTest/Content/FillingHoneyPot_Loop.wav


BIN
Tests/MacOS/SoundTest/SoundTest/Content/FillingHoneyPot_Loop.xnb


BIN
Tests/MacOS/SoundTest/SoundTest/Content/laser1.wav


+ 113 - 0
Tests/MacOS/SoundTest/SoundTest/Game1.cs

@@ -0,0 +1,113 @@
+using System;
+using System.Collections.Generic;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Audio;
+using Microsoft.Xna.Framework.Content;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Input;
+using Microsoft.Xna.Framework.Media;
+
+
+
+
+namespace SoundTest
+{
+	public class Game1 : Microsoft.Xna.Framework.Game
+	{
+		GraphicsDeviceManager graphics;
+		SpriteBatch spriteBatch;
+
+		Texture2D tExplosion;
+		SoundEffect sExplosion;
+		Random rnd = new Random();
+		
+		class explosion
+		{
+			public Vector2 Position;
+			public float Size;
+			
+			public explosion(Vector2 pos)
+			{
+				Position = pos;
+				Size = 1f;
+			}
+		}
+		
+		List<explosion> Explosions = new List<explosion>();
+		TimeSpan timer = TimeSpan.Zero;
+		int Interval = 1000; //Milliseconds. The duration of the sound is about 1.5 sec.
+
+		public Game1()
+		{
+			graphics = new GraphicsDeviceManager(this);
+			Content.RootDirectory = "Content";
+			graphics.PreferredBackBufferWidth =  1024;;
+			graphics.PreferredBackBufferHeight = 768;
+			graphics.IsFullScreen = false;
+		}
+
+		protected override void Initialize()
+		{
+
+			base.Initialize();
+
+		}
+
+		/// <summary>
+		/// LoadContent will be called once per game and is the place to load
+		/// all of your content.
+		/// </summary>
+		protected override void LoadContent()
+		{
+			spriteBatch = new SpriteBatch(GraphicsDevice);
+
+			sExplosion = Content.Load<SoundEffect>("ExplosionSound");
+			sExplosion = Content.Load<SoundEffect>("laser1");
+			//sExplosion = Content.Load<SoundEffect>("FillingHoneyPot_Loop");
+			tExplosion = Content.Load<Texture2D>("Explosion");
+		}
+
+
+		protected override void Update(GameTime gameTime)
+		{
+			base.Update(gameTime);
+			//update explosions
+			for (int i = 0; i<Explosions.Count;i++)
+			{
+				Explosions[i].Size -= 0.01f;
+				if (Explosions[i].Size < 0.1f)
+				{
+					Explosions.RemoveAt(i);
+					i--;
+				}
+			}
+			
+			//Check for next explosion
+			timer += gameTime.ElapsedGameTime;
+			if (timer.TotalMilliseconds > Interval)
+			{
+				timer = TimeSpan.Zero;
+				float x = rnd.Next(24,1000);
+				Explosions.Add(new explosion(new Vector2(x, rnd.Next(50,700))));
+				sExplosion.Play(1f, 1f, (x / 512f) -1);
+			}
+			//Check for exit
+			KeyboardState state = new KeyboardState();
+			state = Keyboard.GetState();
+			if (state.IsKeyDown(Keys.Escape) || state.IsKeyDown(Keys.Space) || state.IsKeyDown(Keys.Enter))
+				this.Exit();
+
+		}
+
+		protected override void Draw(GameTime gameTime)
+		{
+			GraphicsDevice.Clear(Color.Black);
+			base.Draw(gameTime);
+			spriteBatch.Begin();
+			//Draw explosions
+			foreach (explosion e in Explosions)
+				spriteBatch.Draw(tExplosion, e.Position, null, Color.White, 0, Vector2.Zero,e.Size, SpriteEffects.None, 1);
+			spriteBatch.End();
+		}
+	}
+}

+ 18 - 0
Tests/MacOS/SoundTest/SoundTest/Info.plist

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleIdentifier</key>
+	<string>com.yourcompany.SoundTest</string>
+	<key>CFBundleName</key>
+	<string>SoundTest</string>
+	<key>CFBundleVersion</key>
+	<string>1</string>
+	<key>LSMinimumSystemVersion</key>
+	<string>10.6</string>
+	<key>NSMainNibFile</key>
+	<string>MainMenu</string>
+	<key>NSPrincipalClass</key>
+	<string>NSApplication</string>
+</dict>
+</plist>

+ 118 - 0
Tests/MacOS/SoundTest/SoundTest/MainMenu.xib

@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
+	<data>
+		<int key="IBDocument.SystemTarget">1060</int>
+		<string key="IBDocument.SystemVersion">10D573</string>
+		<string key="IBDocument.InterfaceBuilderVersion">762</string>
+		<string key="IBDocument.AppKitVersion">1038.29</string>
+		<string key="IBDocument.HIToolboxVersion">460.00</string>
+		<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
+			<string key="NS.object.0">762</string>
+		</object>
+		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+		</object>
+		<object class="NSArray" key="IBDocument.PluginDependencies">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+		</object>
+		<object class="NSMutableDictionary" key="IBDocument.Metadata">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<object class="NSArray" key="dict.sortedKeys" id="0">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+			</object>
+			<object class="NSMutableArray" key="dict.values">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+			</object>
+		</object>
+		<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<object class="NSCustomObject" id="1001">
+				<string key="NSClassName">NSObject</string>
+			</object>
+			<object class="NSCustomObject" id="1003">
+				<string key="NSClassName">FirstResponder</string>
+			</object>
+			<object class="NSCustomObject" id="1004">
+				<string key="NSClassName">NSApplication</string>
+			</object>
+		</object>
+		<object class="IBObjectContainer" key="IBDocument.Objects">
+			<object class="NSMutableArray" key="connectionRecords">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+			</object>
+			<object class="IBMutableOrderedSet" key="objectRecords">
+				<object class="NSArray" key="orderedObjects">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<object class="IBObjectRecord">
+						<int key="objectID">0</int>
+						<reference key="object" ref="0" />
+						<reference key="children" ref="1000" />
+						<nil key="parent" />
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-2</int>
+						<reference key="object" ref="1001" />
+						<reference key="parent" ref="0" />
+						<string key="objectName">File's Owner</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-1</int>
+						<reference key="object" ref="1003" />
+						<reference key="parent" ref="0" />
+						<string key="objectName">First Responder</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-3</int>
+						<reference key="object" ref="1004" />
+						<reference key="parent" ref="0" />
+						<string key="objectName">Application</string>
+					</object>
+				</object>
+			</object>
+			<object class="NSMutableDictionary" key="flattenedProperties">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="NSArray" key="dict.sortedKeys">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<string>-1.IBPluginDependency</string>
+					<string>-2.IBPluginDependency</string>
+					<string>-3.IBPluginDependency</string>
+				</object>
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+				</object>
+			</object>
+			<object class="NSMutableDictionary" key="unlocalizedProperties">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<reference key="dict.sortedKeys" ref="0" />
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+				</object>
+			</object>
+			<nil key="activeLocalization" />
+			<object class="NSMutableDictionary" key="localizations">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<reference key="dict.sortedKeys" ref="0" />
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+				</object>
+			</object>
+			<nil key="sourceID" />
+			<int key="maxID">0</int>
+		</object>
+		<object class="IBClassDescriber" key="IBDocument.Classes" />
+		<int key="IBDocument.localizationMode">0</int>
+		<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
+		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
+			<integer value="3000" key="NS.object.0" />
+		</object>
+		<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+		<nil key="IBDocument.LastKnownRelativeProjectPath" />
+		<int key="IBDocument.defaultPropertyAccessControl">3</int>
+	</data>
+</archive>

+ 59 - 0
Tests/MacOS/SoundTest/SoundTest/Program.cs

@@ -0,0 +1,59 @@
+#if WINDOWS
+using System;
+
+namespace SoundTest
+{
+
+    static class Program
+    {
+        /// <summary>
+        /// The main entry point for the application.
+        /// </summary>
+        static void Main(string[] args)
+        {
+			using (Game1 game = new Game1())
+            {
+                game.Run();
+            }
+        }
+    }
+}
+#elif MACOS
+using MonoMac.AppKit;
+using MonoMac.Foundation;
+using MonoMac.CoreGraphics;
+using System.Runtime.InteropServices;
+ 
+namespace SoundTest
+{
+    class Program
+    {
+        static void Main (string [] args)
+        {
+            NSApplication.Init ();
+ 
+            using (var p = new NSAutoreleasePool ()) {
+                NSApplication.SharedApplication.Delegate = new AppDelegate();
+                NSApplication.Main(args);
+            }
+        }
+    }
+ 
+    class AppDelegate : NSApplicationDelegate
+    {
+		Game1 game;
+ 
+        public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
+        {
+            using (game  = new Game1()) {
+                game.Run ();
+            }
+        }
+ 
+        public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
+        {
+            return true;
+        }
+    }
+}
+#endif

+ 73 - 0
Tests/MacOS/SoundTest/SoundTest/SoundTest_MacOS.csproj

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProductVersion>10.0.0</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{FE2CB4FE-6466-4B3A-B2B8-38FFD2047DBE}</ProjectGuid>
+    <ProjectTypeGuids>{948B3504-5B70-4649-8FE4-BDE1FB46EC69};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>SoundTest</RootNamespace>
+    <AssemblyName>SoundTest</AssemblyName>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug</OutputPath>
+    <DefineConstants>DEBUG;MACOS</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <PlatformTarget>x86</PlatformTarget>
+    <ConsolePause>false</ConsolePause>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <DebugType>none</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Release</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <PlatformTarget>x86</PlatformTarget>
+    <ConsolePause>false</ConsolePause>
+    <DefineConstants>MACOS</DefineConstants>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="MonoMac" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Info.plist" />
+    <None Include="Content\DepositingIntoVat_Loop.wav" />
+    <None Include="Content\FillingHoneyPot_Loop.xnb" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" />
+  <ItemGroup>
+    <Folder Include="Content\" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Game1.cs" />
+    <Compile Include="Program.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="Content\Explosion.xnb" />
+    <Content Include="Content\ExplosionSound.xnb" />
+    <Content Include="Content\DepositingIntoVat_Loop.xnb" />
+    <Content Include="Content\laser1.wav" />
+    <Content Include="Content\FillingHoneyPot_Loop.wav" />
+  </ItemGroup>
+  <ItemGroup>
+    <InterfaceDefinition Include="MainMenu.xib" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\..\..\MonoGame\MonoGame.Framework\MonoGame.Framework.MacOS.csproj">
+      <Project>{36C538E6-C32A-4A8D-A39C-566173D7118E}</Project>
+      <Name>MonoGame.Framework.MacOS</Name>
+    </ProjectReference>
+  </ItemGroup>
+</Project>

BIN
Tests/MacOS/SoundTest2/SoundTest2_MacOs/Content/DepositingIntoVat_Loop.wav


BIN
Tests/MacOS/SoundTest2/SoundTest2_MacOs/Content/DepositingIntoVat_Loop.xnb


BIN
Tests/MacOS/SoundTest2/SoundTest2_MacOs/Content/Explosion.xnb


BIN
Tests/MacOS/SoundTest2/SoundTest2_MacOs/Content/ExplosionSound.xnb


BIN
Tests/MacOS/SoundTest2/SoundTest2_MacOs/Content/FillingHoneyPot_Loop.wav


BIN
Tests/MacOS/SoundTest2/SoundTest2_MacOs/Content/FillingHoneyPot_Loop.xnb


BIN
Tests/MacOS/SoundTest2/SoundTest2_MacOs/Content/laser1.wav


+ 127 - 0
Tests/MacOS/SoundTest2/SoundTest2_MacOs/Game1.cs

@@ -0,0 +1,127 @@
+using System;
+using System.Collections.Generic;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Audio;
+using Microsoft.Xna.Framework.Content;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Input;
+using Microsoft.Xna.Framework.Media;
+
+namespace SoundTest
+{
+	public class Game1 : Microsoft.Xna.Framework.Game
+	{
+		GraphicsDeviceManager graphics;
+		SpriteBatch spriteBatch;
+		Texture2D tExplosion;
+		SoundEffect sExplosion;
+		SoundEffectInstance eExplosion;
+		float move = 11f;
+		Random rnd = new Random ();
+		
+		class explosion
+		{
+			public Vector2 Position;
+			public float Size;
+			
+			public explosion (Vector2 pos)
+			{
+				Position = pos;
+				Size = 1f;
+			}
+		}
+		
+		List<explosion> Explosions = new List<explosion> ();
+		TimeSpan timer = TimeSpan.Zero;
+		int Interval = 1000; //Milliseconds. The duration of the sound is about 1.5 sec.
+
+		public Game1 ()
+		{
+			graphics = new GraphicsDeviceManager (this);
+			Content.RootDirectory = "Content";
+			graphics.PreferredBackBufferWidth = 1024;
+			;
+			graphics.PreferredBackBufferHeight = 768;
+			graphics.IsFullScreen = false;
+			Explosions.Add (new explosion (new Vector2 (1025, 384)));
+		}
+
+		protected override void Initialize ()
+		{
+
+			base.Initialize ();
+
+		}
+
+		/// <summary>
+		/// LoadContent will be called once per game and is the place to load
+		/// all of your content.
+		/// </summary>
+		protected override void LoadContent ()
+		{
+			spriteBatch = new SpriteBatch (GraphicsDevice);
+
+			sExplosion = Content.Load<SoundEffect> ("ExplosionSound");
+			tExplosion = Content.Load<Texture2D> ("Explosion");
+			eExplosion = sExplosion.CreateInstance ();
+		}
+
+		protected override void Update (GameTime gameTime)
+		{
+			base.Update (gameTime);
+			/*
+			//update explosions
+			for (int i = 0; i<Explosions.Count;i++)
+			{
+				Explosions[i].Size -= 0.01f;
+				if (Explosions[i].Size < 0.1f)
+				{
+					Explosions.RemoveAt(i);
+					i--;
+				}
+			}
+			
+			//Check for next explosion
+			timer += gameTime.ElapsedGameTime;
+			if (timer.TotalMilliseconds > Interval)
+			{
+				timer = TimeSpan.Zero;
+				float x = rnd.Next(24,1000);
+				Explosions.Add(new explosion(new Vector2(x, rnd.Next(50,700))));
+				sExplosion.Play(1f, 1f, (x / 512f) -1);
+			}
+			*/
+			
+			float pan = 0;
+			if (Explosions [0].Position.X > 1024 || Explosions [0].Position.X < 0) {
+				move = -move;
+				pan = MathHelper.Clamp ((Explosions [0].Position.X / 512f) - 1, -1, 1);
+				eExplosion.Pan = pan;
+
+				eExplosion.Play ();				
+			}
+			Explosions [0].Position.X += move;
+			pan = MathHelper.Clamp ((Explosions [0].Position.X / 512f) - 1, -1, 1);
+			eExplosion.Pan = pan;
+			Console.WriteLine (pan);
+
+			//Check for exit
+			KeyboardState state = new KeyboardState ();
+			state = Keyboard.GetState ();
+			if (state.IsKeyDown (Keys.Escape) || state.IsKeyDown (Keys.Space) || state.IsKeyDown (Keys.Enter))
+				this.Exit ();
+
+		}
+
+		protected override void Draw (GameTime gameTime)
+		{
+			GraphicsDevice.Clear (Color.Black);
+			base.Draw (gameTime);
+			spriteBatch.Begin ();
+			//Draw explosions
+			foreach (explosion e in Explosions)
+				spriteBatch.Draw (tExplosion, e.Position, null, Color.White, 0, Vector2.Zero, e.Size, SpriteEffects.None, 1);
+			spriteBatch.End ();
+		}
+	}
+}

+ 18 - 0
Tests/MacOS/SoundTest2/SoundTest2_MacOs/Info.plist

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleIdentifier</key>
+	<string>com.yourcompany.SoundTest</string>
+	<key>CFBundleName</key>
+	<string>SoundTest</string>
+	<key>CFBundleVersion</key>
+	<string>1</string>
+	<key>LSMinimumSystemVersion</key>
+	<string>10.6</string>
+	<key>NSMainNibFile</key>
+	<string>MainMenu</string>
+	<key>NSPrincipalClass</key>
+	<string>NSApplication</string>
+</dict>
+</plist>

+ 118 - 0
Tests/MacOS/SoundTest2/SoundTest2_MacOs/MainMenu.xib

@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
+	<data>
+		<int key="IBDocument.SystemTarget">1060</int>
+		<string key="IBDocument.SystemVersion">10D573</string>
+		<string key="IBDocument.InterfaceBuilderVersion">762</string>
+		<string key="IBDocument.AppKitVersion">1038.29</string>
+		<string key="IBDocument.HIToolboxVersion">460.00</string>
+		<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
+			<string key="NS.object.0">762</string>
+		</object>
+		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+		</object>
+		<object class="NSArray" key="IBDocument.PluginDependencies">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+		</object>
+		<object class="NSMutableDictionary" key="IBDocument.Metadata">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<object class="NSArray" key="dict.sortedKeys" id="0">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+			</object>
+			<object class="NSMutableArray" key="dict.values">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+			</object>
+		</object>
+		<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<object class="NSCustomObject" id="1001">
+				<string key="NSClassName">NSObject</string>
+			</object>
+			<object class="NSCustomObject" id="1003">
+				<string key="NSClassName">FirstResponder</string>
+			</object>
+			<object class="NSCustomObject" id="1004">
+				<string key="NSClassName">NSApplication</string>
+			</object>
+		</object>
+		<object class="IBObjectContainer" key="IBDocument.Objects">
+			<object class="NSMutableArray" key="connectionRecords">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+			</object>
+			<object class="IBMutableOrderedSet" key="objectRecords">
+				<object class="NSArray" key="orderedObjects">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<object class="IBObjectRecord">
+						<int key="objectID">0</int>
+						<reference key="object" ref="0" />
+						<reference key="children" ref="1000" />
+						<nil key="parent" />
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-2</int>
+						<reference key="object" ref="1001" />
+						<reference key="parent" ref="0" />
+						<string key="objectName">File's Owner</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-1</int>
+						<reference key="object" ref="1003" />
+						<reference key="parent" ref="0" />
+						<string key="objectName">First Responder</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-3</int>
+						<reference key="object" ref="1004" />
+						<reference key="parent" ref="0" />
+						<string key="objectName">Application</string>
+					</object>
+				</object>
+			</object>
+			<object class="NSMutableDictionary" key="flattenedProperties">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="NSArray" key="dict.sortedKeys">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<string>-1.IBPluginDependency</string>
+					<string>-2.IBPluginDependency</string>
+					<string>-3.IBPluginDependency</string>
+				</object>
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+				</object>
+			</object>
+			<object class="NSMutableDictionary" key="unlocalizedProperties">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<reference key="dict.sortedKeys" ref="0" />
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+				</object>
+			</object>
+			<nil key="activeLocalization" />
+			<object class="NSMutableDictionary" key="localizations">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<reference key="dict.sortedKeys" ref="0" />
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+				</object>
+			</object>
+			<nil key="sourceID" />
+			<int key="maxID">0</int>
+		</object>
+		<object class="IBClassDescriber" key="IBDocument.Classes" />
+		<int key="IBDocument.localizationMode">0</int>
+		<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
+		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
+			<integer value="3000" key="NS.object.0" />
+		</object>
+		<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+		<nil key="IBDocument.LastKnownRelativeProjectPath" />
+		<int key="IBDocument.defaultPropertyAccessControl">3</int>
+	</data>
+</archive>

+ 59 - 0
Tests/MacOS/SoundTest2/SoundTest2_MacOs/Program.cs

@@ -0,0 +1,59 @@
+#if WINDOWS
+using System;
+
+namespace SoundTest
+{
+
+    static class Program
+    {
+        /// <summary>
+        /// The main entry point for the application.
+        /// </summary>
+        static void Main(string[] args)
+        {
+			using (Game1 game = new Game1())
+            {
+                game.Run();
+            }
+        }
+    }
+}
+#elif MACOS
+using MonoMac.AppKit;
+using MonoMac.Foundation;
+using MonoMac.CoreGraphics;
+using System.Runtime.InteropServices;
+ 
+namespace SoundTest
+{
+    class Program
+    {
+        static void Main (string [] args)
+        {
+            NSApplication.Init ();
+ 
+            using (var p = new NSAutoreleasePool ()) {
+                NSApplication.SharedApplication.Delegate = new AppDelegate();
+                NSApplication.Main(args);
+            }
+        }
+    }
+ 
+    class AppDelegate : NSApplicationDelegate
+    {
+		Game1 game;
+ 
+        public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
+        {
+            using (game  = new Game1()) {
+                game.Run ();
+            }
+        }
+ 
+        public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
+        {
+            return true;
+        }
+    }
+}
+#endif

+ 69 - 0
Tests/MacOS/SoundTest2/SoundTest2_MacOs/SoundTest2_MacOs.csproj

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProductVersion>10.0.0</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{79A32C2C-0F38-4ADE-88D1-F8502C520570}</ProjectGuid>
+    <ProjectTypeGuids>{948B3504-5B70-4649-8FE4-BDE1FB46EC69};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>SoundTest2_MacOs</RootNamespace>
+    <AssemblyName>SoundTest2_MacOs</AssemblyName>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug</OutputPath>
+    <DefineConstants>DEBUG; MACOS</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <PlatformTarget>x86</PlatformTarget>
+    <ConsolePause>false</ConsolePause>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <DebugType>none</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Release</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <PlatformTarget>x86</PlatformTarget>
+    <ConsolePause>false</ConsolePause>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="MonoMac" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Info.plist" />
+    <None Include="Content\DepositingIntoVat_Loop.wav" />
+    <None Include="Content\FillingHoneyPot_Loop.xnb" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" />
+  <ItemGroup>
+    <Compile Include="Game1.cs" />
+    <Compile Include="Program.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <InterfaceDefinition Include="MainMenu.xib" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="Content\Explosion.xnb" />
+    <Content Include="Content\ExplosionSound.xnb" />
+    <Content Include="Content\DepositingIntoVat_Loop.xnb" />
+    <Content Include="Content\laser1.wav" />
+    <Content Include="Content\FillingHoneyPot_Loop.wav" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\..\..\MonoGame\MonoGame.Framework\MonoGame.Framework.MacOS.csproj">
+      <Project>{36C538E6-C32A-4A8D-A39C-566173D7118E}</Project>
+      <Name>MonoGame.Framework.MacOS</Name>
+    </ProjectReference>
+  </ItemGroup>
+</Project>

+ 16 - 0
Tests/MonoGame.Tests.MacOS.sln

@@ -29,6 +29,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TextureScaleColorTest", "Ma
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestDataSetAndGet", "MacOS\TestDataSetAndGet\TestDataSetAndGet.csproj", "{98CB640D-B8C4-496F-9978-F2571268BD70}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoundTest_MacOS", "MacOS\SoundTest\SoundTest\SoundTest_MacOS.csproj", "{FE2CB4FE-6466-4B3A-B2B8-38FFD2047DBE}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoundTest2_MacOs", "MacOS\SoundTest2\SoundTest2_MacOs\SoundTest2_MacOs.csproj", "{79A32C2C-0F38-4ADE-88D1-F8502C520570}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|x86 = Debug|x86
@@ -60,6 +64,12 @@ Global
 		{51147863-7B4E-4467-A5FA-986259EB686F}.Distribution|Any CPU.Build.0 = Debug|x86
 		{51147863-7B4E-4467-A5FA-986259EB686F}.Release|x86.ActiveCfg = Release|x86
 		{51147863-7B4E-4467-A5FA-986259EB686F}.Release|x86.Build.0 = Release|x86
+		{79A32C2C-0F38-4ADE-88D1-F8502C520570}.Debug|x86.ActiveCfg = Debug|x86
+		{79A32C2C-0F38-4ADE-88D1-F8502C520570}.Debug|x86.Build.0 = Debug|x86
+		{79A32C2C-0F38-4ADE-88D1-F8502C520570}.Distribution|Any CPU.ActiveCfg = Debug|x86
+		{79A32C2C-0F38-4ADE-88D1-F8502C520570}.Distribution|Any CPU.Build.0 = Debug|x86
+		{79A32C2C-0F38-4ADE-88D1-F8502C520570}.Release|x86.ActiveCfg = Release|x86
+		{79A32C2C-0F38-4ADE-88D1-F8502C520570}.Release|x86.Build.0 = Release|x86
 		{7B2F1E86-1B56-4F78-9265-EA8852442171}.Debug|x86.ActiveCfg = Debug|x86
 		{7B2F1E86-1B56-4F78-9265-EA8852442171}.Debug|x86.Build.0 = Debug|x86
 		{7B2F1E86-1B56-4F78-9265-EA8852442171}.Distribution|Any CPU.ActiveCfg = Debug|x86
@@ -120,6 +130,12 @@ Global
 		{ECD1D53E-F50A-4299-9B0F-2F64D6063513}.Distribution|Any CPU.Build.0 = Debug|Any CPU
 		{ECD1D53E-F50A-4299-9B0F-2F64D6063513}.Release|x86.ActiveCfg = Release|Any CPU
 		{ECD1D53E-F50A-4299-9B0F-2F64D6063513}.Release|x86.Build.0 = Release|Any CPU
+		{FE2CB4FE-6466-4B3A-B2B8-38FFD2047DBE}.Debug|x86.ActiveCfg = Debug|x86
+		{FE2CB4FE-6466-4B3A-B2B8-38FFD2047DBE}.Debug|x86.Build.0 = Debug|x86
+		{FE2CB4FE-6466-4B3A-B2B8-38FFD2047DBE}.Distribution|Any CPU.ActiveCfg = Debug|x86
+		{FE2CB4FE-6466-4B3A-B2B8-38FFD2047DBE}.Distribution|Any CPU.Build.0 = Debug|x86
+		{FE2CB4FE-6466-4B3A-B2B8-38FFD2047DBE}.Release|x86.ActiveCfg = Release|x86
+		{FE2CB4FE-6466-4B3A-B2B8-38FFD2047DBE}.Release|x86.Build.0 = Release|x86
 	EndGlobalSection
 	GlobalSection(MonoDevelopProperties) = preSolution
 		StartupItem = MacOS\TextureScaleColorTest\TextureScaleColorTest.csproj