import audio.AudioPlayer
import com.sun.jna.Platform
import content.ContentCache
import database.MariaDB
import org.tinylog.Logger
import oshi.util.GlobalConfig
import web.WebApp


fun main() {
    if (Platform.isWindows()){
        // supaya OSHI bisa mendapatkan CPU usage di Windows seperti di Task Manager
        GlobalConfig.set(GlobalConfig.OSHI_OS_WINDOWS_CPU_UTILITY,true)
    }
    Logger.info("Application started" as Any)
    val audioPlayer = AudioPlayer(44100) // 44100 Hz sampling rate
    audioPlayer.InitAudio(1)
    val content = ContentCache()
    val db = MariaDB()
    val web = WebApp(3030,
        listOf(
            Pair("admin", "password"),
            Pair("user", "password")
        ), db
    )
    web.Start()




}
