splayer.cpp \
streamio.cpp \
playlist.cpp \
- downloadmanager.cpp
+ downloadmanager.cpp \
+ grooveprogressbar.cpp
HEADERS += \
groove.h \
splayer.h \
streamio.h \
playlist.h \
- downloadmanager.h
+ downloadmanager.h \
+ grooveprogressbar.h
</valuemap>
<value key="Qt4ProjectManager.MaemoRunConfiguration.DeviceId" type="qulonglong">1</value>
<valuemap key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployed" type="QVariantMap">
- <value key="192.168.1.3" type="QDateTime">2010-06-18T23:28:49</value>
+ <value key="192.168.1.3" type="QDateTime">2010-06-19T01:08:31</value>
</valuemap>
<value key="Qt4ProjectManager.MaemoRunConfiguration.Simulator" type="QString"></value>
</valuemap>
#############################################################################
# Makefile for building: groove
-# Generated by qmake (2.01a) (Qt 4.6.2) on: Fri Jun 18 23:18:05 2010
+# Generated by qmake (2.01a) (Qt 4.6.2) on: Sat Jun 19 00:00:46 2010
# Project: Groove.pro
# Template: app
# Command: /usr/bin/qmake -unix -o Makefile Groove.pro
--- /dev/null
+#include "grooveprogressbar.h"
+
+grooveProgressBar::grooveProgressBar(QDialog *parent) :
+ QDialog(parent)
+{
+ bar = new QProgressBar();
+ bar->setMaximum(100);
+ bar->setValue(0);
+ lay = new QHBoxLayout();
+ lay->addWidget(bar);
+ this->setLayout(lay);
+ this->setWindowTitle("Downloading / Buffering");
+}
+void grooveProgressBar::setMaximum(int maximum)
+{
+ bar->setMaximum(maximum);
+}
+int grooveProgressBar::maximum()
+{
+ return bar->maximum();
+}
+
+void grooveProgressBar::setValue(int position)
+{
+ bar->setValue(position);
+}
--- /dev/null
+#ifndef GROOVEPROGRESSBAR_H
+#define GROOVEPROGRESSBAR_H
+
+#include <QDialog>
+#include <QtGui>
+
+class grooveProgressBar : public QDialog
+{
+ Q_OBJECT
+public:
+ explicit grooveProgressBar(QDialog *parent = 0);
+ void setMaximum(int maximum);
+ void setValue(int position);
+ int maximum();
+
+signals:
+
+public slots:
+
+private:
+ QProgressBar *bar;
+ QHBoxLayout *lay;
+};
+
+#endif // GROOVEPROGRESSBAR_H
}
void sPlayer::abortDownload()
{
- reply->abort();
+ //pd->hide();
+ //reply->abort();
}
void sPlayer::play(QString StreamKey,QUrl server)
{
//reply->abort();
}
- pd = new QProgressDialog("Downloading / Buffering.", "Cancel", 0, 100);
- pd->setValue(0);
+ pd = new grooveProgressBar();
+ //pd->setAttribute();
+
#ifdef Q_WS_MAEMO_5
pd->setAttribute(Qt::WA_Maemo5AutoOrientation,true);
+ //pd->setModal(false);
#endif
+ pd->show();
+ pd->setValue(0);
QNetworkRequest req;
req.setUrl(server);
qDebug() << server;
buffer->open(buffer->ReadWrite | buffer->Truncate);
connect(reply,SIGNAL(finished()),this,SLOT(start()));
connect(reply,SIGNAL(downloadProgress(qint64,qint64)),this,SLOT(putb(qint64,qint64)));
- connect(pd,SIGNAL(canceled()),this,SLOT(abortDownload()));
+ //connect(pd,SIGNAL(canceled()),this,SLOT(abortDownload()));
media->stop();
playing = false;
startStreamT = QTime::currentTime();
#include <phonon>
#include "streamio.h"
#include <QProgressDialog>
+#include "grooveprogressbar.h"
class sPlayer : public QObject
{
bool playing;
QObject *internal;
QTime startStreamT;
- QProgressDialog *pd;
+ grooveProgressBar *pd;
};
#endif // SPLAYER_H
{
internal->stream()->setStreamSize(s);
}
-/*qint64 StreamIO::size()
+qint64 StreamIO::size()
{
return sized;
}
bool StreamIO::isSequential()
{
return true;
-}/*
+}
qint64 StreamIO::readData(char* data, qint64 maxsize)
{
internal->data().at(rpos);