| 4176 | } |
| 4177 | |
| 4178 | void consoleWin_t::wavRecordAsStart(void) |
| 4179 | { |
| 4180 | if ( FCEUI_WaveRecordRunning() ) |
| 4181 | { |
| 4182 | return; |
| 4183 | } |
| 4184 | int ret, useNativeFileDialogVal; |
| 4185 | QString filename; |
| 4186 | std::string lastPath; |
| 4187 | const char *base, *rom; |
| 4188 | QFileDialog dialog(this, tr("Save WAV Movie for Recording") ); |
| 4189 | QList<QUrl> urls; |
| 4190 | QDir d; |
| 4191 | |
| 4192 | dialog.setFileMode(QFileDialog::AnyFile); |
| 4193 | |
| 4194 | dialog.setNameFilter(tr("WAV Movies (*.wav) ;; All files (*)")); |
| 4195 | |
| 4196 | dialog.setViewMode(QFileDialog::List); |
| 4197 | dialog.setFilter( QDir::AllEntries | QDir::AllDirs | QDir::Hidden ); |
| 4198 | dialog.setLabelText( QFileDialog::Accept, tr("Save") ); |
| 4199 | |
| 4200 | base = FCEUI_GetBaseDirectory(); |
| 4201 | |
| 4202 | urls << QUrl::fromLocalFile( QDir::rootPath() ); |
| 4203 | urls << QUrl::fromLocalFile(QStandardPaths::standardLocations(QStandardPaths::HomeLocation).first()); |
| 4204 | urls << QUrl::fromLocalFile(QStandardPaths::standardLocations(QStandardPaths::DesktopLocation).first()); |
| 4205 | urls << QUrl::fromLocalFile(QStandardPaths::standardLocations(QStandardPaths::DownloadLocation).first()); |
| 4206 | |
| 4207 | if ( base ) |
| 4208 | { |
| 4209 | urls << QUrl::fromLocalFile( QDir( base ).absolutePath() ); |
| 4210 | |
| 4211 | d.setPath( QString(base) + "/wav"); |
| 4212 | |
| 4213 | if ( d.exists() ) |
| 4214 | { |
| 4215 | urls << QUrl::fromLocalFile( d.absolutePath() ); |
| 4216 | } |
| 4217 | |
| 4218 | dialog.setDirectory( d.absolutePath() ); |
| 4219 | } |
| 4220 | dialog.setDefaultSuffix( tr(".wav") ); |
| 4221 | |
| 4222 | g_config->getOption ("SDL.WavFilePath", &lastPath); |
| 4223 | if ( lastPath.size() > 0 ) |
| 4224 | { |
| 4225 | dialog.setDirectory( QString::fromStdString(lastPath) ); |
| 4226 | } |
| 4227 | |
| 4228 | rom = getRomFile(); |
| 4229 | |
| 4230 | if ( rom ) |
| 4231 | { |
| 4232 | char baseName[512]; |
| 4233 | getFileBaseName( rom, baseName ); |
| 4234 | |
| 4235 | if ( baseName[0] != 0 ) |
nothing calls this directly
no test coverage detected