mirror of
https://github.com/AxioDL/amuse.git
synced 2025-12-08 13:14:58 +00:00
Windows build fixes
This commit is contained in:
@@ -19,14 +19,14 @@ static void ReportConvType(ConvType tp)
|
||||
switch (tp)
|
||||
{
|
||||
case ConvN64:
|
||||
Log.report(logvisor::Info, _S("using N64 format"));
|
||||
Log.report(logvisor::Info, _SYS_STR("using N64 format"));
|
||||
break;
|
||||
case ConvPC:
|
||||
Log.report(logvisor::Info, _S("using PC format"));
|
||||
Log.report(logvisor::Info, _SYS_STR("using PC format"));
|
||||
break;
|
||||
case ConvGCN:
|
||||
default:
|
||||
Log.report(logvisor::Info, _S("using GameCube format"));
|
||||
Log.report(logvisor::Info, _SYS_STR("using GameCube format"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -43,19 +43,19 @@ static bool ExtractAudioGroup(amuse::SystemStringView inPath, amuse::SystemStrin
|
||||
|
||||
if (groups.size())
|
||||
{
|
||||
Log.report(logvisor::Info, _S("Found '%s'"), amuse::ContainerRegistry::TypeToName(type));
|
||||
Log.report(logvisor::Info, _SYS_STR("Found '%s'"), amuse::ContainerRegistry::TypeToName(type));
|
||||
|
||||
amuse::Mkdir(targetPath.data(), 0755);
|
||||
Log.report(logvisor::Info, _S("Established directory at %s"), targetPath.data());
|
||||
Log.report(logvisor::Info, _SYS_STR("Established directory at %s"), targetPath.data());
|
||||
|
||||
for (auto& group : groups)
|
||||
{
|
||||
Log.report(logvisor::Info, _S("Extracting %s"), group.first.c_str());
|
||||
Log.report(logvisor::Info, _SYS_STR("Extracting %s"), group.first.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
auto songs = amuse::ContainerRegistry::LoadSongs(inPath.data());
|
||||
amuse::SystemString songsDir = amuse::SystemString(targetPath) + _S("/midifiles");
|
||||
amuse::SystemString songsDir = amuse::SystemString(targetPath) + _SYS_STR("/midifiles");
|
||||
bool madeDir = false;
|
||||
for (auto& pair : songs)
|
||||
{
|
||||
@@ -66,11 +66,11 @@ static bool ExtractAudioGroup(amuse::SystemStringView inPath, amuse::SystemStrin
|
||||
madeDir = true;
|
||||
}
|
||||
|
||||
amuse::SystemString songPath = songsDir + _S('/') + pair.first + _S(".mid");
|
||||
FILE* fp = amuse::FOpen(songPath.c_str(), _S("wb"));
|
||||
amuse::SystemString songPath = songsDir + _SYS_STR('/') + pair.first + _SYS_STR(".mid");
|
||||
FILE* fp = amuse::FOpen(songPath.c_str(), _SYS_STR("wb"));
|
||||
if (fp)
|
||||
{
|
||||
Log.report(logvisor::Info, _S("Extracting %s"), pair.first.c_str());
|
||||
Log.report(logvisor::Info, _SYS_STR("Extracting %s"), pair.first.c_str());
|
||||
int extractedVersion;
|
||||
bool isBig;
|
||||
std::vector<uint8_t> mid =
|
||||
@@ -85,7 +85,7 @@ static bool ExtractAudioGroup(amuse::SystemStringView inPath, amuse::SystemStrin
|
||||
|
||||
static bool BuildSNG(amuse::SystemStringView inPath, amuse::SystemStringView targetPath, int version, bool big)
|
||||
{
|
||||
FILE* fp = amuse::FOpen(inPath.data(), _S("rb"));
|
||||
FILE* fp = amuse::FOpen(inPath.data(), _SYS_STR("rb"));
|
||||
if (!fp)
|
||||
return false;
|
||||
|
||||
@@ -100,7 +100,7 @@ static bool BuildSNG(amuse::SystemStringView inPath, amuse::SystemStringView tar
|
||||
if (out.empty())
|
||||
return false;
|
||||
|
||||
fp = amuse::FOpen(targetPath.data(), _S("wb"));
|
||||
fp = amuse::FOpen(targetPath.data(), _SYS_STR("wb"));
|
||||
fwrite(out.data(), 1, out.size(), fp);
|
||||
fclose(fp);
|
||||
|
||||
@@ -109,7 +109,7 @@ static bool BuildSNG(amuse::SystemStringView inPath, amuse::SystemStringView tar
|
||||
|
||||
static bool ExtractSNG(amuse::SystemStringView inPath, amuse::SystemStringView targetPath)
|
||||
{
|
||||
FILE* fp = amuse::FOpen(inPath.data(), _S("rb"));
|
||||
FILE* fp = amuse::FOpen(inPath.data(), _SYS_STR("rb"));
|
||||
if (!fp)
|
||||
return false;
|
||||
|
||||
@@ -126,7 +126,7 @@ static bool ExtractSNG(amuse::SystemStringView inPath, amuse::SystemStringView t
|
||||
if (out.empty())
|
||||
return false;
|
||||
|
||||
fp = amuse::FOpen(targetPath.data(), _S("wb"));
|
||||
fp = amuse::FOpen(targetPath.data(), _SYS_STR("wb"));
|
||||
fwrite(out.data(), 1, out.size(), fp);
|
||||
fclose(fp);
|
||||
|
||||
@@ -150,35 +150,35 @@ int main(int argc, const amuse::SystemChar** argv)
|
||||
ConvType type = ConvGCN;
|
||||
if (argc >= 4)
|
||||
{
|
||||
if (!amuse::CompareCaseInsensitive(argv[3], _S("n64")))
|
||||
if (!amuse::CompareCaseInsensitive(argv[3], _SYS_STR("n64")))
|
||||
type = ConvN64;
|
||||
else if (!amuse::CompareCaseInsensitive(argv[3], _S("gcn")))
|
||||
else if (!amuse::CompareCaseInsensitive(argv[3], _SYS_STR("gcn")))
|
||||
type = ConvGCN;
|
||||
else if (!amuse::CompareCaseInsensitive(argv[3], _S("pc")))
|
||||
else if (!amuse::CompareCaseInsensitive(argv[3], _SYS_STR("pc")))
|
||||
type = ConvPC;
|
||||
else
|
||||
{
|
||||
Log.report(logvisor::Error, _S("unrecognized format: %s"), argv[3]);
|
||||
Log.report(logvisor::Error, _SYS_STR("unrecognized format: %s"), argv[3]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
bool good = false;
|
||||
FILE* fin = amuse::FOpen(argv[1], _S("rb"));
|
||||
FILE* fin = amuse::FOpen(argv[1], _SYS_STR("rb"));
|
||||
if (fin)
|
||||
{
|
||||
fclose(fin);
|
||||
amuse::SystemString barePath(argv[1]);
|
||||
size_t dotPos = barePath.rfind(_S('.'));
|
||||
size_t dotPos = barePath.rfind(_SYS_STR('.'));
|
||||
const amuse::SystemChar* dot = barePath.c_str() + dotPos;
|
||||
if (dotPos != amuse::SystemString::npos)
|
||||
{
|
||||
if (!amuse::CompareCaseInsensitive(dot, _S(".mid")) || !amuse::CompareCaseInsensitive(dot, _S(".midi")))
|
||||
if (!amuse::CompareCaseInsensitive(dot, _SYS_STR(".mid")) || !amuse::CompareCaseInsensitive(dot, _SYS_STR(".midi")))
|
||||
{
|
||||
ReportConvType(type);
|
||||
good = BuildSNG(barePath, argv[2], 1, true);
|
||||
}
|
||||
else if (!amuse::CompareCaseInsensitive(dot, _S(".son")) || !amuse::CompareCaseInsensitive(dot, _S(".sng")))
|
||||
else if (!amuse::CompareCaseInsensitive(dot, _SYS_STR(".son")) || !amuse::CompareCaseInsensitive(dot, _SYS_STR(".sng")))
|
||||
{
|
||||
good = ExtractSNG(argv[1], argv[2]);
|
||||
}
|
||||
@@ -194,8 +194,8 @@ int main(int argc, const amuse::SystemChar** argv)
|
||||
if (!amuse::Stat(argv[1], &theStat) && S_ISDIR(theStat.st_mode))
|
||||
{
|
||||
amuse::SystemString projectPath(argv[1]);
|
||||
projectPath += _S("/project.yaml");
|
||||
fin = amuse::FOpen(projectPath.c_str(), _S("rb"));
|
||||
projectPath += _SYS_STR("/project.yaml");
|
||||
fin = amuse::FOpen(projectPath.c_str(), _SYS_STR("rb"));
|
||||
if (fin)
|
||||
{
|
||||
fclose(fin);
|
||||
@@ -207,7 +207,7 @@ int main(int argc, const amuse::SystemChar** argv)
|
||||
|
||||
if (!good)
|
||||
{
|
||||
Log.report(logvisor::Error, _S("unable to convert %s to %s"), argv[1], argv[2]);
|
||||
Log.report(logvisor::Error, _SYS_STR("unable to convert %s to %s"), argv[1], argv[2]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -624,7 +624,7 @@ struct AppCallback : boo::IApplicationCallback
|
||||
int appMain(boo::IApplication* app)
|
||||
{
|
||||
/* Event window */
|
||||
m_win = app->newWindow(_S("amuseplay"));
|
||||
m_win = app->newWindow(_SYS_STR("amuseplay"));
|
||||
m_win->setCallback(&m_events);
|
||||
m_win->setWindowFrame(100, 100, 100, 100);
|
||||
m_win->setStyle(~boo::EWindowStyle::Resize);
|
||||
@@ -653,7 +653,7 @@ struct AppCallback : boo::IApplicationCallback
|
||||
Log.report(logvisor::Error, "invalid/no data at path argument");
|
||||
return 1;
|
||||
}
|
||||
Log.report(logvisor::Info, _S("Found '%s' Audio Group data"), amuse::ContainerRegistry::TypeToName(cType));
|
||||
Log.report(logvisor::Info, _SYS_STR("Found '%s' Audio Group data"), amuse::ContainerRegistry::TypeToName(cType));
|
||||
|
||||
std::vector<std::pair<amuse::SystemString, amuse::IntrusiveAudioGroupData>> data =
|
||||
amuse::ContainerRegistry::LoadContainer(m_argv[1]);
|
||||
@@ -755,7 +755,7 @@ struct AppCallback : boo::IApplicationCallback
|
||||
break;
|
||||
}
|
||||
}
|
||||
amuse::Printf(_S(" %d %s (Group %d, Setup %d)\n"), idx++, pair.first.c_str(), grpId,
|
||||
amuse::Printf(_SYS_STR(" %d %s (Group %d, Setup %d)\n"), idx++, pair.first.c_str(), grpId,
|
||||
setupId);
|
||||
}
|
||||
|
||||
@@ -825,12 +825,12 @@ struct AppCallback : boo::IApplicationCallback
|
||||
printf("Multiple Audio Groups discovered:\n");
|
||||
for (const auto& pair : allSFXGroups)
|
||||
{
|
||||
amuse::Printf(_S(" %d %s (SFXGroup) %" PRISize " sfx-entries\n"), pair.first.id,
|
||||
amuse::Printf(_SYS_STR(" %d %s (SFXGroup) %" PRISize " sfx-entries\n"), pair.first.id,
|
||||
pair.second.first->first.c_str(), pair.second.second->m_sfxEntries.size());
|
||||
}
|
||||
for (const auto& pair : allSongGroups)
|
||||
{
|
||||
amuse::Printf(_S(" %d %s (SongGroup) %" PRISize " normal-pages, %" PRISize
|
||||
amuse::Printf(_SYS_STR(" %d %s (SongGroup) %" PRISize " normal-pages, %" PRISize
|
||||
" drum-pages, %" PRISize " MIDI-setups\n"),
|
||||
pair.first.id, pair.second.first->first.c_str(), pair.second.second->m_normPages.size(),
|
||||
pair.second.second->m_drumPages.size(), pair.second.second->m_midiSetups.size());
|
||||
@@ -1034,7 +1034,7 @@ int main(int argc, const boo::SystemChar** argv)
|
||||
logvisor::RegisterStandardExceptions();
|
||||
AppCallback app(argc, argv);
|
||||
int ret = boo::ApplicationRun(boo::IApplication::EPlatformType::Auto, app,
|
||||
_S("amuseplay"), _S("Amuse Player"),
|
||||
_SYS_STR("amuseplay"), _SYS_STR("Amuse Player"),
|
||||
argc, argv, {}, 1, 1, false);
|
||||
printf("IM DYING!!\n");
|
||||
return ret;
|
||||
|
||||
@@ -186,7 +186,7 @@ int main(int argc, const boo::SystemChar** argv)
|
||||
Log.report(logvisor::Error, "invalid/no data at path argument");
|
||||
return 1;
|
||||
}
|
||||
Log.report(logvisor::Info, _S("Found '%s' Audio Group data"), amuse::ContainerRegistry::TypeToName(cType));
|
||||
Log.report(logvisor::Info, _SYS_STR("Found '%s' Audio Group data"), amuse::ContainerRegistry::TypeToName(cType));
|
||||
|
||||
std::vector<std::pair<amuse::SystemString, amuse::IntrusiveAudioGroupData>> data =
|
||||
amuse::ContainerRegistry::LoadContainer(m_args[0].c_str());
|
||||
@@ -290,7 +290,7 @@ int main(int argc, const boo::SystemChar** argv)
|
||||
break;
|
||||
}
|
||||
}
|
||||
amuse::Printf(_S(" %d %s (Group %d, Setup %d)\n"), idx++, pair.first.c_str(), grpId, setupId);
|
||||
amuse::Printf(_SYS_STR(" %d %s (Group %d, Setup %d)\n"), idx++, pair.first.c_str(), grpId, setupId);
|
||||
}
|
||||
|
||||
int userSel = 0;
|
||||
@@ -370,12 +370,12 @@ int main(int argc, const boo::SystemChar** argv)
|
||||
printf("Multiple Audio Groups discovered:\n");
|
||||
for (const auto& pair : allSFXGroups)
|
||||
{
|
||||
amuse::Printf(_S(" %d %s (SFXGroup) %" PRISize " sfx-entries\n"), pair.first,
|
||||
amuse::Printf(_SYS_STR(" %d %s (SFXGroup) %" PRISize " sfx-entries\n"), pair.first,
|
||||
pair.second.first->first.c_str(), pair.second.second->m_sfxEntries.size());
|
||||
}
|
||||
for (const auto& pair : allSongGroups)
|
||||
{
|
||||
amuse::Printf(_S(" %d %s (SongGroup) %" PRISize " normal-pages, %" PRISize " drum-pages, %" PRISize
|
||||
amuse::Printf(_SYS_STR(" %d %s (SongGroup) %" PRISize " normal-pages, %" PRISize " drum-pages, %" PRISize
|
||||
" MIDI-setups\n"),
|
||||
pair.first, pair.second.first->first.c_str(), pair.second.second->m_normPages.size(),
|
||||
pair.second.second->m_drumPages.size(), pair.second.second->m_midiSetups.size());
|
||||
@@ -490,8 +490,8 @@ int main(int argc, const boo::SystemChar** argv)
|
||||
|
||||
/* WAV out path */
|
||||
amuse::SystemChar pathOut[1024];
|
||||
SNPrintf(pathOut, 1024, _S("%s-%s.wav"), m_groupName->c_str(), m_songName->c_str());
|
||||
Log.report(logvisor::Info, _S("Writing to %s"), pathOut);
|
||||
SNPrintf(pathOut, 1024, _SYS_STR("%s-%s.wav"), m_groupName->c_str(), m_songName->c_str());
|
||||
Log.report(logvisor::Info, _SYS_STR("Writing to %s"), pathOut);
|
||||
|
||||
/* Build voice engine */
|
||||
std::unique_ptr<boo::IAudioVoiceEngine> voxEngine = boo::NewWAVAudioVoiceEngine(pathOut, rate, chCount);
|
||||
|
||||
Reference in New Issue
Block a user