2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using static Tizen.Multimedia.Remoting.InteropHelper;
19 using Native = Interop.ScreenMirroring;
21 namespace Tizen.Multimedia.Remoting
24 /// Provides a means to retrieve the audio information which is negotiated with the source device.
26 /// <seealso cref="ScreenMirroring"/>
27 public class ScreenMirroringAudioInfo
29 private readonly ScreenMirroring _owner;
31 internal ScreenMirroringAudioInfo(ScreenMirroring owner)
37 /// Gets the negotiated audio codec.
39 /// <exception cref="InvalidOperationException">
40 /// Not connected to a source.<br/>
42 /// An internal error occurs.
44 /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
45 public ScreenMirroringAudioCodec Codec
49 _owner.ThrowIfNotConnected();
51 GetValue(Native.GetNegotiatedAudioCodec, _owner.Handle, out ScreenMirroringAudioCodec value).
52 ThrowIfError("Failed to get audio codec.");
59 /// Gets the negotiated audio channels.
61 /// <exception cref="InvalidOperationException">
62 /// Not connected to a source.<br/>
64 /// An internal error occurs.
66 /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
71 _owner.ThrowIfNotConnected();
73 GetValue(Native.GetNegotiatedAudioChannel, _owner.Handle, out int value).
74 ThrowIfError("Failed to get audio channels.");
81 /// Gets the negotiated audio sample rate.
83 /// <exception cref="InvalidOperationException">
84 /// Not connected to a source.<br/>
86 /// An internal error occurs.
88 /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
93 _owner.ThrowIfNotConnected();
95 GetValue(Native.GetNegotiatedAudioSampleRate, _owner.Handle, out int value).
96 ThrowIfError("Failed to get audio sample rate.");
103 /// Gets the negotiated audio bit width.
105 /// <exception cref="InvalidOperationException">
106 /// Not connected to a source.<br/>
108 /// An internal error occurs.
110 /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
115 _owner.ThrowIfNotConnected();
117 GetValue(Native.GetNegotiatedAudioBitwidth, _owner.Handle, out int value).
118 ThrowIfError("Failed to get audio bit width.");