From c61f3cd64602fd2c65ed0d29d19497f0556e2f2f Mon Sep 17 00:00:00 2001 From: DotnetBuild Date: Thu, 14 Sep 2017 08:29:26 +0900 Subject: [PATCH] Release 4.0.0-preview1-00201 --- packaging/csapi-tizenfx.spec | 2 +- .../Tizen.Account.AccountManager/AccountService.cs | 2 - .../Tizen.Applications/Badge.cs | 1 + .../Tizen.Content.MediaContent/Features.cs | 2 +- .../AudioIO/AudioCapture.cs | 47 +- .../AudioIO/AudioDataAvailableEventArgs.cs | 28 +- .../AudioIO/AudioIOEnums.cs | 37 +- .../AudioIO/AudioIOStateChangedEventArgs.cs | 32 +- .../AudioIO/AudioIOUtil.cs | 28 +- .../AudioIO/AudioPlayback.cs | 76 +- .../AudioPlaybackBufferAvailableEventArgs.cs | 36 +- .../TonePlayer/TonePlayer.cs | 4 +- .../TonePlayer/ToneType.cs | 4 +- .../WavPlayer/WavPlayer.cs | 2 +- src/Tizen.Multimedia.Camera/Camera/Camera.cs | 1 - .../Camera/CameraCapturingEventArgs.cs | 9 +- .../Camera/CameraDeviceStateChangedEventArgs.cs | 8 +- .../Camera/CameraDisplaySettings.cs | 1 - .../Camera/CameraErrorOccurredEventArgs.cs | 8 +- .../Camera/CameraException.cs | 2 +- .../Camera/CameraFocusStateChangedEventArgs.cs | 5 +- .../Camera/CameraInterruptStartedEventArgs.cs | 8 +- .../Camera/CameraInterruptedEventArgs.cs | 10 +- .../Camera/CameraSettings.cs | 1 - .../Camera/CameraStateChangedEventArgs.cs | 6 +- src/Tizen.Multimedia.Camera/Camera/DoublePlane.cs | 2 +- src/Tizen.Multimedia.Camera/Camera/EncodedPlane.cs | 2 +- .../Camera/FaceDetectedEventArgs.cs | 5 +- .../Camera/FaceDetectionData.cs | 1 - .../Camera/HdrCaptureProgressEventArgs.cs | 5 +- .../Camera/IPreviewPlane.cs | 2 +- src/Tizen.Multimedia.Camera/Camera/Location.cs | 1 - .../Camera/MediaPacketPreviewEventArgs.cs | 5 +- .../Camera/PreviewEventArgs.cs | 5 +- src/Tizen.Multimedia.Camera/Camera/PreviewFrame.cs | 2 +- src/Tizen.Multimedia.Camera/Camera/SinglePlane.cs | 2 +- src/Tizen.Multimedia.Camera/Camera/TriplePlane.cs | 2 +- .../MediaCodec/BufferStatusChangedEventArgs.cs | 2 +- .../MediaCodec/InputProcessedEventArgs.cs | 2 +- .../MediaCodec/MediaCodec.cs | 24 +- .../Player/AudioEffect.cs | 11 +- .../Player/EqualizerBand.cs | 9 +- .../Player/MediaBufferSource.cs | 12 +- .../Player/MediaSource.cs | 2 - .../Player/MediaStreamConfiguration.cs | 10 +- .../Player/MediaStreamSource.cs | 25 +- .../Player/MediaUriSource.cs | 2 +- .../Player/Player.Events.cs | 6 +- .../Player/Player.Properties.cs | 12 +- src/Tizen.Multimedia.MediaPlayer/Player/Player.cs | 56 +- .../Player/PlayerDisplaySettings.cs | 10 +- .../Player/PlayerEnums.cs | 21 +- .../Player/PlayerErrorOccurredEventArgs.cs | 2 +- .../Player/PlayerTrackInfo.cs | 23 +- .../Player/StreamInfo.cs | 96 ++- .../Player/VideoStreamChangedEventArgs.cs | 6 +- .../MetadataEditor/MetadataEditor.cs | 63 +- .../MetadataEditor/MetadataEditorError.cs | 2 +- .../MetadataExtractor/Artwork.cs | 8 +- .../MetadataExtractor/Metadata.cs | 10 +- .../MetadataExtractor/MetadataExtractor.cs | 27 +- .../MetadataExtractor/MetadataExtractorError.cs | 2 +- .../MetadataExtractor/SyncLyrics.cs | 4 +- src/Tizen.Multimedia.Radio/Radio/Radio.cs | 32 +- .../Recorder/RecorderInterruptedEventArgs.cs | 2 +- .../MediaController/MediaControllerManager.cs | 2 +- .../MediaController/MediaControllerRepeatMode.cs | 10 + .../ScreenMirroring/EventArgs.cs | 2 +- .../ScreenMirroring/ScreenMirroringEnums.cs | 20 +- src/Tizen.Multimedia.Util/ImageUtil/BitmapFrame.cs | 2 +- src/Tizen.Multimedia.Util/ImageUtil/GifFrame.cs | 4 +- .../ImageUtil/ImageColorSpace.cs | 30 +- .../ImageUtil/ImageDecoder.cs | 22 +- .../ImageUtil/ImageEncoder.cs | 24 +- .../ImageUtil/ImageTransform.cs | 18 +- .../ImageUtil/ImageTransformer.cs | 2 +- .../ImageUtil/JpegDownscale.cs | 2 +- .../ImageUtil/PngCompression.cs | 2 +- .../ThumbnailExtractionResult.cs | 30 +- .../ThumbnailExtractor/ThumbnailExtractor.cs | 62 +- .../ThumbnailExtractor/ThumbnailExtractorError.cs | 28 +- .../MediaVision/BarcodeDetectionConfiguration.cs | 8 +- .../MediaVision/BarcodeGenerationConfiguration.cs | 5 +- .../MediaVision/EngineConfiguration.cs | 2 +- .../MediaVision/FaceRecognitionConfiguration.cs | 6 +- .../MediaVision/FaceRecognitionModel.cs | 2 +- .../MediaVision/FaceTrackingModel.cs | 4 +- .../MediaVision/ImageFillConfiguration.cs | 4 +- .../MediaVision/ImageObject.cs | 2 +- .../MediaVision/ImageTrackingModel.cs | 4 +- src/Tizen.Multimedia/AudioManager/AudioDevice.cs | 4 +- src/Tizen.Multimedia/AudioManager/AudioManager.cs | 2 +- .../AudioManager/AudioManagerEnums.cs | 28 +- .../AudioManager/AudioStreamPolicy.cs | 12 +- src/Tizen.Multimedia/AudioManager/AudioVolume.cs | 28 +- .../AudioManager/VolumeChangedEventArgs.cs | 2 +- src/Tizen.Multimedia/AudioManager/VolumeLevel.cs | 3 +- src/Tizen.Multimedia/Common.Internal/Features.cs | 2 +- .../Common.Internal/IBufferOwner.cs | 2 +- .../Common.Internal/MediaBufferBase.cs | 6 +- .../Common/CodecNotSupportedException.cs | 6 +- src/Tizen.Multimedia/Common/ColorSpace.cs | 34 +- src/Tizen.Multimedia/Common/Display.cs | 6 +- src/Tizen.Multimedia/Common/FileFormatException.cs | 2 +- src/Tizen.Multimedia/Common/IMediaBuffer.cs | 37 +- src/Tizen.Multimedia/Common/Point.cs | 10 +- src/Tizen.Multimedia/Common/Range.cs | 14 +- src/Tizen.Multimedia/Common/Rectangle.cs | 6 +- src/Tizen.Multimedia/Common/Size.cs | 6 +- src/Tizen.Multimedia/MediaTool/AudioMediaFormat.cs | 36 +- .../MediaTool/ContainerMediaFormat.cs | 2 +- src/Tizen.Multimedia/MediaTool/MediaFormat.cs | 6 +- .../MediaTool/MediaFormatAacType.cs | 10 +- .../MediaTool/MediaFormatMimeType.cs | 38 +- .../MediaTool/MediaFormatTextType.cs | 6 +- src/Tizen.Multimedia/MediaTool/MediaPacket.Lock.cs | 2 +- src/Tizen.Multimedia/MediaTool/MediaPacket.cs | 51 +- .../MediaTool/MediaPacketBuffer.cs | 32 +- .../MediaTool/MediaPacketBufferFlags.cs | 4 +- .../MediaTool/MediaPacketVideoPlane.cs | 10 +- src/Tizen.Multimedia/MediaTool/TextMediaFormat.cs | 11 +- src/Tizen.Multimedia/MediaTool/VideoMediaFormat.cs | 67 +- src/Tizen.Multimedia/MediaView/MediaView.cs | 2 +- .../Tizen.Network.Nfc/NfcManager.cs | 48 +- src/Tizen.Sensor/Tizen.Sensor/Sensor.cs | 2 +- src/Tizen.System.Information/Common/Information.cs | 197 +++++ .../InformationErrorFactory.cs} | 24 +- .../Interop/Interop.RuntimeInfo.cs | 28 +- .../Interop/Interop.SystemInfo.cs | 32 +- .../RuntimeInfo/CpuUsage.cs | 77 -- .../RuntimeInfo/Enumerations.cs | 25 +- .../RuntimeInfo/MemoryInformation.cs | 107 --- ....cs => RuntimeFeatureStatusChangedEventArgs.cs} | 11 +- .../RuntimeInfo/RuntimeInfo.cs | 219 +++++ .../RuntimeInfo/RuntimeInfoEventHandler.cs | 74 ++ .../RuntimeInfo/RuntimeInformation.cs | 891 --------------------- .../RuntimeInfo/TvProductHelper.cs | 80 ++ .../SystemInfo/SystemInfo.cs | 63 +- .../Tizen.System.Information.csproj | 0 .../Usage/ProcessCpuUsage.cs | 123 +++ .../Usage/ProcessMemoryUsage.cs | 213 +++++ .../Usage/SystemCpuUsage.cs | 180 +++++ .../Usage/SystemMemoryUsage.cs | 113 +++ 143 files changed, 2138 insertions(+), 2028 deletions(-) mode change 100644 => 100755 src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Features.cs mode change 100644 => 100755 src/Tizen.Multimedia.Camera/Camera/CameraException.cs mode change 100644 => 100755 src/Tizen.Multimedia.Camera/Camera/Location.cs mode change 100644 => 100755 src/Tizen.Multimedia.Radio/Radio/Radio.cs mode change 100644 => 100755 src/Tizen.Multimedia/Common.Internal/Features.cs create mode 100755 src/Tizen.System.Information/Common/Information.cs rename src/Tizen.System.Information/{RuntimeInfo/RuntimeInfoErrorFactory.cs => Common/InformationErrorFactory.cs} (73%) mode change 100644 => 100755 mode change 100644 => 100755 src/Tizen.System.Information/Interop/Interop.RuntimeInfo.cs mode change 100644 => 100755 src/Tizen.System.Information/Interop/Interop.SystemInfo.cs delete mode 100755 src/Tizen.System.Information/RuntimeInfo/CpuUsage.cs delete mode 100755 src/Tizen.System.Information/RuntimeInfo/MemoryInformation.cs rename src/Tizen.System.Information/RuntimeInfo/{RuntimeKeyStatusChangedEventArgs.cs => RuntimeFeatureStatusChangedEventArgs.cs} (69%) create mode 100755 src/Tizen.System.Information/RuntimeInfo/RuntimeInfo.cs create mode 100755 src/Tizen.System.Information/RuntimeInfo/RuntimeInfoEventHandler.cs delete mode 100755 src/Tizen.System.Information/RuntimeInfo/RuntimeInformation.cs create mode 100755 src/Tizen.System.Information/RuntimeInfo/TvProductHelper.cs mode change 100644 => 100755 src/Tizen.System.Information/Tizen.System.Information.csproj create mode 100755 src/Tizen.System.Information/Usage/ProcessCpuUsage.cs create mode 100755 src/Tizen.System.Information/Usage/ProcessMemoryUsage.cs create mode 100755 src/Tizen.System.Information/Usage/SystemCpuUsage.cs create mode 100755 src/Tizen.System.Information/Usage/SystemMemoryUsage.cs diff --git a/packaging/csapi-tizenfx.spec b/packaging/csapi-tizenfx.spec index 5271ff5..71b18fa 100644 --- a/packaging/csapi-tizenfx.spec +++ b/packaging/csapi-tizenfx.spec @@ -10,7 +10,7 @@ Name: csapi-tizenfx Summary: Assemblies of Tizen .NET -Version: 4.0.0.195 +Version: 4.0.0.201 Release: 1 Group: Development/Libraries License: Apache-2.0 diff --git a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountService.cs b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountService.cs index 8ebab51..9e5193c 100644 --- a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountService.cs +++ b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountService.cs @@ -593,8 +593,6 @@ namespace Tizen.Account.AccountManager /// /// ContentUpdate event is triggered if the MediaInformation updated/deleted or new information is inserted. /// - /// An object that contains information about sender - /// A ContentUpdatedEventArgs object that contains information about the update operation. /// http://tizen.org/privilege/account.read /// http://tizen.org/feature/account /// In case of any DB error. diff --git a/src/Tizen.Applications.Badge/Tizen.Applications/Badge.cs b/src/Tizen.Applications.Badge/Tizen.Applications/Badge.cs index 2361942..6fc0ebc 100755 --- a/src/Tizen.Applications.Badge/Tizen.Applications/Badge.cs +++ b/src/Tizen.Applications.Badge/Tizen.Applications/Badge.cs @@ -46,6 +46,7 @@ namespace Tizen.Applications /// Property for the count value of the badge. /// /// 3 + /// Thrown when set negative number public int Count { get diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Features.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Features.cs old mode 100644 new mode 100755 index 245a94a..e0c2d23 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Features.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Features.cs @@ -22,7 +22,7 @@ static internal class Features internal static bool IsSupported(string key) { - if (SystemInfo.TryGetValue(key, out bool value)) + if (Information.TryGetValue(key, out bool value)) { return value; } diff --git a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioCapture.cs b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioCapture.cs index f61ef9e..bde809d 100644 --- a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioCapture.cs +++ b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioCapture.cs @@ -1,18 +1,18 @@ /* -* 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. -*/ + * 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 System.Runtime.InteropServices; @@ -158,7 +158,7 @@ namespace Tizen.Multimedia /// /// Gets the size allocated for the audio input buffer. /// - /// The AudioPlayback has already been disposed. + /// The AudioPlayback has already been disposed of. public int GetBufferSize() { AudioIOUtil.ThrowIfError(AudioInput.GetBufferSize(_handle, out var size)); @@ -169,7 +169,7 @@ namespace Tizen.Multimedia /// Prepares the AudioCapture for reading audio data by starting buffering of audio data from the device. /// /// - /// Operation failed due to internal error.\n + /// Operation failed due to an internal error.\n /// -or-\n /// The current state is not . /// @@ -186,7 +186,7 @@ namespace Tizen.Multimedia /// Unprepares the AudioCapture. /// /// - /// Operation failed due to internal error.\n + /// Operation failed due to an internal error.\n /// -or-\n /// The current state is . /// @@ -237,6 +237,7 @@ namespace Tizen.Multimedia AudioIOUtil.ThrowIfError(AudioInput.Resume(_handle)); } + /// /// Flushes and discards buffered audio data from the input stream. /// @@ -255,7 +256,7 @@ namespace Tizen.Multimedia /// /// The to apply for the AudioCapture. /// is null. - /// has already been disposed. + /// has already been disposed of. /// is not supported. /// Not able to retrieve information from . public void ApplyStreamPolicy(AudioStreamPolicy streamPolicy) @@ -272,15 +273,15 @@ namespace Tizen.Multimedia } /// - /// Provides the ability to record audio from system audio input devices in synchronous way. + /// Provides the ability to record audio from system audio input devices in a synchronous way. /// /// http://tizen.org/privilege/recorder public class AudioCapture : AudioCaptureBase { /// - /// Initializes a new instance of the AudioCapture class with the specified sample rate, channel and sampleType. + /// Initializes a new instance of the AudioCapture class with the specified sample rate, channel, and sampleType. /// - /// The audio sample rate.(8000 ~ 48000Hz) + /// The audio sample rate (8000 ~ 48000Hz). /// The audio channel type. /// The audio sample type. /// @@ -326,7 +327,7 @@ namespace Tizen.Multimedia } /// - /// Provides the ability to record audio from system audio input devices in asynchronous way. + /// Provides the ability to record audio from system audio input devices in an asynchronous way. /// /// http://tizen.org/privilege/recorder public class AsyncAudioCapture : AudioCaptureBase @@ -340,7 +341,7 @@ namespace Tizen.Multimedia /// /// Initializes a new instance of the AsyncAudioCapture class with the specified sample rate, channel and sampleType. /// - /// The audio sample rate.(8000 ~ 48000Hz) + /// The audio sample rate (8000 ~ 48000Hz). /// The audio channel type. /// The audio sample type. /// diff --git a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioDataAvailableEventArgs.cs b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioDataAvailableEventArgs.cs index 8fc7940..72fbc0a 100644 --- a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioDataAvailableEventArgs.cs +++ b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioDataAvailableEventArgs.cs @@ -1,18 +1,18 @@ /* -* 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. -*/ + * 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; diff --git a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOEnums.cs b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOEnums.cs index bec87b0..50e9c84 100644 --- a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOEnums.cs +++ b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOEnums.cs @@ -1,18 +1,18 @@ /* -* 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. -*/ + * 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 Tizen.Internals.Errors; @@ -22,7 +22,7 @@ namespace Tizen.Multimedia { Mono = 0x80, Stereo - }; + } internal enum AudioIOError { @@ -42,7 +42,7 @@ namespace Tizen.Multimedia } /// - /// Specifies the states for the , and . + /// Specifies the states for the , , and . /// public enum AudioIOState { @@ -63,7 +63,7 @@ namespace Tizen.Multimedia } /// - /// Enumeration for audio sample type. + /// Specifies the audio sample types. /// public enum AudioSampleType { @@ -76,5 +76,4 @@ namespace Tizen.Multimedia /// S16Le } - -} +} \ No newline at end of file diff --git a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOStateChangedEventArgs.cs b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOStateChangedEventArgs.cs index 5d1677d..5ade7ed 100644 --- a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOStateChangedEventArgs.cs +++ b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOStateChangedEventArgs.cs @@ -1,25 +1,25 @@ /* -* 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. -*/ + * 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; namespace Tizen.Multimedia { /// - /// Provides data for the event and . + /// Provides data for the event and the event. /// public class AudioIOStateChangedEventArgs : EventArgs { @@ -41,7 +41,7 @@ namespace Tizen.Multimedia public AudioIOState Current { get; } /// - /// Gets the value indicating whether the state is changed by policy or not. + /// Gets the value indicating whether the state is changed by a policy or not. /// public bool ByPolicy { get; } } diff --git a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOUtil.cs b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOUtil.cs index d6a0c76..d0b5d13 100644 --- a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOUtil.cs +++ b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOUtil.cs @@ -1,18 +1,18 @@ /* -* 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. -*/ + * 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 System.Diagnostics; diff --git a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioPlayback.cs b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioPlayback.cs index d8fd45e..4d935db 100644 --- a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioPlayback.cs +++ b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioPlayback.cs @@ -1,18 +1,18 @@ /* -* 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. -*/ + * 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 Interop.AudioIO; @@ -20,7 +20,7 @@ using static Interop.AudioIO; namespace Tizen.Multimedia { /// - /// Provides the ability to directly manage the system audio output devices and play PCM (pulse-code modulation) data. + /// Provides the ability to directly manage the system audio output devices and play the PCM (pulse-code modulation) data. /// public class AudioPlayback : IDisposable { @@ -42,7 +42,7 @@ namespace Tizen.Multimedia #region Event /// - /// Occurs when audio playback data can be written. + /// Occurs when the audio playback data can be written. /// /// public event EventHandler BufferAvailable; @@ -85,9 +85,9 @@ namespace Tizen.Multimedia #endregion /// - /// Initializes a new instance of the AudioPlayback class with the specified sample rate, channel and sample type. + /// Initializes a new instance of the AudioPlayback class with the specified sample rate, channel, and sample type. /// - /// The audio sample rate.(8000 ~ 48000Hz) + /// The audio sample rate (8000 ~ 48000Hz). /// The audio channel type. /// The audio sample type. /// @@ -197,7 +197,7 @@ namespace Tizen.Multimedia /// /// Gets the sound type supported by the audio output device. /// - /// The AudioPlayback has already been disposed. + /// The AudioPlayback has already been disposed of. public AudioStreamType StreamType { get @@ -215,7 +215,7 @@ namespace Tizen.Multimedia /// /// Gets the size allocated for the audio output buffer. /// - /// The AudioPlayback has already been disposed. + /// The AudioPlayback has already been disposed of. public int GetBufferSize() { AudioIOUtil.ThrowIfError(AudioOutput.GetBufferSize(_handle, out var size)); @@ -223,10 +223,10 @@ namespace Tizen.Multimedia } /// - /// Drains buffered audio data from the output stream. - /// It blocks the calling thread until draining the stream buffer completely. (e.g. end of playback) + /// Drains the buffered audio data from the output stream. + /// It blocks the calling thread until the drain of the stream buffer is complete, for example, at the end of playback. /// - /// The AudioPlayback has already been disposed. + /// The AudioPlayback has already been disposed of. /// The current state is . public void Drain() { @@ -245,7 +245,7 @@ namespace Tizen.Multimedia /// is null. /// The length of is zero. /// The current state is not . - /// The AudioPlayback has already been disposed. + /// The AudioPlayback has already been disposed of. public int Write(byte[] buffer) { ValidateState(AudioIOState.Running); @@ -274,11 +274,11 @@ namespace Tizen.Multimedia /// This must be called before . /// /// - /// Operation failed due to internal error.\n + /// Operation failed due to an internal error.\n /// -or-\n /// The current state is not . /// - /// The AudioPlayback has already been disposed. + /// The AudioPlayback has already been disposed of. /// public void Prepare() { @@ -292,11 +292,11 @@ namespace Tizen.Multimedia /// Unprepares the AudioPlayback. /// /// - /// Operation failed due to internal error.\n + /// Operation failed due to an internal error.\n /// -or-\n /// The current state is . /// - /// The AudioPlayback has already been disposed. + /// The AudioPlayback has already been disposed of. /// public void Unprepare() { @@ -307,15 +307,15 @@ namespace Tizen.Multimedia } /// - /// Pauses feeding of audio data to the device. + /// Pauses feeding of the audio data to the device. /// - /// It has no effect if the current is the . + /// It has no effect if the current state is . /// /// The current state is .\n /// -or-\n /// The method is called in the event handler. /// - /// The AudioPlayback has already been disposed. + /// The AudioPlayback has already been disposed of. /// public void Pause() { @@ -329,15 +329,15 @@ namespace Tizen.Multimedia } /// - /// Resumes feeding of audio data to the device. + /// Resumes feeding of the audio data to the device. /// - /// It has no effect if the current is the . + /// It has no effect if the current state is . /// /// The current state is .\n /// -or-\n /// The method is called in an event handler. /// - /// The AudioPlayback has already been disposed. + /// The AudioPlayback has already been disposed of. /// public void Resume() { @@ -351,10 +351,10 @@ namespace Tizen.Multimedia } /// - /// Flushes and discards buffered audio data from the output stream. + /// Flushes and discards the buffered audio data from the output stream. /// /// The current state is . - /// The AudioPlayback has already been disposed. + /// The AudioPlayback has already been disposed of. public void Flush() { ValidateState(AudioIOState.Running, AudioIOState.Paused); @@ -370,9 +370,9 @@ namespace Tizen.Multimedia /// The to apply for the AudioPlayback. /// is null. /// - /// has already been disposed.\n + /// has already been disposed of.\n /// -or-\n - /// The AudioPlayback has already been disposed. + /// The AudioPlayback has already been disposed of. /// /// is not supported. /// Not able to retrieve information from . diff --git a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioPlaybackBufferAvailableEventArgs.cs b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioPlaybackBufferAvailableEventArgs.cs index ac9a495..b834894 100644 --- a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioPlaybackBufferAvailableEventArgs.cs +++ b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioPlaybackBufferAvailableEventArgs.cs @@ -1,23 +1,26 @@ /* -* 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. -*/ + * 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; namespace Tizen.Multimedia { + /// + /// Provides data for the event. + /// public class AudioPlaybackBufferAvailableEventArgs : EventArgs { internal AudioPlaybackBufferAvailableEventArgs(int length) @@ -25,6 +28,11 @@ namespace Tizen.Multimedia Length = length; } + /// + /// Gets the length of the buffer that can be written. + /// + /// The length of the buffer that can be written. + /// public int Length { get; } } } diff --git a/src/Tizen.Multimedia.AudioIO/TonePlayer/TonePlayer.cs b/src/Tizen.Multimedia.AudioIO/TonePlayer/TonePlayer.cs index 4675814..718c4fe 100644 --- a/src/Tizen.Multimedia.AudioIO/TonePlayer/TonePlayer.cs +++ b/src/Tizen.Multimedia.AudioIO/TonePlayer/TonePlayer.cs @@ -38,7 +38,7 @@ namespace Tizen.Multimedia /// is less than -1. /// Any invalid operations occurred. /// is not a supported type. - /// has already been disposed. + /// has already been disposed of. public static Task StartAsync(ToneType tone, AudioStreamPolicy streamPolicy, int durationMilliseconds) { @@ -58,7 +58,7 @@ namespace Tizen.Multimedia /// is less than -1. /// Any invalid operations occurred. /// is not a supported type. - /// has already been disposed. + /// has already been disposed of. public static Task StartAsync(ToneType tone, AudioStreamPolicy streamPolicy, int durationMilliseconds, CancellationToken cancellationToken) { diff --git a/src/Tizen.Multimedia.AudioIO/TonePlayer/ToneType.cs b/src/Tizen.Multimedia.AudioIO/TonePlayer/ToneType.cs index 85e2aab..1cfc2ec 100644 --- a/src/Tizen.Multimedia.AudioIO/TonePlayer/ToneType.cs +++ b/src/Tizen.Multimedia.AudioIO/TonePlayer/ToneType.cs @@ -17,7 +17,7 @@ namespace Tizen.Multimedia { /// - /// Enumeration for Audio Codec. + /// Specifies the audio codec. /// public enum ToneType { @@ -38,7 +38,7 @@ namespace Tizen.Multimedia /// Dtmf2, /// - /// redefined DTMF 3. + /// Predefined DTMF 3. /// Dtmf3, /// diff --git a/src/Tizen.Multimedia.AudioIO/WavPlayer/WavPlayer.cs b/src/Tizen.Multimedia.AudioIO/WavPlayer/WavPlayer.cs index 4a42a41..6e848fe 100644 --- a/src/Tizen.Multimedia.AudioIO/WavPlayer/WavPlayer.cs +++ b/src/Tizen.Multimedia.AudioIO/WavPlayer/WavPlayer.cs @@ -62,7 +62,7 @@ namespace Tizen.Multimedia /// An internal error occurs. /// does not exists. /// The format of is not supported. - /// has already been disposed. + /// has already been disposed of. public static Task StartAsync(string path, AudioStreamPolicy streamPolicy, CancellationToken cancellationToken) { diff --git a/src/Tizen.Multimedia.Camera/Camera/Camera.cs b/src/Tizen.Multimedia.Camera/Camera/Camera.cs index 58477cf..91f6c64 100755 --- a/src/Tizen.Multimedia.Camera/Camera/Camera.cs +++ b/src/Tizen.Multimedia.Camera/Camera/Camera.cs @@ -1005,4 +1005,3 @@ namespace Tizen.Multimedia #endregion Callback registrations } } - diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraCapturingEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/CameraCapturingEventArgs.cs index 4b92096..befb012 100755 --- a/src/Tizen.Multimedia.Camera/Camera/CameraCapturingEventArgs.cs +++ b/src/Tizen.Multimedia.Camera/Camera/CameraCapturingEventArgs.cs @@ -19,7 +19,7 @@ using System; namespace Tizen.Multimedia { /// - /// An extended EventArgs class which contains details about the captured still image. + /// Provides data for the event. /// public class CameraCapturingEventArgs : EventArgs { @@ -31,22 +31,21 @@ namespace Tizen.Multimedia } /// - /// The main image data of the captured still image. + /// Gets the main image data of the captured still image. /// /// 3 public StillImage MainImage { get; } /// - /// The image data of the post view. + /// Gets the image data of the post view. /// /// 3 public StillImage PostView { get; } /// - /// The image data of the thumbnail. + /// Gets the image data of the thumbnail. /// /// 3 public StillImage Thumbnail { get; } } } - diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraDeviceStateChangedEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/CameraDeviceStateChangedEventArgs.cs index 2270436..b647736 100755 --- a/src/Tizen.Multimedia.Camera/Camera/CameraDeviceStateChangedEventArgs.cs +++ b/src/Tizen.Multimedia.Camera/Camera/CameraDeviceStateChangedEventArgs.cs @@ -19,8 +19,7 @@ using System; namespace Tizen.Multimedia { /// - /// An extended EventArgs class which contains details about the previous and the current state - /// of the camera when its state is changed. + /// Provides data for the event. /// public class CameraDeviceStateChangedEventArgs : EventArgs { @@ -31,16 +30,15 @@ namespace Tizen.Multimedia } /// - /// The camera device type. + /// Gets the camera device type. /// /// 3 public CameraDevice Device { get; } /// - /// The current state of the camera device. + /// Gets the current state of the camera device. /// /// 3 public CameraDeviceState State { get; } } } - diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraDisplaySettings.cs b/src/Tizen.Multimedia.Camera/Camera/CameraDisplaySettings.cs index eeddd87..3f90093 100755 --- a/src/Tizen.Multimedia.Camera/Camera/CameraDisplaySettings.cs +++ b/src/Tizen.Multimedia.Camera/Camera/CameraDisplaySettings.cs @@ -173,4 +173,3 @@ namespace Tizen.Multimedia } } } - diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraErrorOccurredEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/CameraErrorOccurredEventArgs.cs index de2032c..650288e 100755 --- a/src/Tizen.Multimedia.Camera/Camera/CameraErrorOccurredEventArgs.cs +++ b/src/Tizen.Multimedia.Camera/Camera/CameraErrorOccurredEventArgs.cs @@ -19,8 +19,7 @@ using System; namespace Tizen.Multimedia { /// - /// An extended EventArgs class which contains details about the error status and the - /// state of the camera when it fails. + /// Provides data for the event. /// public class CameraErrorOccurredEventArgs : EventArgs { @@ -31,16 +30,15 @@ namespace Tizen.Multimedia } /// - /// The camera error code. + /// Gets the camera error. /// /// 3 public CameraErrorCode Error { get; } /// - /// The state of the camera. + /// Gets the current state of the camera. /// /// 3 public CameraState State { get; } } } - diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraException.cs b/src/Tizen.Multimedia.Camera/Camera/CameraException.cs old mode 100644 new mode 100755 index 36f46d7..40d2a70 --- a/src/Tizen.Multimedia.Camera/Camera/CameraException.cs +++ b/src/Tizen.Multimedia.Camera/Camera/CameraException.cs @@ -50,4 +50,4 @@ namespace Tizen.Multimedia { } } -} \ No newline at end of file +} diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraFocusStateChangedEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/CameraFocusStateChangedEventArgs.cs index 9826506..63931d4 100755 --- a/src/Tizen.Multimedia.Camera/Camera/CameraFocusStateChangedEventArgs.cs +++ b/src/Tizen.Multimedia.Camera/Camera/CameraFocusStateChangedEventArgs.cs @@ -19,7 +19,7 @@ using System; namespace Tizen.Multimedia { /// - /// An extended EventArgs class which contains details about the focus state of the camera. + /// Provides data for the event. /// public class CameraFocusStateChangedEventArgs : EventArgs { @@ -29,10 +29,9 @@ namespace Tizen.Multimedia } /// - /// The focus state of the camera. + /// Gets the focus state of the camera. /// /// 3 public CameraFocusState State { get; } } } - diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraInterruptStartedEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/CameraInterruptStartedEventArgs.cs index 626e465..ec969cf 100755 --- a/src/Tizen.Multimedia.Camera/Camera/CameraInterruptStartedEventArgs.cs +++ b/src/Tizen.Multimedia.Camera/Camera/CameraInterruptStartedEventArgs.cs @@ -19,8 +19,7 @@ using System; namespace Tizen.Multimedia { /// - /// An extended EventArgs class which contains details about current state - /// of the camera when interrupt is invoked internally in Native FW. + /// Provides data for the event. /// public class CameraInterruptStartedEventArgs : EventArgs { @@ -31,14 +30,13 @@ namespace Tizen.Multimedia } /// - /// Current state of the camera. + /// Gets the current state of the camera. /// public CameraState State { get; } /// - /// The policy that interrupted the camera. + /// Gets the policy that interrupted the camera. /// public CameraPolicy Policy { get; } } } - diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraInterruptedEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/CameraInterruptedEventArgs.cs index 664f159..ec2d277 100755 --- a/src/Tizen.Multimedia.Camera/Camera/CameraInterruptedEventArgs.cs +++ b/src/Tizen.Multimedia.Camera/Camera/CameraInterruptedEventArgs.cs @@ -19,8 +19,7 @@ using System; namespace Tizen.Multimedia { /// - /// An extended EventArgs class which contains details about the previous and the current state - /// of the camera when it is interrupted. + /// Provides data for the event. /// public class CameraInterruptedEventArgs : EventArgs { @@ -32,22 +31,21 @@ namespace Tizen.Multimedia } /// - /// The previous state of the camera. + /// Gets the previous state of the camera. /// /// 3 public CameraState Previous { get; } /// - /// The current state of the camera. + /// Gets the current state of the camera. /// /// 3 public CameraState Current { get; } /// - /// The policy that interrupted the camera. + /// Gets the policy that interrupted the camera. /// /// 3 public CameraPolicy Policy { get; } } } - diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraSettings.cs b/src/Tizen.Multimedia.Camera/Camera/CameraSettings.cs index e42ee1f..903f17c 100755 --- a/src/Tizen.Multimedia.Camera/Camera/CameraSettings.cs +++ b/src/Tizen.Multimedia.Camera/Camera/CameraSettings.cs @@ -1159,4 +1159,3 @@ namespace Tizen.Multimedia #endregion EXIF tag } } - diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraStateChangedEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/CameraStateChangedEventArgs.cs index 0839688..57f8722 100755 --- a/src/Tizen.Multimedia.Camera/Camera/CameraStateChangedEventArgs.cs +++ b/src/Tizen.Multimedia.Camera/Camera/CameraStateChangedEventArgs.cs @@ -19,8 +19,7 @@ using System; namespace Tizen.Multimedia { /// - /// An extended EventArgs class which contains details about the previous and the current state - /// of the camera when its state is changed. + /// Provides data for the event. /// public class CameraStateChangedEventArgs : EventArgs { @@ -47,10 +46,9 @@ namespace Tizen.Multimedia /// Gets the value indicating whether the state is changed by policy. /// /// - /// true if the state changed by policy such as resource conflict or security, otherwise false. + /// true if the state changed by policy, such as resource conflict or security, otherwise false. /// /// 3 public bool ByPolicy { get; } } } - diff --git a/src/Tizen.Multimedia.Camera/Camera/DoublePlane.cs b/src/Tizen.Multimedia.Camera/Camera/DoublePlane.cs index e6960f1..887388a 100755 --- a/src/Tizen.Multimedia.Camera/Camera/DoublePlane.cs +++ b/src/Tizen.Multimedia.Camera/Camera/DoublePlane.cs @@ -44,4 +44,4 @@ namespace Tizen.Multimedia /// 3 public byte[] UV { get; } } -} \ No newline at end of file +} diff --git a/src/Tizen.Multimedia.Camera/Camera/EncodedPlane.cs b/src/Tizen.Multimedia.Camera/Camera/EncodedPlane.cs index f1620fb..48524b7 100755 --- a/src/Tizen.Multimedia.Camera/Camera/EncodedPlane.cs +++ b/src/Tizen.Multimedia.Camera/Camera/EncodedPlane.cs @@ -36,4 +36,4 @@ namespace Tizen.Multimedia /// 3 public byte[] Data { get; } } -} \ No newline at end of file +} diff --git a/src/Tizen.Multimedia.Camera/Camera/FaceDetectedEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/FaceDetectedEventArgs.cs index 821a0ad..3b9e7eb 100755 --- a/src/Tizen.Multimedia.Camera/Camera/FaceDetectedEventArgs.cs +++ b/src/Tizen.Multimedia.Camera/Camera/FaceDetectedEventArgs.cs @@ -20,7 +20,7 @@ using System.Collections.Generic; namespace Tizen.Multimedia { /// - /// An extended EventArgs class which contains details about all the faces detected. + /// Provides data for the event. /// If the user needs to keep the faces data, the user has to copy the data. /// public class FaceDetectedEventArgs : EventArgs @@ -31,10 +31,9 @@ namespace Tizen.Multimedia } /// - /// The list containing faces of type . + /// Gets the list containing faces of type . /// /// 3 public IEnumerable Faces { get; } } } - diff --git a/src/Tizen.Multimedia.Camera/Camera/FaceDetectionData.cs b/src/Tizen.Multimedia.Camera/Camera/FaceDetectionData.cs index 97b8712..0a3f6c0 100755 --- a/src/Tizen.Multimedia.Camera/Camera/FaceDetectionData.cs +++ b/src/Tizen.Multimedia.Camera/Camera/FaceDetectionData.cs @@ -74,4 +74,3 @@ namespace Tizen.Multimedia public int Height { get; } } } - diff --git a/src/Tizen.Multimedia.Camera/Camera/HdrCaptureProgressEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/HdrCaptureProgressEventArgs.cs index 61ba45b..cf44765 100755 --- a/src/Tizen.Multimedia.Camera/Camera/HdrCaptureProgressEventArgs.cs +++ b/src/Tizen.Multimedia.Camera/Camera/HdrCaptureProgressEventArgs.cs @@ -19,7 +19,7 @@ using System; namespace Tizen.Multimedia { /// - /// An extended EventArgs class which contains details about the HDR capture progress. + /// Provides data for the event. /// public class HdrCaptureProgressEventArgs : EventArgs { @@ -29,10 +29,9 @@ namespace Tizen.Multimedia } /// - /// The HDR capture progress in percent. + /// Gets the HDR Capture progress in percent. /// /// 3 public int Percent { get; } } } - diff --git a/src/Tizen.Multimedia.Camera/Camera/IPreviewPlane.cs b/src/Tizen.Multimedia.Camera/Camera/IPreviewPlane.cs index e3b506b..d84d07a 100755 --- a/src/Tizen.Multimedia.Camera/Camera/IPreviewPlane.cs +++ b/src/Tizen.Multimedia.Camera/Camera/IPreviewPlane.cs @@ -19,4 +19,4 @@ namespace Tizen.Multimedia public interface IPreviewPlane { } -} \ No newline at end of file +} diff --git a/src/Tizen.Multimedia.Camera/Camera/Location.cs b/src/Tizen.Multimedia.Camera/Camera/Location.cs old mode 100644 new mode 100755 index 71c427a..8160f4e --- a/src/Tizen.Multimedia.Camera/Camera/Location.cs +++ b/src/Tizen.Multimedia.Camera/Camera/Location.cs @@ -53,4 +53,3 @@ namespace Tizen.Multimedia public double Altitude { get; } } } - diff --git a/src/Tizen.Multimedia.Camera/Camera/MediaPacketPreviewEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/MediaPacketPreviewEventArgs.cs index 3ef9684..b60083b 100755 --- a/src/Tizen.Multimedia.Camera/Camera/MediaPacketPreviewEventArgs.cs +++ b/src/Tizen.Multimedia.Camera/Camera/MediaPacketPreviewEventArgs.cs @@ -19,7 +19,7 @@ using System; namespace Tizen.Multimedia { /// - /// An extended EventArgs class which contains details about the media packet preview frame. + /// Provides data for the event. /// public class MediaPacketPreviewEventArgs : EventArgs { @@ -29,10 +29,9 @@ namespace Tizen.Multimedia } /// - /// The media packet data. + /// Gets the media packet data. /// /// 3 public MediaPacket Packet { get; } } } - diff --git a/src/Tizen.Multimedia.Camera/Camera/PreviewEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/PreviewEventArgs.cs index 28cce51..fbda63c 100755 --- a/src/Tizen.Multimedia.Camera/Camera/PreviewEventArgs.cs +++ b/src/Tizen.Multimedia.Camera/Camera/PreviewEventArgs.cs @@ -19,7 +19,7 @@ using System; namespace Tizen.Multimedia { /// - /// An extended EventArgs class which contains details about the preview frame. + /// Provides data for the event. /// public class PreviewEventArgs : EventArgs { @@ -29,10 +29,9 @@ namespace Tizen.Multimedia } /// - /// The PreviewData frame. + /// Gets the preview frame data. /// /// 3 public PreviewFrame Preview { get; } } } - diff --git a/src/Tizen.Multimedia.Camera/Camera/PreviewFrame.cs b/src/Tizen.Multimedia.Camera/Camera/PreviewFrame.cs index 04962ef..3777018 100755 --- a/src/Tizen.Multimedia.Camera/Camera/PreviewFrame.cs +++ b/src/Tizen.Multimedia.Camera/Camera/PreviewFrame.cs @@ -114,4 +114,4 @@ namespace Tizen.Multimedia /// 3 public IPreviewPlane Plane { get; } } -} \ No newline at end of file +} diff --git a/src/Tizen.Multimedia.Camera/Camera/SinglePlane.cs b/src/Tizen.Multimedia.Camera/Camera/SinglePlane.cs index 9671090..d627c5d 100755 --- a/src/Tizen.Multimedia.Camera/Camera/SinglePlane.cs +++ b/src/Tizen.Multimedia.Camera/Camera/SinglePlane.cs @@ -36,4 +36,4 @@ namespace Tizen.Multimedia /// 3 public byte[] Data { get; } } -} \ No newline at end of file +} diff --git a/src/Tizen.Multimedia.Camera/Camera/TriplePlane.cs b/src/Tizen.Multimedia.Camera/Camera/TriplePlane.cs index 132911b..0d50515 100755 --- a/src/Tizen.Multimedia.Camera/Camera/TriplePlane.cs +++ b/src/Tizen.Multimedia.Camera/Camera/TriplePlane.cs @@ -52,4 +52,4 @@ namespace Tizen.Multimedia /// 3 public byte[] V { get; } } -} \ No newline at end of file +} diff --git a/src/Tizen.Multimedia.MediaCodec/MediaCodec/BufferStatusChangedEventArgs.cs b/src/Tizen.Multimedia.MediaCodec/MediaCodec/BufferStatusChangedEventArgs.cs index 6beac7c..d5bb05f 100644 --- a/src/Tizen.Multimedia.MediaCodec/MediaCodec/BufferStatusChangedEventArgs.cs +++ b/src/Tizen.Multimedia.MediaCodec/MediaCodec/BufferStatusChangedEventArgs.cs @@ -33,7 +33,7 @@ namespace Tizen.Multimedia.MediaCodec } /// - /// Gets the value indicating new status of the codec. + /// Gets the value indicating the new status of the codec. /// public MediaCodecStatus Status { get; } diff --git a/src/Tizen.Multimedia.MediaCodec/MediaCodec/InputProcessedEventArgs.cs b/src/Tizen.Multimedia.MediaCodec/MediaCodec/InputProcessedEventArgs.cs index 1883d95..b10d0d3 100644 --- a/src/Tizen.Multimedia.MediaCodec/MediaCodec/InputProcessedEventArgs.cs +++ b/src/Tizen.Multimedia.MediaCodec/MediaCodec/InputProcessedEventArgs.cs @@ -36,7 +36,7 @@ namespace Tizen.Multimedia.MediaCodec } /// - /// Gets the packet that the codec has processed. + /// Gets the packet processed by the codec. /// public MediaPacket Packet { get; } } diff --git a/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodec.cs b/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodec.cs index 38d5e0b..b01f245 100644 --- a/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodec.cs +++ b/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodec.cs @@ -21,7 +21,7 @@ using System.Diagnostics; namespace Tizen.Multimedia.MediaCodec { /// - /// Provides the means to encode and decode video and audio data. + /// Provides the means to encode and decode the video and the audio data. /// public class MediaCodec : IDisposable { @@ -33,7 +33,7 @@ namespace Tizen.Multimedia.MediaCodec private IntPtr _handle; /// - /// Initialize a new instance of the MediaCodec class. + /// Initializes a new instance of the MediaCodec class. /// public MediaCodec() { @@ -81,7 +81,7 @@ namespace Tizen.Multimedia.MediaCodec #endregion /// - /// Validates if the object already has been disposed of. + /// Validates if the object has already been disposed of. /// /// The current object has been disposed of. private void ValidateNotDisposed() @@ -188,7 +188,7 @@ namespace Tizen.Multimedia.MediaCodec /// Prepares the MediaCodec for encoding or decoding. /// /// - /// The codec is not configured, yet.\n + /// The codec is not configured yet.\n /// -or-\n /// Internal error. /// @@ -226,15 +226,15 @@ namespace Tizen.Multimedia.MediaCodec /// Configures the MediaCodec. /// /// The for properties of media data to decode or encode. - /// The value indicating whether the codec works as a encoder or a decoder. + /// The value indicating whether the codec works as an encoder or a decoder. /// The value indicating whether the codec uses hardware acceleration. - /// format is null + /// is null. /// /// is invalid.\n /// -or-\n /// is neither audio type nor video type. /// - /// the mime type of the format is not supported. + /// The mime type of the format is not supported. /// /// public void Configure(MediaFormat format, bool encoder, MediaCodecTypes codecType) @@ -343,9 +343,9 @@ namespace Tizen.Multimedia.MediaCodec /// Adds the packet to the internal queue of the codec. /// /// The packet to be encoded or decoded. - /// packet is null. - /// the current codec is not prepared, yet. - /// Any attempts to modify the packet will be failed until the event for the packet is invoked. + /// is null. + /// The current codec is not prepared yet. + /// Any attempts to modify the packet will fail until the event for the packet is invoked. public void ProcessInput(MediaPacket packet) { ValidateNotDisposed(); @@ -385,7 +385,7 @@ namespace Tizen.Multimedia.MediaCodec /// The value indicating encoder or decoder. /// The mime type to query. /// The values indicating which codec types are supported on the current device. - /// type is invalid. + /// is invalid. public MediaCodecTypes GetCodecType(bool encoder, MediaFormatVideoMimeType type) { ValidateNotDisposed(); @@ -404,7 +404,7 @@ namespace Tizen.Multimedia.MediaCodec /// The value indicating encoder or decoder. /// The mime type to query. /// The values indicating which codec types are supported on the current device. - /// type is invalid. + /// is invalid. public MediaCodecTypes GetCodecType(bool encoder, MediaFormatAudioMimeType type) { ValidateNotDisposed(); diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/AudioEffect.cs b/src/Tizen.Multimedia.MediaPlayer/Player/AudioEffect.cs index 9890398..f47e3b2 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/AudioEffect.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/AudioEffect.cs @@ -63,15 +63,14 @@ namespace Tizen.Multimedia /// The index of the band to get. /// The has already been disposed of. /// - /// index is less than zero.\n + /// is less than zero.\n /// -or-\n - /// index is equal to or greater than . + /// is equal to or greater than . /// public EqualizerBand this[int index] { get { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); Player.ValidateNotDisposed(); if (index < 0 || Count <= index) @@ -95,21 +94,19 @@ namespace Tizen.Multimedia /// The has already been disposed of. public void Clear() { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); Player.ValidateNotDisposed(); Native.EqualizerClear(Player.Handle). ThrowIfFailed("Failed to clear equalizer effect"); - Log.Debug(PlayerLog.Tag, PlayerLog.Leave); } /// - /// Get the number of items. + /// Gets the number of items. /// public int Count { get; } /// - /// Get the band level range of the bands in dB. + /// Gets the band level range of the bands in the dB. /// public Range BandLevelRange { get; } diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/EqualizerBand.cs b/src/Tizen.Multimedia.MediaPlayer/Player/EqualizerBand.cs index b64c00f..199fbd1 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/EqualizerBand.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/EqualizerBand.cs @@ -22,7 +22,7 @@ namespace Tizen.Multimedia { /// - /// Represents a equalizer band of . + /// Represents an equalizer band of . /// public class EqualizerBand { @@ -31,7 +31,6 @@ namespace Tizen.Multimedia internal EqualizerBand(AudioEffect owner, int index) { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); Debug.Assert(owner != null); _owner = owner; @@ -63,7 +62,6 @@ namespace Tizen.Multimedia { get { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); _owner.Player.ValidateNotDisposed(); int value = 0; @@ -74,7 +72,6 @@ namespace Tizen.Multimedia } set { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); _owner.Player.ValidateNotDisposed(); if (value < _owner.BandLevelRange.Min || _owner.BandLevelRange.Max < value) @@ -92,12 +89,12 @@ namespace Tizen.Multimedia /// - /// Gets the frequency in dB. + /// Gets the frequency in the dB. /// public int Frequency { get; } /// - /// Gets the frequency range in dB. + /// Gets the frequency range in the dB. /// public int FrequencyRange { get; } diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/MediaBufferSource.cs b/src/Tizen.Multimedia.MediaPlayer/Player/MediaBufferSource.cs index a8982d4..2785aef 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/MediaBufferSource.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/MediaBufferSource.cs @@ -32,7 +32,7 @@ namespace Tizen.Multimedia private byte[] _buffer; /// - /// Initialize a new instance of the MediaBufferSource class with an allocated buffer. + /// Initializes a new instance of the MediaBufferSource class with an allocated buffer. /// /// The value indicating the size of the buffer. /// @@ -52,23 +52,23 @@ namespace Tizen.Multimedia } /// - /// Initialize a new instance of the MediaBufferSource class from the buffer. + /// Initializes a new instance of the MediaBufferSource class from the buffer. /// /// The source array to be copied into the buffer. - /// buffer is null. + /// is null. public MediaBufferSource(byte[] buffer) : this(buffer, buffer == null ? 0 : buffer.Length) { } //TODO remove default parameter. /// - /// Initialize a new instance of the MediaBufferSource class from the buffer + /// Initializes a new instance of the MediaBufferSource class from the buffer /// with the specified length and the specified offset. /// /// The source array to be copied into the buffer. /// The value indicating the number of bytes to copy from the buffer. /// The value indicating the offset in the buffer of the first byte to copy. - /// buffer is null. + /// is null. /// /// is less than zero.\n /// -or-\n @@ -109,7 +109,7 @@ namespace Tizen.Multimedia } /// - /// Create a MediaBufferSource that wraps a byte array. + /// Creates a MediaBufferSource that wraps a byte array. /// /// The array to be wrapped. /// A MediaBufferSource wrapping the byte array. diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/MediaSource.cs b/src/Tizen.Multimedia.MediaPlayer/Player/MediaSource.cs index fb147b5..8d980ce 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/MediaSource.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/MediaSource.cs @@ -27,13 +27,11 @@ namespace Tizen.Multimedia internal void AttachTo(Player player) { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); OnAttached(player); } internal void DetachFrom(Player player) { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); OnDetached(player); } diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamConfiguration.cs b/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamConfiguration.cs index f7c8abf..c0a6319 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamConfiguration.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamConfiguration.cs @@ -42,7 +42,7 @@ namespace Tizen.Multimedia } /// - /// Occurs when the buffer underrun or overflow. + /// Occurs when the buffer underruns or overflows. /// /// The event handler will be executed on an internal thread. /// @@ -59,9 +59,9 @@ namespace Tizen.Multimedia /// Gets the max size of the buffer. /// /// The max size of the buffer. The default is 200000. - /// If the buffer level over the max size, will be raised with . + /// If the buffer level overflows the max size, will be raised with . /// The is not assigned to a player. - /// value is zero. + /// is zero. /// public ulong BufferMaxSize { @@ -91,12 +91,12 @@ namespace Tizen.Multimedia } /// - /// Gets the min threshold of the buffer or zero if the is not assigned to a player. + /// Gets the minimum threshold of the buffer, or zero if the is not assigned to a player. /// /// The minimum threshold of the buffer in percentage. The default is zero. /// If the buffer level drops below the threshold value, will be raised with . /// The is not assigned to a player. - /// value is greater than 100. + /// is greater than 100. /// public uint BufferMinThreshold { diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamSource.cs b/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamSource.cs index 18e8873..2cb9624 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamSource.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamSource.cs @@ -24,7 +24,7 @@ namespace Tizen.Multimedia { /// - /// Provides the ability to push packets as the source of + /// Provides the ability to push packets as the source of . /// /// The source must be set as a source to a player before pushing. /// @@ -91,7 +91,7 @@ namespace Tizen.Multimedia /// - /// Initialize a new instance of the MediaStreamSource class + /// Initializes a new instance of the MediaStreamSource class /// with the specified and . /// /// The for this source. @@ -120,7 +120,7 @@ namespace Tizen.Multimedia } /// - /// Initialize a new instance of the MediaStreamSource class with the specified . + /// Initializes a new instance of the MediaStreamSource class with the specified . /// /// The for this source. /// AAC is supported. @@ -139,9 +139,9 @@ namespace Tizen.Multimedia AudioConfiguration = CreateAudioConfiguration(audioMediaFormat); } /// - /// Initialize a new instance of the MediaStreamSource class with the specified . + /// Initializes a new instance of the MediaStreamSource class with the specified . /// - /// H.264 can is supported. + /// H.264 is supported. /// The for this source. /// is null. /// is not supported. @@ -159,33 +159,34 @@ namespace Tizen.Multimedia } /// - /// Gets the audio configuration or null if no AudioMediaFormat is specified in the constructor. + /// Gets the audio configuration, or null if no AudioMediaFormat is specified in the constructor. /// public MediaStreamConfiguration AudioConfiguration { get; } /// - /// Gets the video configuration or null if no VideoMediaFormat is specified in the constructor. + /// Gets the video configuration, or null if no VideoMediaFormat is specified in the constructor. /// public MediaStreamConfiguration VideoConfiguration { get; } /// /// Pushes elementary stream to decode audio or video. /// - /// This source must be set as a source to a player and the player must be in the , or state. + /// This source must be set as a source to a player and the player must be in the , + /// , or state. /// The to decode. /// /// This source is not set as a source to a player.\n /// -or-\n /// The player is not in the valid state. /// - /// packet is null. - /// packet has been disposed. + /// is null. + /// has been disposed of. /// /// is neither video nor audio type.\n /// -or-\n /// The format of packet is not matched with the specified format in the constructor. /// - /// the internal buffer reaches limits. + /// The internal buffer has reached its limits. /// /// /// @@ -288,7 +289,7 @@ namespace Tizen.Multimedia } /// - /// Gets the that this source is assigned to as a source or null if this source is not assigned. + /// Gets the that this source is assigned to as a source, or null if this source is not assigned. /// /// public Player Player => _player; diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/MediaUriSource.cs b/src/Tizen.Multimedia.MediaPlayer/Player/MediaUriSource.cs index e4c7d41..40f66d4 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/MediaUriSource.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/MediaUriSource.cs @@ -23,7 +23,7 @@ namespace Tizen.Multimedia /// Represents a media source with a uri. /// /// - /// The internet privilege(http://tizen.org/privilege/internet) must be added if any URLs are used to play from network. + /// The internet privilege(http://tizen.org/privilege/internet) must be added if any URLs are used to play from a network. /// The mediastorage privilege(http://tizen.org/privilege/mediastorage) must be added if any video/audio files are used to play located in the internal storage. /// The externalstorage privilege(http://tizen.org/privilege/externalstorage) must be added if any video/audio files are used to play located in the external storage. /// diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/Player.Events.cs b/src/Tizen.Multimedia.MediaPlayer/Player/Player.Events.cs index a9f0f82..11fee2d 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/Player.Events.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/Player.Events.cs @@ -26,13 +26,13 @@ namespace Tizen.Multimedia public partial class Player { /// - /// Occurs when playback of a media is finished. + /// Occurs when the playback of a media is finished. /// public event EventHandler PlaybackCompleted; private NativePlayer.PlaybackCompletedCallback _playbackCompletedCallback; /// - /// Occurs when playback of a media is interrupted. + /// Occurs when the playback of a media is interrupted. /// public event EventHandler PlaybackInterrupted; private NativePlayer.PlaybackInterruptedCallback _playbackInterruptedCallback; @@ -45,7 +45,7 @@ namespace Tizen.Multimedia private NativePlayer.PlaybackErrorCallback _playbackErrorCallback; /// - /// Occurs when the video stream changed. + /// Occurs when the video stream is changed. /// /// The event handler will be executed on an internal thread. public event EventHandler VideoStreamChanged; diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/Player.Properties.cs b/src/Tizen.Multimedia.MediaPlayer/Player/Player.Properties.cs index f0cb03e..e8219d6 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/Player.Properties.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/Player.Properties.cs @@ -53,7 +53,7 @@ namespace Tizen.Multimedia private string _userAgent = ""; /// - /// Gets or Sets the cookie for streaming playback. + /// Gets or sets the cookie for streaming playback. /// /// To set, the player must be in the state. /// The player is not in the valid state. @@ -83,7 +83,7 @@ namespace Tizen.Multimedia } /// - /// Gets or Sets the user agent for streaming playback. + /// Gets or sets the user agent for streaming playback. /// /// To set, the player must be in the state. /// The player is not in the valid state. @@ -145,7 +145,7 @@ namespace Tizen.Multimedia /// A that specifies the mode. The default is . /// /// If the mode is , - /// audio output interval can be increased so, it can keep more audio data to play. + /// audio output interval can be increased, so it can keep more audio data to play. /// But, state transition like pause or resume can be more slower than default(). /// /// The player has already been disposed of. @@ -284,7 +284,7 @@ namespace Tizen.Multimedia private PlayerTrackInfo _audioTrack; /// - /// Gets the track info for audio. + /// Gets the track info for the audio. /// /// A for audio. public PlayerTrackInfo AudioTrackInfo @@ -302,9 +302,9 @@ namespace Tizen.Multimedia private PlayerTrackInfo _subtitleTrackInfo; /// - /// Gets the track info for subtitle. + /// Gets the track info for the subtitle. /// - /// A for subtitle. + /// A for the subtitle. public PlayerTrackInfo SubtitleTrackInfo { get diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs b/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs index 1992c81..7dd4035 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs @@ -23,18 +23,16 @@ using static Interop; namespace Tizen.Multimedia { - static internal class PlayerLog + internal static class PlayerLog { internal const string Tag = "Tizen.Multimedia.Player"; - internal const string Enter = "[ENTER]"; - internal const string Leave = "[LEAVE]"; } /// /// Provides the ability to control media playback. /// /// - /// The Player provides functions to play a media content. + /// The player provides functions to play a media content. /// It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. /// Note that only one video player can be played at one time. /// @@ -43,7 +41,7 @@ namespace Tizen.Multimedia private PlayerHandle _handle; /// - /// Initialize a new instance of the Player class. + /// Initializes a new instance of the class. /// public Player() { @@ -135,7 +133,7 @@ namespace Tizen.Multimedia #region Methods /// - /// Gets the streaming download Progress. + /// Gets the streaming download progress. /// /// The containing current download progress. /// The player must be in the or state. @@ -147,7 +145,6 @@ namespace Tizen.Multimedia /// The player has already been disposed of. public DownloadProgress GetDownloadProgress() { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); ValidatePlayerState(PlayerState.Playing, PlayerState.Paused); int start = 0; @@ -173,7 +170,6 @@ namespace Tizen.Multimedia /// The path is null. public void SetSubtitle(string path) { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); ValidateNotDisposed(); if (path == null) @@ -193,8 +189,6 @@ namespace Tizen.Multimedia NativePlayer.SetSubtitlePath(Handle, path). ThrowIfFailed("Failed to set the subtitle path to the player"); - - Log.Debug(PlayerLog.Tag, PlayerLog.Leave); } /// @@ -205,12 +199,10 @@ namespace Tizen.Multimedia /// The player is not in the valid state. public void ClearSubtitle() { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); ValidatePlayerState(PlayerState.Idle); NativePlayer.SetSubtitlePath(Handle, null). ThrowIfFailed("Failed to clear the subtitle of the player"); - Log.Debug(PlayerLog.Tag, PlayerLog.Leave); } /// @@ -237,7 +229,6 @@ namespace Tizen.Multimedia } err.ThrowIfFailed("Failed to the subtitle offset of the player"); - Log.Debug(PlayerLog.Tag, PlayerLog.Leave); } private void Prepare() @@ -264,7 +255,6 @@ namespace Tizen.Multimedia /// The player is not in the valid state. public virtual Task PrepareAsync() { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); if (_source == null) { throw new InvalidOperationException("No source is set."); @@ -292,7 +282,6 @@ namespace Tizen.Multimedia completionSource.TrySetException(e); } }); - Log.Debug(PlayerLog.Tag, PlayerLog.Leave); return completionSource.Task; } @@ -301,10 +290,10 @@ namespace Tizen.Multimedia /// Unprepares the player. /// /// - /// The most recently used source is reset and no longer associated with the player. Playback is no longer possible. + /// The most recently used source is reset and is no longer associated with the player. Playback is no longer possible. /// If you want to use the player again, you have to set a source and call again. /// - /// The player must be in the , or state. + /// The player must be in the , , or state. /// It has no effect if the player is already in the state. /// /// @@ -312,7 +301,6 @@ namespace Tizen.Multimedia /// The player is not in the valid state. public virtual void Unprepare() { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); if (State == PlayerState.Idle) { Log.Warn(PlayerLog.Tag, "idle state already"); @@ -353,7 +341,6 @@ namespace Tizen.Multimedia /// public virtual void Start() { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); if (State == PlayerState.Playing) { Log.Warn(PlayerLog.Tag, "playing state already"); @@ -362,11 +349,10 @@ namespace Tizen.Multimedia ValidatePlayerState(PlayerState.Ready, PlayerState.Paused); NativePlayer.Start(Handle).ThrowIfFailed("Failed to start the player"); - Log.Debug(PlayerLog.Tag, PlayerLog.Leave); } /// - /// Stops playing media content. + /// Stops playing the media content. /// /// /// The player must be in the or state. @@ -378,7 +364,6 @@ namespace Tizen.Multimedia /// public virtual void Stop() { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); if (State == PlayerState.Ready) { Log.Warn(PlayerLog.Tag, "ready state already"); @@ -387,7 +372,6 @@ namespace Tizen.Multimedia ValidatePlayerState(PlayerState.Paused, PlayerState.Playing); NativePlayer.Stop(Handle).ThrowIfFailed("Failed to stop the player"); - Log.Debug(PlayerLog.Tag, PlayerLog.Leave); } /// @@ -402,7 +386,6 @@ namespace Tizen.Multimedia /// public virtual void Pause() { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); if (State == PlayerState.Paused) { Log.Warn(PlayerLog.Tag, "pause state already"); @@ -412,7 +395,6 @@ namespace Tizen.Multimedia ValidatePlayerState(PlayerState.Playing); NativePlayer.Pause(Handle).ThrowIfFailed("Failed to pause the player"); - Log.Debug(PlayerLog.Tag, PlayerLog.Leave); } private MediaSource _source; @@ -431,7 +413,6 @@ namespace Tizen.Multimedia /// public void SetSource(MediaSource source) { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); ValidatePlayerState(PlayerState.Idle); if (source != null) @@ -445,11 +426,10 @@ namespace Tizen.Multimedia } _source = source; - Log.Debug(PlayerLog.Tag, PlayerLog.Leave); } /// - /// Captures a video frame asynchronously. + /// Captures a video frame, asynchronously. /// /// A task that represents the asynchronous capture operation. /// http://tizen.org/feature/multimedia.raw_video @@ -459,8 +439,6 @@ namespace Tizen.Multimedia /// The required feature is not supported. public async Task CaptureVideoAsync() { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); - ValidationUtil.ValidateFeatureSupported(Features.RawVideo); ValidatePlayerState(PlayerState.Playing, PlayerState.Paused); @@ -489,13 +467,13 @@ namespace Tizen.Multimedia /// /// Gets the play position in milliseconds. /// - /// The player must be in the , or state. + /// The player must be in the , , + /// or state. /// The player has already been disposed of. /// The player is not in the valid state. /// public int GetPlayPosition() { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); ValidatePlayerState(PlayerState.Ready, PlayerState.Paused, PlayerState.Playing); int playPosition = 0; @@ -511,7 +489,6 @@ namespace Tizen.Multimedia private void SetPlayPosition(int milliseconds, bool accurate, NativePlayer.SeekCompletedCallback cb) { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); var ret = NativePlayer.SetPlayPosition(Handle, milliseconds, accurate, cb, IntPtr.Zero); //Note that we assume invalid param error is returned only when the position value is invalid. @@ -533,7 +510,8 @@ namespace Tizen.Multimedia /// The value indicating a desired position in milliseconds. /// The value indicating whether the operation performs with accuracy. /// - /// The player must be in the , or state. + /// The player must be in the , , + /// or state. /// If the is true, the play position will be adjusted as the specified value, /// but this might be considerably slow. If false, the play position will be a nearest keyframe position. /// @@ -543,7 +521,6 @@ namespace Tizen.Multimedia /// public async Task SetPlayPositionAsync(int position, bool accurate) { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); var taskCompletionSource = new TaskCompletionSource(); @@ -562,16 +539,15 @@ namespace Tizen.Multimedia await taskCompletionSource.Task; } - - Log.Debug(PlayerLog.Tag, PlayerLog.Leave); } /// - /// Sets playback rate. + /// Sets the playback rate. /// /// The value for the playback rate. Valid range is -5.0 to 5.0, inclusive. /// - /// The player must be in the , or state. + /// The player must be in the , , + /// or state. /// The sound will be muted, when the playback rate is under 0.0 or over 2.0. /// /// The player has already been disposed of. @@ -589,7 +565,6 @@ namespace Tizen.Multimedia /// public void SetPlaybackRate(float rate) { - Log.Debug(PlayerLog.Tag, PlayerLog.Enter); if (rate < -5.0F || 5.0F < rate || rate == 0.0F) { throw new ArgumentOutOfRangeException(nameof(rate), rate, "Valid range is -5.0 to 5.0 (except 0.0)"); @@ -598,7 +573,6 @@ namespace Tizen.Multimedia ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); NativePlayer.SetPlaybackRate(Handle, rate).ThrowIfFailed("Failed to set the playback rate."); - Log.Debug(PlayerLog.Tag, PlayerLog.Leave); } /// diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerDisplaySettings.cs b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerDisplaySettings.cs index c661b08..12f2acb 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerDisplaySettings.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerDisplaySettings.cs @@ -52,7 +52,7 @@ namespace Tizen.Multimedia /// /// Operation failed; internal error. /// - /// The player already has been disposed of. + /// The player has already been disposed of. /// The specified value to set is invalid. public PlayerDisplayMode Mode { @@ -79,7 +79,7 @@ namespace Tizen.Multimedia /// /// Operation failed; internal error. /// - /// The player already has been disposed of. + /// The player has already been disposed of. public bool IsVisible { get @@ -103,7 +103,7 @@ namespace Tizen.Multimedia /// /// Operation failed; internal error. /// - /// The player already has been disposed of. + /// The player has already been disposed of. /// The specified value to set is invalid. public Rotation Rotation { @@ -135,8 +135,8 @@ namespace Tizen.Multimedia /// -or-\n /// is not set to . /// - /// The player already has been disposed of. - /// width or height is less than or equal to zero. + /// The player has already been disposed of. + /// The width or the height is less than or equal to zero. public void SetRoi(Rectangle roi) { if (roi.Width <= 0) diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerEnums.cs b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerEnums.cs index e52aaad..cfc5c38 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerEnums.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerEnums.cs @@ -126,7 +126,7 @@ namespace Tizen.Multimedia Paused, /// - /// Preparing in progress. + /// Preparation in progress. /// /// /> Preparing, @@ -141,7 +141,7 @@ namespace Tizen.Multimedia } /// - /// Specifies audio latency modes for . + /// Specifies audio latency modes for . /// /// public enum AudioLatencyMode @@ -163,7 +163,7 @@ namespace Tizen.Multimedia } /// - /// Specifies display modes for + /// Specifies display modes for . /// /// public enum PlayerDisplayMode @@ -189,31 +189,32 @@ namespace Tizen.Multimedia CroppedFull, /// - /// Origin size (if surface size is larger than video size(width/height)) or - /// Letter box (if video size(width/height) is larger than surface size). + /// Original size (if surface size is larger than video size(width/height)) or + /// letter box (if video size(width/height) is larger than surface size). /// OriginalOrFull, /// - /// Region of interest, See . + /// Region of interest. /// + /// Roi } internal enum StreamType { /// - /// Audio element stream type + /// Audio element stream type. /// Audio = 1, /// - /// Video element stream type + /// Video element stream type. /// Video, /// - /// Text type + /// Text type. /// Text } @@ -243,7 +244,7 @@ namespace Tizen.Multimedia public enum PlaybackInterruptionReason { /// - /// Interrupted by a resource conflict and the will be unprepared, automatically. + /// Interrupted by a resource conflict and the will be unprepared automatically. /// ResourceConflict = 4 } diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerErrorOccurredEventArgs.cs b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerErrorOccurredEventArgs.cs index 206133f..7971ed4 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerErrorOccurredEventArgs.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerErrorOccurredEventArgs.cs @@ -25,7 +25,7 @@ namespace Tizen.Multimedia /// /// Initializes a new instance of the PlayerErrorOccurredEventArgs class. /// - /// The value indicating what kind of error occurred. + /// The value indicating the kind of error occurred. public PlayerErrorOccurredEventArgs(PlayerError error) { Error = error; diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerTrackInfo.cs b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerTrackInfo.cs index 459f725..d771fae 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerTrackInfo.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerTrackInfo.cs @@ -21,7 +21,7 @@ using static Interop; namespace Tizen.Multimedia { /// - /// Provides a means to retrieve track information. + /// Provides a means to retrieve the track information. /// /// /// @@ -43,8 +43,11 @@ namespace Tizen.Multimedia /// Gets the number of tracks. /// /// The number of tracks. - /// The that owns this instance must be in the , or state. - /// The that this instance belongs to has been disposed. + /// + /// The that owns this instance must be in the , + /// , or state. + /// + /// The that this instance belongs to has been disposed of. /// The that this instance belongs to is not in the valid state. public int GetCount() { @@ -58,14 +61,15 @@ namespace Tizen.Multimedia } /// - /// Gets the language code for the specified index or null if the language is undefined. + /// Gets the language code for the specified index, or null if the language is undefined. /// /// The number of tracks. /// - /// The that owns this instance must be in the , or state. + /// The that owns this instance must be in the , + /// , or state. /// The language codes are defined in ISO 639-1. /// - /// The that this instance belongs to has been disposed. + /// The that this instance belongs to has been disposed of. /// The that this instance belongs to is not in the valid state. /// /// is less than zero.\n @@ -110,8 +114,11 @@ namespace Tizen.Multimedia /// Gets or sets the selected track index. /// /// The currently selected track index. - /// The that owns this instance must be in the , or state. - /// The that this instance belongs to has been disposed. + /// + /// The that owns this instance must be in the , + /// , or state. + /// + /// The that this instance belongs to has been disposed of. /// The that this instance belongs to is not in the valid state. /// /// is less than zero.\n diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/StreamInfo.cs b/src/Tizen.Multimedia.MediaPlayer/Player/StreamInfo.cs index b31fb41..b82ba0c 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/StreamInfo.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/StreamInfo.cs @@ -20,12 +20,12 @@ using static Interop; namespace Tizen.Multimedia { /// - /// Represents properties for audio stream. + /// Represents properties for the audio stream. /// public struct AudioStreamProperties { /// - /// Initialize a new instance of the AudioStreamProperties struct with the specified sample rate, channels and bit rate. + /// Initializes a new instance of the AudioStreamProperties struct with the specified sample rate, channels, and bit rate. /// /// The sample rate of the stream. /// The number of channels of the stream. @@ -76,12 +76,12 @@ namespace Tizen.Multimedia } /// - /// Represents properties for video stream. + /// Represents properties for the video stream. /// public struct VideoStreamProperties { /// - /// Initialize a new instance of the VideoStreamProperties struct with the specified fps, bit rate and size. + /// Initializes a new instance of the VideoStreamProperties struct with the specified fps, bit rate, and size. /// /// The fps of the stream. /// The bit rate of the stream. @@ -95,7 +95,7 @@ namespace Tizen.Multimedia ", width : " + size.Width + ", height : " + size.Height); } /// - /// Initialize a new instance of the VideoStreamProperties struct with the specified fps, bit rate, width and height. + /// Initializes a new instance of the VideoStreamProperties struct with the specified fps, bit rate, width, and height. /// /// The fps of the stream. /// The bit rate of the stream. @@ -157,12 +157,19 @@ namespace Tizen.Multimedia } /// - /// Retrieves the album art of the stream or null if there is no album art data. + /// Retrieves the album art of the stream, or null if there is no album art data. /// /// Raw byte array if album art exists; otherwise null. - /// The that owns this instance must be in the , or state. - /// The that this instance belongs to has been disposed. - /// The that this instance belongs to is not in the valid state. + /// + /// The that owns this instance must be in the , + /// , or state. + /// + /// + /// The that this instance belongs to has been disposed of. + /// + /// + /// The that this instance belongs to is not in the valid state. + /// public byte[] GetAlbumArt() { Player.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); @@ -211,18 +218,18 @@ namespace Tizen.Multimedia } /// - /// Retrieves the codec name of audio or null if there is no audio. + /// Retrieves the codec name of the audio or null if there is no audio. /// - /// A string that represents codec name. + /// A string that represents the codec name. public string GetAudioCodec() { return GetCodecInfo(true); } /// - /// Retrieves the codec name of video or null if there is no video. + /// Retrieves the codec name of the video or null if there is no video. /// - /// A string that represents codec name. + /// A string that represents the codec name. public string GetVideoCodec() { return GetCodecInfo(false); @@ -232,9 +239,16 @@ namespace Tizen.Multimedia /// Gets the duration. /// /// The duration of the stream. - /// The that owns this instance must be in the , or state. - /// The that this instance belongs to has been disposed. - /// The that this instance belongs to is not in the valid state. + /// + /// The that owns this instance must be in the , + /// , or state. + /// + /// + /// The that this instance belongs to has been disposed of. + /// + /// + /// The that this instance belongs to is not in the valid state. + /// public int GetDuration() { Player.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); @@ -248,12 +262,19 @@ namespace Tizen.Multimedia } /// - /// Gets the properties of audio. + /// Gets the properties of the audio. /// - /// A that contains audio stream information. - /// The that owns this instance must be in the , or state. - /// The that this instance belongs to has been disposed. - /// The that this instance belongs to is not in the valid state. + /// A that contains the audio stream information. + /// + /// The that owns this instance must be in the , + /// , or state. + /// + /// + /// The that this instance belongs to has been disposed of. + /// + /// + /// The that this instance belongs to is not in the valid state. + /// public AudioStreamProperties GetAudioProperties() { Player.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); @@ -265,18 +286,23 @@ namespace Tizen.Multimedia NativePlayer.GetAudioStreamInfo(Player.Handle, out sampleRate, out channels, out bitRate). ThrowIfFailed("Failed to get audio stream info"); - // TODO should we check value is zero and return null? - return new AudioStreamProperties(sampleRate, channels, bitRate); } /// - /// Gets the properties of video. + /// Gets the properties of the video. /// - /// A that contains video stream information. - /// The that owns this instance must be in the , or state. - /// The that this instance belongs to has been disposed. - /// The that this instance belongs to is not in the valid state. + /// A that contains the video stream information. + /// + /// The that owns this instance must be in the , + /// , or state. + /// + /// + /// The that this instance belongs to has been disposed of. + /// + /// + /// The that this instance belongs to is not in the valid state. + /// public VideoStreamProperties GetVideoProperties() { Player.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); @@ -287,8 +313,6 @@ namespace Tizen.Multimedia NativePlayer.GetVideoStreamInfo(Player.Handle, out fps, out bitRate). ThrowIfFailed("Failed to get the video stream info"); - // TODO should we check value is zero and return null? - return new VideoStreamProperties(fps, bitRate, GetVideoSize()); } @@ -310,9 +334,15 @@ namespace Tizen.Multimedia /// /// A string that represents the value of the specified key. /// The key to query. - /// The that owns this instance must be in the , or state. - /// The that this instance belongs to has been disposed. - /// The that this instance belongs to is not in the valid state. + /// + /// The that owns this instance must be in the , + /// , or state. + /// + /// The that this instance belongs to has been disposed of. + /// + /// + /// The that this instance belongs to is not in the valid state. + /// public string GetMetadata(StreamMetadataKey key) { Player.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/VideoStreamChangedEventArgs.cs b/src/Tizen.Multimedia.MediaPlayer/Player/VideoStreamChangedEventArgs.cs index 327a565..40ca485 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/VideoStreamChangedEventArgs.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/VideoStreamChangedEventArgs.cs @@ -33,17 +33,17 @@ namespace Tizen.Multimedia } /// - /// Gets the of new video. + /// Gets the of the new video. /// public Size Size { get; } /// - /// Gets the fps of new video + /// Gets the fps of the new video /// public int Fps { get; } /// - /// Gets the bit rate of new video. + /// Gets the bit rate of the new video. /// public int BitRate { get; } diff --git a/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditor.cs b/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditor.cs index aeda76e..9510cb3 100755 --- a/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditor.cs +++ b/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditor.cs @@ -24,9 +24,9 @@ namespace Tizen.Multimedia /// Provides a means to edit the metadata of the media file. /// /// - /// If you want to access only internal storage, + /// If you want to access only an internal storage, /// you should add privilege http://tizen.org/privilege/mediastorage. \n - /// Or if you want to access only external storage, + /// Or if you want to access only an external storage, /// you should add privilege http://tizen.org/privilege/externalstorage. \n /// public class MetadataEditor : IDisposable @@ -52,12 +52,12 @@ namespace Tizen.Multimedia /// Initializes a new instance of the class with the specified path. /// /// 3 - /// The path of the media file to edit metadata. + /// The path of the media file to edit the metadata. /// is null. /// is a zero-length string, contains only white space. /// The file is not supported. - /// File does not exist. - /// Caller does not have required privilege to access the file. + /// The file does not exist. + /// The caller does not have required privilege to access the file. public MetadataEditor(string path) { if (path == null) @@ -117,7 +117,7 @@ namespace Tizen.Multimedia /// /// 3 /// The file is read-only. - /// The has already been disposed. + /// The has already been disposed of. public string Artist { get @@ -136,7 +136,7 @@ namespace Tizen.Multimedia /// /// 3 /// The file is read-only. - /// The has already been disposed. + /// The has already been disposed of. public string Title { get @@ -155,7 +155,7 @@ namespace Tizen.Multimedia /// /// 3 /// The file is read-only. - /// The has already been disposed. + /// The has already been disposed of. public string Album { get @@ -174,7 +174,7 @@ namespace Tizen.Multimedia /// /// 3 /// The file is read-only. - /// The has already been disposed. + /// The has already been disposed of. public string Genre { get @@ -193,7 +193,7 @@ namespace Tizen.Multimedia /// /// 3 /// The file is read-only. - /// The has already been disposed. + /// The has already been disposed of. public string Author { get @@ -212,7 +212,7 @@ namespace Tizen.Multimedia /// /// 3 /// The file is read-only. - /// The has already been disposed. + /// The has already been disposed of. public string Copyright { get @@ -231,11 +231,11 @@ namespace Tizen.Multimedia /// /// 3 /// - /// If the media contains ID3 tag, this refers to the recorded date. - /// If the media is a mp4 format, this refers to the year and the value to set will be converted into integer. + /// If the media contains the ID3 tag, this refers to the recorded date. + /// If the media is a mp4 format, this refers to the year, and the value to set will be converted into integer. /// /// The file is read-only. - /// The has already been disposed. + /// The has already been disposed of. public string Date { get @@ -254,7 +254,7 @@ namespace Tizen.Multimedia /// /// 3 /// The file is read-only. - /// The has already been disposed. + /// The has already been disposed of. public string Description { get @@ -273,7 +273,7 @@ namespace Tizen.Multimedia /// /// 3 /// The file is read-only. - /// The has already been disposed. + /// The has already been disposed of. public string Comment { get @@ -292,7 +292,7 @@ namespace Tizen.Multimedia /// /// 3 /// The file is read-only. - /// The has already been disposed. + /// The has already been disposed of. public string TrackNumber { get @@ -310,7 +310,7 @@ namespace Tizen.Multimedia /// Gets the count of album arts of media. /// /// 3 - /// The has already been disposed. + /// The has already been disposed of. public int PictureCount { get => int.TryParse(GetParam(MetadataEditorAttr.PictureCount), out var value) ? value : 0; @@ -321,7 +321,7 @@ namespace Tizen.Multimedia /// /// 3 /// The file is read-only. - /// The has already been disposed. + /// The has already been disposed of. public string Conductor { get @@ -340,7 +340,7 @@ namespace Tizen.Multimedia /// /// 3 /// The file is read-only. - /// The has already been disposed. + /// The has already been disposed of. public string UnsyncLyrics { get @@ -362,7 +362,7 @@ namespace Tizen.Multimedia /// -or-\n /// The file is read-only. /// - /// The has already been disposed. + /// The has already been disposed of. public void Commit() { if (_isFileReadOnly) @@ -377,16 +377,15 @@ namespace Tizen.Multimedia /// Gets the artwork image in the media file. /// /// 3 - /// The index of picture to import. - /// Artwork included in the media file. - /// Artwork included in the media file. + /// The index of the picture to import. + /// The artwork included in the media file. /// An internal error occurs. /// /// is less than zero.\n /// -or-\n /// is greater than or equal to .\n /// - /// The has already been disposed. + /// The has already been disposed of. public Artwork GetPicture(int index) { if (index < 0) @@ -437,16 +436,16 @@ namespace Tizen.Multimedia /// Appends the picture to the media file. /// /// 3 - /// The path of picture for adding to the metadata. + /// The path of the picture for adding to the metadata. /// /// An internal error occurs.\n /// -or-\n /// The media file is read-only. /// - /// Picture path is null - /// File does not exist. - /// Caller does not have required privilege to access the file. - /// The has already been disposed. + /// is null + /// The file does not exist. + /// The caller does not have required privilege to access the file. + /// The has already been disposed of. /// The specified file is not supported. public void AddPicture(string path) { @@ -473,7 +472,7 @@ namespace Tizen.Multimedia /// Removes the picture from the media file. /// /// 3 - /// The index of picture to remove. + /// The index of the picture to remove. /// /// An internal error occurs.\n /// -or-\n @@ -484,7 +483,7 @@ namespace Tizen.Multimedia /// -or-\n /// is greater than or equal to .\n /// - /// The has already been disposed. + /// The has already been disposed of. public void RemovePicture(int index) { if (index < 0) diff --git a/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditorError.cs b/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditorError.cs index 4459d60..7ae1680 100644 --- a/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditorError.cs +++ b/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditorError.cs @@ -21,7 +21,7 @@ using Tizen.Internals.Errors; namespace Tizen.Multimedia { /// - /// Enumeration for metadata extractor's error codes. + /// Enumeration for the metadata extractor's error codes. /// internal enum MetadataEditorError { diff --git a/src/Tizen.Multimedia.Metadata/MetadataExtractor/Artwork.cs b/src/Tizen.Multimedia.Metadata/MetadataExtractor/Artwork.cs index d5a83a7..38afe72 100755 --- a/src/Tizen.Multimedia.Metadata/MetadataExtractor/Artwork.cs +++ b/src/Tizen.Multimedia.Metadata/MetadataExtractor/Artwork.cs @@ -17,15 +17,15 @@ namespace Tizen.Multimedia { /// - /// Represents artwork information of media. + /// Represents the artwork information of the media. /// public class Artwork { /// - /// Initializes a new instance of the Artwork class with the specified data and mime type. + /// Initializes a new instance of the Artwork class with the specified data and the mime type. /// /// 3 - /// The data of the artwork to set metadata. + /// The data of the artwork to set the metadata. /// The mime type of the data of the artwork. public Artwork(byte[] data, string mimeType) { @@ -40,7 +40,7 @@ namespace Tizen.Multimedia public byte[] Data { get; } /// - /// Gets the mime type of artwork. + /// Gets the mime type of the artwork. /// /// 3 public string MimeType { get; } diff --git a/src/Tizen.Multimedia.Metadata/MetadataExtractor/Metadata.cs b/src/Tizen.Multimedia.Metadata/MetadataExtractor/Metadata.cs index 4efafa1..11b33af 100755 --- a/src/Tizen.Multimedia.Metadata/MetadataExtractor/Metadata.cs +++ b/src/Tizen.Multimedia.Metadata/MetadataExtractor/Metadata.cs @@ -21,7 +21,7 @@ using static Interop.MetadataExtractor; namespace Tizen.Multimedia { /// - /// Represents video metadata information. + /// Represents the video metadata information. /// public class VideoMetadata { @@ -55,7 +55,7 @@ namespace Tizen.Multimedia public int? BitRate { get; } /// - /// Gets the video FPS. + /// Gets the video fps. /// /// 3 /// The fps value, or null if the information does not exist. @@ -76,7 +76,7 @@ namespace Tizen.Multimedia public int? Height { get; } /// - /// Get the codec type of the video. + /// Gets the codec type of the video. /// /// 3 /// A string representing the codec type, or null if the information does not exist. @@ -99,7 +99,7 @@ namespace Tizen.Multimedia } /// - /// Represents audio metadata information. + /// Represents the audio metadata information. /// public class AudioMetadata { @@ -175,7 +175,7 @@ namespace Tizen.Multimedia } /// - /// Represents metadata information of a media. + /// Represents the metadata information of a media. /// public class Metadata { diff --git a/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractor.cs b/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractor.cs index bc3514c..3086a9b 100755 --- a/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractor.cs +++ b/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractor.cs @@ -15,6 +15,7 @@ */ using System; +using System.IO; using System.Runtime.InteropServices; namespace Tizen.Multimedia @@ -25,7 +26,7 @@ namespace Tizen.Multimedia } /// - /// Provides a set of functions to get the metadata from a media file. + /// Provides a means to get the metadata from a media file. /// public class MetadataExtractor : IDisposable { @@ -55,9 +56,9 @@ namespace Tizen.Multimedia /// Initializes a new instance of the MetadataExtractor class with the specified path. /// /// 3 - /// The path for the file to extract metadata. + /// The path for the file to extract the metadata. /// is null. - /// is not exist. + /// does not exist. public MetadataExtractor(string path) { if (path == null) @@ -72,7 +73,7 @@ namespace Tizen.Multimedia /// Initializes a new instance of the MetadataExtractor class with the specified buffer. /// /// 3 - /// The buffer to extract metadata. + /// The buffer to extract the metadata. /// is null. /// The length of is zero. public MetadataExtractor(byte[] buffer) @@ -120,8 +121,8 @@ namespace Tizen.Multimedia /// Retrieves the . /// /// 3 - /// A for the given source. - /// Internal process error is occurred. + /// The for the given source. + /// An internal process error occurs. /// The has been already disposed of. public Metadata GetMetadata() { @@ -137,8 +138,8 @@ namespace Tizen.Multimedia /// Gets the artwork image in the source. /// /// 3 - /// A if it exists, otherwise null. - /// Internal process error is occurred. + /// The if it exists, otherwise null. + /// An internal process error occurs. /// The has been already disposed of. public Artwork GetArtwork() { @@ -174,8 +175,8 @@ namespace Tizen.Multimedia /// /// 3 /// The index of lyrics to retrieve. - /// A object if is valid, otherwise null. - /// Internal process error is occurred. + /// The object if is valid, otherwise null. + /// An internal process error occurs. /// The has been already disposed of. public SyncLyrics GetSyncLyrics(int index) { @@ -206,7 +207,7 @@ namespace Tizen.Multimedia /// /// 3 /// The raw thumbnail data in RGB888 if it exists, otherwise null. - /// Internal process error is occurred. + /// An internal process error occurs. /// The has been already disposed of. public byte[] GetVideoThumbnail() { @@ -272,10 +273,6 @@ namespace Tizen.Multimedia } } - /// - /// Metadata Extractor destructor - /// - /// 3 ~MetadataExtractor() { Dispose(false); diff --git a/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractorError.cs b/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractorError.cs index 36d40a2..71c8bca 100644 --- a/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractorError.cs +++ b/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractorError.cs @@ -21,7 +21,7 @@ using Tizen.Internals.Errors; namespace Tizen.Multimedia { /// - /// Enumeration for metadata extractor's error codes. + /// Enumeration for the metadata extractor's error codes. /// internal enum MetadataExtractorError { diff --git a/src/Tizen.Multimedia.Metadata/MetadataExtractor/SyncLyrics.cs b/src/Tizen.Multimedia.Metadata/MetadataExtractor/SyncLyrics.cs index 3081964..77f1bdf 100755 --- a/src/Tizen.Multimedia.Metadata/MetadataExtractor/SyncLyrics.cs +++ b/src/Tizen.Multimedia.Metadata/MetadataExtractor/SyncLyrics.cs @@ -17,12 +17,12 @@ namespace Tizen.Multimedia { /// - /// Represents synchronized lyrics information of media. + /// Represents the synchronized lyrics information of the media. /// public class SyncLyrics { /// - /// Initialize a new instance of the MetadataExtractor class with the specified lyrics and timestamp. + /// Initializes a new instance of the MetadataExtractor class with the specified lyrics and the timestamp. /// /// 3 /// The text of synchronized lyrics. diff --git a/src/Tizen.Multimedia.Radio/Radio/Radio.cs b/src/Tizen.Multimedia.Radio/Radio/Radio.cs old mode 100644 new mode 100755 index 521eb50..20d70fd --- a/src/Tizen.Multimedia.Radio/Radio/Radio.cs +++ b/src/Tizen.Multimedia.Radio/Radio/Radio.cs @@ -32,9 +32,9 @@ namespace Tizen.Multimedia private const string FeatureFmRadio = "http://tizen.org/feature/fmradio"; /// - /// Initialize a new instance of the Radio class. + /// Initializes a new instance of the Radio class. /// - /// Radio feature is not supported + /// The radio feature is not supported. public Radio() { ValidateFeatureSupported(FeatureFmRadio); @@ -66,22 +66,22 @@ namespace Tizen.Multimedia } /// - /// Occurs when radio scan information is updated. + /// Occurs when the radio scanning information is updated. /// public event EventHandler ScanUpdated; /// - /// Occurs when radio scanning stops. + /// Occurs when the radio scanning stops. /// public event EventHandler ScanStopped; /// - /// Occurs when radio scan is completed. + /// Occurs when the radio scanning is completed. /// public event EventHandler ScanCompleted; /// - /// Occurs when radio is interrupted + /// Occurs when the radio is interrupted. /// public event EventHandler Interrupted; @@ -99,7 +99,7 @@ namespace Tizen.Multimedia } /// - /// Gets or sets the radio frequency, in [87500 ~ 108000] (kHz). + /// Gets or sets the radio frequency in the range of 87500 ~ 108000 kHz. /// /// /// is less than of .\n @@ -126,7 +126,7 @@ namespace Tizen.Multimedia } /// - /// Gets the current signal strength, in [-128 ~ 128] (dBm). + /// Gets the current signal strength in the range of -128 ~ 128 dBm. /// public int SignalStrength { @@ -139,7 +139,7 @@ namespace Tizen.Multimedia } /// - /// Gets the value indicating if radio is muted. + /// Gets the value indicating if the radio is muted. /// /// /// true if the radio is muted; otherwise, false. @@ -160,7 +160,7 @@ namespace Tizen.Multimedia } /// - /// Gets the channel spacing for current region. + /// Gets the channel spacing for the current region. /// public int ChannelSpacing { @@ -203,7 +203,7 @@ namespace Tizen.Multimedia } /// - /// Gets the frequency for the region, in [87500 ~ 108000] (kHz). + /// Gets the frequency for the region in the range of 87500 ~ 108000 kHz. /// public Range FrequencyRange { @@ -242,7 +242,7 @@ namespace Tizen.Multimedia } /// - /// Starts radio scan, will trigger ScanInformationUpdated event, when scan information is updated + /// Starts the radio scanning and triggers the ScanInformationUpdated event when the scan information is updated. /// /// The radio must be in the or state. /// The radio is not in the valid state. @@ -256,7 +256,7 @@ namespace Tizen.Multimedia } /// - /// Stops radio scan. + /// Stops the radio scanning. /// /// The radio must be in the state. /// The radio is not in the valid state. @@ -273,7 +273,7 @@ namespace Tizen.Multimedia /// /// /// A task that represents the asynchronous seeking operation. - /// The result value is the current frequency, in range [87500 ~ 108000] (kHz). + /// The result value is the current frequency in the range of 87500 ~ 108000 kHz. /// It can be -1 if the seeking operation has failed. /// /// The radio must be in the state. @@ -297,7 +297,7 @@ namespace Tizen.Multimedia /// /// /// A task that represents the asynchronous seeking operation. - /// The result value is the current frequency, in range [87500 ~ 108000] (kHz). + /// The result value is the current frequency in the range of 87500 ~ 108000 kHz. /// It can be -1 if the seeking operation has failed. /// /// The radio must be in the state. @@ -319,7 +319,7 @@ namespace Tizen.Multimedia private void ValidateFeatureSupported(string featurePath) { bool supported = false; - SystemInfo.TryGetValue(featurePath, out supported); + Information.TryGetValue(featurePath, out supported); if (supported == false) { diff --git a/src/Tizen.Multimedia.Recorder/Recorder/RecorderInterruptedEventArgs.cs b/src/Tizen.Multimedia.Recorder/Recorder/RecorderInterruptedEventArgs.cs index 86be713..cae1329 100755 --- a/src/Tizen.Multimedia.Recorder/Recorder/RecorderInterruptedEventArgs.cs +++ b/src/Tizen.Multimedia.Recorder/Recorder/RecorderInterruptedEventArgs.cs @@ -31,7 +31,7 @@ namespace Tizen.Multimedia } /// - /// Gets the policy that interrupted the recorder. + /// Gets the reason that interrupted the recorder. /// public RecorderPolicy Reason { get; } diff --git a/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerManager.cs b/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerManager.cs index a8f6c5a..78a0e06 100644 --- a/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerManager.cs +++ b/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerManager.cs @@ -52,7 +52,7 @@ namespace Tizen.Multimedia.Remoting /// /// http://tizen.org/privilege/mediacontroller.client /// An internal error occurs. - /// Caller does not have required privilege. + /// The caller does not have required privilege. public MediaControllerManager() { Native.Create(out _handle).ThrowIfError("Failed to create media controller client."); diff --git a/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerRepeatMode.cs b/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerRepeatMode.cs index 5bcd5c8..1ac0dc8 100644 --- a/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerRepeatMode.cs +++ b/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerRepeatMode.cs @@ -16,9 +16,19 @@ namespace Tizen.Multimedia.Remoting { + /// + /// Specifies the repeat mode. + /// public enum MediaControlRepeatMode { + /// + /// Off. + /// Off, + + /// + /// On. + /// On, } } \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/ScreenMirroring/EventArgs.cs b/src/Tizen.Multimedia.Remoting/ScreenMirroring/EventArgs.cs index 47fde2b..e1d8bf3 100644 --- a/src/Tizen.Multimedia.Remoting/ScreenMirroring/EventArgs.cs +++ b/src/Tizen.Multimedia.Remoting/ScreenMirroring/EventArgs.cs @@ -29,7 +29,7 @@ namespace Tizen.Multimedia.Remoting } /// - /// Gets the current state of screen mirroring. + /// Gets the current state of the screen mirroring. /// public ScreenMirroringState State { get; } } diff --git a/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringEnums.cs b/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringEnums.cs index 91a4e9f..0bed78d 100644 --- a/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringEnums.cs +++ b/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringEnums.cs @@ -19,47 +19,47 @@ using System; namespace Tizen.Multimedia.Remoting { /// - /// Specifies audio codecs for . + /// Specifies the audio codecs for . /// /// public enum ScreenMirroringAudioCodec { /// - /// Screen mirroring is not negotiated yet. + /// The screen mirroring is not negotiated yet. /// None, /// - /// AAC codec for audio. + /// AAC codec. /// Aac, /// - /// AC3 codec for audio. + /// AC3 codec. /// Ac3, /// - /// LPCM codec for audio. + /// LPCM codec. /// Lpcm } /// - /// Specifies video codecs for . + /// Specifies the video codecs for . /// /// public enum ScreenMirroringVideoCodec { /// - /// Screen mirroring is not negotiated yet. + /// The screen mirroring is not negotiated yet. /// None, /// - /// H.264 codec for video. + /// H.264 codec. /// H264 } /// - /// Specifies available combinations of resolutions and fps for . + /// Specifies the available combinations of resolutions and fps for . /// [Flags] public enum ScreenMirroringResolutions @@ -136,7 +136,7 @@ namespace Tizen.Multimedia.Remoting } /// - /// Specifies errors for . + /// Specifies the errors for . /// public enum ScreenMirroringError { diff --git a/src/Tizen.Multimedia.Util/ImageUtil/BitmapFrame.cs b/src/Tizen.Multimedia.Util/ImageUtil/BitmapFrame.cs index d964786..0a48598 100644 --- a/src/Tizen.Multimedia.Util/ImageUtil/BitmapFrame.cs +++ b/src/Tizen.Multimedia.Util/ImageUtil/BitmapFrame.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; namespace Tizen.Multimedia.Util { /// - /// Represents image data returned by a decoder class. + /// Represents the image data returned by a decoder class. /// public class BitmapFrame { diff --git a/src/Tizen.Multimedia.Util/ImageUtil/GifFrame.cs b/src/Tizen.Multimedia.Util/ImageUtil/GifFrame.cs index 48a8896..6649e29 100644 --- a/src/Tizen.Multimedia.Util/ImageUtil/GifFrame.cs +++ b/src/Tizen.Multimedia.Util/ImageUtil/GifFrame.cs @@ -19,13 +19,13 @@ using System; namespace Tizen.Multimedia.Util { /// - /// Represent gif image data used to encode a gif image with . + /// Represents the gif image data used to encode a gif image with . /// public class GifFrame { /// - /// Initialize a new instance of the class with a buffer and a delay. + /// Initializes a new instance of the class with a buffer and a delay. /// /// The raw image buffer to be encoded. /// The delay for this image, in 0.001 sec units. diff --git a/src/Tizen.Multimedia.Util/ImageUtil/ImageColorSpace.cs b/src/Tizen.Multimedia.Util/ImageUtil/ImageColorSpace.cs index 0572e09..8c3fd1b 100644 --- a/src/Tizen.Multimedia.Util/ImageUtil/ImageColorSpace.cs +++ b/src/Tizen.Multimedia.Util/ImageUtil/ImageColorSpace.cs @@ -22,63 +22,63 @@ namespace Tizen.Multimedia.Util internal enum ImageColorSpace { /// - /// YV12 - YCrCb planar format + /// YV12 - YCrCb planar format. /// YV12, /// - /// YUV422 - planar + /// YUV422 - planar. /// Yuv422, /// - /// YUV420 - planar + /// YUV420 - planar. /// I420, /// - /// NV12- planar + /// NV12- planar. /// NV12, /// - /// UYVY - packed + /// UYVY - packed. /// Uyvy, /// - /// YUYV - packed + /// YUYV - packed. /// Yuyv, /// - /// RGB565, high-byte is Blue + /// RGB565, high-byte is blue. /// Rgb565, /// - /// RGB888, high-byte is Blue + /// RGB888, high-byte is blue. /// Rgb888, /// - /// ARGB8888, high-byte is Blue + /// ARGB8888, high-byte is blue. /// Argb8888, /// - /// BGRA8888, high-byte is Alpha + /// BGRA8888, high-byte is alpha. /// Bgra8888, /// - /// RGBA8888, high-byte is Alpha + /// RGBA8888, high-byte is alpha. /// Rgba8888, /// - /// BGRX8888, high-byte is X + /// BGRX8888, high-byte is X. /// Bgrx8888, /// - /// NV21- planar + /// NV21- planar. /// NV21, /// - /// NV16- planar + /// NV16- planar. /// NV16, /// - /// NV61- planar + /// NV61- planar. /// NV61, } diff --git a/src/Tizen.Multimedia.Util/ImageUtil/ImageDecoder.cs b/src/Tizen.Multimedia.Util/ImageUtil/ImageDecoder.cs index 891faaa..fcf1cab 100644 --- a/src/Tizen.Multimedia.Util/ImageUtil/ImageDecoder.cs +++ b/src/Tizen.Multimedia.Util/ImageUtil/ImageDecoder.cs @@ -83,13 +83,13 @@ namespace Tizen.Multimedia.Util /// /// Decodes an image from the specified file. /// - /// Input file path from which to decode. + /// The input file path from which to decode. /// A task that represents the asynchronous decoding operation. /// /// Only Graphics Interchange Format(GIF) codec returns more than one frame.\n /// \n - /// http://tizen.org/privilege/mediastorage is needed if is relevant to media storage.\n - /// http://tizen.org/privilege/externalstorage is needed if is relevant to external storage. + /// http://tizen.org/privilege/mediastorage is needed if is relevant to the media storage.\n + /// http://tizen.org/privilege/externalstorage is needed if is relevant to the external storage. /// /// is null. /// @@ -100,7 +100,7 @@ namespace Tizen.Multimedia.Util /// The format of is not . /// /// does not exists. - /// Caller does not have required permission to access the path. + /// The caller does not have required permission to access the path. /// The format of is not . /// The has already been disposed of. public async Task> DecodeAsync(string inputFilePath) @@ -284,7 +284,7 @@ namespace Tizen.Multimedia.Util private static readonly byte[] _header = { (byte)'B', (byte)'M' }; /// - /// Initialize a new instance of the class. + /// Initializes a new instance of the class. /// /// will be the . public BmpDecoder() : base(ImageFormat.Bmp) @@ -295,14 +295,14 @@ namespace Tizen.Multimedia.Util } /// - /// Provides the ability to decode Portable Network Graphics (PNG) encoded images. + /// Provides the ability to decode the Portable Network Graphics (PNG) encoded images. /// public class PngDecoder : ImageDecoder { private static readonly byte[] _header = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a }; /// - /// Initialize a new instance of the class. + /// Initializes a new instance of the class. /// /// will be the . public PngDecoder() : base(ImageFormat.Png) @@ -313,7 +313,7 @@ namespace Tizen.Multimedia.Util } /// - /// Provides the ability to decode Joint Photographic Experts Group (JPEG) encoded images. + /// Provides the ability to decode the Joint Photographic Experts Group (JPEG) encoded images. /// public class JpegDecoder : ImageDecoder { @@ -327,7 +327,7 @@ namespace Tizen.Multimedia.Util private JpegDownscale _jpegDownscale = DefaultJpegDownscale; /// - /// Initialize a new instance of the class. + /// Initializes a new instance of the class. /// /// will be the . public JpegDecoder() : base(ImageFormat.Jpeg) @@ -363,14 +363,14 @@ namespace Tizen.Multimedia.Util } /// - /// Provides the ability to decode Graphics Interchange Format (GIF) encoded images. + /// Provides the ability to decode the Graphics Interchange Format (GIF) encoded images. /// public class GifDecoder : ImageDecoder { private static readonly byte[] _header = { (byte)'G', (byte)'I', (byte)'F' }; /// - /// Initialize a new instance of the class. + /// Initializes a new instance of the class. /// /// will be the . public GifDecoder() : base(ImageFormat.Gif) diff --git a/src/Tizen.Multimedia.Util/ImageUtil/ImageEncoder.cs b/src/Tizen.Multimedia.Util/ImageUtil/ImageEncoder.cs index d4b8f83..23863a1 100644 --- a/src/Tizen.Multimedia.Util/ImageUtil/ImageEncoder.cs +++ b/src/Tizen.Multimedia.Util/ImageUtil/ImageEncoder.cs @@ -244,12 +244,12 @@ namespace Tizen.Multimedia.Util } /// - /// Provides the ability to encode Bitmap (BMP) format images. + /// Provides the ability to encode the Bitmap (BMP) format images. /// public class BmpEncoder : ImageEncoder { /// - /// Initialize a new instance of the class. + /// Initializes a new instance of the class. /// /// will be the . public BmpEncoder() : base(ImageFormat.Bmp) @@ -262,7 +262,7 @@ namespace Tizen.Multimedia.Util } /// - /// Provides the ability to encode Portable Network Graphics (PNG) format images. + /// Provides the ability to encode the Portable Network Graphics (PNG) format images. /// public class PngEncoder : ImageEncoder { @@ -274,7 +274,7 @@ namespace Tizen.Multimedia.Util private PngCompression? _compression; /// - /// Initialize a new instance of the class. + /// Initializes a new instance of the class. /// /// will be the . public PngEncoder() : @@ -283,7 +283,7 @@ namespace Tizen.Multimedia.Util } /// - /// Initialize a new instance of the class with . + /// Initializes a new instance of the class with . /// /// will be the . /// The compression level of the encoder. @@ -321,7 +321,7 @@ namespace Tizen.Multimedia.Util } /// - /// Provides the ability to encode Joint Photographic Experts Group (JPEG) format images. + /// Provides the ability to encode the Joint Photographic Experts Group (JPEG) format images. /// public class JpegEncoder : ImageEncoder { @@ -333,7 +333,7 @@ namespace Tizen.Multimedia.Util private int? _quality; /// - /// Initialize a new instance of the class. + /// Initializes a new instance of the class. /// /// will be the . public JpegEncoder() : base(ImageFormat.Jpeg) @@ -342,7 +342,7 @@ namespace Tizen.Multimedia.Util /// - /// Initialize a new instance of the class with initial quality value. + /// Initializes a new instance of the class with initial quality value. /// /// The quality for JPEG image encoding; from 1(lowest quality) to 100(highest quality). /// will be the . @@ -394,14 +394,14 @@ namespace Tizen.Multimedia.Util } /// - /// Provides the ability to encode Graphics Interchange Format (GIF) format images. + /// Provides the ability to encode the Graphics Interchange Format (GIF) format images. /// public class GifEncoder : ImageEncoder { /// - /// Initialize a new instance of the class. - /// - /// will be the . + /// Initializes a new instance of the class. + /// + /// will be the . public GifEncoder() : base(ImageFormat.Gif) { } diff --git a/src/Tizen.Multimedia.Util/ImageUtil/ImageTransform.cs b/src/Tizen.Multimedia.Util/ImageUtil/ImageTransform.cs index be552b7..e3d8d14 100644 --- a/src/Tizen.Multimedia.Util/ImageUtil/ImageTransform.cs +++ b/src/Tizen.Multimedia.Util/ImageUtil/ImageTransform.cs @@ -210,7 +210,7 @@ namespace Tizen.Multimedia.Util /// /// Returns an enumerator that can iterate through the collection. /// - /// A enumerator that can be used to iterate through the collection. + /// An enumerator that can be used to iterate through the collection. public IEnumerator GetEnumerator() => _list.GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => _list.GetEnumerator(); @@ -269,7 +269,7 @@ namespace Tizen.Multimedia.Util } /// - /// Rotates or flips an image. + /// Rotates an image. /// /// public class RotateTransform : ImageTransform @@ -277,7 +277,7 @@ namespace Tizen.Multimedia.Util private Rotation _rotation; /// - /// Initialize a new instance of the class. + /// Initializes a new instance of the class. /// /// The value how to rotate an image. /// is invalid. @@ -330,7 +330,7 @@ namespace Tizen.Multimedia.Util /// - /// Rotates or flips an image. + /// Flips an image. /// /// public class FlipTransform : ImageTransform @@ -338,7 +338,7 @@ namespace Tizen.Multimedia.Util private Flips _flip; /// - /// Initialize a new instance of the class. + /// Initializes a new instance of the class. /// /// The value how to flip an image. /// is invalid. @@ -405,7 +405,7 @@ namespace Tizen.Multimedia.Util } /// - /// Changes colorspace of image. + /// Changes the colorspace of an image. /// /// public class ColorSpaceTransform : ImageTransform @@ -413,7 +413,7 @@ namespace Tizen.Multimedia.Util private ImageColorSpace _imageColorSpace; /// - /// Initialize a new instance of the class. + /// Initializes a new instance of the class. /// /// The colorspace of output image. /// is invalid. @@ -469,7 +469,7 @@ namespace Tizen.Multimedia.Util private Rectangle _region; /// - /// Initialize a new instance of the class. + /// Initializes a new instance of the class. /// /// The crop region. /// @@ -546,7 +546,7 @@ namespace Tizen.Multimedia.Util private Size _size; /// - /// Initialize a new instance of the class. + /// Initializes a new instance of the class. /// /// The size that an image is resized to. /// diff --git a/src/Tizen.Multimedia.Util/ImageUtil/ImageTransformer.cs b/src/Tizen.Multimedia.Util/ImageUtil/ImageTransformer.cs index d0f81ad..53bfd38 100644 --- a/src/Tizen.Multimedia.Util/ImageUtil/ImageTransformer.cs +++ b/src/Tizen.Multimedia.Util/ImageUtil/ImageTransformer.cs @@ -25,7 +25,7 @@ namespace Tizen.Multimedia.Util public class ImageTransformer : IDisposable { /// - /// Initialize a new instance of the class. + /// Initializes a new instance of the class. /// public ImageTransformer() { diff --git a/src/Tizen.Multimedia.Util/ImageUtil/JpegDownscale.cs b/src/Tizen.Multimedia.Util/ImageUtil/JpegDownscale.cs index 842eaf6..de4a94a 100644 --- a/src/Tizen.Multimedia.Util/ImageUtil/JpegDownscale.cs +++ b/src/Tizen.Multimedia.Util/ImageUtil/JpegDownscale.cs @@ -17,7 +17,7 @@ namespace Tizen.Multimedia.Util { /// - /// Specifies JPEG Downscale options for decoding. + /// Specifies the JPEG Downscale options for decoding. /// public enum JpegDownscale { diff --git a/src/Tizen.Multimedia.Util/ImageUtil/PngCompression.cs b/src/Tizen.Multimedia.Util/ImageUtil/PngCompression.cs index c2ea191..8398cfa 100644 --- a/src/Tizen.Multimedia.Util/ImageUtil/PngCompression.cs +++ b/src/Tizen.Multimedia.Util/ImageUtil/PngCompression.cs @@ -17,7 +17,7 @@ namespace Tizen.Multimedia.Util { /// - /// Specifies PNG compression levels. + /// Specifies the PNG compression levels. /// public enum PngCompression { diff --git a/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractionResult.cs b/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractionResult.cs index 25aa238..de0a1c4 100755 --- a/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractionResult.cs +++ b/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractionResult.cs @@ -1,23 +1,23 @@ /* -* 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. -*/ + * 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. + */ namespace Tizen.Multimedia.Util { /// - /// Represents the result of thumbnail extraction. + /// Represents the result of the thumbnail extraction. /// public class ThumbnailExtractionResult { diff --git a/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractor.cs b/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractor.cs index 1201d9e..c9ff018 100755 --- a/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractor.cs +++ b/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractor.cs @@ -1,18 +1,18 @@ /* -* 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. -*/ + * 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 System.IO; @@ -41,12 +41,12 @@ namespace Tizen.Multimedia.Util /// /// 3 /// A task that represents the asynchronous extracting operation. - /// The size of the thumbnail will be the default size(320x240).\n + /// The size of the thumbnail will be the default size (320x240). /// The path of the media file to extract the thumbnail. /// is null. - /// Requested does not exist. - /// Internal error occurred. - /// Caller does not have required privilege for accessing the . + /// does not exist. + /// An internal error occurs. + /// The caller does not have required privilege for accessing the . /// The specified file is not supported. public static Task ExtractAsync(string path) { @@ -61,9 +61,9 @@ namespace Tizen.Multimedia.Util /// The path of the media file to extract the thumbnail. /// The token to stop the operation. /// is null. - /// Requested does not exist. - /// Internal error occurred. - /// Caller does not have required privilege for accessing the . + /// does not exist. + /// An internal error occurs. + /// The caller does not have required privilege for accessing the . /// The specified file is not supported. public static Task ExtractAsync(string path, CancellationToken cancellationToken) { @@ -76,17 +76,17 @@ namespace Tizen.Multimedia.Util /// 3 /// A task that represents the asynchronous extracting operation. /// - /// If the width is not a multiple of 8, it can be changed by inner process.\n + /// If the width is not a multiple of 8, it can be changed by the inner process.\n /// The width will be a multiple of 8 greater than the set value. /// /// The path of the media file to extract the thumbnail. /// The size of the thumbnail. /// is null. - /// Requested does not exist. - /// Internal error occurred. - /// Caller does not have required privilege for accessing the . + /// does not exist. + /// An internal error occurs. + /// The caller does not have required privilege for accessing the . /// - /// Width or height of is less than or equal to zero. + /// The width or the height of is less than or equal to zero. /// /// The specified file is not supported. public static Task ExtractAsync(string path, Size size) @@ -100,18 +100,18 @@ namespace Tizen.Multimedia.Util /// 3 /// A task that represents the asynchronous extracting operation. /// - /// If the width is not a multiple of 8, it can be changed by inner process.\n + /// If the width is not a multiple of 8, it can be changed by the inner process.\n /// The width will be a multiple of 8 greater than the set value. /// /// The path of the media file to extract the thumbnail. /// The size of the thumbnail. /// The token to stop the operation. /// is null. - /// Requested does not exist. - /// Internal error occurred. - /// Caller does not have required privilege for accessing the . + /// does not exist. + /// An internal error occurs. + /// The caller does not have required privilege for accessing the . /// - /// Width or height of is less than or equal to zero. + /// The width or the height of is less than or equal to zero. /// /// The specified file is not supported. public static Task ExtractAsync(string path, Size size, diff --git a/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractorError.cs b/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractorError.cs index f14ea05..588d958 100644 --- a/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractorError.cs +++ b/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractorError.cs @@ -1,18 +1,18 @@ /* -* 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. -*/ + * 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 System.IO; diff --git a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeDetectionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/BarcodeDetectionConfiguration.cs index b80cda7..633c983 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeDetectionConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/BarcodeDetectionConfiguration.cs @@ -14,6 +14,8 @@ * limitations under the License. */ +using System; + namespace Tizen.Multimedia.Vision { /// @@ -28,7 +30,7 @@ namespace Tizen.Multimedia.Vision /// /// Initializes a new instance of the class. /// - /// The feature is not supported. + /// The feature is not supported. /// 3 public BarcodeDetectionConfiguration() : base("barcode_detection") { @@ -37,8 +39,8 @@ namespace Tizen.Multimedia.Vision /// /// Gets or sets the target of the barcode detection. /// - /// is not valid. - /// The already has been disposed of. + /// is not valid. + /// The already has been disposed of. /// 3 public BarcodeDetectionTarget Target { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeGenerationConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/BarcodeGenerationConfiguration.cs index a12adea..edfbc50 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeGenerationConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/BarcodeGenerationConfiguration.cs @@ -14,6 +14,7 @@ * limitations under the License. */ +using System; using Tizen.Common; namespace Tizen.Multimedia.Vision @@ -32,7 +33,7 @@ namespace Tizen.Multimedia.Vision /// /// Initializes a new instance of the class. /// - /// The feature is not supported. + /// The feature is not supported. /// 3 public BarcodeGenerationConfiguration() : base("barcode_generation") { @@ -41,7 +42,7 @@ namespace Tizen.Multimedia.Vision /// /// Gets or sets the text visibility of the barcode to be generated. /// - /// is not valid. + /// is not valid. /// The already has been disposed of. /// 3 public Visibility TextVisibility diff --git a/src/Tizen.Multimedia.Vision/MediaVision/EngineConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/EngineConfiguration.cs index 972c0fa..aa20741 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/EngineConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/EngineConfiguration.cs @@ -38,7 +38,7 @@ namespace Tizen.Multimedia.Vision string featureType = _featurePath + type; - bool ret = SystemInfo.TryGetValue(featureType, out isSupported); + bool ret = Information.TryGetValue(featureType, out isSupported); return (isSupported && ret) ? true : false; } diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionConfiguration.cs index 632ac6b..87c2618 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionConfiguration.cs @@ -14,6 +14,8 @@ * limitations under the License. */ +using System; + namespace Tizen.Multimedia.Vision { /// @@ -27,7 +29,7 @@ namespace Tizen.Multimedia.Vision /// /// Initializes a new instance of the class. /// - /// The feature is not supported. + /// The feature is not supported. /// 3 public FaceRecognitionConfiguration() : base("face_recognition") { @@ -37,7 +39,7 @@ namespace Tizen.Multimedia.Vision /// Gets or sets the method used for face recognition model learning. /// Default value is . /// - /// is not valid. + /// is not valid. /// 3 public FaceRecognitionModelType ModelType { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModel.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModel.cs index 69b2956..20b727b 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModel.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModel.cs @@ -44,7 +44,7 @@ namespace Tizen.Multimedia.Vision /// Initializes a new instance of the class with the specified path. /// /// - /// Models saved by can be loaded. + /// Models saved by can be loaded. /// /// Path to the model to load. /// is null. diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingModel.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingModel.cs index 793a5d2..6653921 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingModel.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingModel.cs @@ -43,7 +43,7 @@ namespace Tizen.Multimedia.Vision /// Initializes a new instance of the class with the specified path. /// /// - /// Models saved by can be loaded. + /// Models saved by can be loaded. /// /// Path to the model to load. /// is null. @@ -54,7 +54,7 @@ namespace Tizen.Multimedia.Vision /// is not supported format. /// /// No permission to access the specified file. - /// + /// /// 3 public FaceTrackingModel(string modelPath) { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageFillConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageFillConfiguration.cs index ab4a38d..2eabbb5 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageFillConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageFillConfiguration.cs @@ -14,6 +14,8 @@ * limitations under the License. */ +using System; + namespace Tizen.Multimedia.Vision { /// @@ -40,7 +42,7 @@ namespace Tizen.Multimedia.Vision /// /// Initializes a new instance of the class. /// - /// The feature is not supported. + /// The feature is not supported. /// 3 public ImageFillConfiguration() : base("image_recognition") { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageObject.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageObject.cs index c8d2c70..ab0b6d9 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageObject.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageObject.cs @@ -43,7 +43,7 @@ namespace Tizen.Multimedia.Vision /// Initializes a new instance of the class from the specified file. /// /// - /// ImageObject has been saved by can be loaded. + /// ImageObject has been saved by can be loaded. /// /// Path to the image object to load. /// is null. diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingModel.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingModel.cs index 056b3ec..a3b9bec 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingModel.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingModel.cs @@ -43,7 +43,7 @@ namespace Tizen.Multimedia.Vision /// Initializes a new instance of the class with the specified path. /// /// - /// Model saved by can be loaded. + /// Model saved by can be loaded. /// /// Path to the model to load. /// is null. @@ -54,7 +54,7 @@ namespace Tizen.Multimedia.Vision /// is not supported format. /// /// No permission to access the specified file. - /// + /// /// 3 public ImageTrackingModel(string modelPath) { diff --git a/src/Tizen.Multimedia/AudioManager/AudioDevice.cs b/src/Tizen.Multimedia/AudioManager/AudioDevice.cs index 59d33bd..c5fa445 100755 --- a/src/Tizen.Multimedia/AudioManager/AudioDevice.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioDevice.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; namespace Tizen.Multimedia { /// - /// The Device API provides functions to query the information of sound devices. + /// Provides the ability to query the information of sound devices. /// public class AudioDevice { @@ -46,7 +46,7 @@ namespace Tizen.Multimedia } /// - /// Gets the id of the device. + /// Gets the ID of the device. /// /// The id of the device. public int Id => _id; diff --git a/src/Tizen.Multimedia/AudioManager/AudioManager.cs b/src/Tizen.Multimedia/AudioManager/AudioManager.cs index 51cf1ca..b6be3d5 100755 --- a/src/Tizen.Multimedia/AudioManager/AudioManager.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioManager.cs @@ -85,7 +85,7 @@ namespace Tizen.Multimedia private static object _audioDeviceConnectionLock = new object(); /// - /// Occurs when the state of connection of an audio device changes. + /// Occurs when the state of a connection of an audio device changes. /// public static event EventHandler DeviceConnectionChanged { diff --git a/src/Tizen.Multimedia/AudioManager/AudioManagerEnums.cs b/src/Tizen.Multimedia/AudioManager/AudioManagerEnums.cs index 677a0cd..74d90b1 100644 --- a/src/Tizen.Multimedia/AudioManager/AudioManagerEnums.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioManagerEnums.cs @@ -19,7 +19,7 @@ using System; namespace Tizen.Multimedia { /// - /// Specifies the flag for audio device options. + /// Specifies the flags for the audio device options. /// /// This enumeration has a attribute that allows a bitwise combination of its member values. /// @@ -63,7 +63,7 @@ namespace Tizen.Multimedia } /// - /// Specifies audio device type. + /// Specifies the audio device types. /// public enum AudioDeviceType { @@ -80,11 +80,11 @@ namespace Tizen.Multimedia /// BuiltinMic, /// - /// Audio jack that can be connected to wired accessory such as headphones and headsets. + /// Audio jack that can be connected to wired accessories such as headphones and headsets. /// AudioJack, /// - /// Bluetooth Media (A2DP). + /// Bluetooth media (A2DP). /// BluetoothMedia, /// @@ -96,17 +96,17 @@ namespace Tizen.Multimedia /// Forwarding, /// - /// USB Audio. + /// USB audio. /// UsbAudio, /// - /// Bluetooth Voice (SCO). + /// Bluetooth voice (SCO). /// BluetoothVoice } /// - /// Specifies audio device direction. + /// Specifies the audio device directions. /// public enum AudioDeviceIoDirection { @@ -125,7 +125,7 @@ namespace Tizen.Multimedia } /// - /// Specifies audio device state. + /// Specifies the audio device states. /// public enum AudioDeviceState { @@ -140,7 +140,7 @@ namespace Tizen.Multimedia } /// - /// Specifies audio volume type. + /// Specifies the audio volume types. /// public enum AudioVolumeType { @@ -184,7 +184,7 @@ namespace Tizen.Multimedia } /// - /// Specifies audio stream type. + /// Specifies the audio stream types. /// public enum AudioStreamType { @@ -231,7 +231,7 @@ namespace Tizen.Multimedia } /// - /// Specifies change reason of audio stream focus state. + /// Specifies the change reasons of the audio stream focus state. /// public enum AudioStreamFocusChangedReason { @@ -282,7 +282,7 @@ namespace Tizen.Multimedia } /// - /// Specifies the flag for audio stream focus options. + /// Specifies the flags for the audio stream focus options. /// /// This enumeration has a attribute that allows a bitwise combination of its member values. /// @@ -301,7 +301,7 @@ namespace Tizen.Multimedia } /// - /// Specifies audio stream focus state. + /// Specifies the audio stream focus states. /// public enum AudioStreamFocusState { @@ -316,7 +316,7 @@ namespace Tizen.Multimedia } /// - /// Specifies the flag for audio stream behaviors. + /// Specifies the flags for the audio stream behaviors. /// /// This enumeration has a attribute that allows a bitwise combination of its member values. /// diff --git a/src/Tizen.Multimedia/AudioManager/AudioStreamPolicy.cs b/src/Tizen.Multimedia/AudioManager/AudioStreamPolicy.cs index bfa6ee4..2429e39 100755 --- a/src/Tizen.Multimedia/AudioManager/AudioStreamPolicy.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioStreamPolicy.cs @@ -20,7 +20,7 @@ using System.Diagnostics; namespace Tizen.Multimedia { /// - /// Provides the ability to control a sound stream. + /// Provides the ability to control the sound stream. /// public class AudioStreamPolicy : IDisposable { @@ -29,13 +29,13 @@ namespace Tizen.Multimedia private Interop.AudioStreamPolicy.FocusStateChangedCallback _focusStateChangedCallback; /// - /// Initializes a new instance of the class with + /// Initializes a new instance of the class with /// /// /// To apply the stream policy according to this stream information, the AudioStreamPolicy should - /// be passed to other APIs related to playback or recording. (e.g., , , etc.) + /// be passed to other APIs related to playback or recording. (For example., , , etc.) /// - /// Type of sound stream for which policy needs to be created. + /// The type of the sound stream for which the policy needs to be created. /// is invalid. public AudioStreamPolicy(AudioStreamType streamType) { @@ -98,14 +98,14 @@ namespace Tizen.Multimedia } /// - /// Gets the state of focus for playback. + /// Gets the state of focus for the playback. /// /// The state of focus for playback. /// The has already been disposed of. public AudioStreamFocusState PlaybackFocusState => GetFocusState(true); /// - /// Gets the state of focus for recording. + /// Gets the state of focus for the recording. /// /// The state of focus for recording. /// The has already been disposed of. diff --git a/src/Tizen.Multimedia/AudioManager/AudioVolume.cs b/src/Tizen.Multimedia/AudioManager/AudioVolume.cs index 3ca2057..d50df66 100755 --- a/src/Tizen.Multimedia/AudioManager/AudioVolume.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioVolume.cs @@ -1,18 +1,18 @@ /* -* 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. -*/ + * 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; diff --git a/src/Tizen.Multimedia/AudioManager/VolumeChangedEventArgs.cs b/src/Tizen.Multimedia/AudioManager/VolumeChangedEventArgs.cs index f35481a..aa4b901 100755 --- a/src/Tizen.Multimedia/AudioManager/VolumeChangedEventArgs.cs +++ b/src/Tizen.Multimedia/AudioManager/VolumeChangedEventArgs.cs @@ -36,7 +36,7 @@ namespace Tizen.Multimedia public AudioVolumeType Type { get; } /// - /// Gets the new volume. + /// Gets the new volume level. /// /// The new volume level. public int Level { get; } diff --git a/src/Tizen.Multimedia/AudioManager/VolumeLevel.cs b/src/Tizen.Multimedia/AudioManager/VolumeLevel.cs index 47cb155..cdfcbf0 100644 --- a/src/Tizen.Multimedia/AudioManager/VolumeLevel.cs +++ b/src/Tizen.Multimedia/AudioManager/VolumeLevel.cs @@ -18,7 +18,6 @@ using System; namespace Tizen.Multimedia { - /// /// Provides a means to control volume levels. /// @@ -43,7 +42,7 @@ namespace Tizen.Multimedia /// -or- /// is greater than . /// - /// Caller does not have required privilege to set volume. + /// The caller does not have required privilege to set volume. public int this[AudioVolumeType type] { get diff --git a/src/Tizen.Multimedia/Common.Internal/Features.cs b/src/Tizen.Multimedia/Common.Internal/Features.cs old mode 100644 new mode 100755 index 50c8508..58b1ec6 --- a/src/Tizen.Multimedia/Common.Internal/Features.cs +++ b/src/Tizen.Multimedia/Common.Internal/Features.cs @@ -26,7 +26,7 @@ namespace Tizen.Multimedia internal static bool IsSupported(string featureKey) { bool supported = false; - SystemInfo.TryGetValue(featureKey, out supported); + Information.TryGetValue(featureKey, out supported); return supported; } diff --git a/src/Tizen.Multimedia/Common.Internal/IBufferOwner.cs b/src/Tizen.Multimedia/Common.Internal/IBufferOwner.cs index 6553b3a..16acf08 100644 --- a/src/Tizen.Multimedia/Common.Internal/IBufferOwner.cs +++ b/src/Tizen.Multimedia/Common.Internal/IBufferOwner.cs @@ -56,7 +56,7 @@ namespace Tizen.Multimedia if (!bufferOwner.IsBufferAccessible(buffer, MediaBufferAccessMode.Write)) { - throw new InvalidOperationException("The buffer is not in writable state."); + throw new InvalidOperationException("The buffer is not in the writable state."); } } } diff --git a/src/Tizen.Multimedia/Common.Internal/MediaBufferBase.cs b/src/Tizen.Multimedia/Common.Internal/MediaBufferBase.cs index 90a8226..553a0dc 100644 --- a/src/Tizen.Multimedia/Common.Internal/MediaBufferBase.cs +++ b/src/Tizen.Multimedia/Common.Internal/MediaBufferBase.cs @@ -46,14 +46,14 @@ namespace Tizen.Multimedia public bool IsReadOnly { get; } /// - /// Validates the range + /// Validates the range. /// /// /// /// - /// offset + length is greater than . + /// The offset + length is greater than . /// -or- - /// offset or length is less than zero. + /// The offset or length is less than zero. /// private void ValidateRange(int offset, int length) { diff --git a/src/Tizen.Multimedia/Common/CodecNotSupportedException.cs b/src/Tizen.Multimedia/Common/CodecNotSupportedException.cs index ed8dec6..f5757fd 100644 --- a/src/Tizen.Multimedia/Common/CodecNotSupportedException.cs +++ b/src/Tizen.Multimedia/Common/CodecNotSupportedException.cs @@ -19,17 +19,17 @@ using System; namespace Tizen.Multimedia { /// - /// Specifies whether a codec is audio codec or video codec. + /// Specifies whether a codec is an audio codec or a video codec. /// public enum CodecKind { /// - /// Audio codec + /// Audio codec. /// Audio, /// - /// Video codec + /// Video codec. /// Video } diff --git a/src/Tizen.Multimedia/Common/ColorSpace.cs b/src/Tizen.Multimedia/Common/ColorSpace.cs index edbb001..1d0f598 100644 --- a/src/Tizen.Multimedia/Common/ColorSpace.cs +++ b/src/Tizen.Multimedia/Common/ColorSpace.cs @@ -22,89 +22,89 @@ namespace Tizen.Multimedia public enum ColorSpace { /// - /// Y800 + /// Y800. /// Y800, /// - /// I420 + /// I420. /// I420, /// - /// NV12 + /// NV12. /// NV12, /// - /// NV16 + /// NV16. /// NV16, /// - /// NV21 + /// NV21. /// NV21, /// - /// NV61 + /// NV61. /// NV61, /// - /// YV12 + /// YV12. /// /// YV12, /// - /// YUYV + /// YUYV. /// Yuyv, /// - /// YUV422 + /// YUV422. /// Yuv422, /// - /// UYVY + /// UYVY. /// Uyvy, /// - /// YUV422P + /// YUV422P. /// /// Yuv422P, /// - /// RGB565 + /// RGB565. /// Rgb565, /// - /// RGB888 + /// RGB888. /// Rgb888, /// - /// RGBA8888 + /// RGBA8888. /// Rgba8888, /// - /// ARGB8888 + /// ARGB8888. /// Argb8888, /// - /// BGRA8888 + /// BGRA8888. /// Bgra8888, /// - /// BGRX8888 + /// BGRX8888. /// Bgrx8888 diff --git a/src/Tizen.Multimedia/Common/Display.cs b/src/Tizen.Multimedia/Common/Display.cs index 636fb8f..ba10409 100644 --- a/src/Tizen.Multimedia/Common/Display.cs +++ b/src/Tizen.Multimedia/Common/Display.cs @@ -21,17 +21,17 @@ namespace Tizen.Multimedia internal enum DisplayType { /// - /// Overlay surface display + /// Overlay surface display. /// Overlay, /// - /// Evas image object surface display + /// Evas image object surface display. /// Surface, /// - /// This disposes off buffers + /// This disposes off buffers. /// None, } diff --git a/src/Tizen.Multimedia/Common/FileFormatException.cs b/src/Tizen.Multimedia/Common/FileFormatException.cs index e7d7d9a..94e9b16 100644 --- a/src/Tizen.Multimedia/Common/FileFormatException.cs +++ b/src/Tizen.Multimedia/Common/FileFormatException.cs @@ -20,7 +20,7 @@ namespace Tizen.Multimedia { /// /// The exception that is thrown when an input file or a data stream that is supposed to conform - /// to a certain file format specification is malformed. + /// to a certain file format specification, is malformed. /// public class FileFormatException : FormatException { diff --git a/src/Tizen.Multimedia/Common/IMediaBuffer.cs b/src/Tizen.Multimedia/Common/IMediaBuffer.cs index 0d34db6..dfa4275 100644 --- a/src/Tizen.Multimedia/Common/IMediaBuffer.cs +++ b/src/Tizen.Multimedia/Common/IMediaBuffer.cs @@ -19,7 +19,7 @@ using System; namespace Tizen.Multimedia { /// - /// Provides functionality to read and write a media buffer. + /// Provides functionality to read and write the media buffer. /// public interface IMediaBuffer { @@ -28,12 +28,12 @@ namespace Tizen.Multimedia /// /// The index of the value to get or set. /// - /// index is less than zero.\n + /// is less than zero.\n /// -or-\n - /// index is equal to or greater than . + /// is equal to or greater than . /// - /// The object that owns the current buffer already has been disposed of. - /// The buffer is not available. i.e. not writable state. + /// The object that owns the current buffer has already been disposed of. + /// The buffer is not available, i.e. not writable state. byte this[int index] { get; @@ -57,8 +57,9 @@ namespace Tizen.Multimedia /// The array to copy to. /// The zero-based index in the source array where copying should start. /// The number of array elements to copy. - /// startIndex or length is not valid. - /// The object that owns the current buffer already has been disposed of. + /// is null. + /// or is not valid. + /// The object that owns the current buffer has already been disposed of. void CopyTo(byte[] dest, int startIndex, int length); /// @@ -68,31 +69,35 @@ namespace Tizen.Multimedia /// The zero-based index in the source array where copying should start. /// The number of array elements to copy. /// The zero-based index in the buffer where copying should start. - /// startIndex, offset or length is not valid. - /// The object that owns the current buffer already has been disposed of. + /// is null. + /// , , + /// or is not valid. + /// The object that owns the current buffer has already been disposed of. void CopyTo(byte[] dest, int startIndex, int length, int offset); /// /// Copies data from the buffer to a byte array. /// /// The array to copy from. - /// The zero-based index in the dest array where copying should start. + /// The zero-based index in the destination array where copying should start. /// The number of elements to copy. - /// startIndex or length is not valid. - /// The object that owns the current buffer already has been disposed of. + /// is null. + /// or is not valid. + /// The object that owns the current buffer has already been disposed of. /// The buffer is not available. i.e. not writable state. - void CopyFrom(byte[] source, int startIndex, int length); /// /// Copies data from the buffer to a byte array. /// /// The array to copy from. - /// The zero-based index in the dest array where copying should start. + /// The zero-based index in the destination array where copying should start. /// The number of elements to copy. /// The zero-based index in the buffer where copying should start. - /// startIndex, offset or length is not valid. - /// The object that owns the current buffer already has been disposed of. + /// is null. + /// , , + /// or is not valid. + /// The object that owns the current buffer has already been disposed of. /// The buffer is not available. i.e. not writable state. void CopyFrom(byte[] source, int startIndex, int length, int offset); } diff --git a/src/Tizen.Multimedia/Common/Point.cs b/src/Tizen.Multimedia/Common/Point.cs index 07357b5..4cca360 100644 --- a/src/Tizen.Multimedia/Common/Point.cs +++ b/src/Tizen.Multimedia/Common/Point.cs @@ -19,7 +19,7 @@ using System; namespace Tizen.Multimedia { /// - /// Represents a point in 2D space. + /// Represents a point in the 2D space. /// public struct Point { @@ -27,8 +27,8 @@ namespace Tizen.Multimedia /// /// Initializes a new instance of the Point with the specified coordinates. /// - /// X-axis coordinate of the point in 2D space. - /// Y-axis coordinate of the point in 2D space. + /// X-axis coordinate of the point in the 2D space. + /// Y-axis coordinate of the point in the 2D space. public Point(int x, int y) { X = x; @@ -36,7 +36,7 @@ namespace Tizen.Multimedia } /// - /// Gets or sets X-axis coordinate of the point in 2D space. + /// Gets or sets the X-axis coordinate of the point in the 2D space. /// public int X { @@ -45,7 +45,7 @@ namespace Tizen.Multimedia } /// - /// Gets or sets Y-axis coordinate of the point in 2D space. + /// Gets or sets the Y-axis coordinate of the point in the 2D space. /// public int Y { diff --git a/src/Tizen.Multimedia/Common/Range.cs b/src/Tizen.Multimedia/Common/Range.cs index a1fe5e7..bcfc720 100644 --- a/src/Tizen.Multimedia/Common/Range.cs +++ b/src/Tizen.Multimedia/Common/Range.cs @@ -24,7 +24,7 @@ namespace Tizen.Multimedia public struct Range { /// - /// Initializes a new instance of the Range with the specified values. + /// Initializes a new instance of the range with the specified values. /// /// Minimum value of the range. /// Maximum value of the range. @@ -40,7 +40,7 @@ namespace Tizen.Multimedia } /// - /// Gets or sets minimum value of the range. + /// Gets or sets the minimum value of the range. /// public int Min { @@ -49,7 +49,7 @@ namespace Tizen.Multimedia } /// - /// Gets or sets maximum value of the range. + /// Gets or sets the maximum value of the range. /// public int Max { @@ -58,15 +58,15 @@ namespace Tizen.Multimedia } /// - /// Gets length of the range. + /// Gets the length of the range. /// public int Length => Max - Min; /// - /// Determines if the specified value is inside of the range. + /// Determines if the specified value is within the range. /// - /// A value to check. - /// true if the value is inside of the range; otherwise false. + /// The value to check. + /// true if the value is within the range; otherwise false. public bool IsInside(int value) { return Min <= value && value <= Max; diff --git a/src/Tizen.Multimedia/Common/Rectangle.cs b/src/Tizen.Multimedia/Common/Rectangle.cs index 8f37ee1..d7f537d 100644 --- a/src/Tizen.Multimedia/Common/Rectangle.cs +++ b/src/Tizen.Multimedia/Common/Rectangle.cs @@ -19,7 +19,7 @@ using System; namespace Tizen.Multimedia { /// - /// This class represents location of the object bounded by rectangle defined by + /// Represents the location of the object bounded by a rectangle defined by /// coordinates of top left corner, width and height. /// public struct Rectangle @@ -28,7 +28,7 @@ namespace Tizen.Multimedia private Size _size; /// - /// Initializes a new instance of the Rectangle with the specified values. + /// Initializes a new instance of the with the specified values. /// /// The x-coordinate of the upper-left corner of the rectangle. /// The y-coordinate of the upper-left corner of the rectangle. @@ -40,7 +40,7 @@ namespace Tizen.Multimedia } /// - /// Initializes a new instance of the Rectangle with the specified values. + /// Initializes a new instance of the with the specified values. /// /// A that represents the upper-left corner of the rectangular region. /// A that represents the width and height of the rectangular region. diff --git a/src/Tizen.Multimedia/Common/Size.cs b/src/Tizen.Multimedia/Common/Size.cs index 2ccf856..6545bc2 100644 --- a/src/Tizen.Multimedia/Common/Size.cs +++ b/src/Tizen.Multimedia/Common/Size.cs @@ -24,7 +24,7 @@ namespace Tizen.Multimedia public struct Size { /// - /// Initializes a new instance of the Size with the specified values. + /// Initializes a new instance of the with the specified values. /// /// Width of the size. /// Height of the size. @@ -35,7 +35,7 @@ namespace Tizen.Multimedia } /// - /// Gets or sets the width of the Size. + /// Gets or sets the width. /// public int Width { @@ -44,7 +44,7 @@ namespace Tizen.Multimedia } /// - /// Gets or sets the height of the Size. + /// Gets or sets the height. /// public int Height { diff --git a/src/Tizen.Multimedia/MediaTool/AudioMediaFormat.cs b/src/Tizen.Multimedia/MediaTool/AudioMediaFormat.cs index 60e1a54..b70894e 100644 --- a/src/Tizen.Multimedia/MediaTool/AudioMediaFormat.cs +++ b/src/Tizen.Multimedia/MediaTool/AudioMediaFormat.cs @@ -27,7 +27,7 @@ namespace Tizen.Multimedia /// /// Initializes a new instance of the AudioMediaFormat class with the specified mime type, - /// channel, sample rate, bit and bit rate. + /// channel, sample rate, bit, and bit rate. /// /// The mime type of the format. /// The channel value of the format. @@ -36,7 +36,7 @@ namespace Tizen.Multimedia /// The bit rate value of the format. /// is invalid(i.e. undefined value). /// - /// , , or is less than zero. + /// , , , or is less than zero. /// public AudioMediaFormat(MediaFormatAudioMimeType mimeType, int channel, int sampleRate, int bit, int bitRate) @@ -46,7 +46,7 @@ namespace Tizen.Multimedia /// /// Initializes a new instance of the AudioMediaFormat class with the specified mime type, - /// channel, sample rate, bit, bit rate and aac type. + /// channel, sample rate, bit, bit rate, and AAC type. /// /// The mime type of the format. /// The channel value of the format. @@ -55,12 +55,12 @@ namespace Tizen.Multimedia /// The bit rate value of the format. /// The AAC bitstream format(ADIF or ADTS). /// - /// or is invalid(i.e. undefined value).\n + /// or is invalid (i.e. undefined value).\n /// -or-\n - /// is not , but is one of aac types. + /// is not , but is one of the AAC types. /// /// - /// , , or is less than zero. + /// , , , or is less than zero. /// public AudioMediaFormat(MediaFormatAudioMimeType mimeType, int channel, int sampleRate, int bit, int bitRate, MediaFormatAacType aacType) @@ -138,7 +138,7 @@ namespace Tizen.Multimedia } /// - /// Returns an indication whether a specified mime type is a aac type. + /// Returns an indication whether a specified mime type is an AAC type. /// /// A mime type. private static bool IsAacSupportedMimeType(MediaFormatAudioMimeType mimeType) @@ -149,14 +149,14 @@ namespace Tizen.Multimedia } /// - /// Retrieves audio properties of media format from a native handle. + /// Retrieves audio properties of the media format from a native handle. /// - /// A native handle that properties are retrieved from. - /// An out parameter for mime type. - /// An out parameter for channel. - /// An out parameter for sample rate. - /// An out parameter for bit. - /// An out parameter for bit rate. + /// A native handle that the properties are retrieved from. + /// An out parameter for the mime type. + /// An out parameter for the channel. + /// An out parameter for the sample rate. + /// An out parameter for the bit. + /// An out parameter for the bit rate. private static void GetInfo(IntPtr handle, out MediaFormatAudioMimeType mimeType, out int channel, out int sampleRate, out int bit, out int bitRate) { @@ -176,10 +176,10 @@ namespace Tizen.Multimedia } /// - /// Retrieves aac type value from a native handle. + /// Retrieves the AAC type value from a native handle. /// - /// A native handle that properties are retrieved from. - /// An out parameter for aac type. + /// A native handle that the properties are retrieved from. + /// An out parameter for tha AAC type. private static void GetAacType(IntPtr handle, out MediaFormatAacType aacType) { Debug.Assert(handle != IntPtr.Zero, "The handle is invalid!"); @@ -244,7 +244,7 @@ namespace Tizen.Multimedia public int BitRate { get; } /// - /// Gets the aac type of the current format. + /// Gets the AAC type of the current format. /// public MediaFormatAacType AacType { get; } diff --git a/src/Tizen.Multimedia/MediaTool/ContainerMediaFormat.cs b/src/Tizen.Multimedia/MediaTool/ContainerMediaFormat.cs index 0669184..8efa929 100644 --- a/src/Tizen.Multimedia/MediaTool/ContainerMediaFormat.cs +++ b/src/Tizen.Multimedia/MediaTool/ContainerMediaFormat.cs @@ -28,7 +28,7 @@ namespace Tizen.Multimedia /// Initializes a new instance of the ContainerMediaFormat class. /// /// The mime type of the container format. - /// mimeType is invalid(i.e. undefined value). + /// is invalid (i.e. undefined value). public ContainerMediaFormat(MediaFormatContainerMimeType mimeType) : base(MediaFormatType.Container) { diff --git a/src/Tizen.Multimedia/MediaTool/MediaFormat.cs b/src/Tizen.Multimedia/MediaTool/MediaFormat.cs index f83b205..d6c51e2 100755 --- a/src/Tizen.Multimedia/MediaTool/MediaFormat.cs +++ b/src/Tizen.Multimedia/MediaTool/MediaFormat.cs @@ -46,7 +46,7 @@ namespace Tizen.Multimedia /// Creates a media format from a native handle. /// /// A native handle. - /// An object of one of subclasses of . + /// An object of one of the subclasses of . internal static MediaFormat FromHandle(IntPtr handle) { if (handle == IntPtr.Zero) @@ -81,7 +81,7 @@ namespace Tizen.Multimedia } /// - /// Create a native media format from this object. + /// Creates a native media format from this object. /// /// A converted native handle. /// The returned handle must be destroyed using . @@ -103,7 +103,7 @@ namespace Tizen.Multimedia } /// - /// Fill out properties of a native media format with the current media format object. + /// Fills out properties of a native media format with the current media format object. /// /// A native handle to be written. internal abstract void AsNativeHandle(IntPtr handle); diff --git a/src/Tizen.Multimedia/MediaTool/MediaFormatAacType.cs b/src/Tizen.Multimedia/MediaTool/MediaFormatAacType.cs index 6839c9f..03ed369 100644 --- a/src/Tizen.Multimedia/MediaTool/MediaFormatAacType.cs +++ b/src/Tizen.Multimedia/MediaTool/MediaFormatAacType.cs @@ -17,20 +17,20 @@ namespace Tizen.Multimedia { /// - /// Specifies aac types for . - /// + /// Specifies the AAC types for . + /// public enum MediaFormatAacType { /// - /// Raw, no header + /// Raw, no header. /// None, /// - /// ADTS header + /// ADTS header. /// Adts, /// - /// ADIF header + /// ADIF header. /// Adif } diff --git a/src/Tizen.Multimedia/MediaTool/MediaFormatMimeType.cs b/src/Tizen.Multimedia/MediaTool/MediaFormatMimeType.cs index 9e23406..3fbeebf 100755 --- a/src/Tizen.Multimedia/MediaTool/MediaFormatMimeType.cs +++ b/src/Tizen.Multimedia/MediaTool/MediaFormatMimeType.cs @@ -44,17 +44,17 @@ namespace Tizen.Multimedia } /// - /// Enumeration for media format data type + /// Specifies the media format data types. /// internal enum MediaFormatDataType { /// - /// Encoded type + /// Encoded type. /// Encoded = 0x10000000, /// - /// Raw type + /// Raw type. /// Raw = 0x20000000, } @@ -65,7 +65,7 @@ namespace Tizen.Multimedia public enum MediaFormatAudioMimeType { /// - /// AMR, Alias for . + /// AMR, alias for . /// Amr = (MediaFormatType.Audio | MediaFormatDataType.Encoded | 0x1040), @@ -80,7 +80,7 @@ namespace Tizen.Multimedia AmrWB = (MediaFormatType.Audio | MediaFormatDataType.Encoded | 0x1041), /// - /// AAC, Alias for . + /// AAC, alias for . /// Aac = (MediaFormatType.Audio | MediaFormatDataType.Encoded | 0x1060), @@ -161,7 +161,7 @@ namespace Tizen.Multimedia H263P = (MediaFormatType.Video | MediaFormatDataType.Encoded | 0x2021), /// - /// H264_SP + /// H264_SP. /// H264SP = (MediaFormatType.Video | MediaFormatDataType.Encoded | 0x2030), @@ -211,7 +211,7 @@ namespace Tizen.Multimedia Mpeg4Asp = (MediaFormatType.Video | MediaFormatDataType.Encoded | 0x2071), /// - /// I420 + /// I420. /// I420 = (MediaFormatType.Video | MediaFormatDataType.Raw | 0x2510), @@ -288,63 +288,63 @@ namespace Tizen.Multimedia public enum MediaFormatContainerMimeType { /// - /// MP4 container, Video. + /// MP4 container, video. /// MP4 = (MediaFormatType.Container | 0x3010), /// - /// AVI container, Video. + /// AVI container, video. /// Avi = (MediaFormatType.Container | 0x3020), /// - /// MPEG2TS container, Video. + /// MPEG2TS container, video. /// Mpeg2TS = (MediaFormatType.Container | 0x3030), /// - /// MPEG2PS container, Video. + /// MPEG2PS container, video. /// Mpeg2PS = (MediaFormatType.Container | 0x3040), /// - /// MATROSKA container, Video. + /// MATROSKA container, video. /// Matroska = (MediaFormatType.Container | 0x3050), /// - /// WEBM container, Video. + /// WEBM container, video. /// Webm = (MediaFormatType.Container | 0x3060), /// - /// 3GP container, Video. + /// 3GP container, video. /// ThreeGP = (MediaFormatType.Container | 0x3070), /// - /// WAV container, Audio. + /// WAV container, audio. /// Wav = (MediaFormatType.Container | 0x4010), /// - /// OGG container, Audio + /// OGG container, audio /// Ogg = (MediaFormatType.Container | 0x4020), /// - /// AAC_ADTS container, Audio + /// AAC_ADTS container, audio /// AacAdts = (MediaFormatType.Container | 0x4030), /// - /// AAC_ADIF container, Audio + /// AAC_ADIF container, audio. /// AacAdif = (MediaFormatType.Container | 0x4031), } /// - /// Enumeration for text mime type + /// Specifies the text mime types. /// public enum MediaFormatTextMimeType { diff --git a/src/Tizen.Multimedia/MediaTool/MediaFormatTextType.cs b/src/Tizen.Multimedia/MediaTool/MediaFormatTextType.cs index 38d3a5a..a9673fc 100755 --- a/src/Tizen.Multimedia/MediaTool/MediaFormatTextType.cs +++ b/src/Tizen.Multimedia/MediaTool/MediaFormatTextType.cs @@ -17,7 +17,7 @@ namespace Tizen.Multimedia { /// - /// Specifies text types. + /// Specifies the text types. /// public enum MediaFormatTextType { @@ -27,12 +27,12 @@ namespace Tizen.Multimedia None, /// - /// The mp4 type. + /// MP4. /// MP4, /// - /// The 3gpp type. + /// 3GPP. /// ThreeGpp } diff --git a/src/Tizen.Multimedia/MediaTool/MediaPacket.Lock.cs b/src/Tizen.Multimedia/MediaTool/MediaPacket.Lock.cs index dcdb6a1..e08eb8f 100644 --- a/src/Tizen.Multimedia/MediaTool/MediaPacket.Lock.cs +++ b/src/Tizen.Multimedia/MediaTool/MediaPacket.Lock.cs @@ -30,7 +30,7 @@ namespace Tizen.Multimedia private readonly LockState _lock = new LockState(); /// - /// Validate the current object is not locked. + /// Validates the current object is not locked. /// /// The MediaPacket has already been disposed of. /// The MediaPacket is in use by another module. diff --git a/src/Tizen.Multimedia/MediaTool/MediaPacket.cs b/src/Tizen.Multimedia/MediaTool/MediaPacket.cs index c2ffe33..a72b05c 100644 --- a/src/Tizen.Multimedia/MediaTool/MediaPacket.cs +++ b/src/Tizen.Multimedia/MediaTool/MediaPacket.cs @@ -33,9 +33,10 @@ namespace Tizen.Multimedia /// Initializes a new instance of the MediaPacket class with the specified media format. /// /// The media format containing properties for the packet. - /// format is null. + /// is null. /// - /// of the specified format is . + /// The of the specified format is . + /// /// Operation failed. internal MediaPacket(MediaFormat format) { @@ -168,9 +169,10 @@ namespace Tizen.Multimedia /// /// Gets or sets the PTS(Presentation Time Stamp) value of the current packet. /// - /// The MediaPacket has already been disposed. + /// The MediaPacket has already been disposed of. /// - /// The MediaPacket is not writable state which means it being used by another module. + /// The MediaPacket is not in the writable state, which means it is being used by another module. + /// public ulong Pts { get @@ -198,9 +200,10 @@ namespace Tizen.Multimedia /// /// Gets or sets the DTS(Decoding Time Stamp) value of the current packet. /// - /// The MediaPacket has already been disposed. + /// The MediaPacket has already been disposed of. /// - /// The MediaPacket is not in writable state which means it being used by another module. + /// The MediaPacket is not in the writable state, which means it is being used by another module. + /// public ulong Dts { get @@ -226,10 +229,10 @@ namespace Tizen.Multimedia } /// - /// Gets a value indicating whether the packet is encoded type. + /// Gets a value indicating whether the packet is the encoded type. /// - /// true if the packet is encoded type; otherwise, false. - /// The MediaPacket has already been disposed. + /// true if the packet is the encoded type; otherwise, false. + /// The MediaPacket has already been disposed of. public bool IsEncoded { get @@ -251,8 +254,8 @@ namespace Tizen.Multimedia /// Gets the buffer of the packet. /// /// The allocated to the packet. - /// This property will return null if the packet is raw video format. - /// The MediaPacket has already been disposed. + /// This property will return null if the packet is in the raw video format. + /// The MediaPacket has already been disposed of. /// /// public MediaPacketBuffer Buffer @@ -278,13 +281,13 @@ namespace Tizen.Multimedia /// /// Gets or sets a length of data written in the . /// - /// The MediaPacket has already been disposed. + /// The MediaPacket has already been disposed of. /// /// The value specified for this property is less than zero or greater than . /// /// The MediaPacket has instead of .\n /// -or-\n - /// The MediaPacket is not in writable state which means it being used by another module. + /// The MediaPacket is not in the writable state, which means it is being used by another module. /// public int BufferWrittenLength { @@ -329,8 +332,8 @@ namespace Tizen.Multimedia /// Gets the video planes of the packet. /// /// The s allocated to the packet. - /// This property will return null if the packet is not raw video format. - /// The MediaPacket has already been disposed. + /// This property will return null if the packet is not in the raw video format. + /// The MediaPacket has already been disposed of. /// /// public MediaPacketVideoPlane[] VideoPlanes @@ -356,10 +359,10 @@ namespace Tizen.Multimedia /// /// Gets or sets the buffer flags of the packet. /// - /// The MediaPacket has already been disposed. + /// The MediaPacket has already been disposed of. /// - /// The MediaPacket is not in writable state which means it being used by another module. - /// + /// The MediaPacket is not in the writable state, which means it is being used by another module. + /// public MediaPacketBufferFlags BufferFlags { get @@ -409,7 +412,7 @@ namespace Tizen.Multimedia /// Releases all resources used by the object. /// /// - /// The MediaPacket can not be disposed which means it being used by another module. + /// The MediaPacket can not be disposed, which means it is being used by another module. /// public void Dispose() { @@ -455,7 +458,7 @@ namespace Tizen.Multimedia } /// - /// Validate the current object has not been disposed of. + /// Validates the current object has not been disposed of. /// /// The MediaPacket has already been disposed of. private void ValidateNotDisposed() @@ -469,7 +472,7 @@ namespace Tizen.Multimedia /// /// Ensures whether the packet is writable. /// - /// The MediaPacket already has been disposed of. + /// The MediaPacket has already been disposed of. /// The MediaPacket is being used by another module. internal void EnsureWritableState() { @@ -480,16 +483,16 @@ namespace Tizen.Multimedia /// /// Ensures whether the packet is readable. /// - /// The MediaPacket already has been disposed of. + /// The MediaPacket has already been disposed of. internal void EnsureReadableState() { ValidateNotDisposed(); } /// - /// Gets a value indicating whether the packet is raw video format. + /// Gets a value indicating whether the packet is in the raw video format. /// - /// true if the packet is raw video format; otherwise, false. + /// true if the packet is in the raw video format; otherwise, false. private bool IsVideoPlaneSupported { get diff --git a/src/Tizen.Multimedia/MediaTool/MediaPacketBuffer.cs b/src/Tizen.Multimedia/MediaTool/MediaPacketBuffer.cs index 49b9caf..2aecc07 100644 --- a/src/Tizen.Multimedia/MediaTool/MediaPacketBuffer.cs +++ b/src/Tizen.Multimedia/MediaTool/MediaPacketBuffer.cs @@ -45,11 +45,11 @@ namespace Tizen.Multimedia /// /// The index of the value to get or set. /// - /// index is less than zero.\n + /// is less than zero.\n /// -or-\n - /// index is equal to or greater than . + /// is equal to or greater than . /// - /// The MediaPacket that owns the current buffer already has been disposed of. + /// The MediaPacket that owns the current buffer has already been disposed of. /// The MediaPacket that owns the current buffer is being used by another module. public byte this[int index] { @@ -73,14 +73,14 @@ namespace Tizen.Multimedia } /// - /// Validates the range + /// Validates the range. /// /// /// /// - /// offset + length is greater than .\n + /// + is greater than .\n /// -or-\n - /// offset or length is less than zero. + /// or is less than zero. /// private void ValidateRange(int offset, int length) { @@ -99,14 +99,16 @@ namespace Tizen.Multimedia } /// - /// Copies data from a byte array to the buffer. + /// Copies the data from a byte array to the buffer. /// /// The array to copy from. /// The zero-based index in the source array where copying should start. /// The number of array elements to copy. /// The zero-based index in the buffer where copying should start. - /// startIndex, offset or length is not valid. - /// The MediaPacket that owns the current buffer already has been disposed of. + /// + /// , , or is not valid. + /// + /// The MediaPacket that owns the current buffer has already been disposed of. public void CopyFrom(byte[] source, int startIndex, int length, int offset = 0) { _packet.EnsureReadableState(); @@ -126,14 +128,16 @@ namespace Tizen.Multimedia } /// - /// Copies data from the buffer to a byte array. + /// Copies the data from the buffer to a byte array. /// /// The array to copy to. - /// The zero-based index in the dest array where copying should start. + /// The zero-based index in the destination array where copying should start. /// The number of elements to copy. /// The zero-based index in the buffer where copying should start. - /// startIndex, offset or length is not valid. - /// The MediaPacket that owns the current buffer already has been disposed of. + /// + /// , , , or is not valid. + /// + /// The MediaPacket that owns the current buffer has already been disposed of. /// The MediaPacket that owns the current buffer is being used by another module. public void CopyTo(byte[] dest, int startIndex, int length, int offset = 0) { @@ -158,7 +162,7 @@ namespace Tizen.Multimedia /// /// Gets the size of the buffer, in bytes. /// - /// The MediaPacket that owns the current buffer already has been disposed of. + /// The MediaPacket that owns the current buffer has already been disposed of. public int Length { get diff --git a/src/Tizen.Multimedia/MediaTool/MediaPacketBufferFlags.cs b/src/Tizen.Multimedia/MediaTool/MediaPacketBufferFlags.cs index 7c1bf05..897d4b3 100644 --- a/src/Tizen.Multimedia/MediaTool/MediaPacketBufferFlags.cs +++ b/src/Tizen.Multimedia/MediaTool/MediaPacketBufferFlags.cs @@ -28,12 +28,12 @@ namespace Tizen.Multimedia public enum MediaPacketBufferFlags { /// - /// The buffer contains codec initialization or codec specific data instead of media data. + /// The buffer contains the codec initialization or the codec specific data instead of the media data. /// CodecConfig = 0x1, /// - /// The buffer indicates the end of stream. + /// The buffer indicates the end of the stream. /// EndOfStream = 0x2, diff --git a/src/Tizen.Multimedia/MediaTool/MediaPacketVideoPlane.cs b/src/Tizen.Multimedia/MediaTool/MediaPacketVideoPlane.cs index 3291221..aaabb39 100644 --- a/src/Tizen.Multimedia/MediaTool/MediaPacketVideoPlane.cs +++ b/src/Tizen.Multimedia/MediaTool/MediaPacketVideoPlane.cs @@ -20,8 +20,8 @@ using System.Diagnostics; namespace Tizen.Multimedia { /// - /// Represents a video plane for . - /// This class is used if and only if the format of the packet is raw video. + /// Represents a video plane for the . + /// This class is used if and only if the format of the packet is the raw video. /// public class MediaPacketVideoPlane { @@ -54,7 +54,7 @@ namespace Tizen.Multimedia /// /// Gets the buffer of the current video plane. /// - /// The MediaPacket that owns the current buffer already has been disposed of. + /// The MediaPacket that owns the current buffer has already been disposed of. public MediaPacketBuffer Buffer { get @@ -67,7 +67,7 @@ namespace Tizen.Multimedia /// /// Gets the stride width of the current video plane. /// - /// The MediaPacket that owns the current buffer already has been disposed of. + /// The MediaPacket that owns the current buffer has already been disposed of. public int StrideWidth { get @@ -80,7 +80,7 @@ namespace Tizen.Multimedia /// /// Gets the stride height of the current video plane. /// - /// The MediaPacket that owns the current buffer already has been disposed of. + /// The MediaPacket that owns the current buffer has already been disposed of. public int StrideHeight { get diff --git a/src/Tizen.Multimedia/MediaTool/TextMediaFormat.cs b/src/Tizen.Multimedia/MediaTool/TextMediaFormat.cs index 3f28fe9..1c5ef6b 100644 --- a/src/Tizen.Multimedia/MediaTool/TextMediaFormat.cs +++ b/src/Tizen.Multimedia/MediaTool/TextMediaFormat.cs @@ -31,7 +31,8 @@ namespace Tizen.Multimedia /// The mime type of the format. /// The text type of the format. /// - /// mimeType or textType is invalid(i.e. undefined value). + /// or is invalid (i.e. undefined value). + /// public TextMediaFormat(MediaFormatTextMimeType mimeType, MediaFormatTextType textType) : base(MediaFormatType.Text) { @@ -66,11 +67,11 @@ namespace Tizen.Multimedia } /// - /// Retrieves text properties of media format from a native handle. + /// Retrieves text properties of the media format from a native handle. /// - /// A native handle that properties are retrieved from. - /// An out parameter for mime type. - /// An out parameter for text type. + /// A native handle that the properties are retrieved from. + /// An out parameter for the mime type. + /// An out parameter for the text type. private static void GetInfo(IntPtr handle, out MediaFormatTextMimeType mimeType, out MediaFormatTextType textType) { diff --git a/src/Tizen.Multimedia/MediaTool/VideoMediaFormat.cs b/src/Tizen.Multimedia/MediaTool/VideoMediaFormat.cs index 4890dd1..ca74d18 100644 --- a/src/Tizen.Multimedia/MediaTool/VideoMediaFormat.cs +++ b/src/Tizen.Multimedia/MediaTool/VideoMediaFormat.cs @@ -28,13 +28,13 @@ namespace Tizen.Multimedia private const int DefaultBitRate = 0; /// - /// Initializes a new instance of the VideoMediaFormat class with the specified mime type, width and height. + /// Initializes a new instance of the VideoMediaFormat class with the specified mime type, width, and height. /// /// The mime type of the format. /// The width value of the format. /// The height value of the format - /// mimeType is invalid(i.e. undefined value). - /// width, or height is less than zero. + /// is invalid (i.e. undefined value). + /// or is less than zero. public VideoMediaFormat(MediaFormatVideoMimeType mimeType, int width, int height) : this(mimeType, width, height, DefaultFrameRate) { @@ -45,8 +45,8 @@ namespace Tizen.Multimedia /// /// The mime type of the format. /// The size of the format. - /// mimeType is invalid(i.e. undefined value). - /// width, or height is less than zero. + /// is invalid (i.e. undefined value). + /// The width or the height of is less than zero. public VideoMediaFormat(MediaFormatVideoMimeType mimeType, Size size) : this(mimeType, size, DefaultFrameRate) { @@ -54,29 +54,34 @@ namespace Tizen.Multimedia /// /// Initializes a new instance of the VideoMediaFormat class with the specified mime type, - /// width, height and frame rate. + /// width, height, and frame rate. /// /// The mime type of the format. /// The width value of the format. /// The height value of the format /// The frame rate of the format. - /// mimeType is invalid(i.e. undefined value). - /// width, height or frameRate is less than zero. - public VideoMediaFormat(MediaFormatVideoMimeType mimeType, int width, int height, - int frameRate) + /// is invalid (i.e. undefined value). + /// + /// , , or is less than zero. + /// + public VideoMediaFormat(MediaFormatVideoMimeType mimeType, int width, int height, int frameRate) : this(mimeType, width, height, frameRate, DefaultBitRate) { } /// /// Initializes a new instance of the VideoMediaFormat class with the specified mime type, - /// width, height and frame rate. + /// width, height, and frame rate. /// /// The mime type of the format. /// The video size of the format. /// The frame rate of the format. - /// mimeType is invalid(i.e. undefined value). - /// width, height or frameRate is less than zero. + /// is invalid (i.e. undefined value). + /// + /// The width or the height of is less than zero.\n + /// -or-\n + /// is less than zero. + /// public VideoMediaFormat(MediaFormatVideoMimeType mimeType, Size size, int frameRate) : this(mimeType, size, frameRate, DefaultBitRate) @@ -85,15 +90,17 @@ namespace Tizen.Multimedia /// /// Initializes a new instance of the VideoMediaFormat class with the specified mime type, - /// width, height, frame rate and bit rate. + /// width, height, frame rate, and bit rate. /// /// The mime type of the format. /// The width value of the format. /// The height value of the format /// The frame rate of the format. /// The bit rate of the format. - /// mimeType is invalid(i.e. undefined value). - /// width, height, frameRate or bitRate is less than zero. + /// is invalid (i.e. undefined value). + /// + /// , , , or is less than zero. + /// public VideoMediaFormat(MediaFormatVideoMimeType mimeType, int width, int height, int frameRate, int bitRate) : this(mimeType, new Size(width, height), frameRate, bitRate) @@ -102,14 +109,20 @@ namespace Tizen.Multimedia /// /// Initializes a new instance of the VideoMediaFormat class with the specified mime type, - /// size, frame rate and bit rate. + /// size, frame rate, and bit rate. /// /// The mime type of the format. /// The size of the format. /// The frame rate of the format. /// The bit rate of the format. - /// mimeType is invalid(i.e. undefined value). - /// width, height, frameRate or bitRate is less than zero. + /// is invalid (i.e. undefined value). + /// + /// The width or the height of is less than zero.\n + /// -or-\n + /// is less than zero.\n + /// -or-\n + /// is less than zero. + /// public VideoMediaFormat(MediaFormatVideoMimeType mimeType, Size size, int frameRate, int bitRate) : base(MediaFormatType.Video) @@ -166,13 +179,13 @@ namespace Tizen.Multimedia } /// - /// Retrieves video properties of media format from a native handle. + /// Retrieves video properties of the media format from a native handle. /// - /// A native handle that properties are retrieved from. - /// An out parameter for width. - /// An out parameter for height. - /// An out parameter for bit rate. - /// An out parameter for mime type. + /// A native handle that the properties are retrieved from. + /// An out parameter for the width. + /// An out parameter for the height. + /// An out parameter for the bit rate. + /// An out parameter for the mime type. private static void GetInfo(IntPtr handle, out int width, out int height, out int bitRate, out MediaFormatVideoMimeType mimeType) { @@ -195,8 +208,8 @@ namespace Tizen.Multimedia /// /// Retrieves frame rate from a native handle. /// - /// A native handle that properties are retrieved from. - /// An out parameter for frame rate. + /// A native handle that the properties are retrieved from. + /// An out parameter for the frame rate. private static void GetFrameRate(IntPtr handle, out int frameRate) { Debug.Assert(handle != IntPtr.Zero, "The handle is invalid!"); diff --git a/src/Tizen.Multimedia/MediaView/MediaView.cs b/src/Tizen.Multimedia/MediaView/MediaView.cs index 08e532f..f064a72 100755 --- a/src/Tizen.Multimedia/MediaView/MediaView.cs +++ b/src/Tizen.Multimedia/MediaView/MediaView.cs @@ -20,7 +20,7 @@ using ElmSharp; namespace Tizen.Multimedia { /// - /// The MediaView class allows application developers to display the video output on screen. + /// The MediaView class allows application developers to display the video output on the screen. /// /// /// This view should not be instantiated directly.\n diff --git a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcManager.cs b/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcManager.cs index 43f88e7..41fe3cf 100755 --- a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcManager.cs +++ b/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcManager.cs @@ -38,7 +38,7 @@ namespace Tizen.Network.Nfc { bool isNfcSupported = false; - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); if (!isNfcSupported) { @@ -66,7 +66,7 @@ namespace Tizen.Network.Nfc { bool isNfcSupported = false; - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); if (!isNfcSupported) { @@ -95,8 +95,8 @@ namespace Tizen.Network.Nfc bool isNfcSupported = false; bool isTagSupported = false; - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc.tag", out isTagSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc.tag", out isTagSupported); if (!isNfcSupported || !isTagSupported) { @@ -117,8 +117,8 @@ namespace Tizen.Network.Nfc bool isNfcSupported = false; bool isTagSupported = false; - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc.tag", out isTagSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc.tag", out isTagSupported); if (!isNfcSupported || !isTagSupported) { @@ -148,8 +148,8 @@ namespace Tizen.Network.Nfc bool isNfcSupported = false; bool isCeSupported = false; - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc.cardemulation", out isCeSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc.cardemulation", out isCeSupported); if (!isNfcSupported || !isCeSupported) { @@ -170,8 +170,8 @@ namespace Tizen.Network.Nfc bool isNfcSupported = false; bool isCeSupported = false; - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc.cardemulation", out isCeSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc.cardemulation", out isCeSupported); if (!isNfcSupported || !isCeSupported) { @@ -200,7 +200,7 @@ namespace Tizen.Network.Nfc { bool isNfcSupported = false; - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); if (!isNfcSupported) { @@ -220,7 +220,7 @@ namespace Tizen.Network.Nfc { bool isNfcSupported = false; - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); if (!isNfcSupported) { @@ -248,7 +248,7 @@ namespace Tizen.Network.Nfc { bool isNfcSupported = false; - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); if (!isNfcSupported) { @@ -275,8 +275,8 @@ namespace Tizen.Network.Nfc bool isNfcSupported = false; bool isTagSupported = false; - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc.tag", out isTagSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc.tag", out isTagSupported); if (!isNfcSupported || !isTagSupported) { @@ -302,8 +302,8 @@ namespace Tizen.Network.Nfc bool isNfcSupported = false; bool isP2pSupported = false; - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc.p2p", out isP2pSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc.p2p", out isP2pSupported); if (!isNfcSupported || !isP2pSupported) { @@ -329,8 +329,8 @@ namespace Tizen.Network.Nfc bool isNfcSupported = false; bool isCeSupported = false; - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc.cardemulation", out isCeSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc.cardemulation", out isCeSupported); if (!isNfcSupported || !isCeSupported) { @@ -357,7 +357,7 @@ namespace Tizen.Network.Nfc { bool isNfcSupported = false; - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); if (!isNfcSupported) { @@ -384,7 +384,7 @@ namespace Tizen.Network.Nfc { bool isNfcSupported = false; - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); if (!isNfcSupported) { @@ -404,7 +404,7 @@ namespace Tizen.Network.Nfc { bool isNfcSupported = false; - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); if (!isNfcSupported) { @@ -432,7 +432,7 @@ namespace Tizen.Network.Nfc { bool isNfcSupported = false; - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); if (!isNfcSupported) { @@ -452,7 +452,7 @@ namespace Tizen.Network.Nfc { bool isNfcSupported = false; - SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); if (!isNfcSupported) { diff --git a/src/Tizen.Sensor/Tizen.Sensor/Sensor.cs b/src/Tizen.Sensor/Tizen.Sensor/Sensor.cs index 9b48dee..2210fd3 100755 --- a/src/Tizen.Sensor/Tizen.Sensor/Sensor.cs +++ b/src/Tizen.Sensor/Tizen.Sensor/Sensor.cs @@ -287,7 +287,7 @@ namespace Tizen.Sensor internal static bool CheckIfSupported(SensorType type, String key) { bool isSupported = false; - bool error = SystemInfo.TryGetValue(key, out isSupported); + bool error = Information.TryGetValue(key, out isSupported); if (!error || !isSupported) { diff --git a/src/Tizen.System.Information/Common/Information.cs b/src/Tizen.System.Information/Common/Information.cs new file mode 100755 index 0000000..5ec9dc0 --- /dev/null +++ b/src/Tizen.System.Information/Common/Information.cs @@ -0,0 +1,197 @@ +/* +* Copyright (c) 2017 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 System.Collections.Generic; +using System.ComponentModel; +using System.IO; + +namespace Tizen.System +{ + /// + /// The Information class provides functions to obtain various system information. + /// + public static class Information + { + internal const string HttpPrefix = "http://"; + internal const string RuntimeInfoStringKeyPrefix = "tizen.org/runtimefeature/"; + + internal const string RuntimeInfoStringKeyBluetooth = "bluetooth"; + internal const string RuntimeInfoStringKeyTetheringWiFi = "tethering.wifi"; + internal const string RuntimeInfoStringKeyTetheringBluetooth = "tethering.bluetooth"; + internal const string RuntimeInfoStringKeyTetheringUsb = "tethering.usb"; + internal const string RuntimeInfoStringKeyPacketData = "packetdata"; + internal const string RuntimeInfoStringKeyDataRoaming = "dataroaming"; + internal const string RuntimeInfoStringKeyVibration = "vibration"; + internal const string RuntimeInfoStringKeyAudioJackConnected = "audiojack.connected"; + internal const string RuntimeInfoStringKeyBatteryCharging = "battery.charging"; + internal const string RuntimeInfoStringKeyTvOut = "tvout"; + internal const string RuntimeInfoStringKeyCharger = "charger"; + internal const string RuntimeInfoStringKeyAutoRotation = "autorotation"; + internal const string RuntimeInfoStringKeyGps = "gps"; + internal const string RuntimeInfoStringKeyAudioJackType = "audiojack.type"; + + + private static readonly Dictionary StringEnumMapping = new Dictionary + { + [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyBluetooth] = RuntimeInfoKey.Bluetooth, + [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyTetheringWiFi] = RuntimeInfoKey.WifiHotspot, + [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyTetheringBluetooth] = RuntimeInfoKey.BluetoothTethering, + [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyTetheringUsb] = RuntimeInfoKey.UsbTethering, + [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyPacketData] = RuntimeInfoKey.PacketData, + [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyDataRoaming] = RuntimeInfoKey.DataRoaming, + [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyVibration] = RuntimeInfoKey.Vibration, + [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyAudioJackConnected] = RuntimeInfoKey.AudioJack, + [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyBatteryCharging] = RuntimeInfoKey.BatteryIsCharging, + [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyTvOut] = RuntimeInfoKey.TvOut, + [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyCharger] = RuntimeInfoKey.Charger, + [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyAutoRotation] = RuntimeInfoKey.AutoRotation, + [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyGps] = RuntimeInfoKey.Gps, + [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyAudioJackType] = RuntimeInfoKey.AudioJackConnector + }; + + internal static readonly Dictionary EnumStringMapping = new Dictionary + { + [RuntimeInfoKey.Bluetooth] = RuntimeInfoStringKeyBluetooth, + [RuntimeInfoKey.WifiHotspot] = RuntimeInfoStringKeyTetheringWiFi, + [RuntimeInfoKey.BluetoothTethering] = RuntimeInfoStringKeyTetheringBluetooth, + [RuntimeInfoKey.UsbTethering] = RuntimeInfoStringKeyTetheringUsb, + [RuntimeInfoKey.PacketData] = RuntimeInfoStringKeyPacketData, + [RuntimeInfoKey.DataRoaming] = RuntimeInfoStringKeyDataRoaming, + [RuntimeInfoKey.Vibration] = RuntimeInfoStringKeyVibration, + [RuntimeInfoKey.AudioJack] = RuntimeInfoStringKeyAudioJackConnected, + [RuntimeInfoKey.BatteryIsCharging] = RuntimeInfoStringKeyBatteryCharging, + [RuntimeInfoKey.TvOut] = RuntimeInfoStringKeyTvOut, + [RuntimeInfoKey.Charger] = RuntimeInfoStringKeyCharger, + [RuntimeInfoKey.AutoRotation] = RuntimeInfoStringKeyAutoRotation, + [RuntimeInfoKey.Gps] = RuntimeInfoStringKeyGps, + [RuntimeInfoKey.AudioJackConnector] = RuntimeInfoStringKeyAudioJackType + }; + + [EditorBrowsable(EditorBrowsableState.Never)] + private static bool ConvertStringToRuntimeInfoKey(string key, out RuntimeInfoKey feature) + { + string filteredKey = key.StartsWith(HttpPrefix) ? key.Substring(HttpPrefix.Length) : key; + feature = default(RuntimeInfoKey); + + return StringEnumMapping.TryGetValue(filteredKey, out feature); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + private static bool TryGetRuntimeInfoValue(RuntimeInfoKey key, out T value) + { + value = default(T); + + if (!RuntimeInfo.Is(key)) + { + Log.Error(InformationErrorFactory.LogTag, "Invalid return type"); + return false; + } + + return RuntimeInfo.TryGetValue(key, out value); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + private static bool TryGetSystemInfoValue(string key, out T value) + { + value = default(T); + + if (!SystemInfo.IsValidKey(key)) + { + Log.Error(InformationErrorFactory.LogTag, "Invalid key"); + return false; + } + + if (!SystemInfo.Is(key)) + { + Log.Error(InformationErrorFactory.LogTag, "Invalid return type"); + return false; + } + + return SystemInfo.TryGetValue(key, out value); + } + + /// + /// Gets the value of the feature. + /// + /// 4 + /// The type of . + /// The name of the feature. + /// The value of the given feature. + /// Returns true on success, otherwise false. + public static bool TryGetValue(string key, out T value) + { + RuntimeInfoKey runtimeFeature; + + if (ConvertStringToRuntimeInfoKey(key, out runtimeFeature)) + { + return TryGetRuntimeInfoValue(runtimeFeature, out value); + } + else + { + return TryGetSystemInfoValue(key, out value); + } + } + + /// + /// Registers a change event callback for given runtime feature key. + /// + /// + /// This function is only for runtime feature. + /// + /// 4 + /// The name of runtime feature which wants to register callback. + /// The callback function to subscribe. + /// Thrown when the is invalid. + /// Thrown when the feature related is not supported. + public static void SetCallback(string key, EventHandler callback) + { + RuntimeInfoKey runtimeFeature; + + if (!ConvertStringToRuntimeInfoKey(key, out runtimeFeature)) + { + Log.Error(InformationErrorFactory.LogTag, "Invalid key"); + InformationErrorFactory.ThrowException(InformationError.InvalidParameter); + } + + RuntimeInfo.SetCallback(runtimeFeature, callback); + } + + /// + /// Unregisters a change event callback for given runtime feature key. + /// + /// + /// This function is only for runtime feature. + /// + /// 4 + /// The name of runtime feature which wants to unregister callback. + /// The callback function to unsubscribe. + /// Thrown when the is invalid. + /// Thrown when the feature related is not supported. + public static void UnsetCallback(string key, EventHandler callback) + { + RuntimeInfoKey runtimeFeature; + + if (!ConvertStringToRuntimeInfoKey(key, out runtimeFeature)) + { + Log.Error(InformationErrorFactory.LogTag, "Invalid key"); + InformationErrorFactory.ThrowException(InformationError.InvalidParameter); + } + + RuntimeInfo.UnsetCallback(runtimeFeature, callback); + } + } +} diff --git a/src/Tizen.System.Information/RuntimeInfo/RuntimeInfoErrorFactory.cs b/src/Tizen.System.Information/Common/InformationErrorFactory.cs old mode 100644 new mode 100755 similarity index 73% rename from src/Tizen.System.Information/RuntimeInfo/RuntimeInfoErrorFactory.cs rename to src/Tizen.System.Information/Common/InformationErrorFactory.cs index e9fee57..906961d --- a/src/Tizen.System.Information/RuntimeInfo/RuntimeInfoErrorFactory.cs +++ b/src/Tizen.System.Information/Common/InformationErrorFactory.cs @@ -22,7 +22,7 @@ using Tizen.Internals.Errors; namespace Tizen.System { [EditorBrowsable(EditorBrowsableState.Never)] - internal enum RuntimeInfoError + internal enum InformationError { None = ErrorCode.None, InvalidParameter = ErrorCode.InvalidParameter, @@ -35,38 +35,38 @@ namespace Tizen.System } [EditorBrowsable(EditorBrowsableState.Never)] - internal static class RuntimeInfoErrorFactory + internal static class InformationErrorFactory { - internal const string LogTag = "Tizen.System.RuntimeInformation"; + internal const string LogTag = "Tizen.System.Information"; - internal static void ThrowException(int err) + internal static void ThrowException(InformationError err) { - RuntimeInfoError error = (RuntimeInfoError)err; - if (error == RuntimeInfoError.InvalidParameter) + InformationError error = (InformationError)err; + if (error == InformationError.InvalidParameter) { throw new ArgumentException("Invalid parameter"); } - else if (error == RuntimeInfoError.OutOfMemory) + else if (error == InformationError.OutOfMemory) { throw new OutOfMemoryException("Out of memory"); } - else if (error == RuntimeInfoError.Io) + else if (error == InformationError.Io) { throw new IOException("I/O Error"); } - else if (error == RuntimeInfoError.RemoteIo) + else if (error == InformationError.RemoteIo) { throw new IOException("Remote I/O Error"); } - else if (error == RuntimeInfoError.PermissionDenied) + else if (error == InformationError.PermissionDenied) { throw new UnauthorizedAccessException("Permission denied"); } - else if (error == RuntimeInfoError.NotSupported) + else if (error == InformationError.NotSupported) { throw new NotSupportedException("Not supported"); } - else if (error == RuntimeInfoError.NoData) + else if (error == InformationError.NoData) { throw new NotSupportedException("No data"); } diff --git a/src/Tizen.System.Information/Interop/Interop.RuntimeInfo.cs b/src/Tizen.System.Information/Interop/Interop.RuntimeInfo.cs old mode 100644 new mode 100755 index 21ab05e..d34d53a --- a/src/Tizen.System.Information/Interop/Interop.RuntimeInfo.cs +++ b/src/Tizen.System.Information/Interop/Interop.RuntimeInfo.cs @@ -22,7 +22,7 @@ internal static partial class Interop { internal static partial class RuntimeInfo { - public delegate void RuntimeInformationChangedCallback(RuntimeInformationKey key, IntPtr userData); + public delegate void RuntimeInformationChangedCallback(RuntimeInfoKey key, IntPtr userData); [StructLayout(LayoutKind.Sequential)] public struct MemoryInfo @@ -63,42 +63,42 @@ internal static partial class Interop } [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_value_int")] - public static extern int GetValue(RuntimeInformationKey key, out int status); + public static extern InformationError GetValue(RuntimeInfoKey key, out int status); [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_value_bool")] - public static extern int GetValue(RuntimeInformationKey key, out bool status); + public static extern InformationError GetValue(RuntimeInfoKey key, out bool status); [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_value_double")] - public static extern int GetValue(RuntimeInformationKey key, out double status); + public static extern InformationError GetValue(RuntimeInfoKey key, out double status); [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_value_string")] - public static extern int GetValue(RuntimeInformationKey key, out string status); + public static extern InformationError GetValue(RuntimeInfoKey key, out string status); [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_system_memory_info")] - public static extern int GetSystemMemoryInfo(out MemoryInfo memoryInfo); + public static extern InformationError GetSystemMemoryInfo(out MemoryInfo memoryInfo); [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_process_memory_info")] - public static extern int GetProcessMemoryInfo(int[] pid, int size, out ProcessMemoryInfo[] array); + public static extern InformationError GetProcessMemoryInfo(int[] pid, int size, ref IntPtr array); [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_cpu_usage")] - public static extern int GetCpuUsage(out CpuUsage cpuUsage); + public static extern InformationError GetCpuUsage(out CpuUsage cpuUsage); [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_process_cpu_usage")] - public static extern int GetProcessCpuUsage(int[] pid, int size, out ProcessCpuUsage[] array); + public static extern InformationError GetProcessCpuUsage(int[] pid, int size, ref IntPtr array); [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_processor_count")] - public static extern int GetProcessorCount(out int processorCount); + public static extern InformationError GetProcessorCount(out int processorCount); [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_processor_current_frequency")] - public static extern int GetProcessorCurrentFrequency(int coreId, out int cpuFreq); + public static extern InformationError GetProcessorCurrentFrequency(int coreId, out int cpuFreq); [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_processor_max_frequency")] - public static extern int GetProcessorMaxFrequency(int coreId, out int cpuFreq); + public static extern InformationError GetProcessorMaxFrequency(int coreId, out int cpuFreq); [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_set_changed_cb")] - public static extern int SetRuntimeInfoChangedCallback(RuntimeInformationKey runtimeInfoKey, RuntimeInformationChangedCallback cb, IntPtr userData); + public static extern InformationError SetRuntimeInfoChangedCallback(RuntimeInfoKey runtimeInfoKey, RuntimeInformationChangedCallback cb, IntPtr userData); [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_unset_changed_cb")] - public static extern int UnsetRuntimeInfoChangedCallback(RuntimeInformationKey runtimeInfoKey); + public static extern InformationError UnsetRuntimeInfoChangedCallback(RuntimeInfoKey runtimeInfoKey); } } diff --git a/src/Tizen.System.Information/Interop/Interop.SystemInfo.cs b/src/Tizen.System.Information/Interop/Interop.SystemInfo.cs old mode 100644 new mode 100755 index de7282e..2e820be --- a/src/Tizen.System.Information/Interop/Interop.SystemInfo.cs +++ b/src/Tizen.System.Information/Interop/Interop.SystemInfo.cs @@ -14,23 +14,13 @@ * limitations under the License. */ -using System; +using Tizen.System; using System.Runtime.InteropServices; internal static partial class Interop { internal static partial class SystemInfo { - internal enum ErrorCode - { - None = Tizen.Internals.Errors.ErrorCode.None, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - IoError = Tizen.Internals.Errors.ErrorCode.IoError, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - NotSupported = Tizen.Internals.Errors.ErrorCode.NoSuchDevice, - } - internal enum SystemInfoValueType { Bool = 0, @@ -47,33 +37,33 @@ internal static partial class Interop } [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_type")] - internal static extern ErrorCode SystemInfoGetPlatformType(string key, out SystemInfoValueType type); + internal static extern InformationError SystemInfoGetPlatformType(string key, out SystemInfoValueType type); [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_type")] - internal static extern ErrorCode SystemInfoGetCustomType(string key, out SystemInfoValueType type); + internal static extern InformationError SystemInfoGetCustomType(string key, out SystemInfoValueType type); [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_bool")] - internal static extern ErrorCode SystemInfoGetPlatformBool(string key, out bool value); + internal static extern InformationError SystemInfoGetPlatformBool(string key, out bool value); [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_int")] - internal static extern ErrorCode SystemInfoGetPlatformInt(string key, out int value); + internal static extern InformationError SystemInfoGetPlatformInt(string key, out int value); [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_double")] - internal static extern ErrorCode SystemInfoGetPlatformDouble(string key, out double value); + internal static extern InformationError SystemInfoGetPlatformDouble(string key, out double value); [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_string")] - internal static extern ErrorCode SystemInfoGetPlatformString(string key, out string value); + internal static extern InformationError SystemInfoGetPlatformString(string key, out string value); [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_bool")] - internal static extern ErrorCode SystemInfoGetCustomBool(string key, out bool value); + internal static extern InformationError SystemInfoGetCustomBool(string key, out bool value); [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_int")] - internal static extern ErrorCode SystemInfoGetCustomInt(string key, out int value); + internal static extern InformationError SystemInfoGetCustomInt(string key, out int value); [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_double")] - internal static extern ErrorCode SystemInfoGetCustomDouble(string key, out double value); + internal static extern InformationError SystemInfoGetCustomDouble(string key, out double value); [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_string")] - internal static extern ErrorCode SystemInfoGetCustomString(string key, out string value); + internal static extern InformationError SystemInfoGetCustomString(string key, out string value); } } diff --git a/src/Tizen.System.Information/RuntimeInfo/CpuUsage.cs b/src/Tizen.System.Information/RuntimeInfo/CpuUsage.cs deleted file mode 100755 index 35ceb90..0000000 --- a/src/Tizen.System.Information/RuntimeInfo/CpuUsage.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* -* 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 System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.ComponentModel; - -namespace Tizen.System -{ - /// - /// The structure for CPU usage. - /// - public class CpuUsage - { - [EditorBrowsable(EditorBrowsableState.Never)] - internal CpuUsage(Interop.RuntimeInfo.CpuUsage usage) - { - IoWait = usage.IoWait; - Nice = usage.IoWait; - System = usage.System; - User = usage.User; - } - /// - /// Running time of un-niced user processes (Percent). - /// - public double User { get; internal set; } - /// - /// Running time of kernel processes (Percent). - /// - public double System { get; internal set; } - /// - /// Running time of niced user processes (Percent). - /// - public double Nice { get; internal set; } - /// - /// Time waiting for I/O completion (Percent). - /// - public double IoWait { get; internal set; } - } - - /// - /// The structure for CPU usage per process. - /// - public class ProcessCpuUsage - { - [EditorBrowsable(EditorBrowsableState.Never)] - internal ProcessCpuUsage(Interop.RuntimeInfo.ProcessCpuUsage usage) - { - UTime = usage.UTime; - STime = usage.STime; - } - /// - /// The amount of time this process has been scheduled in user mode (clock ticks). - /// - public uint UTime { get; internal set; } - /// - /// The amount of time this process has been scheduled in kernel mode (clock ticks). - /// - public uint STime { get; internal set; } - } -} diff --git a/src/Tizen.System.Information/RuntimeInfo/Enumerations.cs b/src/Tizen.System.Information/RuntimeInfo/Enumerations.cs index 8b2fcf0..ea0281d 100755 --- a/src/Tizen.System.Information/RuntimeInfo/Enumerations.cs +++ b/src/Tizen.System.Information/RuntimeInfo/Enumerations.cs @@ -14,14 +14,15 @@ * limitations under the License. */ -using System; +using System.ComponentModel; namespace Tizen.System { + [EditorBrowsable(EditorBrowsableState.Never)] /// /// Enumeration for the runtime information key. /// - public enum RuntimeInformationKey + internal enum RuntimeInfoKey { /// /// Indicates whether Bluetooth is enabled. @@ -29,7 +30,6 @@ namespace Tizen.System Bluetooth = 2, /// /// Indicates whether Wi-Fi hotspot is enabled. - /// /// WifiHotspot = 3, /// @@ -85,25 +85,6 @@ namespace Tizen.System } /// - /// Enumeration for the Wi-Fi status. - /// - public enum WifiStatus - { - /// - /// The Wi-Fi is disabled. - /// - Disabled, - /// - /// The Wi-Fi is enabled and the network connection is not established. - /// - Unconnected, - /// - /// The network connection is established in a Wi-Fi network. - /// - Connected - } - - /// /// Enumeration for the GPS status. /// public enum GpsStatus diff --git a/src/Tizen.System.Information/RuntimeInfo/MemoryInformation.cs b/src/Tizen.System.Information/RuntimeInfo/MemoryInformation.cs deleted file mode 100755 index fa38d06..0000000 --- a/src/Tizen.System.Information/RuntimeInfo/MemoryInformation.cs +++ /dev/null @@ -1,107 +0,0 @@ -/* -* 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 System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.ComponentModel; - -namespace Tizen.System -{ - /// - /// Memory information. - /// - public class SystemMemoryInformation - { - [EditorBrowsable(EditorBrowsableState.Never)] - internal SystemMemoryInformation(Interop.RuntimeInfo.MemoryInfo info) - { - Total = info.Total; - Used = info.Used; - Cache = info.Cache; - Free = info.Free; - Swap = info.Swap; - } - /// - /// Total memory (KiB). - /// - public int Total { get; internal set; } - /// - /// Used memory (KiB). - /// - public int Used { get; internal set; } - /// - /// Free memory (KiB). - /// - public int Free { get; internal set; } - /// - /// Cache memory (KiB). - /// - public int Cache { get; internal set; } - /// - /// Swap memory (KiB). - /// - public int Swap { get; internal set; } - } - - /// - /// Memory information per process. - /// - public class ProcessMemoryInformation - { - [EditorBrowsable(EditorBrowsableState.Never)] - internal ProcessMemoryInformation(Interop.RuntimeInfo.ProcessMemoryInfo info) - { - PrivateClean = info.PrivateClean; - PrivateDirty = info.PrivateDirty; - Pss = info.Pss; - Rss = info.Rss; - SharedClean = info.SharedClean; - SharedDirty = info.SharedDirty; - Vsz = info.Vsz; - } - /// - /// Virtual memory size (KiB). - /// - public int Vsz { get; internal set; } - /// - /// Resident set size (KiB). - /// - public int Rss { get; internal set; } - /// - /// Proportional set size (KiB). - /// - public int Pss { get; internal set; } - /// - /// Not modified and mapped by other processes (KiB). - /// - public int SharedClean { get; internal set; } - /// - /// Modified and mapped by other processes (KiB). - /// - public int SharedDirty { get; internal set; } - /// - /// Not modified and available only to that process (KiB). - /// - public int PrivateClean { get; internal set; } - /// - /// Modified and available only to that process (KiB). - /// - public int PrivateDirty { get; internal set; } - } -} diff --git a/src/Tizen.System.Information/RuntimeInfo/RuntimeKeyStatusChangedEventArgs.cs b/src/Tizen.System.Information/RuntimeInfo/RuntimeFeatureStatusChangedEventArgs.cs similarity index 69% rename from src/Tizen.System.Information/RuntimeInfo/RuntimeKeyStatusChangedEventArgs.cs rename to src/Tizen.System.Information/RuntimeInfo/RuntimeFeatureStatusChangedEventArgs.cs index c145c93..dbfacd8 100755 --- a/src/Tizen.System.Information/RuntimeInfo/RuntimeKeyStatusChangedEventArgs.cs +++ b/src/Tizen.System.Information/RuntimeInfo/RuntimeFeatureStatusChangedEventArgs.cs @@ -15,21 +15,18 @@ */ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Tizen.System { /// - /// RuntimeInfoChangedEventArgs is an extended EventArgs class. This class contains event arguments for runtime event listeners. + /// RuntimeFeatureStatusChangedEventArgs is an extended EventArgs class. This class contains event arguments for runtime event listeners. /// - public class RuntimeKeyStatusChangedEventArgs : EventArgs + public class RuntimeFeatureStatusChangedEventArgs : EventArgs { /// /// The key indicating the runtime system preference which was changed. + /// It includes the prefix "http://" though you don't use for registering callback. /// - public RuntimeInformationKey Key { get; internal set; } + public String Key { get; internal set; } } } diff --git a/src/Tizen.System.Information/RuntimeInfo/RuntimeInfo.cs b/src/Tizen.System.Information/RuntimeInfo/RuntimeInfo.cs new file mode 100755 index 0000000..9ce011a --- /dev/null +++ b/src/Tizen.System.Information/RuntimeInfo/RuntimeInfo.cs @@ -0,0 +1,219 @@ +/* +* Copyright (c) 2016 - 2017 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 System.Collections.Generic; +using System.IO; +using System.ComponentModel; + +namespace Tizen.System +{ + [EditorBrowsable(EditorBrowsableState.Never)] + internal static class RuntimeInfo + { + private static RuntimeInfoEventHandler BluetoothEnabled = new RuntimeInfoEventHandler(RuntimeInfoKey.Bluetooth); + private static RuntimeInfoEventHandler WifiHotspotEnabled = new RuntimeInfoEventHandler(RuntimeInfoKey.WifiHotspot); + private static RuntimeInfoEventHandler BluetoothTetheringEnabled = new RuntimeInfoEventHandler(RuntimeInfoKey.BluetoothTethering); + private static RuntimeInfoEventHandler UsbTetheringEnabled = new RuntimeInfoEventHandler(RuntimeInfoKey.UsbTethering); + private static RuntimeInfoEventHandler PacketDataEnabled = new RuntimeInfoEventHandler(RuntimeInfoKey.PacketData); + private static RuntimeInfoEventHandler DataRoamingEnabled = new RuntimeInfoEventHandler(RuntimeInfoKey.DataRoaming); + private static RuntimeInfoEventHandler VibrationEnabled = new RuntimeInfoEventHandler(RuntimeInfoKey.Vibration); + private static RuntimeInfoEventHandler AudioJackConnected = new RuntimeInfoEventHandler(RuntimeInfoKey.AudioJack); + private static RuntimeInfoEventHandler GpsStatusChanged = new RuntimeInfoEventHandler(RuntimeInfoKey.Gps); + private static RuntimeInfoEventHandler BatteryIsCharging = new RuntimeInfoEventHandler(RuntimeInfoKey.BatteryIsCharging); + private static RuntimeInfoEventHandler TvOutConnected = new RuntimeInfoEventHandler(RuntimeInfoKey.TvOut); + private static RuntimeInfoEventHandler AudioJackConnectorChanged = new RuntimeInfoEventHandler(RuntimeInfoKey.AudioJackConnector); + private static RuntimeInfoEventHandler ChargerConnected = new RuntimeInfoEventHandler(RuntimeInfoKey.Charger); + private static RuntimeInfoEventHandler AutoRotationEnabled = new RuntimeInfoEventHandler(RuntimeInfoKey.AutoRotation); + + internal static readonly Dictionary s_keyDataTypeMapping = new Dictionary + { + [RuntimeInfoKey.Bluetooth] = typeof(bool), + [RuntimeInfoKey.WifiHotspot] = typeof(bool), + [RuntimeInfoKey.BluetoothTethering] = typeof(bool), + [RuntimeInfoKey.UsbTethering] = typeof(bool), + [RuntimeInfoKey.PacketData] = typeof(bool), + [RuntimeInfoKey.DataRoaming] = typeof(bool), + [RuntimeInfoKey.Vibration] = typeof(bool), + [RuntimeInfoKey.AudioJack] = typeof(bool), + [RuntimeInfoKey.BatteryIsCharging] = typeof(bool), + [RuntimeInfoKey.TvOut] = typeof(bool), + [RuntimeInfoKey.Charger] = typeof(bool), + [RuntimeInfoKey.AutoRotation] = typeof(bool), + [RuntimeInfoKey.Gps] = typeof(int), + [RuntimeInfoKey.AudioJackConnector] = typeof(int) + }; + + /// + /// Validates the data type of the status represented by the runtime key. + /// Note that this is a generic method. + /// + /// The generic type to validate. + /// The runtime information key for which the status type is validated. + /// True if the data type matches. + /// Thrown when the is invalid. + internal static bool Is(RuntimeInfoKey key) + { + if (!s_keyDataTypeMapping.ContainsKey(key)) + { + Log.Error(InformationErrorFactory.LogTag, "Invalid data type"); + throw new ArgumentException("Invalid parameter"); + } + + return s_keyDataTypeMapping[key] == typeof(T); + } + + /// + /// Gets the status of runtime key. + /// Note that this is a generic method. + /// + /// The generic type to return. + /// The runtime information key for which the current should be read. + /// The value of the given feature. + /// Returns true on success, otherwise false. + internal static bool TryGetValue(RuntimeInfoKey key, out T value) + { + Type type; + value = default(T); + + if (!s_keyDataTypeMapping.TryGetValue(key, out type)) + { + Log.Error(InformationErrorFactory.LogTag, "Invalid key"); + return false; + } + + if (type == typeof(bool)) + { + InformationError ret = Interop.RuntimeInfo.GetValue(TvProductHelper.ConvertKeyIfTvProduct(key), out bool val); + + if (ret != InformationError.None) + { + Log.Error(InformationErrorFactory.LogTag, "Interop failed to get value for key {0}", key.ToString()); + return false; + } + + value = (T)(object)val; + } + else if(type == typeof(int)) + { + InformationError ret = Interop.RuntimeInfo.GetValue(TvProductHelper.ConvertKeyIfTvProduct(key), out int val); + + if (ret != InformationError.None) + { + Log.Error(InformationErrorFactory.LogTag, "Interop failed to get value for key {0}", key.ToString()); + return false; + } + + value = (T)(object)val; + } + + return true; + } + + private static void FindEventHandler(RuntimeInfoKey key, ref RuntimeInfoEventHandler handler) + { + switch (key) + { + case RuntimeInfoKey.Bluetooth: + handler = BluetoothEnabled; + break; + case RuntimeInfoKey.WifiHotspot: + handler = WifiHotspotEnabled; + break; + case RuntimeInfoKey.BluetoothTethering: + handler = BluetoothTetheringEnabled; + break; + case RuntimeInfoKey.UsbTethering: + handler = UsbTetheringEnabled; + break; + case RuntimeInfoKey.PacketData: + handler = PacketDataEnabled; + break; + case RuntimeInfoKey.DataRoaming: + handler = DataRoamingEnabled; + break; + case RuntimeInfoKey.Vibration: + handler = VibrationEnabled; + break; + case RuntimeInfoKey.AudioJack: + handler = AudioJackConnected; + break; + case RuntimeInfoKey.Gps: + handler = GpsStatusChanged; + break; + case RuntimeInfoKey.BatteryIsCharging: + handler = BatteryIsCharging; + break; + case RuntimeInfoKey.TvOut: + handler = TvOutConnected; + break; + case RuntimeInfoKey.AudioJackConnector: + handler = AudioJackConnectorChanged; + break; + case RuntimeInfoKey.Charger: + handler = ChargerConnected; + break; + case RuntimeInfoKey.AutoRotation: + handler = AutoRotationEnabled; + break; + default: + handler = null; + break; + } + } + + /// + /// Registers a change event callback for given key. + /// + /// The runtime information key which wants to register callback. + /// The callback function to subscribe. + /// Thrown when the is invalid. + /// Thrown when the feature related is not supported. + internal static void SetCallback(RuntimeInfoKey key, EventHandler callback) + { + RuntimeInfoEventHandler handler = null; + + FindEventHandler(key, ref handler); + if (handler == null) + { + Log.Error(InformationErrorFactory.LogTag, "Invalid key"); + InformationErrorFactory.ThrowException(InformationError.InvalidParameter); + } + + handler.EventHandler += callback; + } + + /// + /// Unregisters a change event callback for given key. + /// + /// The runtime information key which wants to unregister callback. + /// The callback function to unsubscribe. + /// Thrown when the is invalid. + internal static void UnsetCallback(RuntimeInfoKey key, EventHandler callback) + { + RuntimeInfoEventHandler handler = null; + + FindEventHandler(key, ref handler); + if (handler == null) + { + Log.Error(InformationErrorFactory.LogTag, "Invalid key"); + InformationErrorFactory.ThrowException(InformationError.InvalidParameter); + } + + handler.EventHandler -= callback; + } + } +} diff --git a/src/Tizen.System.Information/RuntimeInfo/RuntimeInfoEventHandler.cs b/src/Tizen.System.Information/RuntimeInfo/RuntimeInfoEventHandler.cs new file mode 100755 index 0000000..733e0f1 --- /dev/null +++ b/src/Tizen.System.Information/RuntimeInfo/RuntimeInfoEventHandler.cs @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2016 - 2017 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 System.ComponentModel; + +namespace Tizen.System +{ + [EditorBrowsable(EditorBrowsableState.Never)] + internal class RuntimeInfoEventHandler + { + private RuntimeInfoKey Key; + private event EventHandler Handler; + + internal RuntimeInfoEventHandler(RuntimeInfoKey key) + { + Key = key; + Handler = null; + } + + internal event EventHandler EventHandler + { + add + { + if (Handler == null) + { + InformationError ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(TvProductHelper.ConvertKeyIfTvProduct(Key), RuntimeInformationChangedCallback, IntPtr.Zero); + if (ret != InformationError.None) + { + Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler"); + InformationErrorFactory.ThrowException(ret); + } + } + Handler += value; + } + remove + { + Handler -= value; + if (Handler == null) + { + InformationError ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(TvProductHelper.ConvertKeyIfTvProduct(Key)); + if (ret != InformationError.None) + { + Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler"); + InformationErrorFactory.ThrowException(ret); + } + } + } + } + + private void RuntimeInformationChangedCallback(RuntimeInfoKey key, IntPtr userData) + { + RuntimeFeatureStatusChangedEventArgs eventArgs = new RuntimeFeatureStatusChangedEventArgs() + { + Key = Information.HttpPrefix + Information.RuntimeInfoStringKeyPrefix + (Information.EnumStringMapping.ContainsKey(key) ? Information.EnumStringMapping[key] : "Invalid") + }; + + Handler?.Invoke(null, eventArgs); + } + } +} diff --git a/src/Tizen.System.Information/RuntimeInfo/RuntimeInformation.cs b/src/Tizen.System.Information/RuntimeInfo/RuntimeInformation.cs deleted file mode 100755 index 93c76c3..0000000 --- a/src/Tizen.System.Information/RuntimeInfo/RuntimeInformation.cs +++ /dev/null @@ -1,891 +0,0 @@ -/* -* 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 System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.ComponentModel; - -namespace Tizen.System -{ - /// - /// The RuntimeInformation provides functions to obtain the runtime information of various system preferences. - /// - public static class RuntimeInformation - { - private static event EventHandler s_bluetoothEnabled; - private static event EventHandler s_wifiHotspotEnabled; - private static event EventHandler s_bluetoothTetheringEnabled; - private static event EventHandler s_usbTetheringEnabled; - private static event EventHandler s_packetDataEnabled; - private static event EventHandler s_dataRoamingEnabled; - private static event EventHandler s_vibrationEnabled; - private static event EventHandler s_audioJackConnected; - private static event EventHandler s_gpsStatusChanged; - private static event EventHandler s_batteryIsCharging; - private static event EventHandler s_tvOutConnected; - private static event EventHandler s_audioJackConnectorChanged; - private static event EventHandler s_chargerConnected; - private static event EventHandler s_autoRotationEnabled; - - private static readonly Interop.RuntimeInfo.RuntimeInformationChangedCallback s_runtimeInfoChangedCallback = (RuntimeInformationKey key, IntPtr userData) => - { - RuntimeKeyStatusChangedEventArgs eventArgs = new RuntimeKeyStatusChangedEventArgs() - { - Key = key - }; - switch (key) - { - case RuntimeInformationKey.Bluetooth: - { - s_bluetoothEnabled?.Invoke(null, eventArgs); - break; - }; - case RuntimeInformationKey.WifiHotspot: - { - s_wifiHotspotEnabled?.Invoke(null, eventArgs); - break; - }; - case RuntimeInformationKey.BluetoothTethering: - { - s_bluetoothTetheringEnabled?.Invoke(null, eventArgs); - break; - }; - case RuntimeInformationKey.UsbTethering: - { - s_usbTetheringEnabled?.Invoke(null, eventArgs); - break; - }; - case RuntimeInformationKey.PacketData: - { - s_packetDataEnabled?.Invoke(null, eventArgs); - break; - }; - case RuntimeInformationKey.DataRoaming: - { - s_dataRoamingEnabled?.Invoke(null, eventArgs); - break; - }; - case RuntimeInformationKey.Vibration: - { - s_vibrationEnabled?.Invoke(null, eventArgs); - break; - }; - case RuntimeInformationKey.AudioJack: - { - s_audioJackConnected?.Invoke(null, eventArgs); - break; - }; - case RuntimeInformationKey.Gps: - { - s_gpsStatusChanged?.Invoke(null, eventArgs); - break; - }; - case RuntimeInformationKey.BatteryIsCharging: - { - s_batteryIsCharging?.Invoke(null, eventArgs); - break; - }; - case RuntimeInformationKey.TvOut: - { - s_tvOutConnected?.Invoke(null, eventArgs); - break; - }; - case RuntimeInformationKey.AudioJackConnector: - { - s_audioJackConnectorChanged?.Invoke(null, eventArgs); - break; - }; - case RuntimeInformationKey.Charger: - { - s_chargerConnected?.Invoke(null, eventArgs); - break; - }; - case RuntimeInformationKey.AutoRotation: - { - s_autoRotationEnabled?.Invoke(null, eventArgs); - break; - }; - default: - break; - }; - }; - - internal static readonly Dictionary s_keyDataTypeMapping = new Dictionary - { - [RuntimeInformationKey.Bluetooth] = typeof(bool), - [RuntimeInformationKey.WifiHotspot] = typeof(bool), - [RuntimeInformationKey.BluetoothTethering] = typeof(bool), - [RuntimeInformationKey.UsbTethering] = typeof(bool), - [RuntimeInformationKey.PacketData] = typeof(bool), - [RuntimeInformationKey.DataRoaming] = typeof(bool), - [RuntimeInformationKey.Vibration] = typeof(bool), - [RuntimeInformationKey.AudioJack] = typeof(bool), - [RuntimeInformationKey.BatteryIsCharging] = typeof(bool), - [RuntimeInformationKey.TvOut] = typeof(bool), - [RuntimeInformationKey.Charger] = typeof(bool), - [RuntimeInformationKey.AutoRotation] = typeof(bool), - [RuntimeInformationKey.Gps] = typeof(int), - [RuntimeInformationKey.AudioJackConnector] = typeof(int) - }; - - internal static readonly Dictionary s_keyTVkeyMapping = new Dictionary - { - [RuntimeInformationKey.Bluetooth] = 5, - [RuntimeInformationKey.WifiHotspot] = 6, - [RuntimeInformationKey.BluetoothTethering] = 7, - [RuntimeInformationKey.UsbTethering] = 8, - [RuntimeInformationKey.PacketData] = 13, - [RuntimeInformationKey.DataRoaming] = 14, - [RuntimeInformationKey.Vibration] = 16, - [RuntimeInformationKey.AudioJack] = 20, - [RuntimeInformationKey.BatteryIsCharging] = 22, - [RuntimeInformationKey.TvOut] = 18, - [RuntimeInformationKey.Charger] = 26, - [RuntimeInformationKey.AutoRotation] = 28, - [RuntimeInformationKey.Gps] = 21, - [RuntimeInformationKey.AudioJackConnector] = 20 - }; - - internal static int is_TV_product = -1; - - [EditorBrowsable(EditorBrowsableState.Never)] - /// This function is for a TV product. It will be removed. - internal static RuntimeInformationKey ConvertKeyIfTvProduct(RuntimeInformationKey key) - { - bool is_key_existed = false; - string profile; - int key_TV = -1; - - if (is_TV_product == -1) - { - is_key_existed = SystemInfo.TryGetValue("http://com.samsung/build_config/product_type", out profile); - if (is_key_existed && String.Compare(profile, "TV") == 0) - { - is_TV_product = 1; - } - else - { - is_TV_product = 0; - } - } - - if (is_TV_product == 0) - { - return key; - } - else - { - if (!s_keyTVkeyMapping.TryGetValue(key, out key_TV)) - { - RuntimeInfoErrorFactory.ThrowException((int)RuntimeInfoError.InvalidParameter); - } - return (RuntimeInformationKey)key_TV; - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - internal static object GetStatus(RuntimeInformationKey key) - { - Type value; - if (!s_keyDataTypeMapping.TryGetValue(key, out value)) - { - RuntimeInfoErrorFactory.ThrowException((int)RuntimeInfoError.InvalidParameter); - } - - if (s_keyDataTypeMapping[key] == typeof(int)) - { - int status; - int ret = Interop.RuntimeInfo.GetValue(ConvertKeyIfTvProduct(key), out status); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get value for key {0}", key.ToString()); - RuntimeInfoErrorFactory.ThrowException(ret); - } - - return status; - } - else - { - bool status; - int ret = Interop.RuntimeInfo.GetValue(ConvertKeyIfTvProduct(key), out status); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get value for key {0}", key.ToString()); - RuntimeInfoErrorFactory.ThrowException(ret); - } - - return status; - } - } - - /// - /// Validates the data type of the status represented by the runtime key. - /// Note that this is a generic method. - /// - /// 3 - /// The generic type to validate. - /// The runtime information key for which the status type is validated. - /// True if the data type matches. - /// Thrown when the is invalid. - public static bool Is(RuntimeInformationKey key) - { - if (!s_keyDataTypeMapping.ContainsKey(key)) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Invalid data type"); - throw new ArgumentException("Invalid parameter"); - } - - return s_keyDataTypeMapping[key] == typeof(T); - } - - /// - /// Gets the status of runtime key. - /// Note that this is a generic method. - /// - /// 3 - /// The generic type to return. - /// The runtime information key for which the current should be read. - /// The current status of the given key.. - /// Thrown when the is invalid. - /// Thrown when I/O error occurs while reading from the system. - /// Thrown when the feature related is not supported. - public static T GetStatus(RuntimeInformationKey key) - { - return (T)GetStatus(key); - } - - /// - /// Gets the system memory information. - /// - /// 3 - /// The system memory information structure. - /// Thrown when I/O error occurs while reading from the system. - public static SystemMemoryInformation GetSystemMemoryInformation() - { - Interop.RuntimeInfo.MemoryInfo info = new Interop.RuntimeInfo.MemoryInfo(); - int ret = Interop.RuntimeInfo.GetSystemMemoryInfo(out info); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get System memory information"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - - return new SystemMemoryInformation(info); - } - - /// - /// Gets the memory information per process. - /// - /// 3 - /// List of unique process ids. - /// List of memory information per process. - /// http://tizen.org/privilege/systemmonitor - /// Thrown when the is empty. - /// Thrown when an I/O error occurs while reading from the system or requesting to the resource management daemon. - /// Thrown when the memory is not enough to allocate. - /// Thrown when the caller does not have privilege to use this method. - public static IDictionary GetProcessMemoryInformation(IEnumerable pid) - { - int[] processArray = pid.ToArray(); - Interop.RuntimeInfo.ProcessMemoryInfo[] processMemoryArray = new Interop.RuntimeInfo.ProcessMemoryInfo[pid.Count()]; - Dictionary map = new Dictionary(); - int ret = Interop.RuntimeInfo.GetProcessMemoryInfo(processArray, pid.Count(), out processMemoryArray); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get Process memory information"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - - int idx = 0; - foreach (Interop.RuntimeInfo.ProcessMemoryInfo cur in processMemoryArray) - { - ProcessMemoryInformation processMemory = new ProcessMemoryInformation(cur); - map.Add(processArray[idx], processMemory); - idx++; - } - - return map; - } - - /// - /// Gets the system CPU usage time. - /// - /// 3 - /// The system CPU usage time structure. - /// Thrown when an I/O error occurs while reading from the system. - public static CpuUsage GetCpuUsage() - { - Interop.RuntimeInfo.CpuUsage usage = new Interop.RuntimeInfo.CpuUsage(); - int ret = Interop.RuntimeInfo.GetCpuUsage(out usage); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get cpu usage"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - return new CpuUsage(usage); - } - - /// - /// Gets the CPU usage time per process. - /// - /// 3 - /// List of unique process ids. - /// List of CPU usage information per process. - /// http://tizen.org/privilege/systemmonitor - /// Thrown when the is empty. - /// Thrown when an I/O error occurs while reading from the system or requesting to the resource management daemon. - /// Thrown when the memory is not enough to allocate. - /// Thrown when the caller does not have privilege to use this method. - public static IDictionary GetProcessCpuUsage(IEnumerable pid) - { - int[] processArray = pid.ToArray(); - Interop.RuntimeInfo.ProcessCpuUsage[] processCpuUsageArray = new Interop.RuntimeInfo.ProcessCpuUsage[pid.Count()]; - Dictionary map = new Dictionary(); - int ret = Interop.RuntimeInfo.GetProcessCpuUsage(processArray, pid.Count(), out processCpuUsageArray); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get Process cpu usage"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - - int idx = 0; - foreach (Interop.RuntimeInfo.ProcessCpuUsage cur in processCpuUsageArray) - { - ProcessCpuUsage processUsage = new ProcessCpuUsage(cur); - map.Add(processArray[idx], processUsage); - idx++; - } - - return map; - } - - /// - /// Gets the number of processors. - /// - /// The number of processors. - /// Thrown when an I/O error occurs while reading from system. - public static int ProcessorCount - { - get - { - int count; - int ret = Interop.RuntimeInfo.GetProcessorCount(out count); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get Processor count"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - - return count; - } - } - - /// - /// Gets the current frequency of the processor. - /// - /// 3 - /// The index (from 0) of the CPU core that you want to know the frequency of. - /// The current frequency(MHz) of processor. - /// Thrown when the is invalid. - /// Thrown when an I/O error occurs while reading from system. - /// Thrown when this system does not store the current CPU frequency. - public static int GetProcessorCurrentFrequency(int coreId) - { - int frequency; - int ret = Interop.RuntimeInfo.GetProcessorCurrentFrequency(coreId, out frequency); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get Processor current frequency"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - return frequency; - } - - /// - /// Gets the max frequency of the processor. - /// - /// 3 - /// The index (from 0) of CPU core that you want to know the frequency of. - /// The max frequency(MHz) of processor. - /// Thrown when the is invalid. - /// Thrown when an I/O error occurs while reading from system. - /// Thrown when this system does not store the max CPU frequency. - public static int GetProcessorMaxFrequency(int coreId) - { - int frequency; - int ret = Interop.RuntimeInfo.GetProcessorMaxFrequency(coreId, out frequency); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get Processor max frequency"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - return frequency; - } - - /// - /// (event) BluetoothEnabled is raised when the system preference for Bluetooth is changed. - /// - public static event EventHandler BluetoothEnabled - { - add - { - if (s_bluetoothEnabled == null) - { - int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Bluetooth), s_runtimeInfoChangedCallback, IntPtr.Zero); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - s_bluetoothEnabled += value; - } - remove - { - s_bluetoothEnabled -= value; - if (s_bluetoothEnabled == null) - { - int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Bluetooth)); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - } - } - /// - /// (event) WifiHotspotEnabled is raised when the system preference for Wi-Fi is changed. - /// - public static event EventHandler WifiHotspotEnabled - { - add - { - if (s_wifiHotspotEnabled == null) - { - int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.WifiHotspot), s_runtimeInfoChangedCallback, IntPtr.Zero); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - s_wifiHotspotEnabled += value; - } - remove - { - s_wifiHotspotEnabled -= value; - if (s_wifiHotspotEnabled == null) - { - int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.WifiHotspot)); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - } - } - /// - /// (event) BluetoothTetheringEnabled is raised when the system preference for bluetooth tethering is changed. - /// - public static event EventHandler BluetoothTetheringEnabled - { - add - { - if (s_bluetoothTetheringEnabled == null) - { - int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.BluetoothTethering), s_runtimeInfoChangedCallback, IntPtr.Zero); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - s_bluetoothTetheringEnabled += value; - } - remove - { - s_bluetoothTetheringEnabled -= value; - if (s_bluetoothTetheringEnabled == null) - { - int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.BluetoothTethering)); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - } - } - /// - /// (event) UsbTetheringEnabled is raised when the system preference for USB tethering is changed. - /// - public static event EventHandler UsbTetheringEnabled - { - add - { - if (s_usbTetheringEnabled == null) - { - int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.UsbTethering), s_runtimeInfoChangedCallback, IntPtr.Zero); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - s_usbTetheringEnabled += value; - } - remove - { - s_usbTetheringEnabled -= value; - if (s_usbTetheringEnabled == null) - { - int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.UsbTethering)); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - } - } - /// - /// (event) PacketDataEnabled is raised when the system preference for package data through 3G network is changed. - /// - public static event EventHandler PacketDataEnabled - { - add - { - if (s_packetDataEnabled == null) - { - int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.PacketData), s_runtimeInfoChangedCallback, IntPtr.Zero); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - s_packetDataEnabled += value; - } - remove - { - s_packetDataEnabled -= value; - if (s_packetDataEnabled == null) - { - int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.PacketData)); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - } - } - /// - /// (event) DataRoamingEnabled is raised when the system preference for data roaming is changed. - /// - public static event EventHandler DataRoamingEnabled - { - add - { - if (s_dataRoamingEnabled == null) - { - int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.DataRoaming), s_runtimeInfoChangedCallback, IntPtr.Zero); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - s_dataRoamingEnabled += value; - } - remove - { - s_dataRoamingEnabled -= value; - if (s_dataRoamingEnabled == null) - { - int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.DataRoaming)); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - } - } - /// - /// (event) VibrationEnabled is raised when the system preference for vibration is changed. - /// - public static event EventHandler VibrationEnabled - { - add - { - if (s_vibrationEnabled == null) - { - int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Vibration), s_runtimeInfoChangedCallback, IntPtr.Zero); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - s_vibrationEnabled += value; - } - remove - { - s_vibrationEnabled -= value; - if (s_vibrationEnabled == null) - { - int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Vibration)); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - } - } - /// - /// (event) AudioJackConnected is raised when the audio jack is connected/disconnected. - /// - public static event EventHandler AudioJackConnected - { - add - { - if (s_audioJackConnected == null) - { - int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AudioJack), s_runtimeInfoChangedCallback, IntPtr.Zero); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - s_audioJackConnected += value; - } - remove - { - s_audioJackConnected -= value; - if (s_audioJackConnected == null) - { - int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AudioJack)); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - } - } - /// - /// (event) GpsStatusChanged is raised when the status of GPS is changed. - /// - public static event EventHandler GpsStatusChanged - { - add - { - if (s_gpsStatusChanged == null) - { - int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Gps), s_runtimeInfoChangedCallback, IntPtr.Zero); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - s_gpsStatusChanged += value; - } - remove - { - s_gpsStatusChanged -= value; - if (s_gpsStatusChanged == null) - { - int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Gps)); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - } - } - /// - /// (event) BatteryIsCharging is raised when the battery is currently charging. - /// - public static event EventHandler BatteryIsCharging - { - add - { - if (s_batteryIsCharging == null) - { - int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.BatteryIsCharging), s_runtimeInfoChangedCallback, IntPtr.Zero); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - s_batteryIsCharging += value; - } - remove - { - s_batteryIsCharging -= value; - if (s_batteryIsCharging == null) - { - int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.BatteryIsCharging)); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - } - } - /// - /// (event) TvOutConnected is raised when TV out is connected/disconnected. - /// - public static event EventHandler TvOutConnected - { - add - { - if (s_tvOutConnected == null) - { - int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.TvOut), s_runtimeInfoChangedCallback, IntPtr.Zero); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - s_tvOutConnected += value; - } - remove - { - s_tvOutConnected -= value; - if (s_tvOutConnected == null) - { - int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.TvOut)); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - } - } - /// - /// (event) AudioJackConnectorChanged is raised when the audio jack connection changes. - /// - public static event EventHandler AudioJackConnectorChanged - { - add - { - if (s_audioJackConnectorChanged == null) - { - int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AudioJackConnector), s_runtimeInfoChangedCallback, IntPtr.Zero); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - s_audioJackConnectorChanged += value; - } - remove - { - s_audioJackConnectorChanged -= value; - if (s_audioJackConnectorChanged == null) - { - int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AudioJackConnector)); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - } - } - /// - /// (event) ChargerConnected is raised when the charger is connected/disconnected. - /// - public static event EventHandler ChargerConnected - { - add - { - if (s_chargerConnected == null) - { - int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Charger), s_runtimeInfoChangedCallback, IntPtr.Zero); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - s_chargerConnected += value; - } - remove - { - s_chargerConnected -= value; - if (s_chargerConnected == null) - { - int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Charger)); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - } - } - /// - /// (event) AutoRotationEnabled is raised when the system preference for auto rotation is changed. - /// - public static event EventHandler AutoRotationEnabled - { - add - { - if (s_autoRotationEnabled == null) - { - int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AutoRotation), s_runtimeInfoChangedCallback, IntPtr.Zero); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - s_autoRotationEnabled += value; - } - remove - { - s_autoRotationEnabled -= value; - if (s_autoRotationEnabled == null) - { - int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AutoRotation)); - if (ret != (int)RuntimeInfoError.None) - { - Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); - RuntimeInfoErrorFactory.ThrowException(ret); - } - } - } - } - } -} diff --git a/src/Tizen.System.Information/RuntimeInfo/TvProductHelper.cs b/src/Tizen.System.Information/RuntimeInfo/TvProductHelper.cs new file mode 100755 index 0000000..df9e3a2 --- /dev/null +++ b/src/Tizen.System.Information/RuntimeInfo/TvProductHelper.cs @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2016 - 2017 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 System.Collections.Generic; +using System.ComponentModel; + +namespace Tizen.System +{ + [EditorBrowsable(EditorBrowsableState.Never)] + internal static class TvProductHelper + { + private static int is_TV_product = -1; + + private static readonly Dictionary s_keyTVkeyMapping = new Dictionary + { + [RuntimeInfoKey.Bluetooth] = 5, + [RuntimeInfoKey.WifiHotspot] = 6, + [RuntimeInfoKey.BluetoothTethering] = 7, + [RuntimeInfoKey.UsbTethering] = 8, + [RuntimeInfoKey.PacketData] = 13, + [RuntimeInfoKey.DataRoaming] = 14, + [RuntimeInfoKey.Vibration] = 16, + [RuntimeInfoKey.AudioJack] = 20, + [RuntimeInfoKey.BatteryIsCharging] = 22, + [RuntimeInfoKey.TvOut] = 18, + [RuntimeInfoKey.Charger] = 26, + [RuntimeInfoKey.AutoRotation] = 28, + [RuntimeInfoKey.Gps] = 21, + [RuntimeInfoKey.AudioJackConnector] = 20 + }; + + /// This function is for a TV product. It will be removed. + internal static RuntimeInfoKey ConvertKeyIfTvProduct(RuntimeInfoKey key) + { + bool is_key_existed = false; + string profile; + int key_TV = -1; + + if (is_TV_product == -1) + { + is_key_existed = SystemInfo.TryGetValue("http://com.samsung/build_config/product_type", out profile); + if (is_key_existed && String.Compare(profile, "TV") == 0) + { + is_TV_product = 1; + } + else + { + is_TV_product = 0; + } + } + + if (is_TV_product == 0) + { + return key; + } + else + { + if (!s_keyTVkeyMapping.TryGetValue(key, out key_TV)) + { + InformationErrorFactory.ThrowException(InformationError.InvalidParameter); + } + return (RuntimeInfoKey)key_TV; + } + } + } +} diff --git a/src/Tizen.System.Information/SystemInfo/SystemInfo.cs b/src/Tizen.System.Information/SystemInfo/SystemInfo.cs index b551c1b..5c352f0 100755 --- a/src/Tizen.System.Information/SystemInfo/SystemInfo.cs +++ b/src/Tizen.System.Information/SystemInfo/SystemInfo.cs @@ -19,41 +19,36 @@ using System.ComponentModel; namespace Tizen.System { - /// - /// System Information class. This class has methods which can be used to obtain device information. - /// - public static class SystemInfo + [EditorBrowsable(EditorBrowsableState.Never)] + internal static class SystemInfo { - private const string LogTag = "Tizen.System"; - [EditorBrowsable(EditorBrowsableState.Never)] private static Interop.SystemInfo.SystemInfoType GetValueType(string key, out Interop.SystemInfo.SystemInfoValueType valueType) { - Interop.SystemInfo.ErrorCode err = Interop.SystemInfo.SystemInfoGetPlatformType(key, out valueType); - if (err == Interop.SystemInfo.ErrorCode.None) + InformationError err = Interop.SystemInfo.SystemInfoGetPlatformType(key, out valueType); + if (err == InformationError.None) { return Interop.SystemInfo.SystemInfoType.platform; } - Log.Debug(LogTag, string.Format("Key {0} not in platform system info", key)); + Log.Debug(InformationErrorFactory.LogTag, string.Format("Key {0} not in platform system info", key)); err = Interop.SystemInfo.SystemInfoGetCustomType(key, out valueType); - if (err == Interop.SystemInfo.ErrorCode.None) + if (err == InformationError.None) { return Interop.SystemInfo.SystemInfoType.Custom; } - Log.Debug(LogTag, string.Format("Key {0} not in custom system info", key)); + Log.Debug(InformationErrorFactory.LogTag, string.Format("Key {0} not in custom system info", key)); return Interop.SystemInfo.SystemInfoType.None; } /// /// Checks if the type of value for the given feature is T. /// - /// 3 /// Type of value for the feature key. /// The name of the feature. /// True if type of value for the given feature is T, otherwise false. - public static bool Is(string key) + internal static bool Is(string key) { Interop.SystemInfo.SystemInfoValueType valueType; Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType); @@ -79,10 +74,9 @@ namespace Tizen.System /// /// Checks if the given key is a valid feature. /// - /// 3 /// The name of the feature. /// True if the key is valid, otherwise false. - public static bool IsValidKey(string key) + internal static bool IsValidKey(string key) { Interop.SystemInfo.SystemInfoValueType valueType; return GetValueType(key, out valueType) != Interop.SystemInfo.SystemInfoType.None; @@ -91,12 +85,11 @@ namespace Tizen.System /// /// Gets the value of the feature. /// - /// 3 /// Type of key value. /// The name of the feature. /// The value of the given feature. /// Returns true on success, otherwise false. - public static bool TryGetValue(string key, out T value) + internal static bool TryGetValue(string key, out T value) { bool res = false; if (typeof(T) == typeof(bool)) @@ -133,16 +126,15 @@ namespace Tizen.System /// /// Gets the bool value of the feature. /// - /// 3 /// The name of the feature. /// The value of the given feature. /// Returns true on success, otherwise false. - public static bool TryGetValue(string key, out bool value) + internal static bool TryGetValue(string key, out bool value) { Interop.SystemInfo.SystemInfoValueType valueType; Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType); - Interop.SystemInfo.ErrorCode err = Interop.SystemInfo.ErrorCode.InvalidParameter; + InformationError err = InformationError.InvalidParameter; if (keyType == Interop.SystemInfo.SystemInfoType.platform) { err = Interop.SystemInfo.SystemInfoGetPlatformBool(key, out value); @@ -155,9 +147,9 @@ namespace Tizen.System value = false; } - if (err != Interop.SystemInfo.ErrorCode.None) + if (err != InformationError.None) { - Log.Warn(LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err)); + Log.Warn(InformationErrorFactory.LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err)); return false; } @@ -167,16 +159,15 @@ namespace Tizen.System /// /// Gets the int value of the feature. /// - /// 3 /// The name of the feature. /// The value of the given feature. /// Returns true on success, otherwise false. - public static bool TryGetValue(string key, out int value) + internal static bool TryGetValue(string key, out int value) { Interop.SystemInfo.SystemInfoValueType valueType; Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType); - Interop.SystemInfo.ErrorCode err = Interop.SystemInfo.ErrorCode.InvalidParameter; + InformationError err = InformationError.InvalidParameter; if (keyType == Interop.SystemInfo.SystemInfoType.platform) { err = Interop.SystemInfo.SystemInfoGetPlatformInt(key, out value); @@ -190,9 +181,9 @@ namespace Tizen.System value = 0; } - if (err != Interop.SystemInfo.ErrorCode.None) + if (err != InformationError.None) { - Log.Warn(LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err)); + Log.Warn(InformationErrorFactory.LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err)); return false; } @@ -202,16 +193,15 @@ namespace Tizen.System /// /// Gets the double value of the feature. /// - /// 3 /// The name of the feature. /// The value of the given feature. /// Returns true on success, otherwise false. - public static bool TryGetValue(string key, out double value) + internal static bool TryGetValue(string key, out double value) { Interop.SystemInfo.SystemInfoValueType valueType; Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType); - Interop.SystemInfo.ErrorCode err = Interop.SystemInfo.ErrorCode.InvalidParameter; + InformationError err = InformationError.InvalidParameter; if (keyType == Interop.SystemInfo.SystemInfoType.platform) { err = Interop.SystemInfo.SystemInfoGetPlatformDouble(key, out value); @@ -225,9 +215,9 @@ namespace Tizen.System value = 0; } - if (err != Interop.SystemInfo.ErrorCode.None) + if (err != InformationError.None) { - Log.Warn(LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err)); + Log.Warn(InformationErrorFactory.LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err)); return false; } @@ -237,16 +227,15 @@ namespace Tizen.System /// /// Gets the string value of the feature. /// - /// 3 /// The name of the feature. /// The value of the given feature. /// Returns true on success, otherwise false. - public static bool TryGetValue(string key, out string value) + internal static bool TryGetValue(string key, out string value) { Interop.SystemInfo.SystemInfoValueType valueType; Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType); - Interop.SystemInfo.ErrorCode err = Interop.SystemInfo.ErrorCode.InvalidParameter; + InformationError err = InformationError.InvalidParameter; if (keyType == Interop.SystemInfo.SystemInfoType.platform) { err = Interop.SystemInfo.SystemInfoGetPlatformString(key, out value); @@ -260,9 +249,9 @@ namespace Tizen.System value = string.Empty; } - if (err != Interop.SystemInfo.ErrorCode.None) + if (err != InformationError.None) { - Log.Warn(LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err)); + Log.Warn(InformationErrorFactory.LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err)); return false; } diff --git a/src/Tizen.System.Information/Tizen.System.Information.csproj b/src/Tizen.System.Information/Tizen.System.Information.csproj old mode 100644 new mode 100755 diff --git a/src/Tizen.System.Information/Usage/ProcessCpuUsage.cs b/src/Tizen.System.Information/Usage/ProcessCpuUsage.cs new file mode 100755 index 0000000..75a579c --- /dev/null +++ b/src/Tizen.System.Information/Usage/ProcessCpuUsage.cs @@ -0,0 +1,123 @@ +/* +* Copyright (c) 2016 - 2017 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 System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; + +namespace Tizen.System +{ + /// + /// The class for CPU usage per process. + /// + public class ProcessCpuUsage + { + private int[] Pids; + private Interop.RuntimeInfo.ProcessCpuUsage[] Usages; + + /// + /// The constructor of ProcessCpuUsage class. + /// + /// 4 + /// List of unique process ids. + /// http://tizen.org/privilege/systemmonitor + /// Thrown when the is empty. + /// Thrown when an I/O error occurs while reading from the system or requesting to the resource management daemon. + /// Thrown when the memory is not enough to allocate. + /// Thrown when the caller does not have privilege to use this method. + public ProcessCpuUsage(IEnumerable pid) + { + Update(pid); + } + + /// + /// The number of usage entries. + /// + /// 4 + public int Count { get; internal set; } + + /// + /// Gets the amount of time this process has been scheduled in user mode. + /// + /// 4 + /// The process id. + /// The amount of time has been scheduled in user mode (clock ticks). + /// Thrown when the is invalid. + public uint GetUTime(int pid) + { + for (int i = 0; i < Count; i++) + if (pid == Pids[i]) + return Usages[i].UTime; + + Log.Error(InformationErrorFactory.LogTag, "Invalid pid"); + InformationErrorFactory.ThrowException(InformationError.InvalidParameter); + return 0; + } + + /// + /// Gets the amount of time this process has been scheduled in kernel mode. + /// + /// 4 + /// The process id. + /// The amount of time has been scheduled in kernel mode (clock ticks). + /// Thrown when the is invalid. + public uint GetSTime(int pid) + { + for (int i = 0; i < Count; i++) + if (pid == Pids[i]) + return Usages[i].STime; + + Log.Error(InformationErrorFactory.LogTag, "Invalid pid"); + InformationErrorFactory.ThrowException(InformationError.InvalidParameter); + return 0; + } + + /// + /// Update the process CPU usage to the latest. + /// + /// 4 + /// List of unique process ids. + /// http://tizen.org/privilege/systemmonitor + /// Thrown when the is empty. + /// Thrown when an I/O error occurs while reading from the system or requesting to the resource management daemon. + /// Thrown when the memory is not enough to allocate. + /// Thrown when the caller does not have privilege to use this method. + public void Update(IEnumerable pid) + { + InformationError ret; + + Pids = pid.ToArray(); + IntPtr ptr = new IntPtr(); + Count = Pids.Count(); + + ret = Interop.RuntimeInfo.GetProcessCpuUsage(Pids, Count, ref ptr); + if (ret != InformationError.None) + { + Log.Error(InformationErrorFactory.LogTag, "Interop failed to get Process cpu usage"); + InformationErrorFactory.ThrowException(ret); + } + + Usages = new Interop.RuntimeInfo.ProcessCpuUsage[Count]; + for (int i = 0; i < Count; i++) + { + Usages[i] = Marshal.PtrToStructure(ptr); + ptr += Marshal.SizeOf(); + } + } + } +} diff --git a/src/Tizen.System.Information/Usage/ProcessMemoryUsage.cs b/src/Tizen.System.Information/Usage/ProcessMemoryUsage.cs new file mode 100755 index 0000000..c10c8c9 --- /dev/null +++ b/src/Tizen.System.Information/Usage/ProcessMemoryUsage.cs @@ -0,0 +1,213 @@ +/* +* Copyright (c) 2016 - 2017 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 System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; + +namespace Tizen.System +{ + /// + /// The class for memory information per process. + /// + public class ProcessMemoryUsage + { + private int[] Pids; + private Interop.RuntimeInfo.ProcessMemoryInfo[] Usages; + + /// + /// The constructor of ProcessMemoryInformation class. + /// + /// 4 + /// List of unique process ids. + /// http://tizen.org/privilege/systemmonitor + /// Thrown when the is empty. + /// Thrown when an I/O error occurs while reading from the system or requesting to the resource management daemon. + /// Thrown when the memory is not enough to allocate. + /// Thrown when the caller does not have privilege to use this method. + public ProcessMemoryUsage(IEnumerable pid) + { + Update(pid); + } + + /// + /// The number of usage entries. + /// + /// 4 + public int Count { get; internal set; } + + /// + /// Gets the virtual memory size of a process. + /// + /// 4 + /// The process id. + /// The virtual memory size is using (KiB). + /// Thrown when the is invalid. + public int GetVsz(int pid) + { + for (int i = 0; i < Count; i++) + if (pid == Pids[i]) + return Usages[i].Vsz; + + Log.Error(InformationErrorFactory.LogTag, "Invalid pid"); + InformationErrorFactory.ThrowException(InformationError.InvalidParameter); + return 0; + } + + /// + /// Gets the resident set size of a process. + /// + /// 4 + /// The process id. + /// The resident set size is using (KiB). + /// Thrown when the is invalid. + public int GetRss(int pid) + { + for (int i = 0; i < Count; i++) + if (pid == Pids[i]) + return Usages[i].Rss; + + Log.Error(InformationErrorFactory.LogTag, "Invalid pid"); + InformationErrorFactory.ThrowException(InformationError.InvalidParameter); + return 0; + } + + /// + /// Gets the proportional set size of a process. + /// + /// 4 + /// The process id. + /// The proportional set size is using (KiB). + /// Thrown when the is invalid. + public int GetPss(int pid) + { + for (int i = 0; i < Count; i++) + if (pid == Pids[i]) + return Usages[i].Pss; + + Log.Error(InformationErrorFactory.LogTag, "Invalid pid"); + InformationErrorFactory.ThrowException(InformationError.InvalidParameter); + return 0; + } + + /// + /// Gets the size not modified and mapped by other processes of a process. + /// + /// 4 + /// The process id. + /// The shared clean memory size is using (KiB). + /// Thrown when the is invalid. + public int GetSharedClean(int pid) + { + for (int i = 0; i < Count; i++) + if (pid == Pids[i]) + return Usages[i].SharedClean; + + Log.Error(InformationErrorFactory.LogTag, "Invalid pid"); + InformationErrorFactory.ThrowException(InformationError.InvalidParameter); + return 0; + } + + /// + /// Gets the size modified and mapped by other processes of a process. + /// + /// 4 + /// The process id. + /// The shared dirty memory size is using (KiB). + /// Thrown when the is invalid. + public int GetSharedDirty(int pid) + { + for (int i = 0; i < Count; i++) + if (pid == Pids[i]) + return Usages[i].SharedDirty; + + Log.Error(InformationErrorFactory.LogTag, "Invalid pid"); + InformationErrorFactory.ThrowException(InformationError.InvalidParameter); + return 0; + } + + /// + /// Gets the size not modified and available only to that process of a process. + /// + /// 4 + /// The process id. + /// The private clean memory size is using (KiB). + /// Thrown when the is invalid. + public int GetPrivateClean(int pid) + { + for (int i = 0; i < Count; i++) + if (pid == Pids[i]) + return Usages[i].PrivateClean; + + Log.Error(InformationErrorFactory.LogTag, "Invalid pid"); + InformationErrorFactory.ThrowException(InformationError.InvalidParameter); + return 0; + } + + /// + /// Gets the size modified and available only to that process of a process. + /// + /// 4 + /// The process id. + /// The private dirty memory size is using (KiB). + /// Thrown when the is invalid. + public int GetPrivateDirty(int pid) + { + for (int i = 0; i < Count; i++) + if (pid == Pids[i]) + return Usages[i].PrivateDirty; + + Log.Error(InformationErrorFactory.LogTag, "Invalid pid"); + InformationErrorFactory.ThrowException(InformationError.InvalidParameter); + return 0; + } + + /// + /// Update the process memory information to the latest. + /// + /// 4 + /// List of unique process ids. + /// http://tizen.org/privilege/systemmonitor + /// Thrown when the is empty. + /// Thrown when an I/O error occurs while reading from the system or requesting to the resource management daemon. + /// Thrown when the memory is not enough to allocate. + /// Thrown when the caller does not have privilege to use this method. + public void Update(IEnumerable pid) + { + InformationError ret; + + Pids = pid.ToArray(); + IntPtr ptr = new IntPtr(); + Count = Pids.Count(); + + ret = Interop.RuntimeInfo.GetProcessMemoryInfo(Pids, Count, ref ptr); + if (ret != InformationError.None) + { + Log.Error(InformationErrorFactory.LogTag, "Interop failed to get Process cpu usage"); + InformationErrorFactory.ThrowException(ret); + } + + Usages = new Interop.RuntimeInfo.ProcessMemoryInfo[Count]; + for (int i = 0; i < Count; i++) + { + Usages[i] = Marshal.PtrToStructure(ptr); + ptr += Marshal.SizeOf(); + } + } + } +} diff --git a/src/Tizen.System.Information/Usage/SystemCpuUsage.cs b/src/Tizen.System.Information/Usage/SystemCpuUsage.cs new file mode 100755 index 0000000..d72b462 --- /dev/null +++ b/src/Tizen.System.Information/Usage/SystemCpuUsage.cs @@ -0,0 +1,180 @@ +/* +* Copyright (c) 2016 - 2017 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 System.IO; + +namespace Tizen.System +{ + /// + /// The class for system CPU usage. + /// + public class SystemCpuUsage + { + private Interop.RuntimeInfo.CpuUsage Usage; + private int[] CurrentFrequencies; + private int[] MaxFrequencies; + + /// + /// The constructor of SystemCpuUsage class. + /// + /// 4 + /// Thrown when an I/O error occurs while reading from the system. + /// Thrown when this system does not store the current CPU frequency. + public SystemCpuUsage() + { + Update(); + } + + /// + /// Running time of un-niced user processes (Percent). + /// + /// 4 + public double User + { + get + { + return Usage.User; + } + } + + /// + /// Running time of kernel processes (Percent). + /// + /// 4 + public double System + { + get + { + return Usage.System; + } + } + + /// + /// Running time of niced user processes (Percent). + /// + /// 4 + public double Nice + { + get + { + return Usage.Nice; + } + } + + /// + /// Time waiting for I/O completion (Percent). + /// + /// 4 + public double IoWait + { + get + { + return Usage.IoWait; + } + } + + /// + /// The number of processors. + /// + /// 4 + public int ProcessorCount { get; internal set; } + + /// + /// Gets the current frequency of the processor. + /// + /// 4 + /// The index (from 0) of the CPU core that you want to know the frequency of. + /// The current frequency(MHz) of processor. + /// Thrown when the is invalid. + public int GetCurrentFrequency(int coreId) + { + if(coreId < 0 || coreId >= ProcessorCount) + { + Log.Error(InformationErrorFactory.LogTag, "Invalid core ID " + coreId); + InformationErrorFactory.ThrowException(InformationError.InvalidParameter); + } + + return CurrentFrequencies[coreId]; + } + + /// + /// Gets the max frequency of the processor. + /// + /// 4 + /// The index (from 0) of CPU core that you want to know the frequency of. + /// The max frequency(MHz) of processor. + /// Thrown when the is invalid. + public int GetMaxFrequency(int coreId) + { + if (coreId < 0 || coreId >= ProcessorCount) + { + Log.Error(InformationErrorFactory.LogTag, "Invalid core ID " + coreId); + InformationErrorFactory.ThrowException(InformationError.InvalidParameter); + } + + return MaxFrequencies[coreId]; + } + + /// + /// Update the system CPU usage to the latest. + /// + /// 4 + /// Thrown when an I/O error occurs while reading from the system. + /// Thrown when this system does not store the current CPU frequency. + public void Update() + { + InformationError ret; + int count; + + ret = Interop.RuntimeInfo.GetCpuUsage(out Usage); + if (ret != InformationError.None) + { + Log.Error(InformationErrorFactory.LogTag, "Interop failed to get cpu usage"); + InformationErrorFactory.ThrowException(ret); + } + + ret = Interop.RuntimeInfo.GetProcessorCount(out count); + if (ret != InformationError.None) + { + Log.Error(InformationErrorFactory.LogTag, "Interop failed to get Processor count"); + InformationErrorFactory.ThrowException(ret); + return; + } + + ProcessorCount = count; + CurrentFrequencies = new int[ProcessorCount]; + MaxFrequencies = new int[ProcessorCount]; + + for (int coreId = 0; coreId < ProcessorCount; coreId++) + { + ret = Interop.RuntimeInfo.GetProcessorCurrentFrequency(coreId, out CurrentFrequencies[coreId]); + if (ret != InformationError.None) + { + Log.Error(InformationErrorFactory.LogTag, "Interop failed to get the current frequency of processor " + coreId); + InformationErrorFactory.ThrowException(ret); + } + + ret = Interop.RuntimeInfo.GetProcessorMaxFrequency(coreId, out MaxFrequencies[coreId]); + if (ret != InformationError.None) + { + Log.Error(InformationErrorFactory.LogTag, "Interop failed to get the max frequency of processor " + coreId); + InformationErrorFactory.ThrowException(ret); + } + } + } + } +} diff --git a/src/Tizen.System.Information/Usage/SystemMemoryUsage.cs b/src/Tizen.System.Information/Usage/SystemMemoryUsage.cs new file mode 100755 index 0000000..41ec78f --- /dev/null +++ b/src/Tizen.System.Information/Usage/SystemMemoryUsage.cs @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2016 - 2017 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.IO; + +namespace Tizen.System +{ + /// + /// The class for system memory information. + /// + public class SystemMemoryUsage + { + private Interop.RuntimeInfo.MemoryInfo Info; + + /// + /// The constructor of MemoryInformation class. + /// + /// 4 + /// Thrown when an I/O error occurs while reading from the system. + public SystemMemoryUsage() + { + Update(); + } + + /// + /// Total memory (KiB). + /// + /// 4 + public int Total + { + get + { + return Info.Total; + } + } + + /// + /// Used memory (KiB). + /// + /// 4 + public int Used + { + get + { + return Info.Used; + } + } + + /// + /// Free memory (KiB). + /// + /// 4 + public int Free + { + get + { + return Info.Free; + } + } + + /// + /// Cache memory (KiB). + /// + /// 4 + public int Cache + { + get + { + return Info.Cache; + } + } + + /// + /// Swap memory (KiB). + /// + /// 4 + public int Swap + { + get + { + return Info.Swap; + } + } + + /// + /// Update the system memory information to the latest. + /// + /// 4 + /// Thrown when I/O error occurs while reading from the system. + public void Update() + { + InformationError ret = Interop.RuntimeInfo.GetSystemMemoryInfo(out Info); + if (ret != InformationError.None) + { + Log.Error(InformationErrorFactory.LogTag, "Interop failed to get System memory information"); + InformationErrorFactory.ThrowException(ret); + } + } + } +} -- 2.7.4