Exemple #1
0
 private void RegisterFocusStateChanged()
 {
     _focusStateChangedCallback = (CameraFocusState state, IntPtr userData) =>
     {
         FocusStateChanged?.Invoke(this, new CameraFocusStateChangedEventArgs(state));
     };
     CameraErrorFactory.ThrowIfError(Native.SetFocusStateChangedCallback(_handle, _focusStateChangedCallback, IntPtr.Zero),
                                     "Setting focus changed callback failed");
 }
Exemple #2
0
        private void RegisterFocusStateChanged()
        {
            _focusStateChangedCallback = (state, _) =>
            {
                FocusStateChanged?.Invoke(this, new CameraFocusStateChangedEventArgs(state));
            };

            Native.SetFocusStateChangedCallback(_handle, _focusStateChangedCallback).
            ThrowIfFailed("Failed to set focus changed callback.");
        }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AudioStreamPolicy"/> class with <see cref="AudioStreamType"/>.
        /// </summary>
        /// <remarks>
        /// To apply the stream policy according to this stream information, the AudioStreamPolicy should
        /// be passed to other APIs related to playback or recording. (For example., <see cref="T:Tizen.Multimedia.Player"/>,
        /// <see cref="T:Tizen.Multimedia.WavPlayer"/> , etc.)
        /// </remarks>
        /// <param name="streamType">The type of the sound stream for which the policy needs to be created.</param>
        /// <exception cref="ArgumentException"><paramref name="streamType"/> is invalid.</exception>
        /// <since_tizen> 3 </since_tizen>
        public AudioStreamPolicy(AudioStreamType streamType)
        {
            ValidationUtil.ValidateEnum(typeof(AudioStreamType), streamType, nameof(streamType));

            _focusStateChangedCallback = (IntPtr streamInfo, AudioStreamFocusOptions focusMask,
                                          AudioStreamFocusState state, AudioStreamFocusChangedReason reason, AudioStreamBehaviors behaviors,
                                          string extraInfo, IntPtr _) =>
            {
                FocusStateChanged?.Invoke(this,
                                          new AudioStreamPolicyFocusStateChangedEventArgs(focusMask, state, reason, behaviors, extraInfo));
            };

            Interop.AudioStreamPolicy.Create(streamType, _focusStateChangedCallback,
                                             IntPtr.Zero, out _handle).ThrowIfError("Unable to create stream information");

            Debug.Assert(_handle != null);
        }