internal void NotifyEqualizeState(EqualizerState state) { int ret = Interop.Bluetooth.NotifyEqualizerState((int)state); if (ret != (int)BluetoothError.None) { Log.Error(Globals.LogTag, "Failed to notify equalizer state to remote device, Error - " + (BluetoothError)ret); BluetoothErrorFactory.ThrowBluetoothException(ret); } }
internal void SetEqualizerState(EqualizerState state) { int ret = Interop.Bluetooth.SetEqualizerState(state); if (ret != (int)BluetoothError.None) { Log.Error(Globals.LogTag, "Failed to set equalizer state to " + state + " - " + (BluetoothError)ret); BluetoothErrorFactory.ThrowBluetoothException(ret); } }
/// <summary> /// Notifies the equalize state to the remote device. /// </summary> /// <remarks> /// The remote device must be connected. /// </remarks> /// <param name="state">The equalizer state.</param> /// <exception cref="NotSupportedException">Thrown when the Bluetooth is not supported.</exception> /// <exception cref="InvalidOperationException">Thrown when the Bluetooth is not enabled /// or when notifying the equalizer state to the remote device fails.</exception> /// <since_tizen> 3 </since_tizen> public void NotifyEqualizerState(EqualizerState state) { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) { BluetoothAvrcpImpl.Instance.NotifyEqualizeState(state); } else { BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); } }
private void RegisterEqualizerStateChangedEvent() { _equalizerStateChangedCallback = (int equalizer, IntPtr userData) => { if (_equalizerStateChanged != null) { EqualizerState state = (EqualizerState)equalizer; _equalizerStateChanged(null, new EqualizerStateChangedEventArgs(state)); } }; int ret = Interop.Bluetooth.SetEqualizerStateChangedCallback(_equalizerStateChangedCallback, IntPtr.Zero); if (ret != (int)BluetoothError.None) { Log.Error(Globals.LogTag, "Failed to set equalizer state changed callback, Error - " + (BluetoothError)ret); } }
internal EqualizerStateChangedEventArgs(EqualizerState state) { _state = state; }