/* * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using static Tizen.Multimedia.Remoting.InteropHelper; using Native = Interop.ScreenMirroring; namespace Tizen.Multimedia.Remoting { /// /// Provides a means to retrieve the audio information which is negotiated with the source device. /// /// public class ScreenMirroringAudioInfo { private readonly ScreenMirroring _owner; internal ScreenMirroringAudioInfo(ScreenMirroring owner) { _owner = owner; } /// /// Gets the negotiated audio codec. /// /// /// Not connected to a source.\n /// \n /// An internal error occurs. /// /// The has already been disposed. public ScreenMirroringAudioCodec Codec { get { _owner.ThrowIfNotConnected(); GetValue(Native.GetNegotiatedAudioCodec, _owner.Handle, out ScreenMirroringAudioCodec value). ThrowIfError("Failed to get audio codec."); return value; } } /// /// Gets the negotiated audio channels. /// /// /// Not connected to a source.\n /// \n /// An internal error occurs. /// /// The has already been disposed. public int Channels { get { _owner.ThrowIfNotConnected(); GetValue(Native.GetNegotiatedAudioChannel, _owner.Handle, out int value). ThrowIfError("Failed to get audio channels."); return value; } } /// /// Gets the negotiated audio sample rate. /// /// /// Not connected to a source.\n /// \n /// An internal error occurs. /// /// The has already been disposed. public int SampleRate { get { _owner.ThrowIfNotConnected(); GetValue(Native.GetNegotiatedAudioSampleRate, _owner.Handle, out int value). ThrowIfError("Failed to get audio sample rate."); return value; } } /// /// Gets the negotiated audio bit width. /// /// /// Not connected to a source.\n /// \n /// An internal error occurs. /// /// The has already been disposed. public int BitWidth { get { _owner.ThrowIfNotConnected(); GetValue(Native.GetNegotiatedAudioBitwidth, _owner.Handle, out int value). ThrowIfError("Failed to get audio bit width."); return value; } } } }