Eliminate uses of c_str made unnecessary by changed to wxString::Format in wx 2.9

Originally committed to SVN as r5612.
This commit is contained in:
Thomas Goyne 2011-09-28 19:43:48 +00:00
parent d990bbbb99
commit cc147d1660
32 changed files with 81 additions and 81 deletions

View file

@ -185,7 +185,7 @@ wxArrayInt AegisubLocale::GetAvailableLanguages() {
// If the locale file doesn't exist then don't list it as an option.
wxString locDir = wxStandardPaths::Get().GetLocalizedResourcesDir(langs[i], wxStandardPathsBase::ResourceCat_Messages);
wxFileName file(wxString::Format("%s/%s.mo", locDir.c_str(), GETTEXT_PACKAGE));
wxFileName file(wxString::Format("%s/%s.mo", locDir, GETTEXT_PACKAGE));
if (lang && file.FileExists()) final.Add(lang->Language);
}
#endif

View file

@ -220,13 +220,13 @@ wxString AssDialogue::GetData(bool ssa) const {
wxString str = wxString::Format(
"%s: %s,%s,%s,%s,%s,%d,%d,%d,%s,%s",
Comment ? "Comment" : "Dialogue",
ssa ? "Marked=0" : wxString::Format("%01d", Layer).c_str(),
Start.GetASSFormated().c_str(),
End.GetASSFormated().c_str(),
s.c_str(), a.c_str(),
ssa ? "Marked=0" : wxString::Format("%01d", Layer),
Start.GetASSFormated(),
End.GetASSFormated(),
s, a,
Margin[0], Margin[1], Margin[2],
e.c_str(),
Text.c_str());
e,
Text);
// Make sure that final has no line breaks
str.Replace("\n", "");

View file

@ -97,7 +97,7 @@ void AssExporter::AddFilter(wxString name) {
}
// Check
if (!filter) throw wxString::Format("Filter not found: %s", name.c_str());
if (!filter) throw wxString::Format("Filter not found: %s", name);
// Add to list
Filters.push_back(filter);
@ -177,5 +177,5 @@ wxString AssExporter::GetDescription(wxString name) {
return (*cur)->GetDescription();
}
}
throw wxString::Format("Filter not found: %s", name.c_str());
throw wxString::Format("Filter not found: %s", name);
}

View file

@ -116,7 +116,7 @@ void AssFile::Load(const wxString &_filename,wxString charset,bool addToRecent)
// Real exception
catch (agi::Exception &e) {
wxMessageBox(wxString(e.GetChainedMessage().c_str(), wxConvUTF8), "Error loading file", wxICON_ERROR|wxOK);
wxMessageBox(lagi_wxString(e.GetChainedMessage()), "Error loading file", wxICON_ERROR|wxOK);
return;
}

View file

