Implement compress action for commandline use (#5341)
This commit is contained in:
@@ -89,7 +89,7 @@ _lmms()
|
||||
pars_render=(--float --bitrate --format --interpolation)
|
||||
pars_render+=(--loop --mode --output --profile)
|
||||
pars_render+=(--samplerate --oversampling)
|
||||
actions=(dump render rendertracks upgrade)
|
||||
actions=(dump compress render rendertracks upgrade)
|
||||
actions_old=(-d --dump -r --render --rendertracks -u --upgrade)
|
||||
shortargs+=(-a -b -c -f -h -i -l -m -o -p -s -v -x)
|
||||
|
||||
|
||||
@@ -161,6 +161,7 @@ void printHelp()
|
||||
"Actions:\n"
|
||||
" <no action> [options...] [<project>] Start LMMS in normal GUI mode\n"
|
||||
" dump <in> Dump XML of compressed file <in>\n"
|
||||
" compress <in> Compress file <in>\n"
|
||||
" render <project> [options...] Render given project file\n"
|
||||
" rendertracks <project> [options...] Render each track to a different file\n"
|
||||
" upgrade <in> [out] Upgrade file <in> and save as <out>\n"
|
||||
@@ -427,6 +428,22 @@ int main( int argc, char * * argv )
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
else if( arg == "compress" || arg == "--compress" )
|
||||
{
|
||||
++i;
|
||||
|
||||
if( i == argc )
|
||||
{
|
||||
return noInputFileError();
|
||||
}
|
||||
|
||||
QFile f( QString::fromLocal8Bit( argv[i] ) );
|
||||
f.open( QIODevice::ReadOnly );
|
||||
QByteArray d = qCompress( f.readAll() ) ;
|
||||
fwrite( d.constData(), sizeof(char), d.size(), stdout );
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
else if( arg == "render" || arg == "--render" || arg == "-r" ||
|
||||
arg == "rendertracks" || arg == "--rendertracks" )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user