Merge pull request #15803 from Eism/videoconverter_ls_ts_4.0_rc
Added commands for video convert mode. RC
This commit is contained in:
commit
44e7ed9209
|
@ -87,6 +87,8 @@ void CommandLineController::parse(const QStringList& args)
|
|||
// m_parser.addOption(QCommandLineOption("piano-position", "Show Piano top or bottom. Default bottom", "bottom"));
|
||||
m_parser.addOption(QCommandLineOption("resolution", "Resolution [2160p, 1440p, 1080p, 720p, 480p, 360p]", "1080p"));
|
||||
m_parser.addOption(QCommandLineOption("fps", "Frame per second [60, 30, 24]", "24"));
|
||||
m_parser.addOption(QCommandLineOption("ls", "Pause before playback in seconds (3.0)", "3.0"));
|
||||
m_parser.addOption(QCommandLineOption("ts", "Pause before end of video in seconds (3.0)", "3.0"));
|
||||
|
||||
m_parser.addOption(QCommandLineOption("gp-linked", "create tabulature linked staves for guitar pro"));
|
||||
m_parser.addOption(QCommandLineOption("gp-experimental", "experimental features for guitar pro import"));
|
||||
|
@ -316,6 +318,14 @@ void CommandLineController::apply()
|
|||
if (m_parser.isSet("fps")) {
|
||||
videoExportConfiguration()->setFps(intValue("fps"));
|
||||
}
|
||||
|
||||
if (m_parser.isSet("ls")) {
|
||||
videoExportConfiguration()->setLeadingSec(doubleValue("ls"));
|
||||
}
|
||||
|
||||
if (m_parser.isSet("ts")) {
|
||||
videoExportConfiguration()->setTrailingSec(doubleValue("ts"));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -26,6 +26,8 @@ static bool DEFAULT_SHOW_PIANO = false;
|
|||
static PianoPosition DEFAULT_PIANO_POSITION = PianoPosition::Bottom;
|
||||
static std::string DEFAULT_RESOLUTION = "1080p";
|
||||
static int DEFAULT_FPS = 24;
|
||||
static double DEFAULT_LEADING_SEC = 3.0;
|
||||
static double DEFAULT_TRAILING_SECONDS = 3.0;
|
||||
|
||||
using namespace mu::iex::videoexport;
|
||||
|
||||
|
@ -78,3 +80,23 @@ void VideoExportConfiguration::setFps(std::optional<int> fps)
|
|||
{
|
||||
m_fps = fps;
|
||||
}
|
||||
|
||||
double VideoExportConfiguration::leadingSec() const
|
||||
{
|
||||
return m_leadingSec ? m_leadingSec.value() : DEFAULT_LEADING_SEC;
|
||||
}
|
||||
|
||||
void VideoExportConfiguration::setLeadingSec(std::optional<double> leadingSec)
|
||||
{
|
||||
m_leadingSec = leadingSec;
|
||||
}
|
||||
|
||||
double VideoExportConfiguration::trailingSec() const
|
||||
{
|
||||
return m_trailingSec ? m_trailingSec.value() : DEFAULT_TRAILING_SECONDS;
|
||||
}
|
||||
|
||||
void VideoExportConfiguration::setTrailingSec(std::optional<double> trailingSec)
|
||||
{
|
||||
m_trailingSec = trailingSec;
|
||||
}
|
||||
|
|
|
@ -40,15 +40,24 @@ public:
|
|||
|
||||
std::string resolution() const override;
|
||||
void setResolution(std::optional<std::string> resolution) override;
|
||||
|
||||
int fps() const override;
|
||||
void setFps(std::optional<int> fps) override;
|
||||
|
||||
double leadingSec() const override;
|
||||
void setLeadingSec(std::optional<double> leadingSec) override;
|
||||
|
||||
double trailingSec() const override;
|
||||
void setTrailingSec(std::optional<double> trailingSec) override;
|
||||
|
||||
private:
|
||||
std::optional<ViewMode> m_viewMode = std::nullopt;
|
||||
std::optional<bool> m_showPiano = std::nullopt;
|
||||
std::optional<PianoPosition> m_pianoPosition = std::nullopt;
|
||||
std::optional<std::string> m_resolution = std::nullopt;
|
||||
std::optional<int> m_fps = std::nullopt;
|
||||
std::optional<double> m_leadingSec = std::nullopt;
|
||||
std::optional<double> m_trailingSec = std::nullopt;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -102,6 +102,9 @@ mu::Ret VideoWriter::write(INotationProjectPtr project, const io::path_t& filePa
|
|||
}
|
||||
cfg.bitrate = int(br * 1000000);
|
||||
|
||||
cfg.leadingSec = configuration()->leadingSec();
|
||||
cfg.trailingSec = configuration()->trailingSec();
|
||||
|
||||
Ret ret = generatePagedOriginalVideo(project, filePath, cfg);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -47,8 +47,15 @@ public:
|
|||
|
||||
virtual std::string resolution() const = 0;
|
||||
virtual void setResolution(std::optional<std::string> resolution) = 0;
|
||||
|
||||
virtual int fps() const = 0;
|
||||
virtual void setFps(std::optional<int> fps) = 0;
|
||||
|
||||
virtual double leadingSec() const = 0;
|
||||
virtual void setLeadingSec(std::optional<double> leadingSec) = 0;
|
||||
|
||||
virtual double trailingSec() const = 0;
|
||||
virtual void setTrailingSec(std::optional<double> trailingSec) = 0;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue