X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fplayermainwindow.cpp;fp=src%2Fplayermainwindow.cpp;h=6ad1541b06951c5883a97647487ff6df750e140c;hb=0ef850b1787962729c2dae523360e8c1f6179402;hp=ff734cb35e74515c5fb0a776345102ad85c0a69e;hpb=e1733dc9f63d6f8cfd99f8082263fa2432abdd80;p=vlc-remote diff --git a/src/playermainwindow.cpp b/src/playermainwindow.cpp index ff734cb..6ad1541 100644 --- a/src/playermainwindow.cpp +++ b/src/playermainwindow.cpp @@ -136,7 +136,7 @@ else { socket->connectToHost(last_ip,8080); } - if (!socket->waitForConnected(1000)) { + if (!socket->waitForConnected(AppSettings::getConnectionTimeout())) { showConfig(); } else { @@ -144,7 +144,7 @@ mPlayListMainWindow->init(); mBrowserMainWindow->init(); - mTimer->start(5000); + mTimer->start(AppSettings::getStatusPollTimeout()); askStatus(); } delete socket; @@ -310,14 +310,14 @@ mPlayListMainWindow->init(); mBrowserMainWindow->init(); - mTimer->start(5000); + mTimer->start(AppSettings::getStatusPollTimeout()); askStatus(); } else { #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) QMaemo5InformationBox::information(this, tr("Network unavailable!"), QMaemo5InformationBox::DefaultTimeout); #endif - QTimer::singleShot(20000, this, SLOT(showConfig())); + QTimer::singleShot(AppSettings::getRetryNetworkTimeout(), this, SLOT(showConfig())); } } void PlayerMainWindow::showAbout() @@ -377,24 +377,6 @@ // now would be a good time to work out if we are a new track / file or not. // key if we are going to look for album art later // for now we check length and title this will require further examination later - mCurrentStatus.newtrack = true; - if ( (0 == mCurrentStatus.length || STOP == mCurrentStatus.state) // stopped or null - || // same track as current playing - (mCurrentStatus.length == length && !mCurrentStatus.title.isNull() && 0 == QString::compare(mCurrentStatus.title, title)) ){ - mCurrentStatus.newtrack = false; - } - mCurrentStatus.volume = volume; - mCurrentStatus.length = length; - mCurrentStatus.time = time; - mCurrentStatus.position = position; - mCurrentStatus.random = (1 == random); - mCurrentStatus.loop = (1 == loop); - mCurrentStatus.repeat = (1 == repeat); - mCurrentStatus.title = title; - mCurrentStatus.artist = artist; - mCurrentStatus.album = album; - mCurrentStatus.nowplaying = now_playing; - mCurrentStatus.hasart = (!art_url.isNull() && !art_url.isEmpty()); if (!state.isNull() && !state.isEmpty()) { if (0 == QString::compare("playing", state, Qt::CaseInsensitive)) { mCurrentStatus.state = PLAYING; @@ -412,6 +394,24 @@ else { mCurrentStatus.state = UNKNOWN; } + mCurrentStatus.newtrack = true; + if ( (0 == mCurrentStatus.length || STOP == mCurrentStatus.state) // stopped or null + || // same track as current playing + (mCurrentStatus.length == length && !mCurrentStatus.title.isNull() && !title.isNull() && 0 == QString::compare(mCurrentStatus.title, title)) ){ + mCurrentStatus.newtrack = false; + } + mCurrentStatus.volume = volume; + mCurrentStatus.length = length; + mCurrentStatus.time = time; + mCurrentStatus.position = position; + mCurrentStatus.random = (1 == random); + mCurrentStatus.loop = (1 == loop); + mCurrentStatus.repeat = (1 == repeat); + mCurrentStatus.title = title; + mCurrentStatus.artist = artist; + mCurrentStatus.album = album; + mCurrentStatus.nowplaying = now_playing; + mCurrentStatus.hasart = (!art_url.isNull() && !art_url.isEmpty()); // What's our mute status? if (0 < mCurrentStatus.volume) { this->mVolume = mCurrentStatus.volume; @@ -466,7 +466,7 @@ // rebuild display layout // retrieve album art mHasImage = false; - QTimer::singleShot(500, mPlayListMainWindow, SLOT(requestPlayList())); + QTimer::singleShot(AppSettings::getRetrieveArtTimeout(), mPlayListMainWindow, SLOT(requestPlayList())); } // Update the buttons on the playlist window if (NULL != this->mPlayListMainWindow) {