// Path: mobile/src/main/java/com/laithlab/rhythm/dto/SongDTO.java
// public class SongDTO implements Parcelable {
// 
//     private String songTitle;
//     private long songDuration;
//     private String songLocation;
//     private String albumId;
//     private String id;
// 
//     public void setSongTitle(String songTitle) {
//         this.songTitle = songTitle;
//     }
// 
//     public String getSongTitle() {
//         return songTitle;
//     }
// 
//     public void setSongDuration(long songDuration) {
//         this.songDuration = songDuration;
//     }
// 
//     public long getSongDuration() {
//         return songDuration;
//     }
// 
//     public void setSongLocation(String songLocation) {
//         this.songLocation = songLocation;
//     }
// 
//     public String getSongLocation() {
//         return songLocation;
//     }
// 
//     public String getAlbumId() {
//         return albumId;
//     }
// 
//     public void setAlbumId(String albumId) {
//         this.albumId = albumId;
//     }
// 
//     public void setId(String id) {
//         this.id = id;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeString(this.songTitle);
//         dest.writeLong(this.songDuration);
//         dest.writeString(this.songLocation);
//         dest.writeString(this.albumId);
//         dest.writeString(this.id);
//     }
// 
//     public SongDTO() {
//     }
// 
//     protected SongDTO(Parcel in) {
//         this.songTitle = in.readString();
//         this.songDuration = in.readLong();
//         this.songLocation = in.readString();
//         this.albumId = in.readString();
//         this.id = in.readString();
//     }
// 
//     public static final Parcelable.Creator<SongDTO> CREATOR = new Parcelable.Creator<SongDTO>() {
//         public SongDTO createFromParcel(Parcel source) {
//             return new SongDTO(source);
//         }
// 
//         public SongDTO[] newArray(int size) {
//             return new SongDTO[size];
//         }
//     };
// }


import android.content.Context;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.net.Uri;
import java.util.List;
import com.laithlab.rhythm.dto.SongDTO;
import timber.log.Timber;
package com.laithlab.rhythm.utils;





public class PlayBackUtil {
    private static List<SongDTO> currentPlayList = null;
    private static int currentSongPosition = 0;
    private static MediaPlayer mediaPlayer = null;
    private static PlayMode currentPlayMode = PlayMode.NONE;
    private static RhythmSong currentSong;

    public static MediaPlayer getMediaPlayer() {
        return mediaPlayer;
    }

    public static MediaPlayer setMediaPlayer(Context context, String songLocation) {
        try {
            if (mediaPlayer != null) {
                if (mediaPlayer.isPlaying()) {
                    mediaPlayer.stop();
                }
                mediaPlayer.reset();
            }
            mediaPlayer = MediaPlayer.create(context, Uri.parse(songLocation));
            mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
            return mediaPlayer;
        } catch (Exception e) {
            Timber.e(e, "setMediaPlayer");
            mediaPlayer = MediaPlayer.create(context, Uri.parse(songLocation));
            mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
            return mediaPlayer;
        }
    }

// Path: mobile/src/main/java/com/laithlab/rhythm/dto/SongDTO.java
// public class SongDTO implements Parcelable {
// 
//     private String songTitle;
//     private long songDuration;
//     private String songLocation;
//     private String albumId;
//     private String id;
// 
//     public void setSongTitle(String songTitle) {
//         this.songTitle = songTitle;
//     }
// 
//     public String getSongTitle() {
//         return songTitle;
//     }
// 
//     public void setSongDuration(long songDuration) {
//         this.songDuration = songDuration;
//     }
// 
//     public long getSongDuration() {
//         return songDuration;
//     }
// 
//     public void setSongLocation(String songLocation) {
//         this.songLocation = songLocation;
//     }
// 
//     public String getSongLocation() {
//         return songLocation;
//     }
// 
//     public String getAlbumId() {
//         return albumId;
//     }
// 
//     public void setAlbumId(String albumId) {
//         this.albumId = albumId;
//     }
// 
//     public void setId(String id) {
//         this.id = id;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeString(this.songTitle);
//         dest.writeLong(this.songDuration);
//         dest.writeString(this.songLocation);
//         dest.writeString(this.albumId);
//         dest.writeString(this.id);
//     }
// 
//     public SongDTO() {
//     }
// 
//     protected SongDTO(Parcel in) {
//         this.songTitle = in.readString();
//         this.songDuration = in.readLong();
//         this.songLocation = in.readString();
//         this.albumId = in.readString();
//         this.id = in.readString();
//     }
// 
//     public static final Parcelable.Creator<SongDTO> CREATOR = new Parcelable.Creator<SongDTO>() {
//         public SongDTO createFromParcel(Parcel source) {
//             return new SongDTO(source);
//         }
// 
//         public SongDTO[] newArray(int size) {
//             return new SongDTO[size];
//         }
//     };
// }


// Path: mobile/src/main/java/com/laithlab/rhythm/utils/PlayBackUtil.java
import android.content.Context;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.net.Uri;
import java.util.List;
import com.laithlab.rhythm.dto.SongDTO;
import timber.log.Timber;

package com.laithlab.rhythm.utils;





public class PlayBackUtil {
    private static List<SongDTO> currentPlayList = null;
    private static int currentSongPosition = 0;
    private static MediaPlayer mediaPlayer = null;
    private static PlayMode currentPlayMode = PlayMode.NONE;
    private static RhythmSong currentSong;

    public static MediaPlayer getMediaPlayer() {
        return mediaPlayer;
    }

    public static MediaPlayer setMediaPlayer(Context context, String songLocation) {
        try {
            if (mediaPlayer != null) {
                if (mediaPlayer.isPlaying()) {
                    mediaPlayer.stop();
                }
                mediaPlayer.reset();
            }
            mediaPlayer = MediaPlayer.create(context, Uri.parse(songLocation));
            mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
            return mediaPlayer;
        } catch (Exception e) {
            Timber.e(e, "setMediaPlayer");
            mediaPlayer = MediaPlayer.create(context, Uri.parse(songLocation));
            mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
            return mediaPlayer;
        }
    }

    public static List<SongDTO> getCurrentPlayList() {