Permalink
Browse files

Remove unused files from mythmusic

  • Loading branch information...
stuartm committed Jul 21, 2012
1 parent e29f47d commit 4c15a87fde495c02aa5a4e5bab4d979ac819f214
@@ -20,7 +20,6 @@
#include "decoderhandler.h"
#include "decoder.h"
#include "metadata.h"
#include "streaminput.h"
#include "shoutcast.h"
/**********************************************************************/
@@ -27,7 +27,6 @@ using namespace std;
// MythMusic includes
#include "metadata.h"
#include "constants.h"
#include "streaminput.h"
#include "decoder.h"
#include "mainvisual.h"
#include "smartplaylist.h"
@@ -24,7 +24,7 @@ LIBS += -ltag -logg -lvorbisfile -lvorbis -lvorbisenc -lFLAC -lmp3lame
HEADERS += constants.h
HEADERS += decoder.h flacencoder.h mainvisual.h
HEADERS += metadata.h playlist.h polygon.h
HEADERS += streaminput.h synaesthesia.h encoder.h visualize.h avfdecoder.h
HEADERS += synaesthesia.h encoder.h visualize.h avfdecoder.h
HEADERS += vorbisencoder.h polygon.h
HEADERS += bumpscope.h lameencoder.h dbcheck.h
HEADERS += importmusic.h
@@ -46,7 +46,7 @@ HEADERS += importsettings.h playersettings.h ratingsettings.h
SOURCES += decoder.cpp
SOURCES += flacencoder.cpp main.cpp
SOURCES += mainvisual.cpp metadata.cpp playlist.cpp
SOURCES += streaminput.cpp encoder.cpp dbcheck.cpp
SOURCES += encoder.cpp dbcheck.cpp
SOURCES += synaesthesia.cpp lameencoder.cpp
SOURCES += vorbisencoder.cpp visualize.cpp bumpscope.cpp
SOURCES += genres.cpp importmusic.cpp
@@ -1,142 +0,0 @@
// Copyright (c) 2000-2001 Brad Hughes <bhughes@trolltech.com>
//
// Use, modification and distribution is allowed without limitation,
// warranty, or liability of any kind.
//
#include "streaminput.h"
#include "mythlogging.h"
#include <QApplication>
#define LOC QString("StreamInput: ")
#define LOC_WARN QString("StreamInput, Warning: ")
#define LOC_ERR QString("StreamInput, Error: ")
StreamInput::StreamInput(const QUrl &source) :
request(QString::null), url(source), sock(NULL), stage(0)
{
}
void StreamInput::Setup(void)
{
if (!url.isValid())
return;
QString protocol = url.scheme();
QString host = url.host();
QString path = url.path();
int port = url.port();
if (protocol != "mqp" || host.isEmpty())
return;
port = (port < 0) ? 42666 : port;
request = path;
request.detach();
sock = new QTcpSocket();
connect(sock, SIGNAL(Error(QAbstractSocket::SocketError)),
this, SLOT( Error(QAbstractSocket::SocketError)));
connect(sock, SIGNAL(hostFound()), this, SLOT(HostFound()));
connect(sock, SIGNAL(connected()), this, SLOT(Connected()));
connect(sock, SIGNAL(readyRead()), this, SLOT(Readyread()));
sock->connectToHost(host, port, QIODevice::ReadWrite);
while (stage != -1 && stage < 4)
{
LOG(VB_GENERAL, LOG_INFO, LOC +
QString("Processing one event: stage %1 %2 %3")
.arg(stage).arg(sock->canReadLine())
.arg(sock->bytesAvailable()));
qApp->processEvents();
}
LOG(VB_GENERAL, LOG_INFO, LOC + "Disconnecting from socket");
disconnect(sock, SIGNAL(Error(QAbstractSocket::SocketError)),
this, SLOT( Error(QAbstractSocket::SocketError)));
disconnect(sock, SIGNAL(hostFound()), this, SLOT(HostFound()));
disconnect(sock, SIGNAL(connected()), this, SLOT(Connected()));
disconnect(sock, SIGNAL(readyRead()), this, SLOT(ReadyRead()));
if (stage == -1)
{
// some sort of error
delete sock;
sock = NULL;
}
}
void StreamInput::HostFound(void)
{
LOG(VB_GENERAL, LOG_INFO, LOC + "Host found");
stage = 1;
}
void StreamInput::Connected(void)
{
QString tmp = QString(".song %1\r\n").arg(QString(request.toUtf8()));
QByteArray ba = tmp.toAscii();
LOG(VB_GENERAL, LOG_INFO, LOC +
QString("Connected... sending request '%1' %2")
.arg(ba.constData()).arg(ba.length()));
sock->write(ba.constData(), ba.length());
sock->flush();
stage = 2;
}
void StreamInput::ReadyRead(void)
{
if (stage == 2)
{
LOG(VB_GENERAL, LOG_INFO, LOC + "ReadyRead... checking response");
if (! sock->canReadLine())
{
stage = -1;
LOG(VB_GENERAL, LOG_ERR, LOC + "ReadyRead... can't read line");
return;
}
QString line = sock->readLine();
if (line.isEmpty())
{
stage = -1;
LOG(VB_GENERAL, LOG_ERR, LOC + "ReadyRead... line is empty");
return;
}
if (line.left(5) != "*GOOD")
{
LOG(VB_GENERAL, LOG_ERR, LOC +
QString("Server error response: %1").arg(line));
stage = -1;
return;
}
stage = 3;
}
else if (sock->bytesAvailable() > 65536 || sock->atEnd())
{
stage = 4;
}
}
void StreamInput::Error(QAbstractSocket::SocketError)
{
LOG(VB_GENERAL, LOG_ERR, LOC +
QString("Socket error: %1").arg(sock->errorString()));
stage = -1;
}
@@ -1,40 +0,0 @@
// Copyright (c) 2000-2001 Brad Hughes <bhughes@trolltech.com>
//
// Use, modification and distribution is allowed without limitation,
// warranty, or liability of any kind.
//
#ifndef INPUT_H
#define INPUT_H
class StreamInput;
#include <QUrl>
#include <QTcpSocket>
class StreamInput : public QObject
{
Q_OBJECT
public:
StreamInput(const QUrl&);
QIODevice *GetSocket(void) { return sock; }
void Setup(void);
private slots:
void HostFound(void);
void Connected(void);
void ReadyRead(void);
void Error(QAbstractSocket::SocketError);
private:
QString request;
QUrl url;
QTcpSocket *sock;
int stage;
};
#endif // INPUT_H
@@ -279,7 +279,7 @@ void StreamView::customEvent(QEvent *event)
else if (event->type() == DecoderHandlerEvent::OperationStop)
{
if (m_bufferStatus)
m_bufferStatus->SetText("");
m_bufferStatus->Reset();
}
else if (event->type() == DialogCompletionEvent::kEventType)
{

0 comments on commit 4c15a87

Please sign in to comment.