2018-07-31 Fred Gleason <fredg@paravelsystems.com>

* Modified logging in caed(8) to use 'RDConfig::log()' method.
This commit is contained in:
Fred Gleason 2018-07-31 13:09:03 -04:00
parent 26c29e1d4e
commit 949b3f903c
6 changed files with 130 additions and 158 deletions

View File

@ -17289,3 +17289,5 @@
* Refactored rmlsend(1) to handle UTF-8 strings correctly.
2018-07-31 Fred Gleason <fredg@paravelsystems.com>
* Refactored 'RDMacro' to handle UTF-8 strings correctly.
2018-07-31 Fred Gleason <fredg@paravelsystems.com>
* Modified logging in caed(8) to use 'RDConfig::log()' method.

View File

@ -77,35 +77,6 @@ void src_float_to_int_array (const float *in, int *out, int len)
}
#endif // HAVE_SRC_CONV
void LogLine(RDConfig::LogPriority prio,const QString &line)
{
FILE *file;
rd_config->log("caed",prio,line);
if(rd_config->caeLogfile().isEmpty()) {
return;
}
QDateTime current=QDateTime::currentDateTime();
file=fopen(rd_config->caeLogfile(),"a");
if(file==NULL) {
return;
}
chmod(rd_config->caeLogfile(),S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH);
fprintf(file,"%02d/%02d/%4d - %02d:%02d:%02d.%03d : %s\n",
current.date().month(),
current.date().day(),
current.date().year(),
current.time().hour(),
current.time().minute(),
current.time().second(),
current.time().msec(),
(const char *)line);
fclose(file);
}
void SigHandler(int signum)
{
@ -140,8 +111,8 @@ MainObject::MainObject(QObject *parent,const char *name)
// Make sure we're the only instance running
//
if(CheckDaemon(RD_CAED_PID)) {
LogLine(RDConfig::LogErr,
"ERROR caed aborting - multiple instances not allowed");
rd_config->log("caed",RDConfig::LogErr,
"ERROR caed aborting - multiple instances not allowed");
exit(1);
}
@ -202,7 +173,8 @@ MainObject::MainObject(QObject *parent,const char *name)
server=new CaeSocket(CAED_TCP_PORT,0,this,"socket");
if(!server->ok()) {
LogLine(RDConfig::LogErr,"ERROR caed aborting - CaeSocket() server not ok");
rd_config->log("caed",RDConfig::LogErr,
"ERROR caed aborting - CaeSocket() server not ok");
exit(1);
}
connect(server,SIGNAL(connection(int)),this,SLOT(newConnection(int)));
@ -216,7 +188,7 @@ MainObject::MainObject(QObject *parent,const char *name)
signal(SIGTERM,SigHandler);
if(!RDWritePid(RD_PID_DIR,"caed.pid",rd_config->uid())) {
LogLine(RDConfig::LogErr,"can't write pid file");
rd_config->log("caed",RDConfig::LogErr,"can't write pid file");
fprintf(stderr,"caed: can't write pid file\n");
exit(1);
}
@ -231,7 +203,7 @@ MainObject::MainObject(QObject *parent,const char *name)
//
QSqlDatabase *db=QSqlDatabase::addDatabase(rd_config->mysqlDriver());
if(!db) {
LogLine(RDConfig::LogErr,"can't open mySQL database");
rd_config->log("caed",RDConfig::LogErr,"can't open mySQL database");
fprintf(stderr,"caed: can't open mySQL database");
exit(1);
}
@ -240,7 +212,7 @@ MainObject::MainObject(QObject *parent,const char *name)
db->setPassword(rd_config->mysqlPassword());
db->setHostName(rd_config->mysqlHostname());
if(!db->open()) {
LogLine(RDConfig::LogErr,"unable to connect to mySQL Server");
rd_config->log("caed",RDConfig::LogErr,"unable to connect to mySQL Server");
printf("caed: unable to connect to mySQL Server");
db->removeDatabase(rd_config->mysqlDbname());
exit(1);
@ -358,11 +330,11 @@ MainObject::MainObject(QObject *parent,const char *name)
}
mlockall(MCL_CURRENT|MCL_FUTURE);
if (result){
LogLine(RDConfig::LogWarning,QString().
rd_config->log("caed",RDConfig::LogWarning,QString().
sprintf("Unable to set realtime scheduling: %s",
strerror (result)));
} else {
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("using realtime scheduling, priority=%d",
sched_params.sched_priority));
}
@ -384,9 +356,9 @@ MainObject::MainObject(QObject *parent,const char *name)
}
*/
if(rd_config->enableMixerLogging()) {
LogLine(RDConfig::LogNotice,"mixer logging enabled");
rd_config->log("caed",RDConfig::LogNotice,"mixer logging enabled");
}
LogLine(RDConfig::LogInfo,"cae started");
rd_config->log("caed",RDConfig::LogInfo,"cae started");
}
@ -402,7 +374,7 @@ void MainObject::newConnection(int fd)
i++;
}
if(i==CAE_MAX_CONNECTIONS) { // Table full, drop it on the floor
LogLine(RDConfig::LogErr,"connection refused due to full socket table");
rd_config->log("caed",RDConfig::LogErr,"connection refused due to full socket table");
close(fd);
return;
}
@ -490,7 +462,7 @@ void MainObject::updateMeters()
alsaFree();
hpiFree();
RDDeletePid(RD_PID_DIR,"caed.pid");
LogLine(RDConfig::LogInfo,"cae exiting");
rd_config->log("caed",RDConfig::LogInfo,"cae exiting");
exit(0);
}
@ -687,7 +659,7 @@ void MainObject::ParseCommand(int ch)
while((c=socket[ch]->readBlock(buf,256))>0) {
buf[c]=0;
// LogLine(QString().sprintf("RCVD: %s",buf));
// rd_config->log("caed",QString().sprintf("RCVD: %s",buf));
for(int i=0;i<c;i++) {
if(buf[i]==' ') {
if(argnum[ch]<CAE_MAX_ARGS) {
@ -815,7 +787,7 @@ void MainObject::DispatchCommand(int ch)
if(!hpiLoadPlayback(card,wavename,&new_stream)) {
sprintf(temp,"LP %d %s -1 -1 -!",card,args[ch][2]);
EchoCommand(ch,temp);
LogLine(RDConfig::LogErr,
rd_config->log("caed",RDConfig::LogErr,
QString().sprintf("unable to allocate stream for card %d",
card));
return;
@ -826,7 +798,7 @@ void MainObject::DispatchCommand(int ch)
if(!alsaLoadPlayback(card,wavename,&new_stream)) {
sprintf(temp,"LP %d %s -1 -1 -!",card,args[ch][2]);
EchoCommand(ch,temp);
LogLine(RDConfig::LogErr,QString().
rd_config->log("caed",RDConfig::LogErr,QString().
sprintf("unable to allocate stream for card %d",
card));
return;
@ -837,7 +809,7 @@ void MainObject::DispatchCommand(int ch)
if(!jackLoadPlayback(card,wavename,&new_stream)) {
sprintf(temp,"LP %d %s -1 -1 -!",card,args[ch][2]);
EchoCommand(ch,temp);
LogLine(RDConfig::LogErr,QString().
rd_config->log("caed",RDConfig::LogErr,QString().
sprintf("unable to allocate stream for card %d",
card));
return;
@ -850,7 +822,7 @@ void MainObject::DispatchCommand(int ch)
return;
}
if((handle=GetHandle(card,new_stream))>=0) {
LogLine(RDConfig::LogErr,QString().
rd_config->log("caed",RDConfig::LogErr,QString().
sprintf("*** clearing stale stream assignment, card=%d stream=%d ***",card,new_stream));
play_handle[handle].card=-1;
play_handle[handle].stream=-1;
@ -861,7 +833,7 @@ void MainObject::DispatchCommand(int ch)
play_handle[handle].stream=new_stream;
play_handle[handle].owner=ch;
play_owner[card][new_stream]=ch;
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("LoadPlayback Card: %d Stream: %d Name: %s Handle: %d",
card,new_stream,(const char *)wavename,handle));
sprintf(temp,"LP %d %s %d %d +!",card,args[ch][2],new_stream,handle);
@ -881,7 +853,7 @@ void MainObject::DispatchCommand(int ch)
case RDStation::Hpi:
if(hpiUnloadPlayback(card,stream)) {
play_owner[card][stream]=-1;
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("UnloadPlayback - Card: %d Stream: %d Handle: %d",
card,stream,handle));
EchoArgs(ch,'+');
@ -894,7 +866,7 @@ void MainObject::DispatchCommand(int ch)
case RDStation::Alsa:
if(alsaUnloadPlayback(card,stream)) {
play_owner[card][stream]=-1;
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("UnloadPlayback - Card: %d Stream: %d Handle: %d",
card,stream,handle));
EchoArgs(ch,'+');
@ -907,7 +879,7 @@ void MainObject::DispatchCommand(int ch)
case RDStation::Jack:
if(jackUnloadPlayback(card,stream)) {
play_owner[card][stream]=-1;
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("UnloadPlayback - Card: %d Stream: %d Handle: %d",
card,stream,handle));
EchoArgs(ch,'+');
@ -946,13 +918,13 @@ void MainObject::DispatchCommand(int ch)
switch(cae_driver[card]) {
case RDStation::Hpi:
if(hpiPlaybackPosition(card,stream,pos)) {
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("PlaybackPosition - Card: %d Stream: %d Pos: %d Handle: %d",
card,stream,pos,handle));
EchoArgs(ch,'+');
}
else {
LogLine(RDConfig::LogNotice,QString().
rd_config->log("caed",RDConfig::LogNotice,QString().
sprintf("*** PlaybackPosition out of bounds - Card: %d Stream: %d Pos: %d Handle: %d***",
card,stream,pos,handle));
EchoArgs(ch,'-');
@ -961,7 +933,7 @@ void MainObject::DispatchCommand(int ch)
case RDStation::Alsa:
if(alsaPlaybackPosition(card,stream,pos)) {
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("PlaybackPosition - Card: %d Stream: %d Pos: %d Handle: %d",
card,stream,pos,handle));
EchoArgs(ch,'+');
@ -973,7 +945,7 @@ void MainObject::DispatchCommand(int ch)
case RDStation::Jack:
if(jackPlaybackPosition(card,stream,pos)) {
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("PlaybackPosition - Card: %d Stream: %d Pos: %d Handle: %d",
card,stream,pos,handle));
EchoArgs(ch,'+');
@ -1056,7 +1028,7 @@ void MainObject::DispatchCommand(int ch)
EchoArgs(ch,'-');
return;
}
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("Play - Card: %d Stream: %d Handle: %d Length: %d Speed: %d Pitch: %d",
card,stream,handle,play_length[card][stream],
play_speed[card][stream],flag));
@ -1101,7 +1073,7 @@ void MainObject::DispatchCommand(int ch)
EchoArgs(ch,'-');
return;
}
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("StopPlayback - Card: %d Stream: %d Handle: %d",
card,stream,handle));
// EchoArgs(ch,'+');
@ -1196,7 +1168,7 @@ void MainObject::DispatchCommand(int ch)
EchoArgs(ch,'-');
return;
}
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("LoadRecord - Card: %d Stream: %d Coding: %d Chans: %d SampRate: %d BitRate: %d Name: %s",
card,stream,coding,channels,sample_rate,bit_rate,
(const char *)wavename));
@ -1243,7 +1215,7 @@ void MainObject::DispatchCommand(int ch)
return;
}
record_owner[card][stream]=-1;
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("UnloadRecord - Card: %d Stream: %d, Length: %u",
card,stream,len));
EchoCommand(ch,(const char *)QString().sprintf("UR %d %d %u +!",
@ -1300,7 +1272,7 @@ void MainObject::DispatchCommand(int ch)
EchoArgs(ch,'-');
return;
}
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("Record - Card: %d Stream: %d Length: %d Thres: %d",
card,stream,record_length[card][stream],
record_threshold[card][stream]));
@ -1344,7 +1316,7 @@ void MainObject::DispatchCommand(int ch)
EchoArgs(ch,'-');
return;
}
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("StopRecord - Card: %d Stream: %d",
card,stream));
return;
@ -1367,7 +1339,7 @@ void MainObject::DispatchCommand(int ch)
return;
}
if(rd_config->enableMixerLogging()) {
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("SetClockSource - Card: %d Source: %d",card,stream));
}
EchoArgs(ch,'+');
@ -1404,7 +1376,7 @@ void MainObject::DispatchCommand(int ch)
return;
}
if(rd_config->enableMixerLogging()) {
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("SetInputVolume - Card: %d Stream: %d Level: %d",
card,stream,level));
}
@ -1446,7 +1418,7 @@ void MainObject::DispatchCommand(int ch)
return;
}
if(rd_config->enableMixerLogging()) {
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("SetOutputVolume - Card: %d Stream: %d Port: %d Level: %d",
card,stream,port,level));
}
@ -1489,7 +1461,7 @@ void MainObject::DispatchCommand(int ch)
return;
}
if(rd_config->enableMixerLogging()) {
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("FadeOutputVolume - Card: %d Stream: %d Port: %d Level: %d Length: %d",
card,stream,port,level,length));
}
@ -1531,7 +1503,7 @@ void MainObject::DispatchCommand(int ch)
return;
}
if(rd_config->enableMixerLogging()) {
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("SetInputLevel - Card: %d Port: %d Level: %d",
card,port,level));
}
@ -1573,7 +1545,7 @@ void MainObject::DispatchCommand(int ch)
return;
}
if(rd_config->enableMixerLogging()) {
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("SetOutputLevel - Card: %d Port: %d Level: %d",
card,port,level));
}
@ -1615,7 +1587,7 @@ void MainObject::DispatchCommand(int ch)
return;
}
if(rd_config->enableMixerLogging()) {
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("SetInputMode - Card: %d Port: %d Mode: %d",
card,port,mode));
}
@ -1657,7 +1629,7 @@ void MainObject::DispatchCommand(int ch)
return;
}
if(rd_config->enableMixerLogging()) {
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("SetOutputMode - Card: %d Port: %d Mode: %d",
card,port,mode));
}
@ -1698,7 +1670,7 @@ void MainObject::DispatchCommand(int ch)
return;
}
if(rd_config->enableMixerLogging()) {
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("SetInputVOXLevel - Card: %d Stream: %d Level: %d",
card,stream,level));
}
@ -1740,7 +1712,7 @@ void MainObject::DispatchCommand(int ch)
return;
}
if(rd_config->enableMixerLogging()) {
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("SetInputType - Card: %d Port: %d Type: %d",
card,port,type));
}
@ -1783,7 +1755,7 @@ void MainObject::DispatchCommand(int ch)
return;
}
if(rd_config->enableMixerLogging()) {
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("SetPassthroughLevel - Card: %d InPort: %d OutPort: %d Level: %d",
card,in_port,out_port,level));
}
@ -1917,7 +1889,7 @@ void MainObject::KillSocket(int ch)
break;
default:
LogLine(RDConfig::LogNotice,"tried to kill unowned socket!");
rd_config->log("caed",RDConfig::LogNotice,"tried to kill unowned socket!");
break;
}
record_length[i][j]=0;
@ -2140,7 +2112,7 @@ void MainObject::ClearDriverEntries(RDStation *station)
/* This is an overloaded virtual function to tell a session manager not to restart this daemon. */
void QApplication::saveState(QSessionManager &sm) {
sm.setRestartHint(QSessionManager::RestartNever);
LogLine(RDConfig::LogDebug,"cae saveState(), set restart hint to Never");
rd_config->log("caed",RDConfig::LogDebug,"cae saveState(), set restart hint to Never");
return;
};
@ -2170,7 +2142,7 @@ bool MainObject::LoadTwoLame()
{
#ifdef HAVE_TWOLAME
if((twolame_handle=dlopen("libtwolame.so.0",RTLD_NOW))==NULL) {
LogLine(RDConfig::LogInfo,
rd_config->log("caed",RDConfig::LogInfo,
"TwoLAME encoder library not found, MPEG L2 encoding not supported");
return false;
}
@ -2195,11 +2167,11 @@ bool MainObject::LoadTwoLame()
dlsym(twolame_handle,"twolame_encode_flush");
*(void **)(&twolame_set_energy_levels)=
dlsym(twolame_handle,"twolame_set_energy_levels");
LogLine(RDConfig::LogInfo,
rd_config->log("caed",RDConfig::LogInfo,
"Found TwoLAME encoder library, MPEG L2 encoding supported");
return true;
#else
LogLine(RDConfig::LogInfo,"MPEG L2 encoding not enabled");
rd_config->log("caed",RDConfig::LogInfo,"MPEG L2 encoding not enabled");
return false;
#endif // HAVE_TWOLAME
}
@ -2221,7 +2193,7 @@ bool MainObject::InitTwoLameEncoder(int card,int stream,int chans,int samprate,
break;
}
if((twolame_lameopts[card][stream]=twolame_init())==NULL) {
LogLine(RDConfig::LogErr,QString().sprintf("unable to initialize twolame instance, card=%d, stream=%d",card,stream));
rd_config->log("caed",RDConfig::LogErr,QString().sprintf("unable to initialize twolame instance, card=%d, stream=%d",card,stream));
return false;
}
twolame_set_mode(twolame_lameopts[card][stream],mpeg_mode);
@ -2231,7 +2203,7 @@ bool MainObject::InitTwoLameEncoder(int card,int stream,int chans,int samprate,
twolame_set_bitrate(twolame_lameopts[card][stream],bitrate/1000);
twolame_set_energy_levels(twolame_lameopts[card][stream],1);
if(twolame_init_params(twolame_lameopts[card][stream])!=0) {
LogLine(RDConfig::LogErr,QString().sprintf("invalid twolame parameters, card=%d, stream=%d, chans=%d, samprate=%d bitrate=%d",
rd_config->log("caed",RDConfig::LogErr,QString().sprintf("invalid twolame parameters, card=%d, stream=%d, chans=%d, samprate=%d bitrate=%d",
card,stream,chans,samprate,bitrate));
return false;
}
@ -2257,7 +2229,7 @@ bool MainObject::LoadMad()
{
#ifdef HAVE_MAD
if((mad_handle=dlopen("libmad.so.0",RTLD_NOW))==NULL) {
LogLine(RDConfig::LogInfo,
rd_config->log("caed",RDConfig::LogInfo,
"MAD decoder library not found, MPEG L2 decoding not supported");
return false;
}
@ -2277,11 +2249,11 @@ bool MainObject::LoadMad()
dlsym(mad_handle,"mad_frame_finish");
*(void **)(&mad_stream_finish)=
dlsym(mad_handle,"mad_stream_finish");
LogLine(RDConfig::LogInfo,
rd_config->log("caed",RDConfig::LogInfo,
"Found MAD decoder library, MPEG L2 decoding supported");
return true;
#else
LogLine(RDConfig::LogInfo,"MPEG L2 decoding not enabled");
rd_config->log("caed",RDConfig::LogInfo,"MPEG L2 decoding not enabled");
return false;
#endif // HAVE_MAD
}
@ -2397,6 +2369,6 @@ int main(int argc,char *argv[])
QApplication a(argc,argv,false);
new MainObject(NULL,"main");
rc=a.exec();
LogLine(RDConfig::LogDebug,QString().sprintf("cae post a.exec() rc:%d", rc));
rd_config->log("caed",RDConfig::LogDebug,QString().sprintf("cae post a.exec() rc:%d", rc));
return rc;
}

View File

@ -98,7 +98,6 @@ void src_float_to_int_array (const float *in, int *out, int len);
//
// Function Prototypes
//
void LogLine(RDConfig::LogPriority prio,const QString &line);
void SigHandler(int signum);
extern RDConfig *rd_config;

View File

@ -76,7 +76,7 @@ void AlsaCapture2Callback(struct alsa_format *alsa_format)
(!alsa_format->exiting))||(s<0)) {
snd_pcm_drop (alsa_format->pcm);
snd_pcm_prepare(alsa_format->pcm);
LogLine(RDConfig::LogNotice,QString().
rd_config->log("caed",RDConfig::LogNotice,QString().
sprintf("****** ALSA Capture Xrun - Card: %d ******",
alsa_format->card));
}
@ -532,11 +532,11 @@ void AlsaPlay2Callback(struct alsa_format *alsa_format)
int s=snd_pcm_writei(alsa_format->pcm,alsa_format->card_buffer,n);
if(s!=n) {
if(s<0) {
LogLine(RDConfig::LogNotice,
rd_config->log("caed",RDConfig::LogNotice,
QString().sprintf("*** alsa error %d: %s",-s,snd_strerror(s)));
}
else {
LogLine(RDConfig::LogNotice,
rd_config->log("caed",RDConfig::LogNotice,
QString().sprintf("period size mismatch - wrote %d\n",s));
}
}
@ -544,7 +544,7 @@ void AlsaPlay2Callback(struct alsa_format *alsa_format)
(!alsa_format->exiting)) {
snd_pcm_drop (alsa_format->pcm);
snd_pcm_prepare(alsa_format->pcm);
LogLine(RDConfig::LogNotice,QString().
rd_config->log("caed",RDConfig::LogNotice,QString().
sprintf("****** ALSA Playout Xrun - Card: %d ******",
alsa_format->card));
}
@ -610,7 +610,7 @@ void MainObject::AlsaInitCallback()
void MainObject::alsaStopTimerData(int cardstream)
{
LogLine(RDConfig::LogErr,QString().sprintf("alsaStopTimerData(%d)",cardstream));
rd_config->log("caed",RDConfig::LogErr,QString().sprintf("alsaStopTimerData(%d)",cardstream));
#ifdef ALSA
int card=cardstream/RD_MAX_STREAMS;
int stream=cardstream-card*RD_MAX_STREAMS;
@ -643,7 +643,7 @@ void MainObject::alsaFadeTimerData(int cardstream)
alsa_fade_timer[card][stream]->stop();
}
}
LogLine(RDConfig::LogDebug,QString().sprintf("FadeLevel: %d",level));
rd_config->log("caed",RDConfig::LogDebug,QString().sprintf("FadeLevel: %d",level));
alsaSetOutputVolume(card,stream,alsa_fade_port[card][stream],level);
#endif // ALSA
}
@ -763,7 +763,7 @@ void MainObject::alsaInit(RDStation *station)
if(cae_driver[i]==RDStation::Alsa) {
station->setCardDriver(i,RDStation::Alsa);
if(snd_ctl_open(&snd_ctl,dev,0)<0) {
LogLine(RDConfig::LogNotice,QString().
rd_config->log("caed",RDConfig::LogNotice,QString().
sprintf("no control device found for %s",
(const char *)dev));
station->
@ -823,7 +823,7 @@ bool MainObject::alsaLoadPlayback(int card,QString wavename,int *stream)
{
#ifdef ALSA
if(alsa_play_format[card].exiting||((*stream=GetAlsaOutputStream(card))<0)) {
LogLine(RDConfig::LogErr,QString().sprintf(
rd_config->log("caed",RDConfig::LogErr,QString().sprintf(
"Error: alsaLoadPlayback(%s) GetAlsaOutputStream():%d < 0",
(const char *) wavename,
*stream) );
@ -831,7 +831,7 @@ bool MainObject::alsaLoadPlayback(int card,QString wavename,int *stream)
}
alsa_play_wave[card][*stream]=new RDWaveFile(wavename);
if(!alsa_play_wave[card][*stream]->openWave()) {
LogLine(RDConfig::LogErr,QString().sprintf(
rd_config->log("caed",RDConfig::LogErr,QString().sprintf(
"Error: alsaLoadPlayback(%s) openWave() failed to open file",
(const char *) wavename) );
delete alsa_play_wave[card][*stream];
@ -850,7 +850,7 @@ bool MainObject::alsaLoadPlayback(int card,QString wavename,int *stream)
break;
default:
LogLine(RDConfig::LogErr,QString().sprintf(
rd_config->log("caed",RDConfig::LogErr,QString().sprintf(
"Error: alsaLoadPlayback(%s) getFormatTag()%d || getBistsPerSample()%d failed",
(const char *) wavename,
alsa_play_wave[card][*stream]->getFormatTag(),
@ -1038,7 +1038,7 @@ bool MainObject::alsaLoadRecord(int card,int stream,int coding,int chans,
break;
default:
LogLine(RDConfig::LogErr,QString().
rd_config->log("caed",RDConfig::LogErr,QString().
sprintf("requested unsupported channel count %d, card: %d, stream: %d",
chans,card,stream));
delete alsa_record_wave[card][stream];
@ -1066,7 +1066,7 @@ bool MainObject::alsaLoadRecord(int card,int stream,int coding,int chans,
break;
default:
LogLine(RDConfig::LogErr,QString().
rd_config->log("caed",RDConfig::LogErr,QString().
sprintf("requested invalid audio encoding %d, card: %d, stream: %d",
coding,card,stream));
delete alsa_record_wave[card][stream];
@ -1406,7 +1406,7 @@ bool MainObject::AlsaStartCaptureDevice(QString &dev,int card,snd_pcm_t *pcm)
snd_pcm_hw_params_alloca(&hwparams);
snd_pcm_hw_params_any(pcm,hwparams);
LogLine(RDConfig::LogInfo,QString().
rd_config->log("caed",RDConfig::LogInfo,QString().
sprintf("Starting ALSA Capture Device %s:",
(const char *)dev));
@ -1415,8 +1415,8 @@ bool MainObject::AlsaStartCaptureDevice(QString &dev,int card,snd_pcm_t *pcm)
//
if(snd_pcm_hw_params_test_access(pcm,hwparams,
SND_PCM_ACCESS_RW_INTERLEAVED)<0) {
LogLine(RDConfig::LogErr," Interleaved access not supported,");
LogLine(RDConfig::LogErr," aborting initialization of device.");
rd_config->log("caed",RDConfig::LogErr," Interleaved access not supported,");
rd_config->log("caed",RDConfig::LogErr," aborting initialization of device.");
return false;
}
snd_pcm_hw_params_set_access(pcm,hwparams,SND_PCM_ACCESS_RW_INTERLEAVED);
@ -1426,17 +1426,17 @@ bool MainObject::AlsaStartCaptureDevice(QString &dev,int card,snd_pcm_t *pcm)
//
if(snd_pcm_hw_params_test_format(pcm,hwparams,SND_PCM_FORMAT_S32_LE)==0) {
alsa_capture_format[card].format=SND_PCM_FORMAT_S32_LE;
LogLine(RDConfig::LogDebug," Format = 32 bit little-endian");
rd_config->log("caed",RDConfig::LogDebug," Format = 32 bit little-endian");
}
else {
if(snd_pcm_hw_params_test_format(pcm,hwparams,SND_PCM_FORMAT_S16_LE)==0) {
alsa_capture_format[card].format=SND_PCM_FORMAT_S16_LE;
LogLine(RDConfig::LogDebug," Format = 16 bit little-endian");
rd_config->log("caed",RDConfig::LogDebug," Format = 16 bit little-endian");
}
else {
LogLine(RDConfig::LogErr,
rd_config->log("caed",RDConfig::LogErr,
" Neither 16 nor 32 bit little-endian formats available,");
LogLine(RDConfig::LogErr,
rd_config->log("caed",RDConfig::LogErr,
" aborting initialization of device.");
return false;
}
@ -1455,14 +1455,14 @@ bool MainObject::AlsaStartCaptureDevice(QString &dev,int card,snd_pcm_t *pcm)
snd_pcm_hw_params_set_rate_near(pcm,hwparams,&sr,&dir);
if((sr<(system_sample_rate-RD_ALSA_SAMPLE_RATE_TOLERANCE))||
(sr>(system_sample_rate+RD_ALSA_SAMPLE_RATE_TOLERANCE))) {
LogLine(RDConfig::LogErr,
rd_config->log("caed",RDConfig::LogErr,
QString().sprintf(" Asked for sample rate %u, got %u",
system_sample_rate,sr));
LogLine(RDConfig::LogErr," Sample rate unsupported by device");
rd_config->log("caed",RDConfig::LogErr," Sample rate unsupported by device");
return false;
}
alsa_capture_format[card].sample_rate=sr;
LogLine(RDConfig::LogNotice,QString().sprintf(" SampleRate = %u",sr));
rd_config->log("caed",RDConfig::LogNotice,QString().sprintf(" SampleRate = %u",sr));
//
// Channels
@ -1476,7 +1476,7 @@ bool MainObject::AlsaStartCaptureDevice(QString &dev,int card,snd_pcm_t *pcm)
snd_pcm_hw_params_set_channels_near(pcm,hwparams,
&alsa_capture_format[card].channels);
alsa_play_format[card].capture_channels=alsa_capture_format[card].channels;
LogLine(RDConfig::LogDebug,QString().
rd_config->log("caed",RDConfig::LogDebug,QString().
sprintf(" Aggregate Channels = %u",
alsa_capture_format[card].channels));
@ -1486,25 +1486,25 @@ bool MainObject::AlsaStartCaptureDevice(QString &dev,int card,snd_pcm_t *pcm)
alsa_capture_format[card].periods=rd_config->alsaPeriodQuantity();
snd_pcm_hw_params_set_periods_near(pcm,hwparams,
&alsa_capture_format[card].periods,&dir);
LogLine(RDConfig::LogDebug,QString().sprintf(" Periods = %u",
rd_config->log("caed",RDConfig::LogDebug,QString().sprintf(" Periods = %u",
alsa_capture_format[card].periods));
alsa_capture_format[card].buffer_size=
alsa_capture_format[card].periods*rd_config->alsaPeriodSize();
snd_pcm_hw_params_set_buffer_size_near(pcm,hwparams,
&alsa_capture_format[card].buffer_size);
LogLine(RDConfig::LogDebug,QString().sprintf(" BufferSize = %u frames",
rd_config->log("caed",RDConfig::LogDebug,QString().sprintf(" BufferSize = %u frames",
(unsigned)alsa_capture_format[card].buffer_size));
//
// Fire It Up
//
if((err=snd_pcm_hw_params(pcm,hwparams))<0) {
LogLine(RDConfig::LogErr,QString().sprintf(" Device Error: %s,",
rd_config->log("caed",RDConfig::LogErr,QString().sprintf(" Device Error: %s,",
(const char *)snd_strerror(err)));
LogLine(RDConfig::LogErr," aborting initialization of device.");
rd_config->log("caed",RDConfig::LogErr," aborting initialization of device.");
return false;
}
LogLine(RDConfig::LogNotice," Device started successfully");
rd_config->log("caed",RDConfig::LogNotice," Device started successfully");
switch(alsa_capture_format[card].format) {
case SND_PCM_FORMAT_S16_LE:
alsa_capture_format[card].card_buffer_size=
@ -1534,7 +1534,7 @@ bool MainObject::AlsaStartCaptureDevice(QString &dev,int card,snd_pcm_t *pcm)
snd_pcm_sw_params_current(pcm,swparams);
snd_pcm_sw_params_set_avail_min(pcm,swparams,rd_config->alsaPeriodSize());
if((err=snd_pcm_sw_params(pcm,swparams))<0) {
LogLine(RDConfig::LogErr,QString().sprintf("ALSA Device %s: %s",
rd_config->log("caed",RDConfig::LogErr,QString().sprintf("ALSA Device %s: %s",
(const char *)dev,
(const char *)snd_strerror(err)));
return false;
@ -1570,7 +1570,7 @@ bool MainObject::AlsaStartPlayDevice(QString &dev,int card,snd_pcm_t *pcm)
snd_pcm_hw_params_alloca(&hwparams);
snd_pcm_hw_params_any(pcm,hwparams);
LogLine(RDConfig::LogNotice,QString().sprintf("Starting ALSA Play Device %s:",
rd_config->log("caed",RDConfig::LogNotice,QString().sprintf("Starting ALSA Play Device %s:",
(const char *)dev));
//
@ -1578,8 +1578,8 @@ bool MainObject::AlsaStartPlayDevice(QString &dev,int card,snd_pcm_t *pcm)
//
if(snd_pcm_hw_params_test_access(pcm,hwparams,
SND_PCM_ACCESS_RW_INTERLEAVED)<0) {
LogLine(RDConfig::LogErr," Interleaved access not supported,");
LogLine(RDConfig::LogErr," aborting initialization of device.");
rd_config->log("caed",RDConfig::LogErr," Interleaved access not supported,");
rd_config->log("caed",RDConfig::LogErr," aborting initialization of device.");
return false;
}
snd_pcm_hw_params_set_access(pcm,hwparams,SND_PCM_ACCESS_RW_INTERLEAVED);
@ -1589,17 +1589,17 @@ bool MainObject::AlsaStartPlayDevice(QString &dev,int card,snd_pcm_t *pcm)
//
if(snd_pcm_hw_params_test_format(pcm,hwparams,SND_PCM_FORMAT_S32_LE)==0) {
alsa_play_format[card].format=SND_PCM_FORMAT_S32_LE;
LogLine(RDConfig::LogDebug," Format = 32 bit little-endian");
rd_config->log("caed",RDConfig::LogDebug," Format = 32 bit little-endian");
}
else {
if(snd_pcm_hw_params_test_format(pcm,hwparams,SND_PCM_FORMAT_S16_LE)==0) {
alsa_play_format[card].format=SND_PCM_FORMAT_S16_LE;
LogLine(RDConfig::LogDebug," Format = 16 bit little-endian");
rd_config->log("caed",RDConfig::LogDebug," Format = 16 bit little-endian");
}
else {
LogLine(RDConfig::LogErr,
rd_config->log("caed",RDConfig::LogErr,
" Neither 16 nor 32 bit little-endian formats available,");
LogLine(RDConfig::LogErr," aborting initialization of device.");
rd_config->log("caed",RDConfig::LogErr," aborting initialization of device.");
return false;
}
}
@ -1612,14 +1612,14 @@ bool MainObject::AlsaStartPlayDevice(QString &dev,int card,snd_pcm_t *pcm)
snd_pcm_hw_params_set_rate_near(pcm,hwparams,&sr,&dir);
if((sr<(system_sample_rate-RD_ALSA_SAMPLE_RATE_TOLERANCE))||
(sr>(system_sample_rate+RD_ALSA_SAMPLE_RATE_TOLERANCE))) {
LogLine(RDConfig::LogErr,
rd_config->log("caed",RDConfig::LogErr,
QString().sprintf(" Asked for sample rate %u, got %u",
system_sample_rate,sr));
LogLine(RDConfig::LogErr," Sample rate unsupported by device");
rd_config->log("caed",RDConfig::LogErr," Sample rate unsupported by device");
return false;
}
alsa_play_format[card].sample_rate=sr;
LogLine(RDConfig::LogDebug,QString().sprintf(" SampleRate = %u",sr));
rd_config->log("caed",RDConfig::LogDebug,QString().sprintf(" SampleRate = %u",sr));
//
// Channels
@ -1632,7 +1632,7 @@ bool MainObject::AlsaStartPlayDevice(QString &dev,int card,snd_pcm_t *pcm)
}
snd_pcm_hw_params_set_channels_near(pcm,hwparams,
&alsa_play_format[card].channels);
LogLine(RDConfig::LogDebug,QString().sprintf(" Aggregate Channels = %u",
rd_config->log("caed",RDConfig::LogDebug,QString().sprintf(" Aggregate Channels = %u",
alsa_play_format[card].channels));
//
@ -1641,13 +1641,13 @@ bool MainObject::AlsaStartPlayDevice(QString &dev,int card,snd_pcm_t *pcm)
alsa_play_format[card].periods=rd_config->alsaPeriodQuantity();
snd_pcm_hw_params_set_periods_near(pcm,hwparams,
&alsa_play_format[card].periods,&dir);
LogLine(RDConfig::LogDebug,QString().sprintf(" Periods = %u",
rd_config->log("caed",RDConfig::LogDebug,QString().sprintf(" Periods = %u",
alsa_play_format[card].periods));
alsa_play_format[card].buffer_size=
alsa_play_format[card].periods*rd_config->alsaPeriodSize();
snd_pcm_hw_params_set_buffer_size_near(pcm,hwparams,
&alsa_play_format[card].buffer_size);
LogLine(RDConfig::LogDebug,QString().
rd_config->log("caed",RDConfig::LogDebug,QString().
sprintf(" BufferSize = %u frames",
(unsigned)alsa_play_format[card].buffer_size));
@ -1655,12 +1655,12 @@ bool MainObject::AlsaStartPlayDevice(QString &dev,int card,snd_pcm_t *pcm)
// Fire It Up
//
if((err=snd_pcm_hw_params(pcm,hwparams))<0) {
LogLine(RDConfig::LogErr,QString().sprintf(" Device Error: %s,",
rd_config->log("caed",RDConfig::LogErr,QString().sprintf(" Device Error: %s,",
(const char *)snd_strerror(err)));
LogLine(RDConfig::LogErr," aborting initialization of device.");
rd_config->log("caed",RDConfig::LogErr," aborting initialization of device.");
return false;
}
LogLine(RDConfig::LogNotice," Device started successfully");
rd_config->log("caed",RDConfig::LogNotice," Device started successfully");
switch(alsa_play_format[card].format) {
case SND_PCM_FORMAT_S16_LE:
alsa_play_format[card].card_buffer_size=
@ -1689,7 +1689,7 @@ bool MainObject::AlsaStartPlayDevice(QString &dev,int card,snd_pcm_t *pcm)
snd_pcm_sw_params_current(pcm,swparams);
snd_pcm_sw_params_set_avail_min(pcm,swparams,rd_config->alsaPeriodSize());
if((err=snd_pcm_sw_params(pcm,swparams))<0) {
LogLine(RDConfig::LogErr,QString().sprintf("ALSA Device %s: %s",
rd_config->log("caed",RDConfig::LogErr,QString().sprintf("ALSA Device %s: %s",
(const char *)dev,
(const char *)snd_strerror(err)));
return false;
@ -1781,7 +1781,7 @@ void MainObject::WriteAlsaBuffer(int card,int stream,int16_t *buffer,unsigned le
alsa_record_wave[card][stream]->writeWave(mpeg,s);
}
else {
LogLine(RDConfig::LogErr,QString().
rd_config->log("caed",RDConfig::LogErr,QString().
sprintf("TwoLAME encode error, card: %d, stream: %d",card,stream));
}
}

View File

@ -76,7 +76,7 @@ bool MainObject::hpiLoadPlayback(int card,QString wavename,int *stream)
RDHPIPlayStream *playstream=new RDHPIPlayStream(sound_card);
playstream->setCard(card);
if(playstream->openWave(wavename)!=RDHPIPlayStream::Ok) {
LogLine(RDConfig::LogNotice,QString().sprintf(
rd_config->log("caed",RDConfig::LogNotice,QString().sprintf(
"Error: hpiLoadPlayback(%s) openWave() failed to open file",
(const char *) wavename) );
delete playstream;
@ -174,7 +174,6 @@ bool MainObject::hpiLoadRecord(int card,int stream,int coding,int chans,
int samprate,int bitrate,QString wavename)
{
#ifdef HPI
syslog(LOG_NOTICE,"card: %d coding: %d\n",card,coding);
record[card][stream]=new RDHPIRecordStream(sound_card);
connect(record[card][stream],SIGNAL(stateChanged(int,int,int)),
this,SLOT(stateRecordUpdate(int,int,int)));

View File

@ -443,11 +443,11 @@ void MainObject::jackClientStartData()
QStringList fields=QStringList().split(" ",cmd);
jack_clients.push_back(new QProcess(fields,this));
if(jack_clients.back()->start()) {
LogLine(RDConfig::LogDebug,"started JACK Client \""+
rd_config->log("caed",RDConfig::LogDebug,"started JACK Client \""+
q->value(0).toString()+"\"");
}
else {
LogLine(RDConfig::LogWarning,"failed to start JACK Client \""+
rd_config->log("caed",RDConfig::LogWarning,"failed to start JACK Client \""+
q->value(0).toString()+"\" ["+
q->value(1).toString()+"]");
}
@ -477,7 +477,7 @@ void MainObject::jackInit(RDStation *station)
}
}
if(jack_card==RD_MAX_CARDS) {
LogLine(RDConfig::LogInfo,"no more RD cards available");
rd_config->log("caed",RDConfig::LogInfo,"no more RD cards available");
return;
}
QString name=QString().sprintf("rivendell_%d",jack_card);
@ -489,10 +489,10 @@ void MainObject::jackInit(RDStation *station)
QStringList fields=QStringList().split(" ",station->jackCommandLine());
QProcess *proc=new QProcess(fields,this);
if(proc->start()) {
LogLine(RDConfig::LogDebug,"JACK server started");
rd_config->log("caed",RDConfig::LogDebug,"JACK server started");
}
else {
LogLine(RDConfig::LogErr,"failed to start JACK server");
rd_config->log("caed",RDConfig::LogErr,"failed to start JACK server");
}
sleep(1);
}
@ -511,61 +511,61 @@ void MainObject::jackInit(RDStation *station)
if(jack_client==NULL) {
if((jackstat&JackInvalidOption)!=0) {
fprintf (stderr, "invalid or unsupported JACK option\n");
LogLine(prio,"invalid or unsupported JACK option");
rd_config->log("caed",prio,"invalid or unsupported JACK option");
}
if((jackstat&JackServerError)!=0) {
fprintf (stderr, "communication error with the JACK server\n");
LogLine(prio,"communication error with the JACK server");
rd_config->log("caed",prio,"communication error with the JACK server");
}
if((jackstat&JackNoSuchClient)!=0) {
fprintf (stderr, "requested JACK client does not exist\n");
LogLine(prio,"requested JACK client does not exist");
rd_config->log("caed",prio,"requested JACK client does not exist");
}
if((jackstat&JackLoadFailure)!=0) {
fprintf (stderr, "unable to load internal JACK client\n");
LogLine(prio,"unable to load internal JACK client");
rd_config->log("caed",prio,"unable to load internal JACK client");
}
if((jackstat&JackInitFailure)!=0) {
fprintf (stderr, "unable to initialize JACK client\n");
LogLine(prio,"unable to initialize JACK client");
rd_config->log("caed",prio,"unable to initialize JACK client");
}
if((jackstat&JackShmFailure)!=0) {
fprintf (stderr, "unable to access JACK shared memory\n");
LogLine(prio,"unable to access JACK shared memory");
rd_config->log("caed",prio,"unable to access JACK shared memory");
}
if((jackstat&JackVersionError)!=0) {
fprintf (stderr, "JACK protocol version mismatch\n");
LogLine(prio,"JACK protocol version mismatch");
rd_config->log("caed",prio,"JACK protocol version mismatch");
}
if((jackstat&JackServerStarted)!=0) {
fprintf (stderr, "JACK server started\n");
LogLine(prio,"JACK server started");
rd_config->log("caed",prio,"JACK server started");
}
if((jackstat&JackServerFailed)!=0) {
fprintf (stderr, "unable to communication with JACK server\n");
LogLine(prio,"unable to communicate with JACK server");
rd_config->log("caed",prio,"unable to communicate with JACK server");
}
if((jackstat&JackNameNotUnique)!=0) {
fprintf (stderr, "JACK client name not unique\n");
LogLine(prio,"JACK client name not unique");
rd_config->log("caed",prio,"JACK client name not unique");
}
if((jackstat&JackFailure)!=0) {
fprintf (stderr, "JACK general failure\n");
LogLine(prio,"JACK general failure");
rd_config->log("caed",prio,"JACK general failure");
}
jack_card=-1;
fprintf (stderr, "no connection to JACK server\n");
LogLine(prio,"no connection to JACK server");
rd_config->log("caed",prio,"no connection to JACK server");
return;
}
jack_connected=true;
@ -577,7 +577,7 @@ void MainObject::jackInit(RDStation *station)
#else
jack_on_shutdown(jack_client,JackShutdown,0);
#endif // HAVE_JACK_INFO_SHUTDOWN
LogLine(RDConfig::LogDebug,"connected to JACK server");
rd_config->log("caed",RDConfig::LogDebug,"connected to JACK server");
//
// Start JACK Clients
@ -694,7 +694,7 @@ void MainObject::jackInit(RDStation *station)
jack_sample_rate=jack_get_sample_rate(jack_client);
if(jack_sample_rate!=system_sample_rate) {
fprintf (stderr,"JACK sample rate mismatch!\n");
LogLine(RDConfig::LogWarning,"JACK sample rate mismatch!");
rd_config->log("caed",RDConfig::LogWarning,"JACK sample rate mismatch!");
}
jack_activated=true;
cae_driver[jack_card]=RDStation::Jack;
@ -723,7 +723,7 @@ bool MainObject::jackLoadPlayback(int card,QString wavename,int *stream)
{
#ifdef JACK
if((*stream=GetJackOutputStream())<0) {
LogLine(RDConfig::LogErr,QString().sprintf(
rd_config->log("caed",RDConfig::LogErr,QString().sprintf(
"Error: jackLoadPlayback(%s) GetJackOutputStream():%d <0",
(const char *) wavename,
*stream) );
@ -731,7 +731,7 @@ bool MainObject::jackLoadPlayback(int card,QString wavename,int *stream)
}
jack_play_wave[*stream]=new RDWaveFile(wavename);
if(!jack_play_wave[*stream]->openWave()) {
LogLine(RDConfig::LogNotice,QString().sprintf(
rd_config->log("caed",RDConfig::LogNotice,QString().sprintf(
"Error: jackLoadPlayback(%s) openWave() failed to open file",
(const char *) wavename) );
delete jack_play_wave[*stream];
@ -750,7 +750,7 @@ bool MainObject::jackLoadPlayback(int card,QString wavename,int *stream)
break;
default:
LogLine(RDConfig::LogNotice,
rd_config->log("caed",RDConfig::LogNotice,
QString().sprintf(
"Error: jackLoadPlayback(%s) getFormatTag()%d || getBistsPerSample()%d failed",
(const char *) wavename,
@ -946,7 +946,7 @@ bool MainObject::jackLoadRecord(int card,int stream,int coding,int chans,
break;
default:
LogLine(RDConfig::LogErr,QString().
rd_config->log("caed",RDConfig::LogErr,QString().
sprintf("requested unsupported channel count %d, card: %d, stream: %d",
chans,card,stream));
delete jack_record_wave[stream];
@ -974,7 +974,7 @@ bool MainObject::jackLoadRecord(int card,int stream,int coding,int chans,
break;
default:
LogLine(RDConfig::LogErr,QString().
rd_config->log("caed",RDConfig::LogErr,QString().
sprintf("requested invalid audio encoding %d, card: %d, stream: %d",
coding,card,stream));
delete jack_record_wave[stream];
@ -1472,7 +1472,7 @@ void MainObject::WriteJackBuffer(int stream,jack_default_audio_sample_t *buffer,
jack_record_wave[stream]->writeWave(mpeg,s);
}
else {
LogLine(RDConfig::LogErr,QString().
rd_config->log("caed",RDConfig::LogErr,QString().
sprintf("TwoLAME encode error, card: %d, stream: %d",jack_card,
stream));
}
@ -1677,7 +1677,7 @@ void MainObject::JackSessionSetup()
QString dest=profile->stringValue("JackSession",dest_tag,"",&dest_ok);
while(src_ok&&dest_ok) {
if(jack_connect(jack_client,(const char *)src,(const char *)dest)!=0) {
LogLine(RDConfig::LogNotice,QString().
rd_config->log("caed",RDConfig::LogNotice,QString().
sprintf("unable to connect %s to %s",
(const char *)src,(const char *)dest));
}