// Path: core/src/com/fteams/siftrain/entities/SimpleNotesInfo.java
// public class SimpleNotesInfo implements Comparable<SimpleNotesInfo>{
//     public Double timing_sec;
//     public Integer effect;
//     public Double effect_value;
//     public Integer position;
// 
// 
//     @Override
//     public int compareTo(SimpleNotesInfo o) {
//         if (!o.timing_sec.equals(timing_sec))
//             return Double.compare(timing_sec, o.timing_sec);
//         return SongUtils.compare(position, o.position);
//     }
// }
// 
// Path: core/src/com/fteams/siftrain/entities/SimpleSong.java
// public class SimpleSong extends SongFileInfo {
//     public List<SimpleSongInfo> song_info;
//     private Boolean valid;
//     public Float lead_in;
// 
//     public Boolean getValid() {
//         return valid;
//     }
// 
//     public void setValid(Boolean valid) {
//         this.valid = valid;
//     }
// }
// 
// Path: core/src/com/fteams/siftrain/entities/SongFileInfo.java
// public class SongFileInfo implements Comparable<SongFileInfo> {
//     private String resourceName;
//     public String song_name;
//     public Integer difficulty;
//     private String fileName;
//     public String music_file;
//     public String difficulty_name;
//     private Long crc;
// 
//     public String toString() {
//         return (difficulty_name == null ? SongUtils.getDifficulty(difficulty) : difficulty_name);
//     }
// 
//     public String getResourceName() {
//         return resourceName;
//     }
// 
//     public void setResourceName(String resourceName) {
//         this.resourceName = resourceName;
//     }
// 
//     @Override
//     public int compareTo(SongFileInfo o) {
//         if (GlobalConfiguration.sortMode == SongUtils.SORTING_MODE_FILE_NAME) {
//             if (!o.getResourceName().equals(resourceName)) {
//                 return (GlobalConfiguration.sortOrder == SongUtils.SORTING_MODE_ASCENDING ? 1 : -1) * resourceName.compareTo(o.getResourceName());
//             }
//             if (!song_name.equals(o.song_name)) {
//                 return (GlobalConfiguration.sortOrder == SongUtils.SORTING_MODE_ASCENDING ? 1 : -1) * song_name.compareTo(o.song_name);
//             }
//         } else if (GlobalConfiguration.sortMode == SongUtils.SORTING_MODE_SONG_NAME) {
//             if (!song_name.equals(o.song_name)) {
//                 return (GlobalConfiguration.sortOrder == SongUtils.SORTING_MODE_ASCENDING ? 1 : -1) * song_name.compareTo(o.song_name);
//             }
//             if (!o.getResourceName().equals(resourceName)) {
//                 return (GlobalConfiguration.sortOrder == SongUtils.SORTING_MODE_ASCENDING ? 1 : -1) * resourceName.compareTo(o.getResourceName());
//             }
//         }
//         // always check difficulty last to keep them in order
//         if (!difficulty.equals(o.difficulty)) {
//             return (GlobalConfiguration.sortOrder == SongUtils.SORTING_MODE_ASCENDING ? 1 : -1) * difficulty.compareTo(o.difficulty);
//         }
//         if (difficulty_name != null && o.difficulty_name != null && !difficulty_name.equals(o.difficulty_name)) {
//             return (GlobalConfiguration.sortOrder == SongUtils.SORTING_MODE_ASCENDING ? 1 : -1) * difficulty_name.compareTo(o.difficulty_name);
//         }
//         return 0;
//     }
// 
//     public String getFileName() {
//         return fileName;
//     }
// 
//     public void setFileName(String fileName) {
//         this.fileName = fileName;
//     }
// 
//     public Long getCrc() {
//         return crc;
//     }
// 
//     public void setCrc(Long crc) {
//         this.crc = crc;
//     }
// 
//     public String to2LineString() {
//         return song_name + "\n[" + (difficulty_name == null ? SongUtils.getDifficulty(difficulty) : difficulty_name) + "]";
//     }
// }


import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.fteams.siftrain.entities.SimpleNotesInfo;
import com.fteams.siftrain.entities.SimpleSong;
import com.fteams.siftrain.entities.SongFileInfo;
import com.google.gson.Gson;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
package com.fteams.siftrain.assets;



public class SimpleSongLoader {
    private List<String> errors = new ArrayList<>();
    private List<String> warnings = new ArrayList<>();

    public List<String> getErrors() {
        return errors;
    }

    public List<String> getWarnings() {
        return warnings;
    }

