Start work on launching a stream from QML and rip out remaining QtWidgets

This commit is contained in:
Cameron Gutman 2018-07-07 16:30:26 -07:00
commit 60ad95bb7b
11 changed files with 83 additions and 55 deletions

View file

@ -78,6 +78,26 @@ QHash<int, QByteArray> ComputerModel::roleNames() const
return names;
}
Session* ComputerModel::createSessionForCurrentGame(int computerIndex)
{
Q_ASSERT(computerIndex < m_Computers.count());
NvComputer* computer = m_Computers[computerIndex];
// We must currently be streaming a game to use this function
Q_ASSERT(computer->currentGameId != 0);
for (NvApp& app : computer->appList) {
if (app.id == computer->currentGameId) {
return new Session(computer, app);
}
}
// We have a current running app but it's not in our app list
Q_ASSERT(false);
return nullptr;
}
void ComputerModel::deleteComputer(int computerIndex)
{
Q_ASSERT(computerIndex < m_Computers.count());