aboutsummaryrefslogtreecommitdiff
path: root/visualization/renderer/main.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2020-05-12 00:58:40 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2020-05-12 00:58:40 +0800
commita7407edaf81c685d4a389785a405a53a5de4b148 (patch)
treee6e4f2d85f2172c94ac83a6e8f01e1e90a78ede9 /visualization/renderer/main.cpp
parent437b7b16c322a8e53ac55a5f831098494d9a7073 (diff)
downloadQMidiPlayer-a7407edaf81c685d4a389785a405a53a5de4b148.tar.xz
Format EVERYTHING.
Hopefully this will make the source code less horrendous and actually readable. The command used was: ``` astyle --suffix=none --style=allman --attach-extern-c --attach-closing-while --indent-switches --indent-after-parens --pad-oper --pad-header --unpad-paren --align-pointer=name --recursive './*.cpp,*.hpp' ```
Diffstat (limited to 'visualization/renderer/main.cpp')
-rw-r--r--visualization/renderer/main.cpp80
1 files changed, 41 insertions, 39 deletions
diff --git a/visualization/renderer/main.cpp b/visualization/renderer/main.cpp
index c651c54..7f25578 100644
--- a/visualization/renderer/main.cpp
+++ b/visualization/renderer/main.cpp
@@ -4,44 +4,46 @@
#include "qmpvisrendercore.hpp"
#include "qmpsettingsro.hpp"
-int main(int argc,char **argv)
+int main(int argc, char **argv)
{
- QCoreApplication::setApplicationName("qmpvisrender");
- QCoreApplication::setApplicationVersion("0.0.0");
- QCoreApplication a(argc,argv);
- QCommandLineParser clp;
- clp.setApplicationDescription("Renderer a visualization of a midi file.");
- clp.addHelpOption();
- clp.addVersionOption();
- clp.addOption({{"f","output-file"},"File name of the output file.","filename","output.mp4"});
- clp.addOption({
- "receiver",
- "Specify a program and its arguments to process the rendered frames. Supports parameter substitution. See documentation for details.",
- "command",
- "ffmpeg %i -vf vflip -pix_fmt yuv420p -c:v libx264 -preset slow -crf 22 %o"
- });
- clp.addOption({
- {"e","receiver-execution"},
- "Execution mode of the receiver command. Valid options are 'one-shot' and 'per-frame'",
- "mode",
- "one-shot"
- });
- clp.addOption({{"s","show-window"},"Do not hide the visualization window."});
- clp.addOption({{"c","config"},"Load options from the configuration file.","qmprc file"});
- clp.addOption({{"o","option"},"Set option for the visualization module.","key-value pair"});
- clp.addOption({"list-options","Show a list of recognized options and quit."});
- clp.addPositionalArgument("file","MIDI file to render");
- clp.process(a.arguments());
- qmpVisRenderCore core(&clp);
- if(clp.positionalArguments().empty()&&!clp.isSet("list-options"))
- clp.showHelp(1);
- core.loadSettings();
- if(!core.loadVisualizationLibrary())
- return 1;
- if(clp.positionalArguments().size())
- core.setMIDIFile(clp.positionalArguments().front().toStdString().c_str());
- core.startRender();
- int retval=a.exec();
- core.unloadVisualizationLibrary();
- return retval;
+ QCoreApplication::setApplicationName("qmpvisrender");
+ QCoreApplication::setApplicationVersion("0.0.0");
+ QCoreApplication a(argc, argv);
+ QCommandLineParser clp;
+ clp.setApplicationDescription("Renderer a visualization of a midi file.");
+ clp.addHelpOption();
+ clp.addVersionOption();
+ clp.addOption({{"f", "output-file"}, "File name of the output file.", "filename", "output.mp4"});
+ clp.addOption(
+ {
+ "receiver",
+ "Specify a program and its arguments to process the rendered frames. Supports parameter substitution. See documentation for details.",
+ "command",
+ "ffmpeg %i -vf vflip -pix_fmt yuv420p -c:v libx264 -preset slow -crf 22 %o"
+ });
+ clp.addOption(
+ {
+ {"e", "receiver-execution"},
+ "Execution mode of the receiver command. Valid options are 'one-shot' and 'per-frame'",
+ "mode",
+ "one-shot"
+ });
+ clp.addOption({{"s", "show-window"}, "Do not hide the visualization window."});
+ clp.addOption({{"c", "config"}, "Load options from the configuration file.", "qmprc file"});
+ clp.addOption({{"o", "option"}, "Set option for the visualization module.", "key-value pair"});
+ clp.addOption({"list-options", "Show a list of recognized options and quit."});
+ clp.addPositionalArgument("file", "MIDI file to render");
+ clp.process(a.arguments());
+ qmpVisRenderCore core(&clp);
+ if (clp.positionalArguments().empty() && !clp.isSet("list-options"))
+ clp.showHelp(1);
+ core.loadSettings();
+ if (!core.loadVisualizationLibrary())
+ return 1;
+ if (clp.positionalArguments().size())
+ core.setMIDIFile(clp.positionalArguments().front().toStdString().c_str());
+ core.startRender();
+ int retval = a.exec();
+ core.unloadVisualizationLibrary();
+ return retval;
}