* Update demo

This commit is contained in:
Murat Suri 2011-06-25 23:34:10 +00:00
parent 7f7eadf6c9
commit 02db1bcc5b
2 changed files with 36 additions and 61 deletions

View File

@ -16,29 +16,24 @@ namespace CSharpTutorial1_2DSound
{
//Some fancy text
Console.WriteLine("cAudio 2.2.0 Tutorial 1: Basic 2D Audio. C# \n \n");
Console.WriteLine("\nAvailable Playback Devices: \n");
//Create an uninitialized Audio Manager
IAudioManager mAudioMgr = cAudioCSharpWrapper.createAudioManager(false);
//Grab a list of avalible devices
//Grab a list of available devices
IAudioDeviceList pDeviceList = cAudioCSharpWrapper.createAudioDeviceList();
//Get the number of avalible devices.
uint deviceCount = pDeviceList.getDeviceCount();
//Get the defualt device name.
string defaultDeviceName = pDeviceList.getDefaultDeviceName().ToString();
//Get the default device name.
string defaultDeviceName = pDeviceList.getDefaultDeviceName();
for(uint i=0; i< deviceCount; ++i)
for(uint i=0; i< pDeviceList.getDeviceCount(); i++)
{
string deviceName = pDeviceList.getDeviceName(i).ToString();
string deviceName = pDeviceList.getDeviceName(i);
if(deviceName.Equals(defaultDeviceName))
Console.WriteLine(" "+ i + "): " + deviceName.ToString() + " [DEFAULT] \n");
Console.WriteLine(" "+ i + "): " + deviceName + " [DEFAULT]");
else
Console.WriteLine(" "+ i + "): " + deviceName.ToString() + " \n");
Console.WriteLine(" "+ i + "): " + deviceName);
}
Console.WriteLine("\n");
@ -46,37 +41,25 @@ namespace CSharpTutorial1_2DSound
string deviceSelection = Console.ReadLine();
uint deviceSelect = Convert.ToUInt32(deviceSelection);
Console.WriteLine("\n");
mAudioMgr.initialize(pDeviceList.getDeviceName(deviceSelect).ToString());
if (mAudioMgr != null)
//Create an uninitialized Audio Manager
IAudioManager audioMgr = cAudioCSharpWrapper.createAudioManager(false);
audioMgr.initialize(pDeviceList.getDeviceName(deviceSelect));
IAudioSource currentSource = audioMgr.create("bing", "../../../Media/cAudioTheme1.ogg");
if (currentSource != null)
{
currentSource.setVolume(0.5f);
currentSource.play2d(false);
IAudioSource mCurrentSource;
mCurrentSource = mAudioMgr.create("bing", "../../../../Media/cAudioTheme1.ogg");
if (mCurrentSource != null)
{
mCurrentSource.setVolume(0.5f);
mCurrentSource.play2d(false);
while (mCurrentSource.isPlaying())
while (currentSource.isPlaying())
{
cAudioCSharpWrapper.cAudioSleep(10);
}
}
audioMgr.Dispose();
mAudioMgr.shutDown();
cAudioCSharpWrapper.destroyAudioManager(mAudioMgr);
}
else
{
Console.WriteLine("Failed to create audio playback manager. \n");
}
Console.WriteLine("Press any key to quit \n");
Console.WriteLine(@"Press any key to quit ");
Console.ReadLine();
}
}

View File

@ -8,8 +8,8 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace cAudioPlayer.Properties
{
namespace cAudioPlayer.Properties {
using System;
/// <summary>
@ -22,28 +22,23 @@ namespace cAudioPlayer.Properties
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("cAudioPlayer.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
@ -56,14 +51,11 @@ namespace cAudioPlayer.Properties
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set
{
set {
resourceCulture = value;
}
}