- Added option -gui in comamd line to show the Pure Data GUI's

- Bugfix in initiatializinng the text subpatch
This commit is contained in:
Santi Noreña 2013-03-01 21:06:35 +01:00
parent d1c4295692
commit b877185c0d
8 changed files with 97 additions and 50 deletions

View file

@ -93,7 +93,7 @@ bool audioCheck;
libreMediaServer::libreMediaServer(QWidget *parent)
libreMediaServer::libreMediaServer(QStringList args, QWidget *parent)
: QMainWindow(parent),
m_startvideo(0),
m_startaudio(0),
@ -102,10 +102,17 @@ libreMediaServer::libreMediaServer(QWidget *parent)
m_pd_write_video(NULL),
m_pd_write_audio(NULL),
m_pd_read_audio(NULL),
m_tcpsocket_audio(NULL)
m_tcpsocket_audio(NULL),
m_gui(FALSE)
{
qDebug() << "******************************************************************************************************";
qDebug() << QDate::currentDate() << QTime::currentTime();
qDebug() << "Parsing the command line";
if (args.contains("-gui"))
{
qDebug()<< "libremediaserver Constructor option GUI detected";
m_gui = true;
}
// Iniciamos el User Interface
ui.setupUi(this);
// Unix Local Sockets
@ -844,7 +851,11 @@ void libreMediaServer::pdstart()
Q_CHECK_PTR(m_pd_write_video);
connect(m_pd_write_video, SIGNAL(connected()),this, SLOT(newconexion()));
// Arrancamos el proceso Pure Data
m_pd_video->start("./pd -noaudio -lib Gem -stderr -nostdpath -path ./externals/ ./patches/lms-video.pd");
QString arguments;
arguments.append("./pd -noaudio -lib Gem -stderr -nostdpath -path ./externals/ -open ./patches/lms-video.pd ");
if (!m_gui)
arguments.append("-nogui");
m_pd_video->start(arguments);
if (m_pd_video->waitForStarted(3000)){
ui.textEdit->appendPlainText("Video Engine started.");
}
@ -869,7 +880,7 @@ void libreMediaServer::pdrestart()
}
save_finish();
qDebug()<<"**************************************************************************";
qDebug()<<"Starting PD Video:" << ++m_startvideo;
qDebug()<<"PD Video Restarts:" << ++m_startvideo;
ui.textEdit->appendPlainText("PD Video Restarting.");
disconnect(m_pd_video, SIGNAL(finished(int)), this, SLOT(pdrestart()));
pdstart();
@ -1363,7 +1374,11 @@ void libreMediaServer::pdstart_audio()
qDebug()<<"error listening tcpServer";
}
// Arrancamos el proceso Pure Data
m_pd_audio->start("./pd -alsa -channels 2 -audiodev 1 -stderr -nostdpath -path ./externals/ ./patches/lms-audio.pd");
QString arguments;
arguments.append("./pd -alsa -channels 2 -audiodev 1 -stderr -nostdpath -path ./externals/ ./patches/lms-audio.pd ");
if (!m_gui)
arguments.append("-nogui");
m_pd_audio->start(arguments);
if (m_pd_audio->waitForStarted(3000)){
ui.textEdit->appendPlainText("PD Audio started.");
}