void Server::updateUserChannel(const UserChannel &serverChannel) { QString userFullName = serverChannel.getUserFullName(); if(users.contains(userFullName)){ users[userFullName].updateChannelName(serverChannel.getIndex(), serverChannel.getName()); } }
void Server::removeUserChannel(const UserChannel &channel) { QString userFullName = channel.getUserFullName(); if(users.contains(userFullName)){ users[userFullName].removeChannel(channel.getIndex()); } }
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) { }
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); } }