mirror of https://github.com/odrling/Aegisub
Add commands to reload audio or video
This is mostly useful for reloading Avisyth or VapourSynth scripts.
This commit is contained in:
parent
c8d4df1355
commit
c7c874acc4
|
@ -128,6 +128,17 @@ struct audio_open_video final : public Command {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct audio_reload final : public Command {
|
||||||
|
CMD_NAME("audio/reload")
|
||||||
|
STR_MENU("Reload Audio")
|
||||||
|
STR_DISP("Reload Audio")
|
||||||
|
STR_HELP("Reload the current audio file")
|
||||||
|
|
||||||
|
void operator()(agi::Context *c) override {
|
||||||
|
c->project->ReloadAudio();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
struct audio_view_spectrum final : public Command {
|
struct audio_view_spectrum final : public Command {
|
||||||
CMD_NAME("audio/view/spectrum")
|
CMD_NAME("audio/view/spectrum")
|
||||||
STR_MENU("&Spectrum Display")
|
STR_MENU("&Spectrum Display")
|
||||||
|
@ -549,6 +560,7 @@ namespace cmd {
|
||||||
reg(agi::make_unique<audio_open_blank>());
|
reg(agi::make_unique<audio_open_blank>());
|
||||||
reg(agi::make_unique<audio_open_noise>());
|
reg(agi::make_unique<audio_open_noise>());
|
||||||
reg(agi::make_unique<audio_open_video>());
|
reg(agi::make_unique<audio_open_video>());
|
||||||
|
reg(agi::make_unique<audio_reload>());
|
||||||
reg(agi::make_unique<audio_play_after>());
|
reg(agi::make_unique<audio_play_after>());
|
||||||
reg(agi::make_unique<audio_play_before>());
|
reg(agi::make_unique<audio_play_before>());
|
||||||
reg(agi::make_unique<audio_play_begin>());
|
reg(agi::make_unique<audio_play_begin>());
|
||||||
|
|
|
@ -612,6 +612,17 @@ struct video_open_dummy final : public Command {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct video_reload final : public Command {
|
||||||
|
CMD_NAME("video/reload")
|
||||||
|
STR_MENU("Reload Video")
|
||||||
|
STR_DISP("Reload Video")
|
||||||
|
STR_HELP("Reload the current video file")
|
||||||
|
|
||||||
|
void operator()(agi::Context *c) override {
|
||||||
|
c->project->ReloadVideo();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
struct video_opt_autoscroll final : public Command {
|
struct video_opt_autoscroll final : public Command {
|
||||||
CMD_NAME("video/opt/autoscroll")
|
CMD_NAME("video/opt/autoscroll")
|
||||||
CMD_ICON(toggle_video_autoscroll)
|
CMD_ICON(toggle_video_autoscroll)
|
||||||
|
@ -794,6 +805,7 @@ namespace cmd {
|
||||||
reg(agi::make_unique<video_jump_start>());
|
reg(agi::make_unique<video_jump_start>());
|
||||||
reg(agi::make_unique<video_open>());
|
reg(agi::make_unique<video_open>());
|
||||||
reg(agi::make_unique<video_open_dummy>());
|
reg(agi::make_unique<video_open_dummy>());
|
||||||
|
reg(agi::make_unique<video_reload>());
|
||||||
reg(agi::make_unique<video_opt_autoscroll>());
|
reg(agi::make_unique<video_opt_autoscroll>());
|
||||||
reg(agi::make_unique<video_play>());
|
reg(agi::make_unique<video_play>());
|
||||||
reg(agi::make_unique<video_play_line>());
|
reg(agi::make_unique<video_play_line>());
|
||||||
|
|
|
@ -60,8 +60,6 @@ class Project {
|
||||||
|
|
||||||
void LoadUnloadFiles(ProjectProperties properties);
|
void LoadUnloadFiles(ProjectProperties properties);
|
||||||
void UpdateRelativePaths();
|
void UpdateRelativePaths();
|
||||||
void ReloadAudio();
|
|
||||||
void ReloadVideo();
|
|
||||||
|
|
||||||
void SetPath(agi::fs::path& var, const char *token, const char *mru, agi::fs::path const& value);
|
void SetPath(agi::fs::path& var, const char *token, const char *mru, agi::fs::path const& value);
|
||||||
|
|
||||||
|
@ -74,11 +72,13 @@ public:
|
||||||
bool CanLoadSubtitlesFromVideo() const { return video_has_subtitles; }
|
bool CanLoadSubtitlesFromVideo() const { return video_has_subtitles; }
|
||||||
|
|
||||||
void LoadAudio(agi::fs::path path);
|
void LoadAudio(agi::fs::path path);
|
||||||
|
void ReloadAudio();
|
||||||
void CloseAudio();
|
void CloseAudio();
|
||||||
agi::AudioProvider *AudioProvider() const { return audio_provider.get(); }
|
agi::AudioProvider *AudioProvider() const { return audio_provider.get(); }
|
||||||
agi::fs::path const& AudioName() const { return audio_file; }
|
agi::fs::path const& AudioName() const { return audio_file; }
|
||||||
|
|
||||||
void LoadVideo(agi::fs::path path);
|
void LoadVideo(agi::fs::path path);
|
||||||
|
void ReloadVideo();
|
||||||
void CloseVideo();
|
void CloseVideo();
|
||||||
AsyncVideoProvider *VideoProvider() const { return video_provider.get(); }
|
AsyncVideoProvider *VideoProvider() const { return video_provider.get(); }
|
||||||
agi::fs::path const& VideoName() const { return video_file; }
|
agi::fs::path const& VideoName() const { return video_file; }
|
||||||
|
|
Loading…
Reference in New Issue