From 794552bdea0580d631f3b587c46c309f6dfc47b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Santi=20Nore=C3=B1a?= Date: Sat, 2 Mar 2013 14:26:06 +0100 Subject: [PATCH] - Added -log option to command line - Added COPYRIGHT VERSION LICENSE marocs in libremediaserver.h --- src/libremediaserver.cpp | 30 ++++++++++++++++++++--------- src/libremediaserver.h | 4 ++++ src/libremediaserver.pro.user | 2 +- src/libremediaserver.ui | 5 +---- src/main.cpp | 36 +++++++++++++++++++++++++---------- todo.txt | 2 +- 6 files changed, 54 insertions(+), 25 deletions(-) diff --git a/src/libremediaserver.cpp b/src/libremediaserver.cpp index 19b8f3a..4e4ffd9 100644 --- a/src/libremediaserver.cpp +++ b/src/libremediaserver.cpp @@ -105,17 +105,29 @@ libreMediaServer::libreMediaServer(QStringList args, QWidget *parent) m_tcpsocket_audio(NULL), m_gui(FALSE) { - qDebug() << "******************************************************************************************************"; + qDebug() << "********************************************************************************"; qDebug() << QDate::currentDate() << QTime::currentTime(); - qDebug() << "Parsing the command line"; + // Iniciamos el User Interface + ui.setupUi(this); + // Parse the command line options if (args.contains("-gui")) { qDebug()<< "libremediaserver Constructor option GUI detected"; m_gui = true; + ui.textEdit->appendPlainText("Pure Data GUI's will be shown"); } - // Iniciamos el User Interface - ui.setupUi(this); - // Unix Local Sockets + //Print the version + QString ver; + ver = VERSION; + ui.textEdit->appendPlainText(ver); + ver = COPYRIGHT; + ui.textEdit->appendPlainText(ver); + ver = LICENSE; + ui.textEdit->appendPlainText(ver); + qDebug() << VERSION; + qDebug() << COPYRIGHT; + qDebug() << LICENSE; + // Init Unix Local Sockets QFile socket(SOCKET); if (socket.exists()) { @@ -125,7 +137,7 @@ libreMediaServer::libreMediaServer(QStringList args, QWidget *parent) Q_CHECK_PTR(m_server_vid); if (!m_server_vid->listen(SOCKET)) { - qErrnoWarning("Init: Can not listen on unix local server"); + qErrnoWarning("libremediaserver::constructor L132: Can not listen on unix local server"); } connect(m_server_vid, SIGNAL(newConnection()),this, SLOT(newPeer())); // Start preview Timer @@ -199,9 +211,9 @@ libreMediaServer::~libreMediaServer() delete m_pd_read_audio; } socket.remove(); - qDebug() << "PD Video starts: " << m_startvideo << " PD Audio starts: " << m_startaudio; + qDebug() << "PD Video restarts: " << m_startvideo << " PD Audio restarts: " << m_startaudio; qDebug() << QDate::currentDate() << QTime::currentTime(); - qDebug() << "******************************************************************************************************"; + qDebug() << "********************************************************************************"; return; } @@ -879,7 +891,7 @@ void libreMediaServer::pdrestart() return; } save_finish(); - qDebug()<<"**************************************************************************"; + qDebug()<<"********************************************************************************"; qDebug()<<"PD Video Restarts:" << ++m_startvideo; ui.textEdit->appendPlainText("PD Video Restarting."); disconnect(m_pd_video, SIGNAL(finished(int)), this, SLOT(pdrestart())); diff --git a/src/libremediaserver.h b/src/libremediaserver.h index b93125f..0558d3b 100644 --- a/src/libremediaserver.h +++ b/src/libremediaserver.h @@ -37,6 +37,10 @@ #include #include +#define VERSION "LibreMediaServer Version 0.03-1" +#define COPYRIGHT "(C) 2012-2013 Santi Norena libremediaserver@gmail.com" +#define LICENSE "GPL 3 License. See LICENSE.txt and credits.txt for details" + class msex; class QMenu; class QProcess; diff --git a/src/libremediaserver.pro.user b/src/libremediaserver.pro.user index b5d6857..28a763d 100644 --- a/src/libremediaserver.pro.user +++ b/src/libremediaserver.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/src/libremediaserver.ui b/src/libremediaserver.ui index 294bf81..8bbee37 100644 --- a/src/libremediaserver.ui +++ b/src/libremediaserver.ui @@ -1135,10 +1135,7 @@ - LibreMediaServer 0.03-1 -(C) 2012-2013 Santiago Noreña libremediaserver@gmail.com -GPL 3 license. See LICENSE.txt and credits.txt for details -This program comes with ABSOLUTELY NO WARRANTY + This program comes with ABSOLUTELY NO WARRANTY diff --git a/src/main.cpp b/src/main.cpp index 1e95a92..ff657b1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,8 +19,6 @@ #include #include "libremediaserver.h" -#define VERSION "0.03-1"; - // Handler for pipe the stderr to a log file bool initMessageHandler = 0; @@ -43,6 +41,7 @@ void MessageHandler(QtMsgType type, const char *msg) txt = QString("Fatal: %1").arg(msg); abort(); } + // Create the log dir and log file if (!initMessageHandler) { QDir dir; @@ -76,25 +75,42 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); QStringList args = app.arguments(); + // parse the command line if (args.size() > 1) { if (args.contains("-v") > 0) { - qDebug() << "LibreMediaServer Version" << VERSION; - app.exit(); + qDebug() << VERSION; + qDebug() << COPYRIGHT; + qDebug() << LICENSE; return 0; } if (args.contains("-h") > 0) { - qDebug() << "LibreMediaServer Version" << VERSION; - qDebug() << "Help"; - qDebug() << "-v Show the version and exits"; - qDebug() << "-gui show the Pure Data GUI's."; - app.exit(); + qDebug() << VERSION; + qDebug() << COPYRIGHT; + qDebug() << LICENSE; + qDebug() << "Help for command line options:"; + qDebug() << "-v show the version and exits"; + qDebug() << "-gui show the Pure Data GUI's"; + qDebug() << "-log write the debug information to a log file instead stderr"; + qDebug() << "-h this help"; return 0; } + if (args.contains("-log")) + { + qInstallMsgHandler(MessageHandler); + } + if (!args.contains("-gui")) + { + for (int i=1; i Optimización de patches y resolver errores Próximas versiones: @@ -49,7 +50,6 @@ Próximas versiones: - Audio: Tarjetas con varias salidas y varias mezclas - Video: Live input - Empaquetar en .deb -- Opción en el arranque para mostrar las guis de Pure Data --> Optimización de patches y resolver errores - Scripts: nuevo script para numerar los media - Text: Alphas high y low. Mirar si se puede - Video: Generación de fractales visuales