projects
/
tomamp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e9a0dd3
)
fixed next behavior in regards to unplayable files (hopefully fine)
author
Tamas
<tamas@u200.(none)>
Wed, 21 Jul 2010 17:10:56 +0000
(19:10 +0200)
committer
Tamas
<tamas@u200.(none)>
Wed, 21 Jul 2010 17:10:56 +0000
(19:10 +0200)
mainwindow.cpp
patch
|
blob
|
history
diff --git
a/mainwindow.cpp
b/mainwindow.cpp
index
d680bb1
..
7cc9f68
100644
(file)
--- a/
mainwindow.cpp
+++ b/
mainwindow.cpp
@@
-126,7
+126,7
@@
void MainWindow::stateChanged(Phonon::State newState, Phonon::State /* oldState
// QMessageBox::warning(this, tr("Error"),
// mediaObject->errorString());
}
// QMessageBox::warning(this, tr("Error"),
// mediaObject->errorString());
}
- next ();
+// next ();
break;
case Phonon::PlayingState:
setWindowTitle(mediaObject->metaData().value("TITLE") + " - TomAmp");
break;
case Phonon::PlayingState:
setWindowTitle(mediaObject->metaData().value("TITLE") + " - TomAmp");
@@
-172,15
+172,20
@@
void MainWindow::next()
bool wasPlaying = (mediaObject->state () == Phonon::PlayingState);
if (mediaObject->state () == Phonon::ErrorState)
wasPlaying = true;
bool wasPlaying = (mediaObject->state () == Phonon::PlayingState);
if (mediaObject->state () == Phonon::ErrorState)
wasPlaying = true;
- int index = plman.indexOf(mediaObject->currentSource()) + 1;
+ qDebug () << "Getting index of current playing";
+ int index = plman.indexOf(mediaObject->currentSource());
+ qDebug () << "Next index is " << index;
if (shuffle)
{
if (shuffle)
{
+ qDebug () << "Shuffle next";
index = shuffleList.indexOf(plman.indexOf(mediaObject->currentSource()));
do
{
index += 1;
index = shuffleList.indexOf(plman.indexOf(mediaObject->currentSource()));
do
{
index += 1;
+ qDebug () << "Index increase a " << index;
}
while (index < shuffleList.size () && !plman.getItem(index).playable);
}
while (index < shuffleList.size () && !plman.getItem(index).playable);
+ qDebug () << "Shuffle next 2 " << index;
if (index < shuffleList.size ())
{
mediaObject->setCurrentSource(plman.at (shuffleList[index]));
if (index < shuffleList.size ())
{
mediaObject->setCurrentSource(plman.at (shuffleList[index]));
@@
-190,6
+195,7
@@
void MainWindow::next()
index = 0;
do
{
index = 0;
do
{
+ qDebug () << "Index increase 2a " << index;
index += 1;
}
while (index < shuffleList.size () && !plman.getItem(index).playable);
index += 1;
}
while (index < shuffleList.size () && !plman.getItem(index).playable);
@@
-200,10
+206,15
@@
void MainWindow::next()
}
else
{
}
else
{
- while (index < plman.size () && !plman.getItem(index).playable);
+ qDebug () << "Normal next";
+ while ((index + 1) < plman.size ())
{
index += 1;
{
index += 1;
+ qDebug () << "Index increase " << index;
+ if (plman.getItem(index).playable)
+ break;
}
}
+ qDebug () << "Normal next 2 " << index;
if (plman.size() > index)
{
mediaObject->setCurrentSource(plman.at(index));
if (plman.size() > index)
{
mediaObject->setCurrentSource(plman.at(index));
@@
-213,12
+224,16
@@
void MainWindow::next()
index = 0;
do
{
index = 0;
do
{
+ qDebug () << "Index increase 2 " << index;
index += 1;
index += 1;
+ if (plman.getItem(index).playable)
+ break;
}
}
- while (index < shuffleList.size () && !plman.getItem(index).playable);
+ while ((index + 1) < shuffleList.size ());
mediaObject->setCurrentSource(plman.at(index));
}
}
mediaObject->setCurrentSource(plman.at(index));
}
}
+ musicTable->selectRow (plman.indexOf(mediaObject->currentSource()));
if (wasPlaying)
mediaObject->play();
}
if (wasPlaying)
mediaObject->play();
}
@@
-274,7
+289,7
@@
void MainWindow::tableClicked(int row, int /* column */)
return;
int index = row;
return;
int index = row;
- while (index < plman.size () && !plman.getItem(index).playable);
+ while (index < plman.size () && !plman.getItem(index).playable)
{
index += 1;
}
{
index += 1;
}
@@
-526,9
+541,9
@@
void MainWindow::setupUi()
qDebug () << "cucc: " << musicTable->columnWidth(1);
}
qDebug () << "cucc: " << musicTable->columnWidth(1);
}
-void MainWindow::cellClicked(int row, int)
+void MainWindow::cellClicked(int /*row*/, int)
{
{
- if (mediaObject->state() == Phonon::PlayingState)
+ /*if (mediaObject->state() == Phonon::PlayingState)
{
int index = plman.indexOf(mediaObject->currentSource());
if (index >= 0)
{
int index = plman.indexOf(mediaObject->currentSource());
if (index >= 0)
@@
-542,7
+557,7
@@
void MainWindow::cellClicked(int row, int)
shuffleList.removeAll(row);
shuffleList.insert(0, row);
qDebug () << shuffleList;
shuffleList.removeAll(row);
shuffleList.insert(0, row);
qDebug () << shuffleList;
- }
+ }*/
}
void MainWindow::setupShuffleList()
}
void MainWindow::setupShuffleList()
@@
-553,7
+568,7
@@
void MainWindow::setupShuffleList()
index = 0;
for (int i = 0; i < plman.size(); ++i)
{
index = 0;
for (int i = 0; i < plman.size(); ++i)
{
- if (i != index)
+ if ((i != index))
tmp.append(i);
}
shuffleList.clear();
tmp.append(i);
}
shuffleList.clear();