// Path: RemoteControlPC-Studio/app/src/main/java/me/varunon9/remotecontrolpc/CallbackReceiver.java
// public interface CallbackReceiver {
//      public void receiveData (Object result);
// }
// 
// Path: RemoteControlPC-Studio/app/src/main/java/me/varunon9/remotecontrolpc/MusicImageAvatar.java
// public class MusicImageAvatar {
// 
// 	private int icon, duration;
// 	private String avatarHeading, avatarSubheading, avatarData, type;
// 	
// 	public MusicImageAvatar(int icon, int duration, String avatarHeading,
//                             String avatarSubheading, String avatarData, String type) {
// 		this.icon = icon;
// 		this.duration = duration;
// 		this.avatarHeading = avatarHeading;
// 		this.avatarSubheading = avatarSubheading;
// 		this.avatarData = avatarData;
// 		this.type = type;
// 	}
// 	
// 	public String getHeading() {
// 		return avatarHeading;
// 	}
// 	
// 	public String getData() {
// 		return avatarData;
// 	}
// 	
// 	public String getType() {
// 		return type;
// 	}
// 	
// 	public String getSubheading() {
// 		return avatarSubheading;
// 	}
// 	
// 	public int getIcon() {
// 		return icon;
// 	}
// 	
// 	public int getDuration() {
// 		return duration;
// 	}
// }
// 
// Path: RemoteControlPC-Studio/app/src/main/java/me/varunon9/remotecontrolpc/Utility.java
// public class Utility {
// 	public String getDate(String date, String dateFormat) {
// 		long milliSeconds = Long.parseLong(date);
// 		// Create a DateFormatter object for displaying date in specified format.
// 	    SimpleDateFormat formatter = new SimpleDateFormat(dateFormat);
// 	    // Create a calendar object that will convert the date and time value in milliseconds to date. 
// 	     Calendar calendar = Calendar.getInstance();
// 	     calendar.setTimeInMillis(milliSeconds);
// 	     return formatter.format(calendar.getTime());
// 	}
// 	public String getDate(long milliSeconds, String dateFormat) {
// 		// Create a DateFormatter object for displaying date in specified format.
// 	    SimpleDateFormat formatter = new SimpleDateFormat(dateFormat);
// 	    // Create a calendar object that will convert the date and time value in milliseconds to date. 
// 	     Calendar calendar = Calendar.getInstance();
// 	     calendar.setTimeInMillis(milliSeconds);
// 	     return formatter.format(calendar.getTime());
// 	}
// 	/*http://stackoverflow.com/questions/22859350/android-listview-out-of-memory-exception*/
// 	public Bitmap decodeImageFile(String path) {
// 		try {
//             // Decode image size
//             BitmapFactory.Options o = new BitmapFactory.Options();
//             o.inJustDecodeBounds = true;
//             BitmapFactory.decodeFile(path, o);
//             // The new size we want to scale to
//             final int REQUIRED_SIZE = 60;
//             // Find the correct scale value. It should be the power of 2.
//             int scale = 1;
//             while (o.outWidth / scale / 2 >= REQUIRED_SIZE && o.outHeight / scale / 2 >= REQUIRED_SIZE)
//                 scale *= 2;
// 
//             // Decode with inSampleSize
//             BitmapFactory.Options o2 = new BitmapFactory.Options();
//             o2.inSampleSize = scale;
//             return BitmapFactory.decodeFile(path, o2);
//         } catch (Throwable e) {
//             e.printStackTrace();
//         }
//         return null;
// 	}
// 	public String getDuration(int duration) {
// 		String time = "";
// 		duration /= 1000;//in seconds
// 		int minutes = duration / 60;
// 		duration %= 60;
// 		if (minutes > 0) {
// 			time += minutes + " mins ";
// 		}
// 		time += duration + " secs";
// 		return time;
// 	}
// 	public Bitmap getAlbumart(int albumId, Context context) {
// 	    Bitmap bm = null;
// 	    try {
// 	        final Uri sArtworkUri = Uri.parse("content://media/external/audio/albumart");
// 	        Uri uri = ContentUris.withAppendedId(sArtworkUri, albumId);
// 	        ParcelFileDescriptor pfd = context.getContentResolver().openFileDescriptor(uri, "r");
//             if (pfd != null) {
// 	            FileDescriptor fd = pfd.getFileDescriptor();
// 	            bm = BitmapFactory.decodeFileDescriptor(fd);
// 	        }
// 	    } catch (Exception e) {
// 	    }
// 	    return bm;
// 	}
// 	public String getSize(int size) {
// 		size /= 1024; 
// 		return size + "KB";
// 	}
// 	public String getSize(long size) {
// 		size /= 1024; 
// 		return size + "KB";
// 	}
// }


import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.AsyncTask;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import me.varunon9.remotecontrolpc.CallbackReceiver;
import me.varunon9.remotecontrolpc.MusicImageAvatar;
import me.varunon9.remotecontrolpc.Utility;
package me.varunon9.remotecontrolpc.mediaplayer;




