- Added -log option to command line

- Added COPYRIGHT VERSION LICENSE marocs in libremediaserver.h
This commit is contained in:
Santi Noreña 2013-03-02 14:26:06 +01:00
parent b877185c0d
commit 794552bdea
6 changed files with 54 additions and 25 deletions

View file

@ -105,17 +105,29 @@ libreMediaServer::libreMediaServer(QStringList args, QWidget *parent)
m_tcpsocket_audio(NULL), m_tcpsocket_audio(NULL),
m_gui(FALSE) m_gui(FALSE)
{ {
qDebug() << "******************************************************************************************************"; qDebug() << "********************************************************************************";
qDebug() << QDate::currentDate() << QTime::currentTime(); 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")) if (args.contains("-gui"))
{ {
qDebug()<< "libremediaserver Constructor option GUI detected"; qDebug()<< "libremediaserver Constructor option GUI detected";
m_gui = true; m_gui = true;
ui.textEdit->appendPlainText("Pure Data GUI's will be shown");
} }
// Iniciamos el User Interface //Print the version
ui.setupUi(this); QString ver;
// Unix Local Sockets 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); QFile socket(SOCKET);
if (socket.exists()) if (socket.exists())
{ {
@ -125,7 +137,7 @@ libreMediaServer::libreMediaServer(QStringList args, QWidget *parent)
Q_CHECK_PTR(m_server_vid); Q_CHECK_PTR(m_server_vid);
if (!m_server_vid->listen(SOCKET)) 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())); connect(m_server_vid, SIGNAL(newConnection()),this, SLOT(newPeer()));
// Start preview Timer // Start preview Timer
@ -199,9 +211,9 @@ libreMediaServer::~libreMediaServer()
delete m_pd_read_audio; delete m_pd_read_audio;
} }
socket.remove(); 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() << QDate::currentDate() << QTime::currentTime();
qDebug() << "******************************************************************************************************"; qDebug() << "********************************************************************************";
return; return;
} }
@ -879,7 +891,7 @@ void libreMediaServer::pdrestart()
return; return;
} }
save_finish(); save_finish();
qDebug()<<"**************************************************************************"; qDebug()<<"********************************************************************************";
qDebug()<<"PD Video Restarts:" << ++m_startvideo; qDebug()<<"PD Video Restarts:" << ++m_startvideo;
ui.textEdit->appendPlainText("PD Video Restarting."); ui.textEdit->appendPlainText("PD Video Restarting.");
disconnect(m_pd_video, SIGNAL(finished(int)), this, SLOT(pdrestart())); disconnect(m_pd_video, SIGNAL(finished(int)), this, SLOT(pdrestart()));

View file

@ -37,6 +37,10 @@
#include <QFile> #include <QFile>
#include <QTextStream> #include <QTextStream>
#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 msex;
class QMenu; class QMenu;
class QProcess; class QProcess;

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by Qt Creator 2.5.0, 2013-03-01T20:59:13. --> <!-- Written by Qt Creator 2.5.0, 2013-03-02T13:18:40. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>ProjectExplorer.Project.ActiveTarget</variable> <variable>ProjectExplorer.Project.ActiveTarget</variable>

View file

@ -1135,10 +1135,7 @@
</rect> </rect>
</property> </property>
<property name="plainText"> <property name="plainText">
<string>LibreMediaServer 0.03-1 <string>This program comes with ABSOLUTELY NO WARRANTY</string>
(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</string>
</property> </property>
</widget> </widget>
</widget> </widget>

View file

@ -19,8 +19,6 @@
#include <QApplication> #include <QApplication>
#include "libremediaserver.h" #include "libremediaserver.h"
#define VERSION "0.03-1";
// Handler for pipe the stderr to a log file // Handler for pipe the stderr to a log file
bool initMessageHandler = 0; bool initMessageHandler = 0;
@ -43,6 +41,7 @@ void MessageHandler(QtMsgType type, const char *msg)
txt = QString("Fatal: %1").arg(msg); txt = QString("Fatal: %1").arg(msg);
abort(); abort();
} }
// Create the log dir and log file
if (!initMessageHandler) if (!initMessageHandler)
{ {
QDir dir; QDir dir;
@ -76,25 +75,42 @@ int main(int argc, char *argv[])
{ {
QApplication app(argc, argv); QApplication app(argc, argv);
QStringList args = app.arguments(); QStringList args = app.arguments();
// parse the command line
if (args.size() > 1) if (args.size() > 1)
{ {
if (args.contains("-v") > 0) if (args.contains("-v") > 0)
{ {
qDebug() << "LibreMediaServer Version" << VERSION; qDebug() << VERSION;
app.exit(); qDebug() << COPYRIGHT;
qDebug() << LICENSE;
return 0; return 0;
} }
if (args.contains("-h") > 0) if (args.contains("-h") > 0)
{ {
qDebug() << "LibreMediaServer Version" << VERSION; qDebug() << VERSION;
qDebug() << "Help"; qDebug() << COPYRIGHT;
qDebug() << "-v Show the version and exits"; qDebug() << LICENSE;
qDebug() << "-gui show the Pure Data GUI's."; qDebug() << "Help for command line options:";
app.exit(); 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; return 0;
} }
if (args.contains("-log"))
{
qInstallMsgHandler(MessageHandler);
}
if (!args.contains("-gui"))
{
for (int i=1; i<args.size();i++)
{
qDebug() << "Option not known: " << args.at(i);
}
qDebug() <<"Write ./libremediaserver -h for help in command line arguments";
return 0;
}
} }
qInstallMsgHandler(MessageHandler);
libreMediaServer libreMediaServer(args); libreMediaServer libreMediaServer(args);
libreMediaServer.show(); libreMediaServer.show();
return app.exec(); return app.exec();

View file

@ -22,6 +22,7 @@ v 0.03:
+ Pure Data: Carpetas para imágenes + Pure Data: Carpetas para imágenes
+ Text: Diferentes ficheros de texto + Text: Diferentes ficheros de texto
+ GUI: Configuración para anular los previews y salvar tiempo de proceso + GUI: Configuración para anular los previews y salvar tiempo de proceso
+ Opción en la línea de comandos para mostrar las guis de Pure Data --> Optimización de patches y resolver errores
Próximas versiones: Próximas versiones:
@ -49,7 +50,6 @@ Próximas versiones:
- Audio: Tarjetas con varias salidas y varias mezclas - Audio: Tarjetas con varias salidas y varias mezclas
- Video: Live input - Video: Live input
- Empaquetar en .deb - 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 - Scripts: nuevo script para numerar los media
- Text: Alphas high y low. Mirar si se puede - Text: Alphas high y low. Mirar si se puede
- Video: Generación de fractales visuales - Video: Generación de fractales visuales