    public SimpleSong loadSong(SongFileInfo beatmap) {
        FileHandle handle = Gdx.files.absolute(Gdx.files.getExternalStoragePath() + "/" + beatmap.getFileName());
        SimpleSong song = null;
        String jsonDefinition = handle.readString("UTF-8");
        try {
            song = new Gson().fromJson(jsonDefinition, SimpleSong.class);
            validateSong(song);
// Path: core/src/com/fteams/siftrain/entities/SimpleNotesInfo.java
// public class SimpleNotesInfo implements Comparable<SimpleNotesInfo>{
//     public Double timing_sec;
//     public Integer effect;
//     public Double effect_value;
//     public Integer position;
// 
// 
//     @Override
//     public int compareTo(SimpleNotesInfo o) {
//         if (!o.timing_sec.equals(timing_sec))
//             return Double.compare(timing_sec, o.timing_sec);
//         return SongUtils.compare(position, o.position);
//     }
// }
// 
// Path: core/src/com/fteams/siftrain/entities/SimpleSong.java
// public class SimpleSong extends SongFileInfo {
//     public List<SimpleSongInfo> song_info;
//     private Boolean valid;
//     public Float lead_in;
// 
//     public Boolean getValid() {
//         return valid;
//     }
// 
//     public void setValid(Boolean valid) {
//         this.valid = valid;
//     }
// }
// 
// Path: core/src/com/fteams/siftrain/entities/SongFileInfo.java
// public class SongFileInfo implements Comparable<SongFileInfo> {
//     private String resourceName;
//     public String song_name;
//     public Integer difficulty;
//     private String fileName;
//     public String music_file;
//     public String difficulty_name;
//     private Long crc;
// 
//     public String toString() {
//         return (difficulty_name == null ? SongUtils.getDifficulty(difficulty) : difficulty_name);
//     }
// 
//     public String getResourceName() {
//         return resourceName;
//     }
// 
//     public void setResourceName(String resourceName) {
//         this.resourceName = resourceName;
//     }
// 
//     @Override
//     public int compareTo(SongFileInfo o) {
//         if (GlobalConfiguration.sortMode == SongUtils.SORTING_MODE_FILE_NAME) {
//             if (!o.getResourceName().equals(resourceName)) {
//                 return (GlobalConfiguration.sortOrder == SongUtils.SORTING_MODE_ASCENDING ? 1 : -1) * resourceName.compareTo(o.getResourceName());
//             }
//             if (!song_name.equals(o.song_name)) {
//                 return (GlobalConfiguration.sortOrder == SongUtils.SORTING_MODE_ASCENDING ? 1 : -1) * song_name.compareTo(o.song_name);
//             }
//         } else if (GlobalConfiguration.sortMode == SongUtils.SORTING_MODE_SONG_NAME) {
//             if (!song_name.equals(o.song_name)) {
//                 return (GlobalConfiguration.sortOrder == SongUtils.SORTING_MODE_ASCENDING ? 1 : -1) * song_name.compareTo(o.song_name);
//             }
//             if (!o.getResourceName().equals(resourceName)) {
//                 return (GlobalConfiguration.sortOrder == SongUtils.SORTING_MODE_ASCENDING ? 1 : -1) * resourceName.compareTo(o.getResourceName());
//             }
//         }
//         // always check difficulty last to keep them in order
//         if (!difficulty.equals(o.difficulty)) {
//             return (GlobalConfiguration.sortOrder == SongUtils.SORTING_MODE_ASCENDING ? 1 : -1) * difficulty.compareTo(o.difficulty);
//         }
//         if (difficulty_name != null && o.difficulty_name != null && !difficulty_name.equals(o.difficulty_name)) {
//             return (GlobalConfiguration.sortOrder == SongUtils.SORTING_MODE_ASCENDING ? 1 : -1) * difficulty_name.compareTo(o.difficulty_name);
//         }
//         return 0;
//     }
// 
//     public String getFileName() {
//         return fileName;
//     }
// 
//     public void setFileName(String fileName) {
//         this.fileName = fileName;
//     }
// 
//     public Long getCrc() {
//         return crc;
//     }
// 
//     public void setCrc(Long crc) {
//         this.crc = crc;
//     }
// 
//     public String to2LineString() {
//         return song_name + "\n[" + (difficulty_name == null ? SongUtils.getDifficulty(difficulty) : difficulty_name) + "]";
//     }
// }


// Path: core/src/com/fteams/siftrain/assets/SimpleSongLoader.java
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.fteams.siftrain.entities.SimpleNotesInfo;
import com.fteams.siftrain.entities.SimpleSong;
import com.fteams.siftrain.entities.SongFileInfo;
import com.google.gson.Gson;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

package com.fteams.siftrain.assets;



public class SimpleSongLoader {
    private List<String> errors = new ArrayList<>();
    private List<String> warnings = new ArrayList<>();

    public List<String> getErrors() {
        return errors;
    }

    public List<String> getWarnings() {
        return warnings;
    }

    public SimpleSong loadSong(SongFileInfo beatmap) {
        FileHandle handle = Gdx.files.absolute(Gdx.files.getExternalStoragePath() + "/" + beatmap.getFileName());
        SimpleSong song = null;
        String jsonDefinition = handle.readString("UTF-8");
        try {
            song = new Gson().fromJson(jsonDefinition, SimpleSong.class);
            validateSong(song);
            song.setValid(true);