public abstract class SongsList extends AsyncTask<Void, Void, ArrayList<MusicImageAvatar>> implements CallbackReceiver {
	Context context;
	public SongsList(Context context) {
		this.context = context;
	}
	protected ArrayList<MusicImageAvatar> doInBackground(Void... params) {
		ArrayList<MusicImageAvatar> songsList = new ArrayList<MusicImageAvatar>();
		ContentResolver musicResolver = context.getContentResolver();
    	Uri musicUri = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
        Cursor musicCursor = musicResolver.query(musicUri, null, null, null, null);
// Path: RemoteControlPC-Studio/app/src/main/java/me/varunon9/remotecontrolpc/CallbackReceiver.java
// public interface CallbackReceiver {
//      public void receiveData (Object result);
// }
// 
// Path: RemoteControlPC-Studio/app/src/main/java/me/varunon9/remotecontrolpc/MusicImageAvatar.java
// public class MusicImageAvatar {
// 
// 	private int icon, duration;
// 	private String avatarHeading, avatarSubheading, avatarData, type;
// 	
// 	public MusicImageAvatar(int icon, int duration, String avatarHeading,
//                             String avatarSubheading, String avatarData, String type) {
// 		this.icon = icon;
// 		this.duration = duration;
// 		this.avatarHeading = avatarHeading;
// 		this.avatarSubheading = avatarSubheading;
// 		this.avatarData = avatarData;
// 		this.type = type;
// 	}
// 	
// 	public String getHeading() {
// 		return avatarHeading;
// 	}
// 	
// 	public String getData() {
// 		return avatarData;
// 	}
// 	
// 	public String getType() {
// 		return type;
// 	}
// 	
// 	public String getSubheading() {
// 		return avatarSubheading;
// 	}
// 	
// 	public int getIcon() {
// 		return icon;
// 	}
// 	
// 	public int getDuration() {
// 		return duration;
// 	}
// }
// 
// Path: RemoteControlPC-Studio/app/src/main/java/me/varunon9/remotecontrolpc/Utility.java
// public class Utility {
// 	public String getDate(String date, String dateFormat) {
// 		long milliSeconds = Long.parseLong(date);
// 		// Create a DateFormatter object for displaying date in specified format.
// 	    SimpleDateFormat formatter = new SimpleDateFormat(dateFormat);
// 	    // Create a calendar object that will convert the date and time value in milliseconds to date. 
// 	     Calendar calendar = Calendar.getInstance();
// 	     calendar.setTimeInMillis(milliSeconds);
// 	     return formatter.format(calendar.getTime());
// 	}
// 	public String getDate(long milliSeconds, String dateFormat) {
// 		// Create a DateFormatter object for displaying date in specified format.
// 	    SimpleDateFormat formatter = new SimpleDateFormat(dateFormat);
// 	    // Create a calendar object that will convert the date and time value in milliseconds to date. 
// 	     Calendar calendar = Calendar.getInstance();
// 	     calendar.setTimeInMillis(milliSeconds);
// 	     return formatter.format(calendar.getTime());
// 	}
// 	/*http://stackoverflow.com/questions/22859350/android-listview-out-of-memory-exception*/
// 	public Bitmap decodeImageFile(String path) {
// 		try {
//             // Decode image size
//             BitmapFactory.Options o = new BitmapFactory.Options();
//             o.inJustDecodeBounds = true;
//             BitmapFactory.decodeFile(path, o);
//             // The new size we want to scale to
//             final int REQUIRED_SIZE = 60;
//             // Find the correct scale value. It should be the power of 2.
//             int scale = 1;
//             while (o.outWidth / scale / 2 >= REQUIRED_SIZE && o.outHeight / scale / 2 >= REQUIRED_SIZE)
//                 scale *= 2;
// 
//             // Decode with inSampleSize
//             BitmapFactory.Options o2 = new BitmapFactory.Options();
//             o2.inSampleSize = scale;
//             return BitmapFactory.decodeFile(path, o2);
//         } catch (Throwable e) {
//             e.printStackTrace();
//         }
//         return null;
// 	}
// 	public String getDuration(int duration) {
// 		String time = "";
// 		duration /= 1000;//in seconds
// 		int minutes = duration / 60;
// 		duration %= 60;
// 		if (minutes > 0) {
// 			time += minutes + " mins ";
// 		}
// 		time += duration + " secs";
// 		return time;
// 	}
// 	public Bitmap getAlbumart(int albumId, Context context) {
// 	    Bitmap bm = null;
// 	    try {
// 	        final Uri sArtworkUri = Uri.parse("content://media/external/audio/albumart");
// 	        Uri uri = ContentUris.withAppendedId(sArtworkUri, albumId);
// 	        ParcelFileDescriptor pfd = context.getContentResolver().openFileDescriptor(uri, "r");
//             if (pfd != null) {
// 	            FileDescriptor fd = pfd.getFileDescriptor();
// 	            bm = BitmapFactory.decodeFileDescriptor(fd);
// 	        }
// 	    } catch (Exception e) {
// 	    }
// 	    return bm;
// 	}
// 	public String getSize(int size) {
// 		size /= 1024; 
// 		return size + "KB";
// 	}
// 	public String getSize(long size) {
// 		size /= 1024; 
// 		return size + "KB";
// 	}
// }


// Path: RemoteControlPC-Studio/app/src/main/java/me/varunon9/remotecontrolpc/mediaplayer/SongsList.java
import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.AsyncTask;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import me.varunon9.remotecontrolpc.CallbackReceiver;
import me.varunon9.remotecontrolpc.MusicImageAvatar;
import me.varunon9.remotecontrolpc.Utility;

package me.varunon9.remotecontrolpc.mediaplayer;




public abstract class SongsList extends AsyncTask<Void, Void, ArrayList<MusicImageAvatar>> implements CallbackReceiver {
	Context context;
	public SongsList(Context context) {
		this.context = context;
	}
	protected ArrayList<MusicImageAvatar> doInBackground(Void... params) {
		ArrayList<MusicImageAvatar> songsList = new ArrayList<MusicImageAvatar>();
		ContentResolver musicResolver = context.getContentResolver();
    	Uri musicUri = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
        Cursor musicCursor = musicResolver.query(musicUri, null, null, null, null);
        Utility utility = new Utility();