Successful test of fully integrated avi recording in Qt GUI.
This commit is contained in:
parent
4a498d20af
commit
6283dc4687
|
@ -24,6 +24,7 @@
|
|||
|
||||
static gwavi_t *gwavi = NULL;
|
||||
static bool recordEnable = false;
|
||||
static bool recordAudio = true;
|
||||
static int vbufHead = 0;
|
||||
static int vbufTail = 0;
|
||||
static int vbufSize = 0;
|
||||
|
@ -585,6 +586,10 @@ int aviRecordAddAudioFrame( int32_t *buf, int numSamples )
|
|||
{
|
||||
return -1;
|
||||
}
|
||||
if ( !recordAudio )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (int i=0; i<numSamples; i++)
|
||||
{
|
||||
|
@ -621,6 +626,16 @@ int aviRecordClose(void)
|
|||
return 0;
|
||||
}
|
||||
//**************************************************************************************
|
||||
bool aviGetAudioEnable(void)
|
||||
{
|
||||
return recordAudio;
|
||||
}
|
||||
//**************************************************************************************
|
||||
void aviSetAudioEnable(bool val)
|
||||
{
|
||||
recordAudio = val;
|
||||
}
|
||||
//**************************************************************************************
|
||||
bool aviRecordRunning(void)
|
||||
{
|
||||
return recordEnable;
|
||||
|
@ -655,7 +670,9 @@ int aviGetSelVideoFormat(void)
|
|||
void aviSetSelVideoFormat(int idx)
|
||||
{
|
||||
videoFormat = idx;
|
||||
printf("AVI Video Format Changed:%i\n", videoFormat );
|
||||
//printf("AVI Video Format Changed:%i\n", videoFormat );
|
||||
|
||||
g_config->setOption("SDL.AviVideoFormat", videoFormat);
|
||||
}
|
||||
//**************************************************************************************
|
||||
int FCEUD_AviGetFormatOpts( std::vector <std::string> &formatList )
|
||||
|
@ -802,7 +819,7 @@ void AviRecordDiskThread_t::run(void)
|
|||
|
||||
numPixelsReady = 0;
|
||||
|
||||
if ( writeAudio )
|
||||
if ( writeAudio && recordAudio )
|
||||
{
|
||||
numSamples = 0;
|
||||
|
||||
|
|
|
@ -34,6 +34,10 @@ int aviRecordClose(void);
|
|||
|
||||
bool aviRecordRunning(void);
|
||||
|
||||
bool aviGetAudioEnable(void);
|
||||
|
||||
void aviSetAudioEnable(bool val);
|
||||
|
||||
int aviGetSelVideoFormat(void);
|
||||
|
||||
void aviSetSelVideoFormat(int idx);
|
||||
|
|
|
@ -1487,6 +1487,7 @@ void consoleWin_t::createMainMenu(void)
|
|||
|
||||
aviMenu->addAction(stopAviAct);
|
||||
|
||||
// Movie -> Avi Recording -> Video Format
|
||||
subMenu = aviMenu->addMenu( tr("Video Format") );
|
||||
|
||||
{
|
||||
|
@ -1512,8 +1513,16 @@ void consoleWin_t::createMainMenu(void)
|
|||
// Use Lambda Function to set callback
|
||||
connect( act, &QAction::triggered, [ this, i ] { aviVideoFormatChanged( i ); } );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Movie -> Avi Recording -> Include Audio
|
||||
act = new QAction(tr("Include Audio"), this);
|
||||
act->setCheckable(true);
|
||||
act->setChecked( aviGetAudioEnable() );
|
||||
connect(act, SIGNAL(triggered(bool)), this, SLOT(aviAudioEnableChange(bool)) );
|
||||
aviMenu->addAction(act);
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
// Help
|
||||
helpMenu = menubar->addMenu(tr("&Help"));
|
||||
|
@ -3252,6 +3261,13 @@ void consoleWin_t::aviRecordStop(void)
|
|||
}
|
||||
}
|
||||
|
||||
void consoleWin_t::aviAudioEnableChange(bool checked)
|
||||
{
|
||||
aviSetAudioEnable( checked );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void consoleWin_t::aviVideoFormatChanged(int idx)
|
||||
{
|
||||
aviSetSelVideoFormat(idx);
|
||||
|
@ -3516,6 +3532,7 @@ void consoleWin_t::updatePeriodic(void)
|
|||
quickSaveAct->setEnabled( FCEU_IsValidUI( FCEUI_QUICKSAVE ) );
|
||||
loadStateAct->setEnabled( FCEU_IsValidUI( FCEUI_LOADSTATE ) );
|
||||
saveStateAct->setEnabled( FCEU_IsValidUI( FCEUI_SAVESTATE ) );
|
||||
openMovAct->setEnabled( FCEU_IsValidUI( FCEUI_PLAYMOVIE ) );
|
||||
recMovAct->setEnabled( FCEU_IsValidUI( FCEUI_RECORDMOVIE ) );
|
||||
recAsMovAct->setEnabled( FCEU_IsValidUI( FCEUI_RECORDMOVIE ) );
|
||||
recAviAct->setEnabled( FCEU_IsValidUI( FCEUI_RECORDMOVIE ) );
|
||||
|
|
|
@ -365,6 +365,7 @@ class consoleWin_t : public QMainWindow
|
|||
void aviRecordStart(void);
|
||||
void aviRecordAsStart(void);
|
||||
void aviRecordStop(void);
|
||||
void aviAudioEnableChange(bool);
|
||||
void aviVideoFormatChanged(int idx);
|
||||
|
||||
};
|
||||
|
|
|
@ -521,6 +521,7 @@ InitConfig()
|
|||
config->addOption("pauseframe", "SDL.PauseFrame", 0);
|
||||
config->addOption("recordhud", "SDL.RecordHUD", 1);
|
||||
config->addOption("moviemsg", "SDL.MovieMsg", 1);
|
||||
config->addOption("SDL.AviVideoFormat", 0);
|
||||
|
||||
// Hex Editor Options
|
||||
config->addOption("hexEditBgColor", "SDL.HexEditBgColor", "#000000");
|
||||
|
|
|
@ -581,7 +581,7 @@ static void ShowUsage(const char *prog)
|
|||
|
||||
int fceuWrapperInit( int argc, char *argv[] )
|
||||
{
|
||||
int error;
|
||||
int opt, error;
|
||||
std::string s;
|
||||
|
||||
for (int i=0; i<argc; i++)
|
||||
|
@ -710,6 +710,9 @@ int fceuWrapperInit( int argc, char *argv[] )
|
|||
else
|
||||
FCEUI_SetAviDisableMovieMessages(false);
|
||||
|
||||
g_config->getOption("SDL.AviVideoFormat", &opt);
|
||||
aviSetSelVideoFormat(opt);
|
||||
|
||||
// check for a .fm2 file to rip the subtitles
|
||||
g_config->getOption("SDL.RipSubs", &s);
|
||||
g_config->setOption("SDL.RipSubs", "");
|
||||
|
|
Loading…
Reference in New Issue