Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public CoreAudioDevice.Properties #70

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions AudioSwitcher.AudioApi.CoreAudio/CoreAudioDevice.Internal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,6 @@ public sealed partial class CoreAudioDevice
private ThreadLocal<IAudioMeterInformation> _audioMeterInformation;
private IntPtr _audioMeterInformationPtr;

private IPropertyDictionary Properties
{
get
{
ThrowIfDisposed();
return _properties;
}
}

/// <summary>
/// Audio Meter Information - Future support
/// </summary>
Expand Down
9 changes: 9 additions & 0 deletions AudioSwitcher.AudioApi.CoreAudio/CoreAudioDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ private IMultimediaDevice Device
}
}

public IPropertyDictionary Properties
{
get
{
ThrowIfDisposed();
return _properties;
}
}

/// <summary>
/// Unique identifier for this device
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,15 @@ public void SetValue(PropertyKey key, object value)
Marshal.ThrowExceptionForHR(_propertyStoreInteface.SetValue(ref key, ref value));
_propertyStoreInteface.Commit();
}

public IEnumerator<KeyValuePair<PropertyKey, object>> GetEnumerator()
{
return _properties.GetEnumerator();
}

System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using System;
using System.Collections.Generic;

namespace AudioSwitcher.AudioApi.CoreAudio
{
internal interface IPropertyDictionary : IDisposable
public interface IPropertyDictionary : IDisposable, IEnumerable<KeyValuePair<PropertyKey, object>>
{
AccessMode Mode { get; }

Expand All @@ -14,7 +15,7 @@ internal interface IPropertyDictionary : IDisposable
}

[Flags]
internal enum AccessMode
public enum AccessMode
{
Read,
Write,
Expand Down