Esempio n. 1
0
void Server::updateUserChannel(const UserChannel &serverChannel)
{
    QString userFullName = serverChannel.getUserFullName();
    if(users.contains(userFullName)){
        users[userFullName].updateChannelName(serverChannel.getIndex(), serverChannel.getName());
    }
}
Esempio n. 2
0
void Server::removeUserChannel(const UserChannel &channel)
{
    QString userFullName = channel.getUserFullName();
    if(users.contains(userFullName)){
        users[userFullName].removeChannel(channel.getIndex());
    }
}
Esempio n. 3
0
UserChannel::UserChannel(const UserChannel &c) :
    userFullName(c.getUserFullName()),
    channelName(c.getName()),
    active(c.isActive()),
    index(c.getIndex()),
    volume(c.volume),
    pan(c.pan),
    flags(c.flags)
{
}
Esempio n. 4
0
void Server::addUserChannel(const UserChannel &newChannel)
{
    QString userFullName = newChannel.getUserFullName();
    if(users.contains(userFullName)){
        int userChannelsCount = users[userFullName].getChannelsCount();
        if(userChannelsCount < maxChannels)
            users[userFullName].addChannel(newChannel);
        else
            qCCritical(jtNinjamCore) << "Can't add more channels for " << userFullName << "(using" <<
                                        QString::number(userChannelsCount) << " channels). The server maxChannels is " <<
                                        QString::number(maxChannels);
    }
}