@ -340,7 +340,7 @@ std::vector<wxString> tokenize(const wxString &text) {
else if (c == ')') {
parDepth--;
if (parDepth < 0) {
wxLogWarning("Unmatched parenthesis near '%s'!\nTag-parsing incomplete.", text.SubString(i, 10).c_str());
wxLogWarning("Unmatched parenthesis near '%s'!\nTag-parsing incomplete.", text.SubString(i, 10));
return paramList;
}
else if (parDepth == 0) {

View file

@ -429,11 +429,11 @@ void AssStyle::UpdateData() {
final = wxString::Format("Style: %s,%s,%g,%s,%s,%s,%s,%d,%d,%d,%d,%g,%g,%g,%g,%d,%g,%g,%i,%i,%i,%i,%i",
name.c_str(), font.c_str(), fontsize,
primary.GetASSFormatted(true,false,true).c_str(),
secondary.GetASSFormatted(true,false,true).c_str(),
outline.GetASSFormatted(true,false,true).c_str(),
shadow.GetASSFormatted(true,false,true).c_str(),
name, font, fontsize,
primary.GetASSFormatted(true,false,true),
secondary.GetASSFormatted(true,false,true),
outline.GetASSFormatted(true,false,true),
shadow.GetASSFormatted(true,false,true),
(bold? -1 : 0), (italic ? -1 : 0),
(underline?-1:0),(strikeout?-1:0),
scalex,scaley,spacing,angle,
@ -491,10 +491,10 @@ wxString AssStyle::GetSSAText() const {
f.Replace(",", ";");
output = wxString::Format("Style: %s,%s,%g,%s,%s,0,%s,%d,%d,%d,%g,%g,%d,%d,%d,%d,0,%i",
n.c_str(), f.c_str(), fontsize,
primary.GetSSAFormatted().c_str(),
secondary.GetSSAFormatted().c_str(),
shadow.GetSSAFormatted().c_str(),
n, f, fontsize,
primary.GetSSAFormatted(),
secondary.GetSSAFormatted(),
shadow.GetSSAFormatted(),
(bold? -1 : 0), (italic ? -1 : 0),
borderstyle,outline_w,shadow_w,align,
Margin[0],Margin[1],Margin[2],encoding);

View file

@ -165,7 +165,7 @@ wxString HDAudioProvider::DiskCacheName() {
// Try from 00 to 99
for (int i=0;i<100;i++) {
// File exists?
wxString curStringTry = DiskCachePath() + wxString::Format(pattern.c_str(),i);
wxString curStringTry = DiskCachePath() + wxString::Format(pattern,i);
if (!wxFile::Exists(curStringTry)) return curStringTry;
}
return "";

View file

@ -104,7 +104,7 @@ namespace Automation4 {
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf.lfQuality = ANTIALIASED_QUALITY;
lf.lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE;
_tcsncpy(lf.lfFaceName, style->font.c_str(), 32);
wcsncpy(lf.lfFaceName, style->font.wc_str(), 32);
HFONT thefont = CreateFontIndirect(&lf);
if (!thefont) return false;
@ -311,7 +311,7 @@ namespace Automation4 {
///
wxString FeatureFilter::GetScriptSettingsIdentifier()
{
return inline_string_encode(wxString::Format("Automation Settings %s", GetName().c_str()));
return inline_string_encode(wxString::Format("Automation Settings %s", GetName()));
}
@ -899,11 +899,11 @@ namespace Automation4 {
}
catch (const char *e) {
error_count++;
wxLogError("Error loading Automation script: %s\n%s", fn.c_str(), e);
wxLogError("Error loading Automation script: %s\n%s", fn, e);
}
catch (...) {
error_count++;
wxLogError("Error loading Automation script: %s\nUnknown error.", fn.c_str());
wxLogError("Error loading Automation script: %s\nUnknown error.", fn);
}
more = dir.GetNext(&fn);
}
@ -991,7 +991,7 @@ namespace Automation4 {
Script *s = (*i)->Produce(filename);
if (s) {
if (!s->GetLoadedState() && log_errors) {
wxLogError(_("An Automation script failed to load. File name: '%s', error reported:"), filename.c_str());
wxLogError(_("An Automation script failed to load. File name: '%s', error reported:"), filename);
wxLogError(s->GetDescription());
}
return s;
@ -1004,7 +1004,7 @@ namespace Automation4 {
}
}
if (log_errors) {
wxLogWarning(_("The file was not recognised as an Automation script: %s"), filename.c_str());
wxLogWarning(_("The file was not recognised as an Automation script: %s"), filename);
}
return new UnknownScript(filename);
}

View file

@ -756,7 +756,7 @@ namespace Automation4 {
bool result;
if (err) {
wxString errmsg(lua_tostring(L, -1), wxConvUTF8);
wxLogWarning("Runtime error in Lua macro validation function:\n%s", errmsg.c_str());
wxLogWarning("Runtime error in Lua macro validation function:\n%s", errmsg);
result = false;
} else {
result = !!lua_toboolean(L, -1);
@ -948,7 +948,7 @@ namespace Automation4 {
int err = lua_pcall(L, 2, 1, 0);
if (err) {
wxString errmsg(lua_tostring(L, -1), wxConvUTF8);
wxLogWarning("Runtime error in Lua macro validation function:\n%s", errmsg.c_str());
wxLogWarning("Runtime error in Lua macro validation function:\n%s", errmsg);
lua_pop(L, 1); // remove error message
return config_dialog = 0;
} else {

View file

@ -342,7 +342,7 @@ namespace Automation4 {
} else if (lclass == "info") {
GETSTRING(key, "key", "info")
GETSTRING(value, "value", "info")
result = new AssEntry(wxString::Format("%s: %s", key.c_str(), value.c_str()));
result = new AssEntry(wxString::Format("%s: %s", key, value));
result->group = "[Script Info]"; // just so it can be read correctly back
} else if (lclass == "format") {

View file

@ -138,7 +138,7 @@ namespace Automation4 {
}
lua_pop(L, 1);
LOG_D("automation/lua/dialog") << "created control: '" << name.c_str() << "', (" << x << "," << y << ")(" << width << "," << height << ", "<< hint.c_str();
LOG_D("automation/lua/dialog") << "created control: '" << STD_STR(name) << "', (" << x << "," << y << ")(" << width << "," << height << ", "<< STD_STR(hint);
}
@ -1007,7 +1007,7 @@ badcontrol:
if (buttons.size() > 0) {
LOG_D("automation/lua/dialog") << "creating user buttons";
for (size_t i = 0; i < buttons.size(); ++i) {
LOG_D("automation/lua/dialog") << "button '" << buttons[i].c_str() << "' gets id " << 1001+(wxWindowID)i;
LOG_D("automation/lua/dialog") << "button '" << STD_STR(buttons[i]) << "' gets id " << 1001+(wxWindowID)i;
bs->Add(new wxButton(w, 1001+(wxWindowID)i, buttons[i]));
}
@ -1054,7 +1054,7 @@ badcontrol:
LOG_D("automation/lua/dialog") << "default buttons, button 1 bushed, Ok button";
lua_pushboolean(L, 1);
} else {
LOG_D("automation/lua/dialog") << "user button: " << buttons.at(btn-1).c_str();
LOG_D("automation/lua/dialog") << "user button: " << STD_STR(buttons.at(btn-1));
// button_pushed is index+1 to reserve 0 for Cancel
lua_pushstring(L, buttons.at(btn-1).mb_str(wxConvUTF8));
}
@ -1090,7 +1090,7 @@ badcontrol:
if (controls[i]->CanSerialiseValue()) {
wxString sn = inline_string_encode(controls[i]->name);
wxString sv = controls[i]->SerialiseValue();
res += wxString::Format("%s:%s|", sn.c_str(), sv.c_str());
res += wxString::Format("%s:%s|", sn, sv);
}
}

View file

@ -80,7 +80,7 @@ struct am_manager : public Command {
} catch (const char *e) {
wxLogError(e);
} catch (...) {
wxLogError("An unknown error occurred reloading Automation script '%s'.", scripts[i]->GetName().c_str());
wxLogError("An unknown error occurred reloading Automation script '%s'.", scripts[i]->GetName());
}
}

View file

@ -100,7 +100,7 @@ struct help_files : public Command {
void operator()(agi::Context *c) {
#ifdef __WXMAC__
char *shared_path = agi::util::OSX_GetBundleSharedSupportDirectory();
wxString help_path = wxString::Format("%s/doc", wxString(shared_path, wxConvUTF8).c_str());
wxString help_path = wxString::Format("%s/doc", wxString(shared_path, wxConvUTF8));
agi::util::OSX_OpenLocation(help_path.c_str());
free(shared_path);
#endif

View file

@ -215,7 +215,7 @@ void DialogAutomation::OnAdd(wxCommandEvent &evt)
const Automation4::ScriptFactory *fact = factories[i];
if (fact->GetEngineName().IsEmpty() || fact->GetFilenamePattern().IsEmpty())
continue;
fnfilter = wxString::Format("%s%s scripts (%s)|%s|", fnfilter.c_str(), fact->GetEngineName().c_str(), fact->GetFilenamePattern().c_str(), fact->GetFilenamePattern().c_str());
fnfilter = wxString::Format("%s%s scripts (%s)|%s|", fnfilter, fact->GetEngineName(), fact->GetFilenamePattern(), fact->GetFilenamePattern());
catchall << fact->GetFilenamePattern() << ";";
}
#ifdef __WINDOWS__
@ -323,16 +323,16 @@ void DialogAutomation::OnInfo(wxCommandEvent &evt)
info += _("Scripting engines installed:\n");
const std::vector<Automation4::ScriptFactory*> &factories = Automation4::ScriptFactory::GetFactories();
for (std::vector<Automation4::ScriptFactory*>::const_iterator c = factories.begin(); c != factories.end(); ++c) {
info += wxString::Format("- %s (%s)\n", (*c)->GetEngineName().c_str(), (*c)->GetFilenamePattern().c_str());
info += wxString::Format("- %s (%s)\n", (*c)->GetEngineName(), (*c)->GetFilenamePattern());
}
if (ei) {
info += wxString::Format(_("\nScript info:\nName: %s\nDescription: %s\nAuthor: %s\nVersion: %s\nFull path: %s\nState: %s\n\nFeatures provided by script:\n"),
ei->script->GetName().c_str(),
ei->script->GetDescription().c_str(),
ei->script->GetAuthor().c_str(),
ei->script->GetVersion().c_str(),
ei->script->GetFilename().c_str(),
ei->script->GetName(),
ei->script->GetDescription(),
ei->script->GetAuthor(),
ei->script->GetVersion(),
ei->script->GetFilename(),
ei->script->GetLoadedState() ? _("Correctly loaded") : _("Failed to load"));
for (std::vector<Automation4::Feature*>::iterator f = ei->script->GetFeatures().begin(); f != ei->script->GetFeatures().end(); ++f) {
switch ((*f)->GetClass()) {

View file

@ -536,7 +536,7 @@ bool FontsCollectorThread::ProcessFont(wxString name) {
int action = collector->CollectAction->GetSelection();
// Font name
AppendText(wxString::Format(_T("\"%s\"... "),name.c_str()));
AppendText(wxString::Format("\"%s\"... ", name));
// Get font list
wxArrayString files = FontFileLister::GetFilesWithFace(name);
@ -565,14 +565,14 @@ bool FontsCollectorThread::ProcessFont(wxString name) {
}
if (tempResult == 1) {
AppendText(wxString::Format(_("* Copied %s.\n"),files[i].c_str()),1);
AppendText(wxString::Format(_("* Copied %s.\n"),files[i]),1);
}
else if (tempResult == 2) {
wxFileName fn(files[i]);
AppendText(wxString::Format(_("* %s already exists on destination.\n"),fn.GetFullName().c_str()),3);
AppendText(wxString::Format(_("* %s already exists on destination.\n"),fn.GetFullName()),3);
}
else {
AppendText(wxString::Format(_("* Failed to copy %s.\n"),files[i].c_str()),2);
AppendText(wxString::Format(_("* Failed to copy %s.\n"),files[i]),2);
result = false;
}
}
@ -662,9 +662,9 @@ void FontsCollectorThread::AddFont(wxString fontname,int mode) {
if (fonts.Index(fontname) == wxNOT_FOUND) {
fonts.Add(fontname);
if (mode == 0) AppendText(wxString::Format(_("\"%s\" found on style \"%s\".\n"), fontname.c_str(), curStyle->name.c_str()));
else if (mode == 1) AppendText(wxString::Format(_("\"%s\" found on dialogue line \"%d\".\n"), fontname.c_str(), curLine));
else AppendText(wxString::Format(_("\"%s\" found.\n"), fontname.c_str()));
if (mode == 0) AppendText(wxString::Format(_("\"%s\" found on style \"%s\".\n"), fontname, curStyle->name));
else if (mode == 1) AppendText(wxString::Format(_("\"%s\" found on dialogue line \"%d\".\n"), fontname, curLine));
else AppendText(wxString::Format(_("\"%s\" found.\n"), fontname));
}
}

View file

@ -510,7 +510,7 @@ wxString KaraokeLineMatchDisplay::GetOutputLine()
for (size_t i = 0; i < matched_groups.size(); ++i)
{
MatchGroup &match = matched_groups[i];
res = wxString::Format("%s{\\k%d}%s", res.c_str(), match.duration, match.dst.c_str());
res = wxString::Format("%s{\\k%d}%s", res, match.duration, match.dst);
}
return res;

View file

@ -435,7 +435,7 @@ void DialogStyleManager::OnCatalogNew (wxCommandEvent &) {
// Warn about bad characters
if (badchars_removed > 0) {
wxMessageBox(wxString::Format(_("The specified catalog name contains one or more illegal characters. They have been replaced with underscores instead.\nThe catalog has been renamed to \"%s\"."), name.c_str()),_("Invalid characters"));
wxMessageBox(wxString::Format(_("The specified catalog name contains one or more illegal characters. They have been replaced with underscores instead.\nThe catalog has been renamed to \"%s\"."), name),_("Invalid characters"));
}
// Add to list of storages
@ -462,7 +462,7 @@ void DialogStyleManager::OnCatalogDelete (wxCommandEvent &) {
int sel = CatalogList->GetSelection();
if (sel != wxNOT_FOUND) {
wxString name = CatalogList->GetString(sel);
wxString message = wxString::Format(_("Are you sure you want to delete the storage \"%s\" from the catalog?"), name.c_str());
wxString message = wxString::Format(_("Are you sure you want to delete the storage \"%s\" from the catalog?"), name);
int option = wxMessageBox(message, _("Confirm delete"), wxYES_NO | wxICON_EXCLAMATION , this);
if (option == wxYES) {
wxRemoveFile(StandardPaths::DecodePath("?user/catalog/" + name + ".sty"));
@ -543,7 +543,7 @@ void DialogStyleManager::OnCopyToStorage (wxCommandEvent &) {
for (list<AssStyle *>::iterator style = Store.style.begin(); style != Store.style.end(); ++style) {
if ((*style)->name.CmpNoCase(styleName) == 0) {
addStyle = false;
if (wxYES == wxMessageBox(wxString::Format("There is already a style with the name \"%s\" on the current storage. Proceed and overwrite anyway?",styleName.c_str()), "Style name collision.", wxYES_NO)) {
if (wxYES == wxMessageBox(wxString::Format("There is already a style with the name \"%s\" on the current storage. Proceed and overwrite anyway?",styleName), "Style name collision.", wxYES_NO)) {
**style = *styleMap.at(selections[i]);
copied.push_back(styleName);
}
@ -578,7 +578,7 @@ void DialogStyleManager::OnCopyToCurrent (wxCommandEvent &) {
for (std::vector<AssStyle *>::iterator style = styleMap.begin(); style != styleMap.end(); ++style) {
if ((*style)->name.CmpNoCase(styleName) == 0) {
addStyle = false;
if (wxYES == wxMessageBox(wxString::Format("There is already a style with the name \"%s\" on the current script. Proceed and overwrite anyway?",styleName.c_str()), "Style name collision.", wxYES_NO)) {
if (wxYES == wxMessageBox(wxString::Format("There is already a style with the name \"%s\" on the current script. Proceed and overwrite anyway?",styleName), "Style name collision.", wxYES_NO)) {
**style = *styleStorageMap.at(selections[i]);
copied.push_back(styleName);
}
@ -879,7 +879,7 @@ void DialogStyleManager::OnCurrentImport(wxCommandEvent &) {
// Check if there is already a style with that name
int test = CurrentList->FindString(styles[selections[i]], false);
if (test != wxNOT_FOUND) {
int answer = wxMessageBox(wxString::Format("There is already a style with the name \"%s\" on the current script. Overwrite?",styles[selections[i]].c_str()),"Style name collision.",wxYES_NO);
int answer = wxMessageBox(wxString::Format("There is already a style with the name \"%s\" on the current script. Overwrite?",styles[selections[i]]),"Style name collision.",wxYES_NO);
if (answer == wxYES) {
// Overwrite
modified = true;

View file

@ -342,7 +342,7 @@ void AegisubVersionCheckerThread::DoCheck()
GetSVNRevision(),
GetIsOfficialRelease()?1:0,
GetOSShortName(),
GetSystemLanguage().c_str());
GetSystemLanguage());
wxString path = base_updates_path + querystring;

View file

@ -159,12 +159,12 @@ int FFmpegSourceProvider::AskForTrackSelection(const std::map<int,wxString> &Tra
TypeName = _("audio");
for (std::map<int,wxString>::const_iterator i = TrackList.begin(); i != TrackList.end(); i++) {
Choices.Add(wxString::Format(_("Track %02d: %s"), i->first, i->second.c_str()));
Choices.Add(wxString::Format(_("Track %02d: %s"), i->first, i->second));
TrackNumbers.push_back(i->first);
}
int Choice = wxGetSingleChoiceIndex(wxString::Format(_("Multiple %s tracks detected, please choose the one you wish to load:"), TypeName.c_str()),
wxString::Format(_("Choose %s track"), TypeName.c_str()), Choices);
int Choice = wxGetSingleChoiceIndex(wxString::Format(_("Multiple %s tracks detected, please choose the one you wish to load:"), TypeName),
wxString::Format(_("Choose %s track"), TypeName), Choices);
if (Choice < 0)
return Choice;
@ -301,7 +301,7 @@ wxThread::ExitCode FFmpegSourceCacheCleaner::Entry() {
wxString cachedirname = StandardPaths::DecodePath("?user/ffms2cache/");
wxDir cachedir;
if (!cachedir.Open(cachedirname)) {
LOG_D("provider/ffmpegsource/cache") << "couldn't open cache directory " << cachedirname.c_str();
LOG_D("provider/ffmpegsource/cache") << "couldn't open cache directory " << STD_STR(cachedirname);
return (wxThread::ExitCode)1;
}
@ -360,7 +360,7 @@ wxThread::ExitCode FFmpegSourceCacheCleaner::Entry() {
int64_t fsize = i->second.GetSize().GetValue();
if (!wxRemoveFile(i->second.GetFullPath())) {
LOG_D("provider/ffmpegsource/cache") << "failed to remove file " << i->second.GetFullPath().c_str();
LOG_D("provider/ffmpegsource/cache") << "failed to remove file " << STD_STR(i->second.GetFullPath());
continue;
}
cursize -= fsize;

View file

@ -752,7 +752,7 @@ void FrameMain::OnSubtitlesOpen() {
basepath = "";
} else {
wxLogWarning("Automation Script referenced with unknown location specifier character.\nLocation specifier found: %s\nFilename specified: %s",
sfnamel.c_str(), sfnames.c_str());
sfnamel, sfnames);
continue;
}
wxFileName sfname(sfnames);
@ -762,7 +762,7 @@ void FrameMain::OnSubtitlesOpen() {
context->local_scripts->Add(Automation4::ScriptFactory::CreateFromFile(sfnames, true));
} else {
wxLogWarning("Automation Script referenced could not be found.\nFilename specified: %s%s\nSearched relative to: %s\nResolved filename: %s",
sfnamel.c_str(), sfnames.c_str(), basepath.c_str(), sfname.GetFullPath().c_str());
sfnamel, sfnames, basepath, sfname.GetFullPath());
}
}
#endif

View file

@ -99,7 +99,7 @@ void HelpButton::OpenPage(const wxString pageID) {
docsPath.Replace("\\","/");
docsPath = "/" + docsPath;
#endif
wxString path = wxString::Format("file://%s/%s.html",docsPath.c_str(),page.c_str());
wxString path = wxString::Format("file://%s/%s.html",docsPath,page);
wxLaunchDefaultBrowser(path);
}
}

View file

@ -378,7 +378,7 @@ static void UnhandledExeception(bool stackWalk) {
#endif
// Inform user of crash.
wxMessageBox(wxString::Format(exception_message, filename.c_str()), _("Program error"), wxOK | wxICON_ERROR, NULL);
wxMessageBox(wxString::Format(exception_message, filename), _("Program error"), wxOK | wxICON_ERROR, NULL);
}
else if (LastStartupState) {
#if wxUSE_STACKWALKER == 1

View file

@ -88,7 +88,7 @@ void MatroskaWrapper::Open(wxString filename,bool parse) {
// Failed parsing
if (!file) {
delete input;
throw wxString("MatroskaParser error: " + wxString(err,wxConvUTF8)).c_str();
throw wxString("MatroskaParser error: " + wxString(err,wxConvUTF8));
}
// Parse

View file

@ -820,7 +820,7 @@ void SubsTextEditCtrl::OnContextMenu(wxContextMenuEvent &event) {
// Build list
wxMenu *subMenu = new wxMenu();
for (int i=0;i<nSugs;i++) subMenu->Append(EDIT_MENU_SUGGESTIONS+i,sugs[i]);
menu.Append(-1,wxString::Format(_("Spell checker suggestions for \"%s\""),currentWord.c_str()), subMenu);
menu.Append(-1,wxString::Format(_("Spell checker suggestions for \"%s\""),currentWord), subMenu);
}
}

View file

@ -291,7 +291,7 @@ SubtitleFormat::FPSRational SubtitleFormat::AskForFPS(bool showSMPTE) {
wxString vidFPS;
if (context->FPS().IsVFR()) vidFPS = "VFR";
else vidFPS = wxString::Format("%.3f",context->FPS().FPS());
choices.Add(wxString::Format("From video (%s)",vidFPS.c_str()));
choices.Add(wxString::Format("From video (%s)",vidFPS));
}
// Standard FPS values

View file

@ -105,7 +105,7 @@ void EncoreSubtitleFormat::WriteFile(wxString _filename,wxString encoding) {
AssDialogue *current = dynamic_cast<AssDialogue*>(*cur);
if (current && !current->Comment) {
++i;
file.WriteLineToFile(wxString::Format("%i %s %s %s", i, ft.FromAssTime(current->Start).c_str(), ft.FromAssTime(current->End).c_str(), current->Text.c_str()));
file.WriteLineToFile(wxString::Format("%i %s %s %s", i, ft.FromAssTime(current->Start), ft.FromAssTime(current->End), current->Text));
}
}

View file

@ -174,7 +174,7 @@ void MicroDVDSubtitleFormat::WriteFile(wxString filename,wxString encoding) {
int start = rate->FrameAtTime(current->Start.GetMS(),agi::vfr::START);
int end = rate->FrameAtTime(current->End.GetMS(),agi::vfr::END);
file.WriteLineToFile(wxString::Format("{%i}{%i}%s",start,end,current->Text.c_str()));
file.WriteLineToFile(wxString::Format("{%i}{%i}%s",start,end,current->Text));
}
}

View file

@ -57,7 +57,7 @@ TextFileWriter::TextFileWriter(wxString const& filename, wxString encoding)
, conv() {
if (encoding.empty()) encoding = lagi_wxString(OPT_GET("App/Save Charset")->GetString());
if (encoding.Lower() != wxSTRING_ENCODING)
conv.reset(new agi::charset::IconvWrapper(wxSTRING_ENCODING, encoding.c_str(), true));
conv.reset(new agi::charset::IconvWrapper(wxSTRING_ENCODING, encoding.utf8_str(), true));
// Write the BOM
try {

View file

@ -437,7 +437,7 @@ void RestartAegisub() {
char *bundle_path = agi::util::OSX_GetBundlePath();
char *support_path = agi::util::OSX_GetBundleSupportFilesDirectory();
if (!bundle_path || !support_path) return; // oops
wxString exec = wxString::Format("\"%s/MacOS/restart-helper\" /usr/bin/open -n \"%s\"'", wxString(support_path, wxConvUTF8).c_str(), wxString(bundle_path, wxConvUTF8).c_str());
wxString exec = wxString::Format("\"%s/MacOS/restart-helper\" /usr/bin/open -n \"%s\"'", wxString(support_path, wxConvUTF8), wxString(bundle_path, wxConvUTF8));
LOG_I("util/restart/exec") << exec;
wxExecute(exec);
free(bundle_path);

View file

@ -535,7 +535,7 @@ void VideoContext::LoadTimecodes(wxString filename) {
config::mru->Remove("Timecodes", STD_STR(filename));
}
catch (const agi::vfr::Error& e) {
wxLogError("Timecode file parse error: %s", e.GetMessage().c_str());
wxLogError("Timecode file parse error: %s", e.GetMessage());
}
}
void VideoContext::SaveTimecodes(wxString filename) {
@ -571,12 +571,12 @@ void VideoContext::OnVideoError(VideoProviderErrorEvent const& err) {
wxLogError(
"Failed seeking video. The video file may be corrupt or incomplete.\n"
"Error message reported: %s",
lagi_wxString(err.GetMessage()).c_str());
lagi_wxString(err.GetMessage()));
}
void VideoContext::OnSubtitlesError(SubtitlesProviderErrorEvent const& err) {
wxLogError(
"Failed rendering subtitles. Error message reported: %s",
lagi_wxString(err.GetMessage()).c_str());
lagi_wxString(err.GetMessage()));
}
void VideoContext::OnExit() {

View file

@ -191,14 +191,14 @@ void VideoDisplay::UploadFrameData(FrameReadyEvent &evt) {
"Failed to initialize video display. Closing other running "
"programs and updating your video card drivers may fix this.\n"
"Error message reported: %s",
err.GetMessage().c_str());
err.GetMessage());
con->videoController->Reset();
}
catch (const VideoOutRenderException& err) {
wxLogError(
"Could not upload video frame to graphics card.\n"
"Error message reported: %s",
err.GetMessage().c_str());
err.GetMessage());
}
Render();
}
@ -258,14 +258,14 @@ catch (const VideoOutException &err) {
wxLogError(
"An error occurred trying to render the video frame on the screen.\n"
"Error message reported: %s",
err.GetMessage().c_str());
err.GetMessage());
con->videoController->Reset();
}
catch (const OpenGlException &err) {
wxLogError(
"An error occurred trying to render visual overlays on the screen.\n"
"Error message reported: %s",
err.GetMessage().c_str());
err.GetMessage());
con->videoController->Reset();
}
catch (const char *err) {

View file

@ -255,7 +255,7 @@ void YUV4MPEGVideoProvider::ParseFileHeader(const std::vector<wxString>& tags) {
throw VideoOpenError("ParseFileHeader: invalid or unknown interlacing mode");
}
else
LOG_D("provider/video/yuv4mpeg") << "Unparsed tag: " << tags[i].c_str();
LOG_D("provider/video/yuv4mpeg") << "Unparsed tag: " << STD_STR(tags[i]);
}
// The point of all this is to allow multiple YUV4MPEG2 headers in a single file