MCPcopy Create free account
hub / github.com/TASEmulators/fceux / wavRecordAsStart

Method wavRecordAsStart

src/drivers/Qt/ConsoleWindow.cpp:4178–4278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4176}
4177
4178void 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 )

Callers

nothing calls this directly

Calls 10

FCEUI_WaveRecordRunningFunction · 0.85
FCEUI_GetBaseDirectoryFunction · 0.85
getFileBaseNameFunction · 0.85
FCEUI_BeginWaveRecordFunction · 0.85
getOptionMethod · 0.80
setOptionMethod · 0.80
execMethod · 0.80
getRomFileFunction · 0.70
trFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected