Pass frame size to recorder

This commit is contained in:
Peter L Jones 2020-04-10 17:51:37 +01:00
parent 3831e83535
commit a80b437858
3 changed files with 8 additions and 3 deletions

View file

@ -295,7 +295,8 @@ QMap<QString, QList<STrackItem>> CJamSession::TracksFromSessionDir(const QString
* @brief CJamRecorder::Init Create recording directory, if necessary, and connect signal handlers
* @param server Server object emiting signals
*/
void CJamRecorder::Init(const CServer* server)
void CJamRecorder::Init( const CServer* server,
const int _iServerFrameSizeSamples )
{
QFileInfo fi(recordBaseDir.absolutePath());
fi.setCaching(false);
@ -325,6 +326,8 @@ void CJamRecorder::Init(const CServer* server)
QObject::connect((const QObject *)server, SIGNAL ( AudioFrame(const int, const QString, const CHostAddress, const int, const CVector<int16_t>) ),
this, SLOT( OnFrame(const int, const QString, const CHostAddress, const int, const CVector<int16_t>) ),
Qt::ConnectionType::QueuedConnection);
iServerFrameSizeSamples = _iServerFrameSizeSamples;
}
/**

View file

@ -139,7 +139,8 @@ class CJamRecorder : public QThread
public:
CJamRecorder(const QString recordingDirName) :
recordBaseDir (recordingDirName), isRecording (false) {}
void Init(const CServer* server);
void Init( const CServer* server, const int _iServerFrameSizeSamples );
static void SessionDirToReaper(QString& strSessionDirName);
@ -170,6 +171,7 @@ private:
bool isRecording;
CJamSession* currentSession;
int iServerFrameSizeSamples;
};
}

View file

@ -397,7 +397,7 @@ CServer::CServer ( const int iNewMaxNumChan,
// Enable jam recording (if requested)
if ( bEnableRecording )
{
JamRecorder.Init ( this );
JamRecorder.Init ( this, iServerFrameSizeSamples );
JamRecorder.start();
}