Commit adbadc5e authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#2165] Implement call recording using the Recordable interface

parent 8fbbe7e4
......@@ -36,18 +36,11 @@ Call::Call (const CallID& id, Call::CallType type)
, _peerNumber()
{
FILE_TYPE fileType = FILE_WAV;
SOUND_FORMAT soundFormat = INT16;
recAudio.setRecordingOption (fileType,soundFormat,44100, Manager::instance().getConfigString (AUDIO, RECORD_PATH),id);
}
Call::~Call()
{
if (recAudio.isOpenFile()) {
recAudio.closeFile();
}
}
void
......
......@@ -235,6 +235,9 @@ class Call: public Recordable{
*/
void initRecFileName();
std::string getRecFileId(){ return getPeerName(); }
protected:
/** Protect every attribute that can be changed by two threads */
ost::Mutex _callMutex;
......
......@@ -43,6 +43,8 @@ Conference::Conference()
_nbParticipant = 0;
_id = conf.append(s);
}
......
......@@ -20,6 +20,7 @@
#define CONFERENCE_H
#include <set>
#include <string>
#include "audio/recordable.h"
#include "call.h"
......@@ -61,6 +62,8 @@ class Conference: public Recordable{
ParticipantSet getParticipantList();
std::string getRecFileId(){ return getConfID(); }
private:
/** Unique ID of the conference */
......
......@@ -639,8 +639,6 @@ ManagerImpl::offHoldCall (const CallID& call_id)
}
if ( participToConference(call_id) ) {
_debug("????????????????????????? Particip to conference ????????????????????????????");
AccountID currentAccountId;
Call* call = NULL;
......@@ -2658,19 +2656,32 @@ ManagerImpl::setVolumeControls (void)
void
ManagerImpl::setRecordingCall (const CallID& id)
{
/*
_debug ("ManagerImpl::setRecording()! \n");
AccountID accountid = getAccountFromCall (id);
getAccountLink (accountid)->setRecording (id);
*/
AccountID accountid = getAccountFromCall (id);
Recordable* rec = (Recordable*)getAccountLink (accountid)->getCall(id);
rec->setRecording();
}
bool
ManagerImpl::isRecording (const CallID& id)
{
/*
_debug ("ManagerImpl::isRecording()! \n");
AccountID accountid = getAccountFromCall (id);
return getAccountLink (accountid)->isRecording (id);
*/
AccountID accountid = getAccountFromCall (id);
Recordable* rec = (Recordable*)getAccountLink (accountid)->getCall(id);
rec->isRecording();
}
void
......
......@@ -68,7 +68,7 @@ void AudioRecord::setSndSamplingRate (int smplRate)
sndSmplRate_ = smplRate;
}
void AudioRecord::setRecordingOption (FILE_TYPE type, SOUND_FORMAT format, int sndSmplRate, std::string path, std::string id)
void AudioRecord::setRecordingOption (FILE_TYPE type, SOUND_FORMAT format, int sndSmplRate, std::string path)
{
......@@ -76,7 +76,6 @@ void AudioRecord::setRecordingOption (FILE_TYPE type, SOUND_FORMAT format, int s
sndFormat_ = format;
channels_ = 1;
sndSmplRate_ = sndSmplRate;
call_id_ = id;
savePath_ = path + "/";
......
......@@ -45,7 +45,7 @@ public:
void setSndSamplingRate(int smplRate);
void setRecordingOption(FILE_TYPE type, SOUND_FORMAT format, int sndSmplRate, std::string path, std::string id);
void setRecordingOption(FILE_TYPE type, SOUND_FORMAT format, int sndSmplRate, std::string path);
void initFileName( std::string peerNumber );
......@@ -226,11 +226,6 @@ protected:
* Path for this recording
*/
std::string savePath_;
/**
* Path for this recordingId for this call
*/
std::string call_id_;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment