foreach (string id in trackList)\r
{\r
MediaInfo info = mediaInfo.SelectMedia(id);\r
+ if (info == null)\r
+ {\r
+ continue;\r
+ }\r
string filePath = @info.Path;\r
try\r
{\r
foreach (string id in trackList)\r
{\r
MediaInfo info = mediaInfo.SelectMedia(id);\r
- Tizen.Log.Debug(AppConstants.LogTag, "Track Path: " + info.Path);\r
+ if (info == null)\r
+ {\r
+ continue;\r
+ }\r
string filePath = @info.Path;\r
try\r
{\r
ArtistDetail = artist;
TrackDetail = track;
ItemType = type;
- if(type ==0)
+ if(type ==0 && artist != null)
{
Thumbnail = artist.AlbumArtPath;
Title = artist.ArtistName;
SubTitle = "";
}
- else if (type == 1)
+ else if (type == 1 && musicAlbum != null)
{
Thumbnail = musicAlbum.AlbumArtPath;
Title = musicAlbum.AlbumName;
SubTitle = musicAlbum.ArtistName;
}
- else if (type == 2)
+ else if (type == 2 && track != null)
{
Thumbnail = track.ThumbnailPath;
Title = track.TrackTitle;
var metadataExtractor = new MetadataExtractor(path);
Metadata metadata = metadataExtractor.GetMetadata();
lyrics = metadata.UnsyncLyrics;
+ metadataExtractor.Dispose();
}
catch(System.IO.FileNotFoundException ex)
{
public void StartShuffledTrack()
{
- SetCurrentTrack(playingListViewModel.FirstShuffledTrack());
+ Track track = playingListViewModel.FirstShuffledTrack();
+ if (track != null)
+ {
+ SetCurrentTrack(track);
+ }
}
private void UpdatePlayingStatus(PlayingStatus status)
Tizen.Log.Info(AppConstants.LogTag, "Palette or palatte values not valid, adding default gradient");
ImageVisual imageVisual = CreateImageVisual();
PlayerBackground = imageVisual.OutputVisualMap;
- return;
+ imageVisual.Dispose();
}
else
{
Tizen.Log.Info(AppConstants.LogTag, "setting palette color");
GradientVisual gradientVisual = CreateGradientVisual(stopColor);
PlayerBackground = gradientVisual.OutputVisualMap;
+ gradientVisual.Dispose();
}
+ stopColor.Dispose();
}
}
}
using System;
+using System.Collections.Generic;
using Tizen.NUI.Components;
using Tizen.NUI.BaseComponents;
using Tizen.NUI;
noItemFound = true;
}
}
+
+ protected override void Dispose(DisposeTypes type)
+ {
+ if (Disposed)
+ {
+ return;
+ }
+ if (type == DisposeTypes.Explicit)
+ {
+ if (searchBox != null)
+ {
+ List<View> children = searchBox.Children;
+ foreach (View child in children)
+ {
+ searchBox.Remove(child);
+ child.Dispose();
+ }
+ textField = null;
+ crossButton = null;
+ }
+
+ if (topView != null)
+ {
+ List<View> children = topView.Children;
+ foreach (View child in children)
+ {
+ topView.Remove(child);
+ child.Dispose();
+ }
+ backButton = null;
+ searchBox = null;
+ base.Remove(topView);
+ topView.Dispose();
+ topView = null;
+ }
+
+ if (!noItemFound && collectionView != null)
+ {
+ base.Remove(collectionView);
+ }
+ else if(noItemFound && noItemView != null)
+ {
+ base.Remove(noItemView);
+ }
+
+ if (collectionView != null)
+ {
+ collectionView.Dispose();
+ collectionView = null;
+ }
+
+ if (noItemView != null)
+ {
+ List<View> children = noItemView.Children;
+ foreach (View child in children)
+ {
+ noItemView.Remove(child);
+ child.Dispose();
+ }
+ noItemView.Dispose();
+ noItemView = null;
+ }
+ }
+
+ base.Dispose(type);
+ }
}
}