Skip to content

Commit 61b8a16

Browse files
committed
vapoursynth: Unify capitalization
1 parent 041e9fc commit 61b8a16

10 files changed

Lines changed: 72 additions & 72 deletions

automation/vapoursynth/aegisub_vs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
"""
2-
Utility functions for loading video files into Aegisub using the Vapoursynth
2+
Utility functions for loading video files into Aegisub using the VapourSynth
33
video provider.
44
55
When encountering a file whose file extension is not .py or .vpy, the
6-
Vapoursynth audio and video providers will execute the respective default
6+
VapourSynth audio and video providers will execute the respective default
77
script set in Aegisub's configuration, with the following string variables set:
88
- filename: The path to the file that's being opened.
99
- __aegi_data, __aegi_dictionary, __aegi_local, __aegi_script, __aegi_temp, __aegi_user:
1010
The values of ?data, ?dictionary, etc. respectively.
11-
- __aegi_vscache: The path to a directory where the Vapoursynth script can
11+
- __aegi_vscache: The path to a directory where the VapourSynth script can
1212
store cache files. This directory is cleaned by Aegisub when it gets too
1313
large (as defined by Aegisub's configuration).
1414
@@ -53,7 +53,7 @@ def set_paths(vars: dict):
5353

5454
def ensure_plugin(name: str, loadname: str, errormsg: str):
5555
"""
56-
Ensures that the Vapoursynth plugin with the given name exists.
56+
Ensures that the VapourSynth plugin with the given name exists.
5757
If it doesn't, it tries to load it from `loadname`.
5858
If that fails, it raises an error with the given error message.
5959
"""

src/audio_provider_factory.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ using namespace agi;
3232
std::unique_ptr<AudioProvider> CreateAvisynthAudioProvider(fs::path const& filename, BackgroundRunner *);
3333
std::unique_ptr<AudioProvider> CreateFFmpegSourceAudioProvider(fs::path const& filename, BackgroundRunner *);
3434
std::unique_ptr<AudioProvider> CreateBSAudioProvider(fs::path const& filename, BackgroundRunner *);
35-
std::unique_ptr<AudioProvider> CreateVapoursynthAudioProvider(fs::path const& filename, BackgroundRunner *);
35+
std::unique_ptr<AudioProvider> CreateVapourSynthAudioProvider(fs::path const& filename, BackgroundRunner *);
3636

3737
namespace {
3838
struct factory {
@@ -54,7 +54,7 @@ const factory providers[] = {
5454
{"BestSource", CreateBSAudioProvider, false},
5555
#endif
5656
#ifdef WITH_VAPOURSYNTH
57-
{"Vapoursynth", CreateVapoursynthAudioProvider, false},
57+
{"VapourSynth", CreateVapourSynthAudioProvider, false},
5858
#endif
5959
};
6060
}

src/audio_provider_vs.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// Aegisub Project http://www.aegisub.org/
1616

1717
/// @file audio_provider_vs.cpp
18-
/// @brief Vapoursynth-based audio provider
18+
/// @brief VapourSynth-based audio provider
1919
/// @ingroup audio_input
2020
///
2121

@@ -38,7 +38,7 @@
3838
#include "VSScript4.h"
3939

4040
namespace {
41-
class VapoursynthAudioProvider final : public agi::AudioProvider {
41+
class VapourSynthAudioProvider final : public agi::AudioProvider {
4242
VapourSynthWrapper vs;
4343
VSScript *script = nullptr;
4444
VSNode *node = nullptr;
@@ -47,36 +47,36 @@ class VapoursynthAudioProvider final : public agi::AudioProvider {
4747
void FillBufferWithFrame(void *buf, int frame, int64_t start, int64_t count) const;
4848
void FillBuffer(void *buf, int64_t start, int64_t count) const override;
4949
public:
50-
VapoursynthAudioProvider(agi::fs::path const& filename);
51-
~VapoursynthAudioProvider();
50+
VapourSynthAudioProvider(agi::fs::path const& filename);
51+
~VapourSynthAudioProvider();
5252

5353
bool NeedsCache() const override { return true; }
5454
};
5555

56-
VapoursynthAudioProvider::VapoursynthAudioProvider(agi::fs::path const& filename) try {
56+
VapourSynthAudioProvider::VapourSynthAudioProvider(agi::fs::path const& filename) try {
5757
std::lock_guard<std::mutex> lock(vs.GetMutex());
5858

5959
VSCleanCache();
6060

6161
script = vs.GetScriptAPI()->createScript(nullptr);
6262
if (script == nullptr) {
63-
throw VapoursynthError("Error creating script API");
63+
throw VapourSynthError("Error creating script API");
6464
}
6565
vs.GetScriptAPI()->evalSetWorkingDir(script, 1);
6666
if (OpenScriptOrVideo(vs.GetAPI(), vs.GetScriptAPI(), script, filename, OPT_GET("Provider/Audio/VapourSynth/Default Script")->GetString())) {
6767
std::string msg = agi::format("Error executing VapourSynth script: %s", vs.GetScriptAPI()->getError(script));
6868
vs.GetScriptAPI()->freeScript(script);
69-
throw VapoursynthError(msg);
69+
throw VapourSynthError(msg);
7070
}
7171
node = vs.GetScriptAPI()->getOutputNode(script, 0);
7272
if (node == nullptr) {
7373
vs.GetScriptAPI()->freeScript(script);
74-
throw VapoursynthError("No output node set");
74+
throw VapourSynthError("No output node set");
7575
}
7676
if (vs.GetAPI()->getNodeType(node) != mtAudio) {
7777
vs.GetAPI()->freeNode(node);
7878
vs.GetScriptAPI()->freeScript(script);
79-
throw VapoursynthError("Output node isn't an audio node");
79+
throw VapourSynthError("Output node isn't an audio node");
8080
}
8181
vi = vs.GetAPI()->getAudioInfo(node);
8282
float_samples = vi->format.sampleType == stFloat;
@@ -85,10 +85,10 @@ VapoursynthAudioProvider::VapoursynthAudioProvider(agi::fs::path const& filename
8585
channels = vi->format.numChannels;
8686
num_samples = vi->numSamples;
8787
}
88-
catch (VapoursynthError const& err) {
88+
catch (VapourSynthError const& err) {
8989
// Unlike the video provider manager, the audio provider factory catches AudioProviderErrors and picks whichever source doesn't throw one.
9090
// So just rethrow the Error here with an extra label so the user will see the error message and know the audio wasn't loaded with VS
91-
throw VapoursynthError(agi::format("Vapoursynth error: %s", err.GetMessage()));
91+
throw VapourSynthError(agi::format("VapourSynth error: %s", err.GetMessage()));
9292
}
9393

9494
template<typename T>
@@ -102,27 +102,27 @@ static void PackChannels(const uint8_t **Src, void *Dst, size_t Length, size_t C
102102
}
103103
}
104104

105-
void VapoursynthAudioProvider::FillBufferWithFrame(void *buf, int n, int64_t start, int64_t count) const {
105+
void VapourSynthAudioProvider::FillBufferWithFrame(void *buf, int n, int64_t start, int64_t count) const {
106106
char errorMsg[1024];
107107
const VSFrame *frame = vs.GetAPI()->getFrame(n, node, errorMsg, sizeof(errorMsg));
108108
if (frame == nullptr) {
109-
throw VapoursynthError(agi::format("Error getting frame: %s", errorMsg));
109+
throw VapourSynthError(agi::format("Error getting frame: %s", errorMsg));
110110
}
111111
if (vs.GetAPI()->getFrameLength(frame) < count) {
112112
vs.GetAPI()->freeFrame(frame);
113-
throw VapoursynthError("Audio frame too short");
113+
throw VapourSynthError("Audio frame too short");
114114
}
115115
if (vs.GetAPI()->getAudioFrameFormat(frame)->numChannels != channels || vs.GetAPI()->getAudioFrameFormat(frame)->bytesPerSample != bytes_per_sample) {
116116
vs.GetAPI()->freeFrame(frame);
117-
throw VapoursynthError("Audio format is not constant");
117+
throw VapourSynthError("Audio format is not constant");
118118
}
119119

120120
std::vector<const uint8_t *> planes(channels);
121121
for (int c = 0; c < channels; c++) {
122122
planes[c] = vs.GetAPI()->getReadPtr(frame, c) + bytes_per_sample * start;
123123
if (planes[c] == nullptr) {
124124
vs.GetAPI()->freeFrame(frame);
125-
throw VapoursynthError("Failed to read audio channel");
125+
throw VapourSynthError("Failed to read audio channel");
126126
}
127127
}
128128

@@ -138,7 +138,7 @@ void VapoursynthAudioProvider::FillBufferWithFrame(void *buf, int n, int64_t sta
138138
vs.GetAPI()->freeFrame(frame);
139139
}
140140

141-
void VapoursynthAudioProvider::FillBuffer(void *buf, int64_t start, int64_t count) const {
141+
void VapourSynthAudioProvider::FillBuffer(void *buf, int64_t start, int64_t count) const {
142142
int end = start + count; // exclusive
143143
int startframe = start / VS_AUDIO_FRAME_SAMPLES;
144144
int endframe = (end - 1) / VS_AUDIO_FRAME_SAMPLES;
@@ -154,7 +154,7 @@ void VapoursynthAudioProvider::FillBuffer(void *buf, int64_t start, int64_t coun
154154
}
155155
}
156156

157-
VapoursynthAudioProvider::~VapoursynthAudioProvider() {
157+
VapourSynthAudioProvider::~VapourSynthAudioProvider() {
158158
if (node != nullptr) {
159159
vs.GetAPI()->freeNode(node);
160160
}
@@ -164,7 +164,7 @@ VapoursynthAudioProvider::~VapoursynthAudioProvider() {
164164
}
165165
}
166166

167-
std::unique_ptr<agi::AudioProvider> CreateVapoursynthAudioProvider(agi::fs::path const& file, agi::BackgroundRunner *) {
168-
return agi::make_unique<VapoursynthAudioProvider>(file);
167+
std::unique_ptr<agi::AudioProvider> CreateVapourSynthAudioProvider(agi::fs::path const& file, agi::BackgroundRunner *) {
168+
return agi::make_unique<VapourSynthAudioProvider>(file);
169169
}
170170
#endif

src/vapoursynth_common.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
void SetStringVar(const VSAPI *api, VSMap *map, std::string variable, std::string value) {
3030
if (api->mapSetData(map, variable.c_str(), value.c_str(), -1, dtUtf8, 1))
31-
throw VapoursynthError("Failed to set VSMap entry");
31+
throw VapourSynthError("Failed to set VSMap entry");
3232
}
3333

3434
int OpenScriptOrVideo(const VSAPI *api, const VSSCRIPTAPI *sapi, VSScript *script, agi::fs::path const& filename, std::string default_script) {
@@ -38,7 +38,7 @@ int OpenScriptOrVideo(const VSAPI *api, const VSSCRIPTAPI *sapi, VSScript *scrip
3838
} else {
3939
VSMap *map = api->createMap();
4040
if (map == nullptr)
41-
throw VapoursynthError("Failed to create VSMap for script info");
41+
throw VapourSynthError("Failed to create VSMap for script info");
4242

4343
SetStringVar(api, map, "filename", filename.string());
4444
SetStringVar(api, map, "__aegi_vscache", config::path->Decode("?local/vscache").string());
@@ -52,7 +52,7 @@ int OpenScriptOrVideo(const VSAPI *api, const VSSCRIPTAPI *sapi, VSScript *scrip
5252
SetStringVar(api, map, "__aegi_" + dir, config::path->Decode("?" + dir).string());
5353

5454
if (sapi->setVariables(script, map))
55-
throw VapoursynthError("Failed to set script info variables");
55+
throw VapourSynthError("Failed to set script info variables");
5656

5757
api->freeMap(map);
5858

src/vapoursynth_wrap.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// Aegisub Project http://www.aegisub.org/
1616

1717
/// @file vapoursynth_wrap.cpp
18-
/// @brief Wrapper-layer for Vapoursynth
18+
/// @brief Wrapper-layer for VapourSynth
1919
/// @ingroup video_input audio_input
2020
///
2121

@@ -67,15 +67,15 @@ VapourSynthWrapper::VapourSynthWrapper() {
6767
#endif
6868

6969
if (!hLib)
70-
throw VapoursynthError("Could not load " VSSCRIPT_SO);
70+
throw VapourSynthError("Could not load " VSSCRIPT_SO);
7171

7272
#ifdef _WIN32
7373
FUNC* getVSScriptAPI = (FUNC*)GetProcAddress(hLib, "getVSScriptAPI");
7474
#else
7575
FUNC* getVSScriptAPI = (FUNC*)dlsym(hLib, "getVSScriptAPI");
7676
#endif
7777
if (!getVSScriptAPI)
78-
throw VapoursynthError("Failed to get address of getVSScriptAPI from " VSSCRIPT_SO);
78+
throw VapourSynthError("Failed to get address of getVSScriptAPI from " VSSCRIPT_SO);
7979

8080
// Python will set the program's locale to the user's default locale, which will break
8181
// half of wxwidgets on some operating systems due to locale mismatches. There's not really anything
@@ -85,12 +85,12 @@ VapourSynthWrapper::VapourSynthWrapper() {
8585
setlocale(LC_ALL, oldlocale.c_str());
8686

8787
if (!scriptapi)
88-
throw VapoursynthError("Failed to get Vapoursynth ScriptAPI");
88+
throw VapourSynthError("Failed to get VapourSynth ScriptAPI");
8989

9090
api = scriptapi->getVSAPI(VAPOURSYNTH_API_VERSION);
9191

9292
if (!api)
93-
throw VapoursynthError("Failed to get Vapoursynth API");
93+
throw VapourSynthError("Failed to get VapourSynth API");
9494

9595
vs_loaded = true;
9696
}

src/vapoursynth_wrap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#include <libaegisub/exception.h>
2525

26-
DEFINE_EXCEPTION(VapoursynthError, agi::Exception);
26+
DEFINE_EXCEPTION(VapourSynthError, agi::Exception);
2727

2828
struct VSAPI;
2929
struct VSSCRIPTAPI;

src/video_provider_manager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ std::unique_ptr<VideoProvider> CreateYUV4MPEGVideoProvider(agi::fs::path const&,
3030
std::unique_ptr<VideoProvider> CreateFFmpegSourceVideoProvider(agi::fs::path const&, std::string const&, agi::BackgroundRunner *);
3131
std::unique_ptr<VideoProvider> CreateAvisynthVideoProvider(agi::fs::path const&, std::string const&, agi::BackgroundRunner *);
3232
std::unique_ptr<VideoProvider> CreateBSVideoProvider(agi::fs::path const&, std::string const&, agi::BackgroundRunner *);
33-
std::unique_ptr<VideoProvider> CreateVapoursynthVideoProvider(agi::fs::path const&, std::string const&, agi::BackgroundRunner *);
33+
std::unique_ptr<VideoProvider> CreateVapourSynthVideoProvider(agi::fs::path const&, std::string const&, agi::BackgroundRunner *);
3434

3535
std::unique_ptr<VideoProvider> CreateCacheVideoProvider(std::unique_ptr<VideoProvider>);
3636

@@ -54,7 +54,7 @@ namespace {
5454
{"BestSource", CreateBSVideoProvider, false},
5555
#endif
5656
#ifdef WITH_VAPOURSYNTH
57-
{"Vapoursynth", CreateVapoursynthVideoProvider, false},
57+
{"VapourSynth", CreateVapourSynthVideoProvider, false},
5858
#endif
5959
};
6060
}

0 commit comments

Comments
 (0)