예제 #1
0
///High level test: simple node connections test
TEST_F(BaseTest,SimpleNodeConnections) {
    ///create the generator
    NodePtr generator = createNode(_dotGeneratorPluginID);

    ///create the writer and set its output filename
    NodePtr writer = createNode(_writeOIIOPluginID);
    ASSERT_TRUE(writer && generator);
    connectNodes(generator, writer, 0, true);
    connectNodes(generator, writer, 0, false); //< expect it to fail
    disconnectNodes(generator, writer, true);
    disconnectNodes(generator, writer, false);
    connectNodes(generator, writer, 0, true);
}
예제 #2
0
void GameConsole::loadLibretro() {
    // Ensure that the properties were set in QML
    Q_ASSERT_X( controlOutput, "libretro load", "controlOutput was not set!" );
    Q_ASSERT_X( videoOutput, "libretro load", "videoOutput was not set!" );
    Q_ASSERT_X( variableModel, "libretro load", "variableModel was not set!" );

    // Disconnect PhoenixWindow from MicroTimer, insert libretroLoader in between
    disconnectNodes( phoenixWindow, microTimer );
    sessionConnections << connectNodes( phoenixWindow, libretroLoader );
    sessionConnections << connectNodes( libretroLoader, microTimer );

    // Disconnect SDLRunner from Remapper, it'll get inserted after LibretroRunner
    disconnectNodes( remapper, sdlUnloader );

    // Connect LibretroVariableForwarder to the global pipeline
    sessionConnections << connectNodes( remapper, libretroVariableForwarder );
    sessionConnections << connectNodes( libretroVariableForwarder, libretroRunner );

    // Connect LibretroRunner to its children

    sessionConnections << connectNodes( libretroRunner, audioOutput );
    sessionConnections << connectNodes( libretroRunner, sdlUnloader );

    // It's very important that ControlOutput is always connected via a queued connection as things that handle
    // state changes (things that listen to ControlOutput) should not be at the top of a stack that contains
    // the function calls that changed the state in the first place. This only really applies when we're single-threaded.
    sessionConnections << connectNodes( libretroRunner, controlOutput, Qt::QueuedConnection );

    sessionConnections << connectNodes( libretroRunner, videoOutput );

    // Hook LibretroCore so we know when commands have reached it
    // We can't hook ControlOutput as it lives on the main thread and if it's time to quit the main thread's event loop is dead
    // We care about this happening as LibretroCore needs to save its running game before quitting
    sessionConnections << connect( libretroRunner, &Node::commandOut, libretroRunner, [ & ]( Command command, QVariant, qint64 ) {
        switch( command ) {
            case Command::Stop: {
                unloadLibretro();
                break;
            }

            default: {
                break;
            }
        }
    } );
}