#include "mainwindow.h"
#include "audio/audioengine.h"
#include "config/pluginregistry.h"
#include "data/graph.h"

#include <vector>

#include <QDebug>
#include <QFontDatabase>
#include <QApplication>
#include <QSurfaceFormat>

int main(int argc, char *argv[]) {
    qRegisterMetaType<Xybrid::Data::Port>();

    QApplication a(argc, argv);

    // enable antialiasing on accelerated graphicsview
    QSurfaceFormat fmt;
    fmt.setSamples(10);
    QSurfaceFormat::setDefaultFormat(fmt);

    // make sure bundled fonts are loaded
    QFontDatabase::addApplicationFont(":/fonts/iosevka-term-light.ttf");

    Xybrid::Config::PluginRegistry::init();
    Xybrid::Audio::AudioEngine::init();

    auto* w = new Xybrid::MainWindow();
    w->show();

    return a.exec();
}
