Merge branch 'devel' into develPlots
This commit is contained in:
commit
4eee6204d2
12 files changed
+118
-67
No files matched your search
+1
-1
@@ -13,7 +13,7 @@ SET( PROJECT_NAME "playuver" )
|
||||
PROJECT( ${PROJECT_NAME} )
|
||||
SET( PLAYUVER_VERSION_MAJOR "0" )
|
||||
SET( PLAYUVER_VERSION_MINOR "6" )
|
||||
SET( PLAYUVER_VERSION_PATCH "0" )
|
||||
SET( PLAYUVER_VERSION_PATCH "1" )
|
||||
SET( PLAYUVER_VERSION "${PLAYUVER_VERSION_MAJOR}.${PLAYUVER_VERSION_MINOR}.${PLAYUVER_VERSION_PATCH}")
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ ENDIF()
|
||||
set(plaYUVer_App_SRCS
|
||||
# Main
|
||||
main.cpp
|
||||
plaYUVerApp.cpp
|
||||
PlaYUVerApp.cpp
|
||||
PlaYUVerSubWindowHandle.cpp
|
||||
PlaYUVerMdiSubWindow.cpp
|
||||
SubWindowHandle.cpp
|
||||
|
||||
@@ -18,20 +18,20 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file plaYUVerApp.cpp
|
||||
* \file PlaYUVerApp.cpp
|
||||
* \brief Main definition of the plaYUVerApp app
|
||||
*/
|
||||
|
||||
#include <QtDebug>
|
||||
#include "plaYUVerApp.h"
|
||||
#include "PlaYUVerApp.h"
|
||||
#ifdef USE_FERVOR
|
||||
#include "fvupdater.h"
|
||||
#endif
|
||||
#include "lib/PlaYUVerCmdParser.h"
|
||||
#include "PlaYUVerSubWindowHandle.h"
|
||||
#include "VideoHandle.h"
|
||||
#include "QualityHandle.h"
|
||||
#include "ModulesHandle.h"
|
||||
|
||||
#include "DialogSubWindowSelector.h"
|
||||
|
||||
#define SYNCHRONISED_ZOON 1
|
||||
@@ -83,17 +83,47 @@ plaYUVerApp::plaYUVerApp()
|
||||
m_pcCurrentVideoSubWindow = NULL;
|
||||
}
|
||||
|
||||
Void plaYUVerApp::parseArgs( Int argc, Char *argv[] )
|
||||
Bool plaYUVerApp::parseArgs( Int argc, Char *argv[] )
|
||||
{
|
||||
if( argc >= 2 )
|
||||
Bool bRet = false;
|
||||
m_pcCmdParser = new PlaYUVerCmdParser();
|
||||
m_pcCmdParser->config( argc, argv );
|
||||
|
||||
std::vector<std::string> m_apcInputs;
|
||||
std::string strResolution( "" );
|
||||
std::string strPelFmt( "" );
|
||||
|
||||
m_pcCmdParser->Opts().addOptions()/**/
|
||||
( "input,i", m_apcInputs, "input file" ) /**/
|
||||
( "size,s", strResolution, "size (WxH)" ) /**/
|
||||
( "pel_fmt", strPelFmt, "pixel format" );
|
||||
|
||||
if( !m_pcCmdParser->parse() )
|
||||
{
|
||||
for( Int i = 1; i < argc; i++ )
|
||||
{
|
||||
loadFile( argv[i] );
|
||||
}
|
||||
m_pcWindowHandle->tileSubWindows();
|
||||
zoomToFitAll();
|
||||
bRet |= true;
|
||||
}
|
||||
|
||||
if( m_pcCmdParser->Opts()["help"]->count() )
|
||||
{
|
||||
printf( "Usage: %s [options] input_file[s]\n", argv[0] );
|
||||
doHelp( std::cout, m_pcCmdParser->Opts() );
|
||||
bRet |= true;
|
||||
}
|
||||
if( m_pcCmdParser->Opts()["input"]->count() )
|
||||
{
|
||||
for( UInt i = 1; i < m_apcInputs.size(); i++ )
|
||||
{
|
||||
loadFile( QString::fromStdString( m_apcInputs[i] ) );
|
||||
}
|
||||
}
|
||||
std::list<const Char*>& argv_unhandled = m_pcCmdParser->getNoArgs();
|
||||
for( std::list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++ )
|
||||
{
|
||||
loadFile( QString::fromStdString( *it ) );
|
||||
}
|
||||
m_pcWindowHandle->tileSubWindows();
|
||||
zoomToFitAll();
|
||||
return bRet;
|
||||
}
|
||||
|
||||
Void plaYUVerApp::about()
|
||||
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file plaYUVerApp.h
|
||||
* \file PlaYUVerApp.h
|
||||
* \ingroup PlaYUVerApp
|
||||
* \brief Main definition of the plaYUVerApp app
|
||||
*
|
||||
@@ -55,6 +55,7 @@
|
||||
namespace plaYUVer
|
||||
{
|
||||
|
||||
class PlaYUVerCmdParser;
|
||||
class PlaYUVerStream;
|
||||
class PlaYUVerSubWindowHandle;
|
||||
class VideoHandle;
|
||||
@@ -68,7 +69,7 @@ Q_OBJECT
|
||||
|
||||
public:
|
||||
plaYUVerApp();
|
||||
Void parseArgs( Int argc, Char *argv[] );
|
||||
Bool parseArgs( Int argc, Char *argv[] );
|
||||
Void loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo = NULL );
|
||||
|
||||
protected:
|
||||
@@ -113,7 +114,7 @@ private Q_SLOTS:
|
||||
private:
|
||||
|
||||
PlaYUVerAppAdaptor* m_pDBusAdaptor;
|
||||
|
||||
PlaYUVerCmdParser* m_pcCmdParser;
|
||||
/**
|
||||
* Save the current subwindow for every category
|
||||
*/
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <QDBusAbstractAdaptor>
|
||||
#include "PlaYUVerAppAdaptor.h"
|
||||
#include "plaYUVerApp.h"
|
||||
#include "PlaYUVerApp.h"
|
||||
|
||||
namespace plaYUVer
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* \brief Handle multiple sub-windows
|
||||
*/
|
||||
|
||||
#include "plaYUVerApp.h"
|
||||
#include "PlaYUVerApp.h"
|
||||
#include "PlaYUVerSubWindowHandle.h"
|
||||
#include "PlaYUVerMdiSubWindow.h"
|
||||
#include "SubWindowHandle.h"
|
||||
|
||||
+24
-22
@@ -25,7 +25,7 @@
|
||||
#include "config.h"
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include <QApplication>
|
||||
#include "plaYUVerApp.h"
|
||||
#include "PlaYUVerApp.h"
|
||||
#include "SubWindowHandle.h"
|
||||
#ifdef USE_QTDBUS
|
||||
#include "PlaYUVerAppAdaptor.h"
|
||||
@@ -93,33 +93,32 @@ int main( int argc, char *argv[] )
|
||||
QStringList tokens;
|
||||
|
||||
// open given files...
|
||||
foreach(const QString & file, filenameList)
|
||||
foreach(const QString & file, filenameList){
|
||||
QDBusMessage m = QDBusMessage::createMethodCall(PLAYUVER_DBUS_SESSION_NAME,
|
||||
QStringLiteral(PLAYUVER_DBUS_PATH), QStringLiteral(PLAYUVER_DBUS_SESSION_NAME), QStringLiteral("loadFile"));
|
||||
|
||||
QList<QVariant> dbusargs;
|
||||
dbusargs.append( file );
|
||||
m.setArguments(dbusargs);
|
||||
|
||||
QDBusMessage res = QDBusConnection::sessionBus().call(m);
|
||||
if (res.type() == QDBusMessage::ReplyMessage)
|
||||
{
|
||||
QDBusMessage m = QDBusMessage::createMethodCall(PLAYUVER_DBUS_SESSION_NAME,
|
||||
QStringLiteral(PLAYUVER_DBUS_PATH), QStringLiteral(PLAYUVER_DBUS_SESSION_NAME), QStringLiteral("loadFile"));
|
||||
|
||||
QList<QVariant> dbusargs;
|
||||
dbusargs.append( file );
|
||||
m.setArguments(dbusargs);
|
||||
|
||||
QDBusMessage res = QDBusConnection::sessionBus().call(m);
|
||||
if (res.type() == QDBusMessage::ReplyMessage)
|
||||
if (res.arguments().count() == 1)
|
||||
{
|
||||
if (res.arguments().count() == 1)
|
||||
QVariant v = res.arguments()[0];
|
||||
if (v.isValid())
|
||||
{
|
||||
QVariant v = res.arguments()[0];
|
||||
if (v.isValid())
|
||||
QString s = v.toString();
|
||||
if ((!s.isEmpty()) && (s != QStringLiteral("ERROR")))
|
||||
{
|
||||
QString s = v.toString();
|
||||
if ((!s.isEmpty()) && (s != QStringLiteral("ERROR")))
|
||||
{
|
||||
tokens << s;
|
||||
}
|
||||
tokens << s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// this will wait until exiting is emitted by the used instance, if wanted...
|
||||
}
|
||||
// this will wait until exiting is emitted by the used instance, if wanted...
|
||||
return needToBlock ? application.exec() : 0;
|
||||
}
|
||||
}
|
||||
@@ -131,10 +130,13 @@ int main( int argc, char *argv[] )
|
||||
#endif
|
||||
plaYUVerApp mainwindow;
|
||||
mainwindow.show();
|
||||
mainwindow.parseArgs( argc, argv );
|
||||
if( mainwindow.parseArgs( argc, argv ) )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef USE_FERVOR
|
||||
FvUpdater::sharedUpdater()->SetFeedURL("http://192.168.96.201/share/PlaYUVerProject/PlaYUVerUpdate-" UPDATE_CHANNEL ".xml");
|
||||
FvUpdater::sharedUpdater()->SetFeedURL("http://192.168.96.201/share/PlaYUVerProject/PlaYUVerUpdate-" UPDATE_CHANNEL ".xml");
|
||||
FvUpdater::sharedUpdater()->SetDependencies("ALL");
|
||||
#endif
|
||||
|
||||
|
||||
+22
-12
@@ -55,17 +55,22 @@ Options& PlaYUVerCmdParser::Opts()
|
||||
return m_cParserOptions;
|
||||
}
|
||||
|
||||
Bool PlaYUVerCmdParser::parse( Int argc, Char *argv[] )
|
||||
std::list<const Char*>& PlaYUVerCmdParser::getNoArgs()
|
||||
{
|
||||
return m_aUnhandledArgs;
|
||||
}
|
||||
|
||||
Bool PlaYUVerCmdParser::parse()
|
||||
{
|
||||
try
|
||||
{
|
||||
// m_cParserOptions.setDefaults();
|
||||
const std::list<const Char*>& argv_unhandled = scanArgv( m_cParserOptions, argc, ( const Char** )argv );
|
||||
m_aUnhandledArgs = scanArgv( m_cParserOptions, m_iArgc, ( const Char** )m_ppArgv );
|
||||
|
||||
for( std::list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++ )
|
||||
{
|
||||
fprintf( stderr, "Unhandled argument ignored: `%s'\n", *it );
|
||||
}
|
||||
// for( std::list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++ )
|
||||
// {
|
||||
// fprintf( stderr, "Unhandled argument ignored: `%s'\n", *it );
|
||||
// }
|
||||
|
||||
if( checkListingOpts() )
|
||||
{
|
||||
@@ -90,12 +95,6 @@ Bool PlaYUVerCmdParser::checkListingOpts()
|
||||
{
|
||||
Bool bRet = false;
|
||||
|
||||
if( m_cParserOptions["help"]->count() )
|
||||
{
|
||||
doHelp( std::cout, m_cParserOptions );
|
||||
bRet |= true;
|
||||
}
|
||||
|
||||
if( m_cParserOptions["version"]->count() )
|
||||
{
|
||||
std::cout << "PlaYUVer version "
|
||||
@@ -112,6 +111,17 @@ Bool PlaYUVerCmdParser::checkListingOpts()
|
||||
}
|
||||
bRet |= true;
|
||||
}
|
||||
|
||||
if( Opts()["quality_metrics"]->count() )
|
||||
{
|
||||
printf( "PlaYUVer supported quality metrics: \n" );
|
||||
for( UInt i = 0; i < PlaYUVerFrame::supportedQualityMetricsList().size(); i++ )
|
||||
{
|
||||
printf( " %s\n", PlaYUVerFrame::supportedQualityMetricsList()[i].c_str() );
|
||||
}
|
||||
bRet |= true;
|
||||
}
|
||||
|
||||
return bRet;
|
||||
}
|
||||
|
||||
|
||||
+11
-2
@@ -25,7 +25,6 @@
|
||||
#include "PlaYUVerDefs.h"
|
||||
#include "ProgramOptions.h"
|
||||
|
||||
|
||||
namespace plaYUVer
|
||||
{
|
||||
|
||||
@@ -35,12 +34,22 @@ public:
|
||||
PlaYUVerCmdParser();
|
||||
~PlaYUVerCmdParser();
|
||||
|
||||
Bool parse( Int argc, Char *argv[] );
|
||||
Void config( Int argc, Char *argv[] )
|
||||
{
|
||||
m_iArgc = argc;
|
||||
m_ppArgv = argv;
|
||||
}
|
||||
Bool parse();
|
||||
std::list<const Char*>& getNoArgs();
|
||||
Options& Opts();
|
||||
private:
|
||||
Int m_iArgc;
|
||||
Char** m_ppArgv;
|
||||
Options m_cParserOptions;
|
||||
std::list<const Char*> m_aUnhandledArgs;
|
||||
|
||||
Bool checkListingOpts();
|
||||
Void listModules();
|
||||
};
|
||||
|
||||
} // NAMESPACE
|
||||
@@ -51,6 +51,11 @@ using namespace std;
|
||||
namespace plaYUVer
|
||||
{
|
||||
|
||||
Options::Options( const std::string& name )
|
||||
{
|
||||
opt_name = name;
|
||||
}
|
||||
|
||||
Options::~Options()
|
||||
{
|
||||
for( Options::NamesPtrList::iterator it = opt_list.begin(); it != opt_list.end(); it++ )
|
||||
|
||||
@@ -227,6 +227,7 @@ private:
|
||||
class OptionSpecific;
|
||||
struct Options
|
||||
{
|
||||
Options( const std::string& name = "" );
|
||||
~Options();
|
||||
|
||||
OptionSpecific addOptions();
|
||||
@@ -261,6 +262,7 @@ struct Options
|
||||
NamesMap opt_long_map;
|
||||
NamesMap opt_short_map;
|
||||
|
||||
std::string opt_name;
|
||||
};
|
||||
|
||||
/* Class with templated overloaded operator(), for use by Options::addOptions() */
|
||||
|
||||
@@ -76,7 +76,8 @@ Int CommandLineHandle::parseToolsArgs( Int argc, Char *argv[] )
|
||||
( "quality", m_strQualityMetric, "select a quality metric" ) /**/
|
||||
( "module", m_strModule, "select a module (use internal name)" );
|
||||
|
||||
if( !parse( argc, argv ) )
|
||||
config( argc, argv );
|
||||
if( !parse() )
|
||||
{
|
||||
iRet = 1;
|
||||
}
|
||||
@@ -86,19 +87,10 @@ Int CommandLineHandle::parseToolsArgs( Int argc, Char *argv[] )
|
||||
m_uiLogLevel = RESULT;
|
||||
}
|
||||
|
||||
if( Opts()["quality_metrics"]->count() )
|
||||
if( Opts()["help"]->count() )
|
||||
{
|
||||
printf( "PlaYUVer supported quality metrics: \n" );
|
||||
for( UInt i = 0; i < PlaYUVerFrame::supportedQualityMetricsList().size(); i++ )
|
||||
{
|
||||
printf( " %s\n", PlaYUVerFrame::supportedQualityMetricsList()[i].c_str() );
|
||||
}
|
||||
iRet = 1;
|
||||
}
|
||||
|
||||
if( Opts()["module_list"]->count() || Opts()["module_list_full"]->count() )
|
||||
{
|
||||
listModules();
|
||||
printf( "Usage: %s modules/quality [options] -input=input_file [--output=output_file]\n", argv[0] );
|
||||
doHelp( std::cout, Opts() );
|
||||
iRet = 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user