#include "UtilTool.h" #include "mediaService.h" #include #include #include #include #include #include #define DEBUG constexpr int CLIENT_WIDTH = 800; constexpr int CLIENT_HEIGHT = 600; int main(int argc, char **argv) { spdlog::info("Current WorkDir Is: {}", argv[0]); #ifdef DEBUG argv[1] = R"(../img/ocean.mp4)"; #else if (argc != 2) { spdlog::error("Usage: mp filename "); return 0; } #endif spdlog::info("filename: {}", argv[1]); std::shared_ptr window = std::make_shared( sf::VideoMode(CLIENT_WIDTH, CLIENT_HEIGHT), "mp"); MediaService mediaService(window, argv[1], CLIENT_WIDTH, CLIENT_HEIGHT); bool running = true; while (running) { sf::Event event; while (window->pollEvent(event)) { if (event.type == sf::Event::Closed) { running = false; } if (event.type == sf::Event::KeyPressed) { if (event.key.code == sf::Keyboard::Escape) { running = false; } } } mediaService.Play(); } return 0; }