Exemplo n.º 1
0
void PlaylistEdit::checkCurrentIp()
{
#if WITH_EDITOR_VLCQT
    if(_currentIpPlaying) {
        _player->stop();

        bool newChannel = true;
        for(int i = 0; i < _model->rowCount(); i++) {
            if(_model->row(i)->url() == currentIp()) {
                newChannel = false;
                break;
            }
        }

        if(newChannel) {
            qDebug() << "Scanning:" << "Channel Found";
            addItem(tr("New channel from scan %1").arg(currentIp()), currentIp());
        }
    }

    if(_currentIp[3] != 255) {
        _currentIp[3]++;
        checkIp();
    } else {
        ui->buttonUpdate->setChecked(false);
    }
#endif
}
Exemplo n.º 2
0
void PlaylistEdit::refreshPlaylist(const bool &refresh)
{
#if WITH_EDITOR_VLCQT
    if(!refresh) {
        _timer->stop();
        ui->progressBar->setValue(1);
        ui->playlist->setEnabled(true);

        QFile::remove(QDir::tempPath() + "/tano-test.ts");
    } else {
        ui->playlist->setEnabled(false);

        qDebug() << "Scanning:" << ui->ipFrom->text() << ui->ipPort->value() << ui->ipTimeout->value();

        QStringList ipFrom = ui->ipFrom->text().split(".");
        _currentIp[0] = ipFrom[0].toInt();
        _currentIp[1] = ipFrom[1].toInt();
        _currentIp[2] = ipFrom[2].toInt();
        _currentIp[3] = 1;

        _currentPort = ui->ipPort->value();
        _currentTimeout = ui->ipTimeout->value();

        checkIp();
    }
#else
    Q_UNUSED(refresh)
#endif
}
Exemplo n.º 3
0
mocca::net::TCPNetworkAddress::TCPNetworkAddress(const std::string& address) {
    auto parts = mocca::splitString<std::string>(address, ':');
    if (parts.size() != 2) {
        throw Error("TCP connection string is malformed, must have the format 'ip:port'", __FILE__, __LINE__);
    }
    auto ip = parts.front();
    auto port = parsePort(parts.back());
    checkIp(ip);
    checkPort(port);
    ip_ = ip;
    port_ = port;
}
Exemplo n.º 4
0
TCPNetworkAddress::TCPNetworkAddress(const std::string& ip, int port) {
    checkIp(ip);
    checkPort(port);
    ip_ = ip;
    port_ = port;
}