using System;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
+using Tizen.System;
namespace Tizen.Multimedia
{
{
internal Interop.RadioHandle _handle;
+ private const string FeatureFmRadio = "http://tizen.org/feature/fmradio";
+
/// <summary>
/// Radio constructor
/// </summary>
+ /// <Feature> http://tizen.org/feature/fmradio </Feature>
/// <exception cref="OutOfMemoryException"></exception>
/// <exception cref="NotSupportedException">This is thrown if Radio feature is not supported</exception>
/// <exception cref="InvalidOperationException"></exception>
public Radio()
{
+ ValidateFeatureSupported(FeatureFmRadio);
_handle = new Interop.RadioHandle();
_handle.ScanCompleteCb = ScanCompleteCallback;
_handle.InteruptedCb = PlaybackIntruptedCallback;
return Interop.PinnedTask(tcs);
}
+ private void ValidateFeatureSupported(string featurePath)
+ {
+ bool supported = false;
+ SystemInfo.TryGetValue(featurePath, out supported);
+
+ if (supported == false)
+ {
+ throw new NotSupportedException($"The feature({featurePath}) is not supported.");
+ }
+
+ }
+
private void ScanUpdateCallback(int frequency, IntPtr data)
{
ScanInformationUpdated?.Invoke(this, new ScanUpdatedEventArgs(frequency));
{
internal static class Features
{
- internal static string AudioEffect = "http://tizen.org/feature/multimedia.custom_audio_effect";
- internal static string RawVideo = "http://tizen.org/feature/multimedia.raw_video";
+ internal const string AudioEffect = "http://tizen.org/feature/multimedia.custom_audio_effect";
+ internal const string RawVideo = "http://tizen.org/feature/multimedia.raw_video";
internal static bool IsSupported(string featureKey)
{