From 112ecea98a5d28478e65c373c19907f6ae3466ee Mon Sep 17 00:00:00 2001 From: Praveen Gattu Date: Tue, 26 Jul 2016 15:48:35 +0530 Subject: [PATCH] Fixed doxygen issues. Fixed svace issues. Change-Id: I9da7cec2c2bb4ca7f40d40511e71e2c0ef1811be Signed-off-by: Praveen Gattu --- .../Tizen.Content.MediaContent/AudioInformation.cs | 39 +++++++++--------- .../Tizen.Content.MediaContent/ContentDatabase.cs | 14 +++---- .../Tizen.Content.MediaContent/ContentFilter.cs | 47 ++++++++++++++++++++-- .../Tizen.Content.MediaContent/ContentManager.cs | 10 ++--- .../Tizen.Content.MediaContent/Group.cs | 15 +++---- .../Tizen.Content.MediaContent/ImageInformation.cs | 2 +- .../Tizen.Content.MediaContent/MediaInformation.cs | 4 +- .../Tizen.Content.MediaContent/PlayList.cs | 2 - .../Tizen.Content.MediaContent/VideoInformation.cs | 17 ++++---- 9 files changed, 97 insertions(+), 53 deletions(-) diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/AudioInformation.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/AudioInformation.cs index 75339b5..d409108 100755 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/AudioInformation.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/AudioInformation.cs @@ -52,8 +52,8 @@ namespace Tizen.Content.MediaContent /// /// Gets the album name. - /// If the value is an empty string, the method returns "Unknown". - /// If the media content has no album info, the method returns empty string. + /// If the value is an empty string, the property returns "Unknown". + /// If the media content has no album info, the property returns empty string. /// public string Album { @@ -75,8 +75,8 @@ namespace Tizen.Content.MediaContent /// /// Gets the artist name. - /// If the value is an empty string, the method returns "Unknown". - /// If the media content has no album info, the method returns empty string. + /// If the value is an empty string, the property returns "Unknown". + /// If the media content has no album info, the property returns empty string. /// public string Artist { @@ -98,8 +98,8 @@ namespace Tizen.Content.MediaContent /// /// Gets the album artist name. - /// If the value is an empty string, the method returns "Unknown". - /// If the media content has no album info, the method returns empty string. + /// If the value is an empty string, the property returns "Unknown". + /// If the media content has no album info, the property returns empty string. /// public string AlbumArtist { @@ -121,8 +121,8 @@ namespace Tizen.Content.MediaContent /// /// Gets the genre name. - /// If the value is an empty string, the method returns "Unknown". - /// If the media content has no album info, the method returns empty string. + /// If the value is an empty string, the property returns "Unknown". + /// If the media content has no album info, the property returns empty string. /// public string Genre { @@ -144,8 +144,8 @@ namespace Tizen.Content.MediaContent /// /// Gets the composer name. - /// If the value is an empty string, the method returns "Unknown". - /// If the media content has no album info, the method returns empty string. + /// If the value is an empty string, the property returns "Unknown". + /// If the media content has no album info, the property returns empty string. /// public string Composer { @@ -167,8 +167,8 @@ namespace Tizen.Content.MediaContent /// /// Gets the year. - /// If the value is an empty string, the method returns "Unknown". - /// If the media content has no album info, the method returns empty string. + /// If the value is an empty string, the property returns "Unknown". + /// If the media content has no album info, the property returns empty string. /// public string Year { @@ -211,7 +211,7 @@ namespace Tizen.Content.MediaContent /// /// Gets the copyright notice. - /// If the media content has no copyright info, the method returns empty string. + /// If the media content has no copyright info, the property returns empty string. /// public string Copyright { @@ -233,7 +233,7 @@ namespace Tizen.Content.MediaContent /// /// Gets the track number. - /// If the value is an empty string, the method returns "Unknown". + /// If the value is an empty string, the property returns "Unknown". /// public string TrackNumber { @@ -362,7 +362,7 @@ namespace Tizen.Content.MediaContent /// If NULL is passed to the filter, no filtering is applied. /// /// - /// Task to get all the BookMarks + /// Task to get all the BookMarks /// /// filter for the Tags public Task> GetMediaBookmarksAsync(ContentFilter filter) @@ -396,7 +396,9 @@ namespace Tizen.Content.MediaContent /// Adds a MediaBookMark to the audio /// /// Offset of the audio in seconds - /// + /// + /// Task with newly added MediaBookMark instance. + /// public async Task AddBookmark(uint offset) { MediaBookmark result = null; @@ -413,13 +415,14 @@ namespace Tizen.Content.MediaContent break; } } + bookmarkfilter.Dispose(); return result; } /// - /// Deletes a MediaBookMark from the media database. + /// Deletes a MediaBookMark item from the media database. /// - /// The bookmark to be deleted + /// The MediaBookMark instance to be deleted public void DeleteBookmark(MediaBookmark bookmark) { ContentManager.Database.Delete(bookmark); diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ContentDatabase.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ContentDatabase.cs index ad3a17d..8bf8358 100644 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ContentDatabase.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ContentDatabase.cs @@ -225,7 +225,7 @@ namespace Tizen.Content.MediaContent /// /// Gets the ContentCollection object for the passed media Id. - /// Applicable for Playlist, Album and Tag types. + /// Applicable for PlayList, Album and Tag types. /// /// The ContentCollection id to fetch the respective MediaInformation instance /// ContentCollection instance for the associated id.It throws Exception for invalid Id. @@ -581,22 +581,22 @@ namespace Tizen.Content.MediaContent /// /// Deletes a content collection from the media database. - /// Applicable for Tag and Playlist only. + /// Applicable for Tag and PlayList only. /// For other types ArgumentException is thrown. /// - /// The content collection to be deleted - public void Delete(ContentCollection contecollection) + /// The ContentCollection instance to be deleted + public void Delete(ContentCollection contentcollection) { ConnectToDB(); - Type type = contecollection.GetType(); + Type type = contentcollection.GetType(); MediaContentError result = MediaContentError.None; if (type == typeof(Tag)) { - result = (MediaContentError)Interop.Tag.DeleteFromDb(((Tag)contecollection).Id); + result = (MediaContentError)Interop.Tag.DeleteFromDb(((Tag)contentcollection).Id); } else if (type == typeof(PlayList)) { - result = (MediaContentError)Interop.Playlist.DeleteFromDb(((PlayList)contecollection).Id); + result = (MediaContentError)Interop.Playlist.DeleteFromDb(((PlayList)contentcollection).Id); } else { diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ContentFilter.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ContentFilter.cs index d1ff9ac..0c52f94 100644 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ContentFilter.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ContentFilter.cs @@ -18,30 +18,71 @@ namespace Tizen.Content.MediaContent /// It provide functionality to set properties associated with a given content filter. /// Setting content filter properties helps to limit the number of filtered items as following: - + /// + /// /// Offset - Used to set starting position of the filter's search + /// + /// /// Count - Used to set number of items to be searched from offset + /// + /// /// Condition - Used to set keyword which user want to search + /// + /// /// Order - Used to set type of media to be ordered by the filter + /// + /// /// Searchable expression can use one of the following forms: + /// + /// /// column = value + /// + /// /// column > value + /// + /// /// column >= value + /// + /// /// column < value + /// + /// /// column <= value + /// + /// /// value = column - /// * - value > column + /// + /// /// value >= column + /// + /// /// value < column + /// + /// /// value <= column + /// + /// /// column IN (value) + /// + /// /// column IN(value-list) + /// + /// /// column NOT IN(value) + /// + /// /// column NOT IN(value-list) + /// + /// /// column LIKE value + /// + /// /// expression1 AND expression2 OR expression3 + /// + /// + /// Note that if you want to set qoutation(" ' " or " " ") as value of LIKE operator, you should use two times.(" '' " or " "" ") \n And the optional ESCAPE clause is supported. Both percent symbol("%") and underscore symbol("_") are used in the LIKE pattern. /// If these characters are used as value of LIKE operation, then the expression following the ESCAPE caluse of sqlite. @@ -299,4 +340,4 @@ namespace Tizen.Content.MediaContent } } } -} \ No newline at end of file +} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ContentManager.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ContentManager.cs index feec756..114141b 100644 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ContentManager.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ContentManager.cs @@ -130,7 +130,7 @@ namespace Tizen.Content.MediaContent return task.Task; } - internal static Interop.Content.MediaScanCompletedCallback scanCompleted = null; + internal static Interop.Content.MediaScanCompletedCallback scanCompletedWithToken = null; internal static Object l = new Object(); /// /// Requests to scan a media folder, asynchronously. @@ -177,7 +177,7 @@ namespace Tizen.Content.MediaContent Tizen.Log.Info("TCT", "Cancellation delegate: Releasing lock on l"); } }); - scanCompleted = (MediaContentError scanResult, IntPtr data) => + scanCompletedWithToken = (MediaContentError scanResult, IntPtr data) => { Tizen.Log.Info("TCT", "Scan Callback ScanResult: " + scanResult); Tizen.Log.Info("TCT", "Scan Callback ThreadId: " + Thread.CurrentThread.ManagedThreadId); @@ -209,7 +209,7 @@ namespace Tizen.Content.MediaContent if (dir.Exists) { Tizen.Log.Info("TCT", "Scan folder start"); - result = (MediaContentError)Interop.Content.ScanFolder(folderPath, recursive, scanCompleted, IntPtr.Zero); + result = (MediaContentError)Interop.Content.ScanFolder(folderPath, recursive, scanCompletedWithToken, IntPtr.Zero); Tizen.Log.Info("TCT", "Scan folder end"); } else @@ -242,7 +242,7 @@ namespace Tizen.Content.MediaContent { if (error != MediaContentError.None) { - task.SetException(MediaContentErrorFactory.CreateException(res, "Failed to add batch media")); + task.SetException(MediaContentErrorFactory.CreateException(error, "Failed to add batch media")); } task.SetResult((int)error); }; @@ -269,7 +269,7 @@ namespace Tizen.Content.MediaContent { if (error != MediaContentError.None) { - task.SetException(MediaContentErrorFactory.CreateException(res, "Failed to add burst shots to db")); + task.SetException(MediaContentErrorFactory.CreateException(error, "Failed to add burst shots to db")); } task.SetResult((int)error); }; diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Group.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Group.cs index 7c0b7a0..734d31c 100644 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Group.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Group.cs @@ -36,9 +36,6 @@ namespace Tizen.Content.MediaContent _groupType = groupType; } - /// - /// Dispose API for closing the internal resources. - /// public override void Dispose() { Dispose(true); @@ -60,12 +57,12 @@ namespace Tizen.Content.MediaContent /// The number of media contents matching the filter passed public override int GetMediaInformationCount(ContentFilter filter) { - int mediaCount; + int mediaCount = 0; IntPtr handle = (filter != null) ? filter.Handle : IntPtr.Zero; MediaContentError res = (MediaContentError)Interop.Group.GetMediaCountFromDb(Name, _groupType, handle, out mediaCount); if (res != MediaContentError.None) { - Log.Warn(MediaContentErrorFactory.LogTag, "Failed to get media count for the group"); + throw MediaContentErrorFactory.CreateException(res, "Failed to GetMediaCountFromDb"); } return mediaCount; } @@ -83,11 +80,15 @@ namespace Tizen.Content.MediaContent var tcs = new TaskCompletionSource>(); List mediaContents = new List(); IntPtr handle = (filter != null) ? filter.Handle : IntPtr.Zero; - MediaContentError res; + MediaContentError res = MediaContentError.None; Interop.Group.MediaInfoCallback callback = (IntPtr mediaHandle, IntPtr data) => { Interop.MediaInformation.SafeMediaInformationHandle newHandle; res = (MediaContentError)Interop.MediaInformation.Clone(out newHandle, mediaHandle); + if (res != MediaContentError.None) + { + throw MediaContentErrorFactory.CreateException(res, "Failed to clone MediaInformation instance"); + } MediaInformation info = new MediaInformation(newHandle); mediaContents.Add(info); return true; @@ -95,7 +96,7 @@ namespace Tizen.Content.MediaContent res = (MediaContentError)Interop.Group.ForeachMediaFromDb(Name, _groupType, handle, callback, IntPtr.Zero); if (res != MediaContentError.None) { - Log.Warn(MediaContentErrorFactory.LogTag, "Failed to get media information for the group"); + throw MediaContentErrorFactory.CreateException(res, "Failed to get media information for the group"); } tcs.TrySetResult(mediaContents); return tcs.Task; diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ImageInformation.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ImageInformation.cs index be45d0e..a7ef458 100755 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ImageInformation.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ImageInformation.cs @@ -128,7 +128,7 @@ namespace Tizen.Content.MediaContent /// /// Gets the burst shot ID. - /// If burst_id is Empty, this is not burst shot + /// If BurstId is empty, this is not a burst shot /// public string BurstId { diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInformation.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInformation.cs index 806d9db..338ee49 100755 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInformation.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInformation.cs @@ -297,7 +297,7 @@ namespace Tizen.Content.MediaContent } /// - /// Gets the media file size in Bytes. + /// Gets the media file size in bytes. /// public long Size { @@ -435,7 +435,7 @@ namespace Tizen.Content.MediaContent /// /// Description of media. - /// If the media info has no description, the method returns empty string. + /// If the media info has no description, the property returns empty string. /// public string Description { diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlayList.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlayList.cs index 14f8f75..43ec8b5 100644 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlayList.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlayList.cs @@ -48,8 +48,6 @@ namespace Tizen.Content.MediaContent { throw MediaContentErrorFactory.CreateException(res, "Failed to clone media"); } - - MediaInformation info = new MediaInformation(newHandle); string mediaId; Interop.MediaInformation.GetMediaId(newHandle, out mediaId); _dictionary.Add(mediaId, memberId); diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/VideoInformation.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/VideoInformation.cs index b1112eb..dd48dbd 100755 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/VideoInformation.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/VideoInformation.cs @@ -46,7 +46,7 @@ namespace Tizen.Content.MediaContent /// /// Gets the album name. - /// If the value is an empty string, the method returns "Unknown". + /// If the value is an empty string, the property returns "Unknown". /// public string Album { @@ -68,7 +68,7 @@ namespace Tizen.Content.MediaContent /// /// Gets the artist name. - /// If the value is an empty string, the method returns "Unknown". + /// If the value is an empty string, the property returns "Unknown". /// public string Artist { @@ -90,7 +90,7 @@ namespace Tizen.Content.MediaContent /// /// Gets the album artist name. - /// If the value is an empty string, the method returns "Unknown". + /// If the value is an empty string, the property returns "Unknown". /// public string AlbumArtist { @@ -112,7 +112,7 @@ namespace Tizen.Content.MediaContent /// /// Gets the genre name. - /// If the value is an empty string, the method returns "Unknown". + /// If the value is an empty string, the property returns "Unknown". /// public string Genre { @@ -134,7 +134,7 @@ namespace Tizen.Content.MediaContent /// /// Gets the composer name. - /// If the value is an empty string, the method returns "Unknown". + /// If the value is an empty string, the property returns "Unknown". /// public string Composer { @@ -156,7 +156,7 @@ namespace Tizen.Content.MediaContent /// /// Gets the year. - /// If the value is an empty string, the method returns "Unknown". + /// If the value is an empty string, the property returns "Unknown". /// public string Year { @@ -199,7 +199,7 @@ namespace Tizen.Content.MediaContent /// /// Gets the copyright notice. - /// If the value is an empty string, the method returns "Unknown". + /// If the value is an empty string, the property returns "Unknown". /// public string Copyright { @@ -221,7 +221,7 @@ namespace Tizen.Content.MediaContent /// /// Gets the track number. - /// If the value is an empty string, the method returns "Unknown". + /// If the value is an empty string, the property returns "Unknown". /// public string TrackNumber { @@ -382,6 +382,7 @@ namespace Tizen.Content.MediaContent break; } } + bookmarkfilter.Dispose(); return result; } -- 2.7.4