コード例 #1
0
void NinjamRoomWindow::showLastChordsInChat()
{
    Login::LoginService *loginService = mainController->getLoginService();
    QString lastChordProgression = loginService->getChordProgressionFor(roomInfo);
    ChatChordsProgressionParser parser;
    if (parser.containsProgression(lastChordProgression)) {
        ChordProgression progression = parser.parse(lastChordProgression);
        QString title = tr("Last chords used");
        chatPanel->addLastChordsMessage(title, progression.toString());
        chatPanel->addChordProgressionConfirmationMessage(parser.parse(lastChordProgression));

    }
}
コード例 #2
0
void NinjamRoomWindow::handleChordProgressionMessage(const Ninjam::User &user, const QString &message)
{
    Q_UNUSED(user)
    ChatChordsProgressionParser parser;
    try{
        ChordProgression chordProgression = parser.parse(message);
        chatPanel->addChordProgressionConfirmationMessage(chordProgression);
    }
    catch (const std::runtime_error &e) {
        qCCritical(jtNinjamGUI) << e.what();
    }
}