From: <man...@us...> - 2014-11-10 14:01:06
|
Revision: 4589 http://sourceforge.net/p/modplug/code/4589 Author: manxorist Date: 2014-11-10 14:00:54 +0000 (Mon, 10 Nov 2014) Log Message: ----------- [Ref] Stream export: Convert encoder backends to mpt::ustring. Modified Paths: -------------- trunk/OpenMPT/mptrack/Mod2wave.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/StreamEncoder.cpp trunk/OpenMPT/mptrack/StreamEncoder.h trunk/OpenMPT/mptrack/StreamEncoderFLAC.cpp trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp trunk/OpenMPT/mptrack/StreamEncoderOpus.cpp trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp trunk/OpenMPT/mptrack/StreamEncoderWAV.cpp trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/mod2wave.h Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mod2wave.cpp 2014-11-10 13:31:26 UTC (rev 4588) +++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2014-11-10 14:00:54 UTC (rev 4589) @@ -254,9 +254,9 @@ m_EditGenre.Clear(); m_CbnGenre.ResetContent(); m_CbnGenre.AddString(""); - for(std::vector<std::string>::const_iterator genre = encTraits->genres.begin(); genre != encTraits->genres.end(); ++genre) + for(std::vector<mpt::ustring>::const_iterator genre = encTraits->genres.begin(); genre != encTraits->genres.end(); ++genre) { - m_CbnGenre.AddString((*genre).c_str()); + m_CbnGenre.AddString(mpt::ToCString(*genre)); } } else { @@ -272,15 +272,15 @@ void CWaveConvert::OnShowEncoderInfo() //------------------------------------ { - std::string info; - info += "Format: "; + mpt::ustring info; + info += MPT_USTRING("Format: "); info += encTraits->fileDescription; - info += "\r\n"; - info += "Encoder: "; + info += MPT_USTRING("\r\n"); + info += MPT_USTRING("Encoder: "); info += encTraits->encoderName; - info += "\r\n"; - info += mpt::String::Replace(encTraits->description, "\n", "\r\n"); - Reporting::Information(info.c_str(), "Encoder Information"); + info += MPT_USTRING("\r\n"); + info += mpt::String::Replace(encTraits->description, MPT_USTRING("\n"), MPT_USTRING("\r\n")); + Reporting::Information(info, "Encoder Information"); } @@ -292,7 +292,7 @@ for(std::size_t i = 0; i < m_Settings.EncoderFactories.size(); ++i) { const Encoder::Traits &encTraits = m_Settings.EncoderFactories[i]->GetTraits(); - int ndx = m_CbnFileType.AddString(encTraits.fileShortDescription.c_str()); + int ndx = m_CbnFileType.AddString(mpt::ToCString(encTraits.fileShortDescription)); m_CbnFileType.SetItemData(ndx, i); if(m_Settings.EncoderIndex == i) { @@ -431,7 +431,7 @@ // too may formats break; } - int ndx = m_CbnSampleFormat.AddString(format.Description.c_str()); + int ndx = m_CbnSampleFormat.AddString(mpt::ToCString(format.Description)); m_CbnSampleFormat.SetItemData(ndx, i & 0xffff); if(encSettings.Mode & Encoder::ModeEnumerated && (int)i == encSettings.Format) { @@ -789,8 +789,8 @@ } -std::size_t CWaveConvertSettings::FindEncoder(const std::string &name) const -//-------------------------------------------------------------------------- +std::size_t CWaveConvertSettings::FindEncoder(const mpt::ustring &name) const +//--------------------------------------------------------------------------- { for(std::size_t i = 0; i < EncoderFactories.size(); ++i) { @@ -840,7 +840,7 @@ CWaveConvertSettings::CWaveConvertSettings(SettingsContainer &conf, const std::vector<EncoderFactoryBase*> &encFactories) //----------------------------------------------------------------------------------------------------------------------- : EncoderFactories(encFactories) - , EncoderName(conf, "Export", encFactories.size() > 2 ? "LossyEncoder" : "LosslessEncoder", "") + , EncoderName(conf, "Export", encFactories.size() > 2 ? "LossyEncoder" : "LosslessEncoder", MPT_USTRING("")) , EncoderIndex(FindEncoder(EncoderName)) , FinalSampleFormat(SampleFormatInt16) , storedTags(conf) Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2014-11-10 13:31:26 UTC (rev 4588) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2014-11-10 14:00:54 UTC (rev 4589) @@ -1664,12 +1664,12 @@ EncoderFactoryBase *encFactory = wsdlg.m_Settings.GetEncoderFactory(); - const std::string extension = encFactory->GetTraits().fileExtension; + const mpt::PathString extension = encFactory->GetTraits().fileExtension; FileDialog dlg = SaveFileDialog() .DefaultExtension(extension) - .DefaultFilename(GetPathNameMpt().GetFileName() + MPT_PATHSTRING(".") + mpt::PathString::FromUTF8(extension)) - .ExtensionFilter(encFactory->GetTraits().fileDescription + " (*." + extension + ")|*." + extension + "||") + .DefaultFilename(GetPathNameMpt().GetFileName() + MPT_PATHSTRING(".") + extension) + .ExtensionFilter(encFactory->GetTraits().fileDescription + MPT_USTRING(" (*.") + extension.ToUnicode() + MPT_USTRING(")|*.") + extension.ToUnicode() + MPT_USTRING("||")) .WorkingDirectory(TrackerDirectories::Instance().GetWorkingDirectory(DIR_EXPORT)); if(!dlg.Show()) return; Modified: trunk/OpenMPT/mptrack/StreamEncoder.cpp =================================================================== --- trunk/OpenMPT/mptrack/StreamEncoder.cpp 2014-11-10 13:31:26 UTC (rev 4588) +++ trunk/OpenMPT/mptrack/StreamEncoder.cpp 2014-11-10 14:00:54 UTC (rev 4589) @@ -28,8 +28,8 @@ } -StreamEncoderSettings::StreamEncoderSettings(SettingsContainer &conf, const std::string §ion) -//----------------------------------------------------------------------------------------------- +StreamEncoderSettings::StreamEncoderSettings(SettingsContainer &conf, const mpt::ustring §ion) +//------------------------------------------------------------------------------------------------ : FLACCompressionLevel(conf, section, "FLACCompressionLevel", 5) , MP3LameQuality(conf, section, "MP3LameQuality", 3) , MP3ACMFast(conf, section, "MP3ACMFast", false) Modified: trunk/OpenMPT/mptrack/StreamEncoder.h =================================================================== --- trunk/OpenMPT/mptrack/StreamEncoder.h 2014-11-10 13:31:26 UTC (rev 4588) +++ trunk/OpenMPT/mptrack/StreamEncoder.h 2014-11-10 14:00:54 UTC (rev 4589) @@ -66,7 +66,7 @@ SampleFormat Sampleformat; int Bitrate; - std::string Description; + mpt::ustring Description; }; enum Mode @@ -85,23 +85,23 @@ { switch(val) { - case Encoder::ModeCBR: return SettingValue("CBR", "Encoder::Mode"); break; - case Encoder::ModeABR: return SettingValue("ABR", "Encoder::Mode"); break; - case Encoder::ModeVBR: return SettingValue("VBR", "Encoder::Mode"); break; - case Encoder::ModeQuality: return SettingValue("Quality", "Encoder::Mode"); break; - case Encoder::ModeEnumerated: return SettingValue("Enumerated", "Encoder::Mode"); break; - default: return SettingValue("Invalid", "Encoder::Mode"); break; + case Encoder::ModeCBR: return SettingValue(MPT_USTRING("CBR"), "Encoder::Mode"); break; + case Encoder::ModeABR: return SettingValue(MPT_USTRING("ABR"), "Encoder::Mode"); break; + case Encoder::ModeVBR: return SettingValue(MPT_USTRING("VBR"), "Encoder::Mode"); break; + case Encoder::ModeQuality: return SettingValue(MPT_USTRING("Quality"), "Encoder::Mode"); break; + case Encoder::ModeEnumerated: return SettingValue(MPT_USTRING("Enumerated"), "Encoder::Mode"); break; + default: return SettingValue(MPT_USTRING("Invalid"), "Encoder::Mode"); break; } } template<> inline Encoder::Mode FromSettingValue(const SettingValue &val) { ASSERT(val.GetTypeTag() == "Encoder::Mode"); - if(val.as<std::string>() == "") { return Encoder::ModeInvalid; } - else if(val.as<std::string>() == "CBR") { return Encoder::ModeCBR; } - else if(val.as<std::string>() == "ABR") { return Encoder::ModeABR; } - else if(val.as<std::string>() == "VBR") { return Encoder::ModeVBR; } - else if(val.as<std::string>() == "Quality") { return Encoder::ModeQuality; } - else if(val.as<std::string>() == "Enumerated") { return Encoder::ModeEnumerated; } + if(val.as<mpt::ustring>() == MPT_USTRING("")) { return Encoder::ModeInvalid; } + else if(val.as<mpt::ustring>() == MPT_USTRING("CBR")) { return Encoder::ModeCBR; } + else if(val.as<mpt::ustring>() == MPT_USTRING("ABR")) { return Encoder::ModeABR; } + else if(val.as<mpt::ustring>() == MPT_USTRING("VBR")) { return Encoder::ModeVBR; } + else if(val.as<mpt::ustring>() == MPT_USTRING("Quality")) { return Encoder::ModeQuality; } + else if(val.as<mpt::ustring>() == MPT_USTRING("Enumerated")) { return Encoder::ModeEnumerated; } else { return Encoder::ModeInvalid; } } @@ -111,15 +111,15 @@ struct Traits { - std::string fileExtension; - std::string fileDescription; - std::string fileShortDescription; - std::string encoderSettingsName; - std::string encoderName; - std::string description; + mpt::PathString fileExtension; + mpt::ustring fileDescription; + mpt::ustring fileShortDescription; + mpt::ustring encoderSettingsName; + mpt::ustring encoderName; + mpt::ustring description; bool canTags; - std::vector<std::string> genres; + std::vector<mpt::ustring> genres; int modesWithFixedGenres; bool canCues; @@ -174,16 +174,16 @@ Setting<int> Format; Setting<int> Dither; - Settings(SettingsContainer &conf, const std::string &encoderName, bool cues, bool tags, uint32 samplerate, uint16 channels, Encoder::Mode mode, int bitrate, float quality, int format, int dither) - : Cues(conf, "Export", encoderName + "_" + "Cues", cues) - , Tags(conf, "Export", encoderName + "_" + "Tags", tags) - , Samplerate(conf, "Export", encoderName + "_" + "Samplerate", samplerate) - , Channels(conf, "Export", encoderName + "_" + "Channels", channels) - , Mode(conf, "Export", encoderName + "_" + "Mode", mode) - , Bitrate(conf, "Export", encoderName + "_" + "Bitrate", bitrate) - , Quality(conf, "Export", encoderName + "_" + "Quality", quality) - , Format(conf, "Export", encoderName + "_" + "Format", format) - , Dither(conf, "Export", encoderName + "_" + "Dither", dither) + Settings(SettingsContainer &conf, const mpt::ustring &encoderName, bool cues, bool tags, uint32 samplerate, uint16 channels, Encoder::Mode mode, int bitrate, float quality, int format, int dither) + : Cues(conf, "Export", encoderName + MPT_USTRING("_") + MPT_USTRING("Cues"), cues) + , Tags(conf, "Export", encoderName + MPT_USTRING("_") + MPT_USTRING("Tags"), tags) + , Samplerate(conf, "Export", encoderName + MPT_USTRING("_") + MPT_USTRING("Samplerate"), samplerate) + , Channels(conf, "Export", encoderName + MPT_USTRING("_") + MPT_USTRING("Channels"), channels) + , Mode(conf, "Export", encoderName + MPT_USTRING("_") + MPT_USTRING("Mode"), mode) + , Bitrate(conf, "Export", encoderName + MPT_USTRING("_") + MPT_USTRING("Bitrate"), bitrate) + , Quality(conf, "Export", encoderName + MPT_USTRING("_") + MPT_USTRING("Quality"), quality) + , Format(conf, "Export", encoderName + MPT_USTRING("_") + MPT_USTRING("Format"), format) + , Dither(conf, "Export", encoderName + MPT_USTRING("_") + MPT_USTRING("Dither"), dither) { return; } @@ -201,7 +201,7 @@ Setting<int32> MP3LameQuality; Setting<bool> MP3ACMFast; Setting<int32> OpusComplexity; - StreamEncoderSettings(SettingsContainer &conf, const std::string §ion); + StreamEncoderSettings(SettingsContainer &conf, const mpt::ustring §ion); static StreamEncoderSettings &Instance(); }; Modified: trunk/OpenMPT/mptrack/StreamEncoderFLAC.cpp =================================================================== --- trunk/OpenMPT/mptrack/StreamEncoderFLAC.cpp 2014-11-10 13:31:26 UTC (rev 4588) +++ trunk/OpenMPT/mptrack/StreamEncoderFLAC.cpp 2014-11-10 14:00:54 UTC (rev 4589) @@ -255,16 +255,16 @@ //------------------------ { Encoder::Traits traits; - traits.fileExtension = "flac"; - traits.fileShortDescription = "FLAC"; - traits.fileDescription = "FLAC"; - traits.encoderSettingsName = "FLAC"; - traits.encoderName = "libFLAC"; - traits.description = ""; - traits.description += mpt::String::Print<std::string>("Free Lossless Audio Codec\n"); - traits.description += mpt::String::Print<std::string>("Vendor: %1\n", FLAC__VENDOR_STRING); - traits.description += mpt::String::Print<std::string>("Version: %1\n", FLAC__VERSION_STRING); - traits.description += mpt::String::Print<std::string>("API: %1.%2.%3\n", FLAC_API_VERSION_CURRENT, FLAC_API_VERSION_REVISION, FLAC_API_VERSION_AGE); + traits.fileExtension = MPT_PATHSTRING("flac"); + traits.fileShortDescription = MPT_USTRING("FLAC"); + traits.fileDescription = MPT_USTRING("FLAC"); + traits.encoderSettingsName = MPT_USTRING("FLAC"); + traits.encoderName = MPT_USTRING("libFLAC"); + traits.description = MPT_USTRING(""); + traits.description += mpt::String::Print(MPT_USTRING("Free Lossless Audio Codec\n")); + traits.description += mpt::String::Print(MPT_USTRING("Vendor: %1\n"), mpt::ToUnicode(mpt::CharsetASCII, FLAC__VENDOR_STRING)); + traits.description += mpt::String::Print(MPT_USTRING("Version: %1\n"), mpt::ToUnicode(mpt::CharsetASCII, FLAC__VERSION_STRING)); + traits.description += mpt::String::Print(MPT_USTRING("API: %1.%2.%3\n"), FLAC_API_VERSION_CURRENT, FLAC_API_VERSION_REVISION, FLAC_API_VERSION_AGE); traits.canTags = true; traits.maxChannels = 4; traits.samplerates = TrackerSettings::Instance().GetSampleRates(); @@ -280,7 +280,7 @@ format.Samplerate = samplerate; format.Channels = channels; format.Sampleformat = (SampleFormat)(bytes * 8); - format.Description = mpt::String::Print("%1 Bit", bytes * 8); + format.Description = mpt::String::Print(MPT_USTRING("%1 Bit"), bytes * 8); format.Bitrate = 0; traits.formats.push_back(format); } Modified: trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp =================================================================== --- trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp 2014-11-10 13:31:26 UTC (rev 4588) +++ trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp 2014-11-10 14:00:54 UTC (rev 4589) @@ -426,7 +426,7 @@ Encoder::Traits &traits = *reinterpret_cast<Encoder::Traits*>(cookie); if(name) { - traits.genres.push_back(name); + traits.genres.push_back(mpt::ToUnicode(mpt::CharsetISO8859_1, name)); } } Encoder::Traits BuildTraits() @@ -436,20 +436,20 @@ { return traits; } - traits.fileExtension = "mp3"; - traits.fileShortDescription = "MP3 (Lame)"; - traits.fileDescription = "MPEG-1/2 Layer 3"; - traits.encoderSettingsName = "MP3Lame"; - traits.encoderName = "libMP3Lame"; - traits.description += "Version: "; - traits.description += (get_lame_version()?get_lame_version():""); - traits.description += "\n"; - traits.description += "Psycho acoustic model version: "; - traits.description += (get_psy_version()?get_psy_version():""); - traits.description += "\n"; - traits.description += "URL: "; - traits.description += (get_lame_url()?get_lame_url():""); - traits.description += "\n"; + traits.fileExtension = MPT_PATHSTRING("mp3"); + traits.fileShortDescription = MPT_USTRING("MP3 (Lame)"); + traits.fileDescription = MPT_USTRING("MPEG-1/2 Layer 3"); + traits.encoderSettingsName = MPT_USTRING("MP3Lame"); + traits.encoderName = MPT_USTRING("libMP3Lame"); + traits.description += MPT_USTRING("Version: "); + traits.description += mpt::ToUnicode(mpt::CharsetASCII, get_lame_version()?get_lame_version():""); + traits.description += MPT_USTRING("\n"); + traits.description += MPT_USTRING("Psycho acoustic model version: "); + traits.description += mpt::ToUnicode(mpt::CharsetASCII, get_psy_version()?get_psy_version():""); + traits.description += MPT_USTRING("\n"); + traits.description += MPT_USTRING("URL: "); + traits.description += mpt::ToUnicode(mpt::CharsetASCII, get_lame_url()?get_lame_url():""); + traits.description += MPT_USTRING("\n"); traits.canTags = true; traits.genres.clear(); id3tag_genre_list(&GenreEnumCallback, &traits); @@ -724,23 +724,23 @@ { return traits; } - traits.fileExtension = "mp3"; - traits.fileShortDescription = std::string("MP3 ") + (lame ? "(Lame_enc)" : "(BladeEnc)"); - traits.fileDescription = "MPEG-1 Layer 3"; - traits.encoderSettingsName = "MP3Blade"; - traits.encoderName = lame ? "Lame_enc.dll" : "BladeEnc.dll"; + traits.fileExtension = MPT_PATHSTRING("mp3"); + traits.fileShortDescription = MPT_USTRING("MP3 ") + (lame ? MPT_USTRING("(Lame_enc)") : MPT_USTRING("(BladeEnc)")); + traits.fileDescription = MPT_USTRING("MPEG-1 Layer 3"); + traits.encoderSettingsName = MPT_USTRING("MP3Blade"); + traits.encoderName = lame ? MPT_USTRING("Lame_enc.dll") : MPT_USTRING("BladeEnc.dll"); BE_VERSION ver; MemsetZero(ver); beVersion(&ver); - traits.description = ""; - traits.description += mpt::String::Print<std::string>("DLL version: %1.%2\n", (int)ver.byDLLMajorVersion, (int)ver.byDLLMinorVersion); - traits.description += mpt::String::Print<std::string>("Engine version: %1.%2 %3-%4-%5\n" + traits.description = MPT_USTRING(""); + traits.description += mpt::String::Print(MPT_USTRING("DLL version: %1.%2\n"), (int)ver.byDLLMajorVersion, (int)ver.byDLLMinorVersion); + traits.description += mpt::String::Print(MPT_USTRING("Engine version: %1.%2 %3-%4-%5\n") , (int)ver.byMajorVersion, (int)ver.byMinorVersion - , mpt::fmt::dec0<4>((int)ver.wYear), mpt::fmt::dec0<2>((int)ver.byMonth), mpt::fmt::dec0<2>((int)ver.byDay) + , mpt::ufmt::dec0<4>((int)ver.wYear), mpt::ufmt::dec0<2>((int)ver.byMonth), mpt::ufmt::dec0<2>((int)ver.byDay) ); std::string url; mpt::String::Copy(url, ver.zHomepage); - traits.description += mpt::String::Print<std::string>("URL: \n", url); + traits.description += mpt::String::Print(MPT_USTRING("URL: %1\n"), mpt::ToUnicode(mpt::CharsetASCII, url)); traits.canTags = true; traits.maxChannels = 2; traits.samplerates = std::vector<uint32>(mpeg1layer3_samplerates, mpeg1layer3_samplerates + CountOf(mpeg1layer3_samplerates));; @@ -1092,7 +1092,7 @@ format.Channels = pafd->pwfx->nChannels; format.Sampleformat = SampleFormatInvalid; format.Bitrate = pafd->pwfx->nAvgBytesPerSec * 8 / 1000; - format.Description = formatName; + format.Description = mpt::ToUnicode(mpt::CharsetLocale, formatName); formats.push_back(format); formats_driverids.push_back(driver); { @@ -1178,21 +1178,21 @@ { return traits; } - traits.fileExtension = "mp3"; - traits.fileShortDescription = "MP3 (ACM)"; - traits.fileDescription = "MPEG Layer 3"; + traits.fileExtension = MPT_PATHSTRING("mp3"); + traits.fileShortDescription = MPT_USTRING("MP3 (ACM)"); + traits.fileDescription = MPT_USTRING("MPEG Layer 3"); DWORD ver = acmGetVersion(); if(ver & 0xffff) { - traits.encoderName = mpt::String::Print<std::string>("%1 %2.%3.%4", "Microsoft Windows ACM", mpt::fmt::hex0<2>((ver>>24)&0xff), mpt::fmt::hex0<2>((ver>>16)&0xff), mpt::fmt::hex0<4>((ver>>0)&0xffff)); + traits.encoderName = mpt::String::Print(MPT_USTRING("%1 %2.%3.%4"), MPT_USTRING("Microsoft Windows ACM"), mpt::ufmt::hex0<2>((ver>>24)&0xff), mpt::ufmt::hex0<2>((ver>>16)&0xff), mpt::ufmt::hex0<4>((ver>>0)&0xffff)); } else { - traits.encoderName = mpt::String::Print<std::string>("%1 %2.%3", "Microsoft Windows ACM", mpt::fmt::hex0<2>((ver>>24)&0xff), mpt::fmt::hex0<2>((ver>>16)&0xff)); + traits.encoderName = mpt::String::Print(MPT_USTRING("%1 %2.%3"), MPT_USTRING("Microsoft Windows ACM"), mpt::ufmt::hex0<2>((ver>>24)&0xff), mpt::ufmt::hex0<2>((ver>>16)&0xff)); } - traits.encoderSettingsName = "MP3ACM"; + traits.encoderSettingsName = MPT_USTRING("MP3ACM"); for(std::set<std::string>::const_iterator i = drivers.begin(); i != drivers.end(); ++i) { - traits.description += (*i); + traits.description += mpt::ToUnicode(mpt::CharsetLocale, (*i)); } traits.canTags = true; traits.maxChannels = 2; Modified: trunk/OpenMPT/mptrack/StreamEncoderOpus.cpp =================================================================== --- trunk/OpenMPT/mptrack/StreamEncoderOpus.cpp 2014-11-10 13:31:26 UTC (rev 4588) +++ trunk/OpenMPT/mptrack/StreamEncoderOpus.cpp 2014-11-10 14:00:54 UTC (rev 4589) @@ -157,14 +157,14 @@ { return traits; } - traits.fileExtension = "opus"; - traits.fileShortDescription = "Opus"; - traits.fileDescription = "Opus"; - traits.encoderSettingsName = "Opus"; - traits.encoderName = "libOpus"; - traits.description += "Version: "; - traits.description += (opus_get_version_string&&opus_get_version_string()?opus_get_version_string():""); - traits.description += "\n"; + traits.fileExtension = MPT_PATHSTRING("opus"); + traits.fileShortDescription = MPT_USTRING("Opus"); + traits.fileDescription = MPT_USTRING("Opus"); + traits.encoderSettingsName = MPT_USTRING("Opus"); + traits.encoderName = MPT_USTRING("libOpus"); + traits.description += MPT_USTRING("Version: "); + traits.description += mpt::ToUnicode(mpt::CharsetASCII, opus_get_version_string && opus_get_version_string() ? opus_get_version_string() : ""); + traits.description += MPT_USTRING("\n"); traits.canTags = true; traits.maxChannels = 4; traits.samplerates = std::vector<uint32>(opus_samplerates, opus_samplerates + CountOf(opus_samplerates)); Modified: trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp =================================================================== --- trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp 2014-11-10 13:31:26 UTC (rev 4588) +++ trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp 2014-11-10 14:00:54 UTC (rev 4589) @@ -173,14 +173,14 @@ { return traits; } - traits.fileExtension = "ogg"; - traits.fileShortDescription = "Vorbis"; - traits.fileDescription = "Ogg Vorbis"; - traits.encoderSettingsName = "Vorbis"; - traits.encoderName = "libVorbis"; - traits.description += "Version: "; - traits.description += (vorbis_version_string&&vorbis_version_string()?vorbis_version_string():"unknown"); - traits.description += "\n"; + traits.fileExtension = MPT_PATHSTRING("ogg"); + traits.fileShortDescription = MPT_USTRING("Vorbis"); + traits.fileDescription = MPT_USTRING("Ogg Vorbis"); + traits.encoderSettingsName = MPT_USTRING("Vorbis"); + traits.encoderName = MPT_USTRING("libVorbis"); + traits.description += MPT_USTRING("Version: "); + traits.description += mpt::ToUnicode(mpt::CharsetASCII, vorbis_version_string&&vorbis_version_string()?vorbis_version_string():"unknown"); + traits.description += MPT_USTRING("\n"); traits.canTags = true; traits.maxChannels = 4; traits.samplerates = std::vector<uint32>(vorbis_samplerates, vorbis_samplerates + CountOf(vorbis_samplerates)); Modified: trunk/OpenMPT/mptrack/StreamEncoderWAV.cpp =================================================================== --- trunk/OpenMPT/mptrack/StreamEncoderWAV.cpp 2014-11-10 13:31:26 UTC (rev 4588) +++ trunk/OpenMPT/mptrack/StreamEncoderWAV.cpp 2014-11-10 14:00:54 UTC (rev 4589) @@ -164,12 +164,12 @@ //---------------------- { Encoder::Traits traits; - traits.fileExtension = "wav"; - traits.fileShortDescription = "Wave"; - traits.fileDescription = "Wave"; - traits.encoderSettingsName = "Wave"; - traits.encoderName = "OpenMPT"; - traits.description = "Microsoft RIFF WAVE"; + traits.fileExtension = MPT_PATHSTRING("wav"); + traits.fileShortDescription = MPT_USTRING("Wave"); + traits.fileDescription = MPT_USTRING("Wave"); + traits.encoderSettingsName = MPT_USTRING("Wave"); + traits.encoderName = MPT_USTRING("OpenMPT"); + traits.description = MPT_USTRING("Microsoft RIFF WAVE"); traits.canTags = true; traits.canCues = true; traits.maxChannels = 4; @@ -188,11 +188,11 @@ if(bytes == 5) { format.Sampleformat = SampleFormatFloat32; - format.Description = "Floating Point"; + format.Description = MPT_USTRING("Floating Point"); } else { format.Sampleformat = (SampleFormat)(bytes * 8); - format.Description = mpt::String::Print("%1 Bit", bytes * 8); + format.Description = mpt::String::Print(MPT_USTRING("%1 Bit"), bytes * 8); } format.Bitrate = 0; traits.formats.push_back(format); Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-11-10 13:31:26 UTC (rev 4588) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-11-10 14:00:54 UTC (rev 4589) @@ -219,7 +219,7 @@ , previewInFileDialogs(conf, "Sample Editor", "PreviewInFileDialogs", false) // Export , ExportDefaultToSoundcardSamplerate(conf, "Export", "DefaultToSoundcardSamplerate", true) - , ExportStreamEncoderSettings(conf, "Export") + , ExportStreamEncoderSettings(conf, MPT_USTRING("Export")) // Components , ComponentsLoadOnStartup(conf, "Components", "LoadOnStartup", ComponentManagerSettingsDefault().LoadOnStartup()) , ComponentsKeepLoaded(conf, "Components", "KeepLoaded", ComponentManagerSettingsDefault().KeepLoaded()) Modified: trunk/OpenMPT/mptrack/mod2wave.h =================================================================== --- trunk/OpenMPT/mptrack/mod2wave.h 2014-11-10 13:31:26 UTC (rev 4588) +++ trunk/OpenMPT/mptrack/mod2wave.h 2014-11-10 14:00:54 UTC (rev 4589) @@ -41,7 +41,7 @@ std::vector<EncoderFactoryBase*> EncoderFactories; std::vector<MPT_SHARED_PTR<Encoder::Settings> > EncoderSettings; - Setting<std::string> EncoderName; + Setting<mpt::ustring> EncoderName; std::size_t EncoderIndex; SampleFormat FinalSampleFormat; @@ -55,7 +55,7 @@ bool Normalize; bool SilencePlugBuffers; - std::size_t FindEncoder(const std::string &name) const; + std::size_t FindEncoder(const mpt::ustring &name) const; void SelectEncoder(std::size_t index); EncoderFactoryBase *GetEncoderFactory() const; const Encoder::Traits *GetTraits() const; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |