Example #1
0
bool VGMColl::OnSaveAllDLS() {
  wstring dirpath = pRoot->UI_GetSaveDirPath();
  if (dirpath.length() != 0) {
    DLSFile dlsfile;
    wstring filepath = dirpath + L"\\" + ConvertToSafeFileName(this->name) + L".dls";
    if (CreateDLSFile(dlsfile)) {
      if (!dlsfile.SaveDLSFile(filepath))
        pRoot->AddLogItem(new LogItem(std::wstring(L"Failed to save DLS file"), LOG_LEVEL_ERR, L"VGMColl"));
    }
    else
      pRoot->AddLogItem(new LogItem(std::wstring(L"Failed to save DLS file"), LOG_LEVEL_ERR, L"VGMColl"));

    if (this->seq != nullptr) {
      filepath = dirpath + L"\\" + ConvertToSafeFileName(this->name) + L".mid";
      if (!this->seq->SaveAsMidi(filepath))
        pRoot->AddLogItem(new LogItem(std::wstring(L"Failed to save MIDI file"), LOG_LEVEL_ERR, L"VGMColl"));
    }
  }
  return true;
}
Example #2
0
bool VGMColl::OnSaveAllDLS()
{
	wstring dirpath = pRoot->UI_GetSaveDirPath();
	if (dirpath.length() != 0)
	{
		DLSFile dlsfile;
		wstring filepath = dirpath + L"\\" + ConvertToSafeFileName(this->name) + L".dls";
		if (CreateDLSFile(dlsfile))
		{
			if (!dlsfile.SaveDLSFile(filepath))
				Alert(L"Failed to save DLS file.");
		}
		else
			Alert(L"Failed to save DLS file.");

		filepath = dirpath + L"\\" + ConvertToSafeFileName(this->name) + L".mid";
		if (!this->seq->SaveAsMidi(filepath))
			Alert(L"Failed to save MIDI file.");
	}
	return true;
}