package com.zxhy.simplefilesmanager.simplelist

import com.zxhy.simplefilesmanager.simpleCommon.SimpleCommonViewModel
import com.zxhy.simplefilesmanager.simpledata.JoGridFileJo
import java.io.File

class SimpleListViewModel : SimpleCommonViewModel() {

    fun isAudio(file: File): Boolean {
        return file.name.contains(".mp3") or
                file.name.contains(".aac") or
                file.name.contains(".ogg") or
                file.name.contains(".aac")
    }

    fun loadAudio(
        onDo: (list: List<JoGridFileJo>) -> Unit,
        onFinish: (list: List<JoGridFileJo>) -> Unit
    ) = loadFile(::isAudio, JoGridFileJo.Companion ::joGridFileJo, onDo, onFinish)
}