#pragma once

#include <memory>
#include <filesystem>

#include "AbstractApp.h"
#include "AudioManager.h"
#include "FileLogger.h"
#include "DatabaseManager.h"
#include "NetworkManager.h"
#include "CommandLineArgs.h"

class MainApplication : public AbstractApp
{
public:

    MainApplication();

    ~MainApplication();

    void Initialize(CommandLineArgsUPtr commandLineArgs, std::unique_ptr<IApplicationContext> applicationContext=nullptr);

    void Run();

    void ShutDown();

    CommandLineArgs* GetCommandLineArgs() const;

    static std::shared_ptr<MainApplication> Create();

private:
    void RunServer();

    void PlayAudio();

    void ConvertDocument(const std::string& inputPath, const std::string& outputPath);

    CommandLineArgsUPtr mCommandLineArgs;
    DatabaseManagerPtr mDatabaseManager;
    NetworkManagerUPtr mNetworkManager;
    AudioManagerUPtr mAudioManager;
};

using MainApplicationPtr = std::shared_ptr<MainApplication>;
