// FlightController.cpp: 定义应用程序的入口点。
//

#include <iostream>
#include <QApplication>
#include <QProcess>

#include "SpdLog.h"
#include "VlcMediaPlayer.h"

#include "MainWindow.h"

int main(int argc, char* argv[]) {
	QApplication app(argc, argv);
    InitSpdlog("PhotoVideoPlayer_log", "logs/PhotoVideoPlayer_log.txt", 5);

    VlcMediaPlayer::Init();

    QTimer::singleShot(50, []() {
        MainWindow* mainWindow = new MainWindow;
        mainWindow->showFullScreen();
        });

	int ret = app.exec();
    VlcMediaPlayer::Uninit();
    QString batFile = app.applicationDirPath() + "/PhotoVideoPlayer";
    QProcess process1;
    process1.setWorkingDirectory(batFile);
    process1.start(batFile + "/kill.bat");
    process1.waitForFinished();
 
    UninitSpdlog();
    return ret;
}