+void playlist::markPlayed(int position)
+{
+ pList->at(position)->played = true;
+ this->freeMemory(position);
+}
+void playlist::freeMemory(int position)
+{
+ pList->at(position)->downloaded = false;
+ delete pList->at(position)->buffer;
+ pList->at(position)->buffer = new QBuffer();
+}
+bool playlist::existAt(int position)
+{
+ return (pList->size() > position);
+}
+
+int playlist::currentplaying()
+{
+ return this->currentplayingitem;
+}
+bool playlist::bReady(int b)
+{
+ if(pList->size() > b)
+ return pList->at(b)->bufferready;
+ else
+ return false;
+}
+void playlist::setBufferRdy(int b)
+{
+ pList->at(b)->bufferready = true;
+}
+bool playlist::setCurrentPlaying(int position)
+{
+ if(pList->size() > position)
+ {
+ this->currentplayingitem = position;
+ if(!pList->at(position)->downloaded && this->currentdownloaditem != this->currentplayingitem)
+ this->beginDownload(position);
+ /*if(pList->at(position)->bufferready == false &&)
+ {
+ if(!pList->at(position)->downloaded)
+ this->beginDownload(position);
+ }
+ else
+ emit this->bufferReady(position);
+ */
+ return true;
+ }
+ else
+ return false;
+}
+QIODevice * playlist::getBuffer(int position)
+{
+ return pList->at(position)->buffer;
+}
+