mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-19 14:43:30 +02:00
2021-03-31 Fred Gleason <fredg@paravelsystems.com>
* Modernized indentation style of all switch() statements in caed(8). Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
6eea64f71a
commit
ba755a60ba
@ -21358,3 +21358,5 @@
|
||||
2021-03-25 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Removed 'RDEditAudio', 'RDMarkerEdit' and 'RDMarkerPlayer'
|
||||
classes.
|
||||
2021-03-31 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Modernized indentation style of all switch() statements in caed(8).
|
||||
|
372
cae/cae.cpp
372
cae/cae.cpp
@ -76,11 +76,11 @@ void src_float_to_int_array (const float *in, int *out, int len)
|
||||
void SigHandler(int signum)
|
||||
{
|
||||
switch(signum) {
|
||||
case SIGINT:
|
||||
case SIGTERM:
|
||||
case SIGHUP:
|
||||
exiting=true;
|
||||
break;
|
||||
case SIGINT:
|
||||
case SIGTERM:
|
||||
case SIGHUP:
|
||||
exiting=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1453,23 +1453,25 @@ void MainObject::statePlayUpdate(int card,int stream,int state)
|
||||
}
|
||||
if(play_owner[card][stream]!=-1) {
|
||||
switch(state) {
|
||||
case 1: // Playing
|
||||
cae_server->sendCommand(play_owner[card][stream],
|
||||
QString().
|
||||
sprintf("PY %d %d %d +!",handle,
|
||||
play_length[card][stream],
|
||||
play_speed[card][stream]).toUtf8());
|
||||
break;
|
||||
case 2: // Paused
|
||||
cae_server->
|
||||
sendCommand(play_owner[card][stream],(const char *)QString().
|
||||
sprintf("SP %d +!",handle).toUtf8());
|
||||
break;
|
||||
case 0: // Stopped
|
||||
cae_server->
|
||||
sendCommand(play_owner[card][stream],(const char *)QString().
|
||||
sprintf("SP %d +!",handle).toUtf8());
|
||||
break;
|
||||
case 1: // Playing
|
||||
cae_server->sendCommand(play_owner[card][stream],
|
||||
QString().
|
||||
sprintf("PY %d %d %d +!",handle,
|
||||
play_length[card][stream],
|
||||
play_speed[card][stream]).toUtf8());
|
||||
break;
|
||||
|
||||
case 2: // Paused
|
||||
cae_server->
|
||||
sendCommand(play_owner[card][stream],(const char *)QString().
|
||||
sprintf("SP %d +!",handle).toUtf8());
|
||||
break;
|
||||
|
||||
case 0: // Stopped
|
||||
cae_server->
|
||||
sendCommand(play_owner[card][stream],(const char *)QString().
|
||||
sprintf("SP %d +!",handle).toUtf8());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1479,26 +1481,26 @@ void MainObject::stateRecordUpdate(int card,int stream,int state)
|
||||
{
|
||||
if(record_owner[card][stream]!=-1) {
|
||||
switch(state) {
|
||||
case 0: // Recording
|
||||
cae_server->
|
||||
sendCommand(record_owner[card][stream],(const char *)QString().
|
||||
sprintf("RD %d %d %d %d +!",card,stream,
|
||||
record_length[card][stream],
|
||||
record_threshold[card][stream]).toUtf8());
|
||||
break;
|
||||
case 0: // Recording
|
||||
cae_server->
|
||||
sendCommand(record_owner[card][stream],(const char *)QString().
|
||||
sprintf("RD %d %d %d %d +!",card,stream,
|
||||
record_length[card][stream],
|
||||
record_threshold[card][stream]).toUtf8());
|
||||
break;
|
||||
|
||||
case 4: // Record Started
|
||||
cae_server->
|
||||
sendCommand(record_owner[card][stream],(const char *)QString().
|
||||
sprintf("RS %d %d +!",card,stream).toUtf8());
|
||||
break;
|
||||
case 4: // Record Started
|
||||
cae_server->
|
||||
sendCommand(record_owner[card][stream],(const char *)QString().
|
||||
sprintf("RS %d %d +!",card,stream).toUtf8());
|
||||
break;
|
||||
|
||||
case 2: // Paused
|
||||
case 3: // Stopped
|
||||
cae_server->
|
||||
sendCommand(record_owner[card][stream],(const char *)QString().
|
||||
sprintf("SR %d %d +!",card,stream).toUtf8());
|
||||
break;
|
||||
case 2: // Paused
|
||||
case 3: // Stopped
|
||||
cae_server->
|
||||
sendCommand(record_owner[card][stream],(const char *)QString().
|
||||
sprintf("SR %d %d +!",card,stream).toUtf8());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1522,81 +1524,81 @@ void MainObject::updateMeters()
|
||||
|
||||
for(int i=0;i<RD_MAX_CARDS;i++) {
|
||||
switch(cae_driver[i]) {
|
||||
case RDStation::Hpi:
|
||||
for(int j=0;j<RD_MAX_PORTS;j++) {
|
||||
if(hpiGetInputStatus(i,j)!=port_status[i][j]) {
|
||||
port_status[i][j]=hpiGetInputStatus(i,j);
|
||||
if(port_status[i][j]) {
|
||||
cae_server->sendCommand(QString().sprintf("IS %d %d 0!",i,j));
|
||||
}
|
||||
else {
|
||||
cae_server->sendCommand(QString().sprintf("IS %d %d 1!",i,j));
|
||||
}
|
||||
}
|
||||
if(hpiGetInputMeters(i,j,levels)) {
|
||||
SendMeterLevelUpdate("I",i,j,levels);
|
||||
}
|
||||
if(hpiGetOutputMeters(i,j,levels)) {
|
||||
SendMeterLevelUpdate("O",i,j,levels);
|
||||
}
|
||||
case RDStation::Hpi:
|
||||
for(int j=0;j<RD_MAX_PORTS;j++) {
|
||||
if(hpiGetInputStatus(i,j)!=port_status[i][j]) {
|
||||
port_status[i][j]=hpiGetInputStatus(i,j);
|
||||
if(port_status[i][j]) {
|
||||
cae_server->sendCommand(QString().sprintf("IS %d %d 0!",i,j));
|
||||
}
|
||||
hpiGetOutputPosition(i,positions);
|
||||
SendMeterPositionUpdate(i,positions);
|
||||
for(int j=0;j<RD_MAX_STREAMS;j++) {
|
||||
if(hpiGetStreamOutputMeters(i,j,levels)) {
|
||||
SendStreamMeterLevelUpdate(i,j,levels);
|
||||
}
|
||||
else {
|
||||
cae_server->sendCommand(QString().sprintf("IS %d %d 1!",i,j));
|
||||
}
|
||||
break;
|
||||
}
|
||||
if(hpiGetInputMeters(i,j,levels)) {
|
||||
SendMeterLevelUpdate("I",i,j,levels);
|
||||
}
|
||||
if(hpiGetOutputMeters(i,j,levels)) {
|
||||
SendMeterLevelUpdate("O",i,j,levels);
|
||||
}
|
||||
}
|
||||
hpiGetOutputPosition(i,positions);
|
||||
SendMeterPositionUpdate(i,positions);
|
||||
for(int j=0;j<RD_MAX_STREAMS;j++) {
|
||||
if(hpiGetStreamOutputMeters(i,j,levels)) {
|
||||
SendStreamMeterLevelUpdate(i,j,levels);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case RDStation::Jack:
|
||||
for(int j=0;j<RD_MAX_PORTS;j++) {
|
||||
if(jackGetInputStatus(i,j)!=port_status[i][j]) {
|
||||
port_status[i][j]=!port_status[i][j];
|
||||
cae_server->sendCommand(QString().sprintf("IS %d %d %d",i,j,
|
||||
port_status[i][j]));
|
||||
}
|
||||
if(jackGetInputMeters(i,j,levels)) {
|
||||
SendMeterLevelUpdate("I",i,j,levels);
|
||||
}
|
||||
if(jackGetOutputMeters(i,j,levels)) {
|
||||
SendMeterLevelUpdate("O",i,j,levels);
|
||||
}
|
||||
}
|
||||
jackGetOutputPosition(i,positions);
|
||||
SendMeterPositionUpdate(i,positions);
|
||||
for(int j=0;j<RD_MAX_STREAMS;j++) {
|
||||
if(jackGetStreamOutputMeters(i,j,levels)) {
|
||||
SendStreamMeterLevelUpdate(i,j,levels);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case RDStation::Jack:
|
||||
for(int j=0;j<RD_MAX_PORTS;j++) {
|
||||
if(jackGetInputStatus(i,j)!=port_status[i][j]) {
|
||||
port_status[i][j]=!port_status[i][j];
|
||||
cae_server->sendCommand(QString().sprintf("IS %d %d %d",i,j,
|
||||
port_status[i][j]));
|
||||
}
|
||||
if(jackGetInputMeters(i,j,levels)) {
|
||||
SendMeterLevelUpdate("I",i,j,levels);
|
||||
}
|
||||
if(jackGetOutputMeters(i,j,levels)) {
|
||||
SendMeterLevelUpdate("O",i,j,levels);
|
||||
}
|
||||
}
|
||||
jackGetOutputPosition(i,positions);
|
||||
SendMeterPositionUpdate(i,positions);
|
||||
for(int j=0;j<RD_MAX_STREAMS;j++) {
|
||||
if(jackGetStreamOutputMeters(i,j,levels)) {
|
||||
SendStreamMeterLevelUpdate(i,j,levels);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case RDStation::Alsa:
|
||||
for(int j=0;j<RD_MAX_PORTS;j++) {
|
||||
if(alsaGetInputStatus(i,j)!=port_status[i][j]) {
|
||||
port_status[i][j]=!port_status[i][j];
|
||||
cae_server->sendCommand(QString().sprintf("IS %d %d %d",i,j,
|
||||
port_status[i][j]));
|
||||
}
|
||||
if(alsaGetInputMeters(i,j,levels)) {
|
||||
SendMeterLevelUpdate("I",i,j,levels);
|
||||
}
|
||||
if(alsaGetOutputMeters(i,j,levels)) {
|
||||
SendMeterLevelUpdate("O",i,j,levels);
|
||||
}
|
||||
}
|
||||
alsaGetOutputPosition(i,positions);
|
||||
SendMeterPositionUpdate(i,positions);
|
||||
for(int j=0;j<RD_MAX_STREAMS;j++) {
|
||||
if(alsaGetStreamOutputMeters(i,j,levels)) {
|
||||
SendStreamMeterLevelUpdate(i,j,levels);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case RDStation::Alsa:
|
||||
for(int j=0;j<RD_MAX_PORTS;j++) {
|
||||
if(alsaGetInputStatus(i,j)!=port_status[i][j]) {
|
||||
port_status[i][j]=!port_status[i][j];
|
||||
cae_server->sendCommand(QString().sprintf("IS %d %d %d",i,j,
|
||||
port_status[i][j]));
|
||||
}
|
||||
if(alsaGetInputMeters(i,j,levels)) {
|
||||
SendMeterLevelUpdate("I",i,j,levels);
|
||||
}
|
||||
if(alsaGetOutputMeters(i,j,levels)) {
|
||||
SendMeterLevelUpdate("O",i,j,levels);
|
||||
}
|
||||
}
|
||||
alsaGetOutputPosition(i,positions);
|
||||
SendMeterPositionUpdate(i,positions);
|
||||
for(int j=0;j<RD_MAX_STREAMS;j++) {
|
||||
if(alsaGetStreamOutputMeters(i,j,levels)) {
|
||||
SendStreamMeterLevelUpdate(i,j,levels);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case RDStation::None:
|
||||
break;
|
||||
case RDStation::None:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1673,60 +1675,60 @@ void MainObject::InitMixers()
|
||||
for(int i=0;i<RD_MAX_CARDS;i++) {
|
||||
RDAudioPort *port=new RDAudioPort(rd_config->stationName(),i);
|
||||
switch(cae_driver[i]) {
|
||||
case RDStation::Hpi:
|
||||
hpiSetClockSource(i,port->clockSource());
|
||||
for(int j=0;j<RD_MAX_PORTS;j++) {
|
||||
for(int k=0;k<RD_MAX_PORTS;k++) {
|
||||
hpiSetPassthroughLevel(i,j,k,RD_MUTE_DEPTH);
|
||||
}
|
||||
if(port->inputPortType(j)==RDAudioPort::Analog) {
|
||||
hpiSetInputType(i,j,RDCae::Analog);
|
||||
}
|
||||
else {
|
||||
hpiSetInputType(i,j,RDCae::AesEbu);
|
||||
}
|
||||
hpiSetInputLevel(i,j,RD_BASE_ANALOG+port->inputPortLevel(j));
|
||||
hpiSetOutputLevel(i,j,RD_BASE_ANALOG+port->outputPortLevel(j));
|
||||
hpiSetInputMode(i,j,port->inputPortMode(j));
|
||||
}
|
||||
break;
|
||||
case RDStation::Hpi:
|
||||
hpiSetClockSource(i,port->clockSource());
|
||||
for(int j=0;j<RD_MAX_PORTS;j++) {
|
||||
for(int k=0;k<RD_MAX_PORTS;k++) {
|
||||
hpiSetPassthroughLevel(i,j,k,RD_MUTE_DEPTH);
|
||||
}
|
||||
if(port->inputPortType(j)==RDAudioPort::Analog) {
|
||||
hpiSetInputType(i,j,RDCae::Analog);
|
||||
}
|
||||
else {
|
||||
hpiSetInputType(i,j,RDCae::AesEbu);
|
||||
}
|
||||
hpiSetInputLevel(i,j,RD_BASE_ANALOG+port->inputPortLevel(j));
|
||||
hpiSetOutputLevel(i,j,RD_BASE_ANALOG+port->outputPortLevel(j));
|
||||
hpiSetInputMode(i,j,port->inputPortMode(j));
|
||||
}
|
||||
break;
|
||||
|
||||
case RDStation::Jack:
|
||||
for(int j=0;j<RD_MAX_PORTS;j++) {
|
||||
for(int k=0;k<RD_MAX_PORTS;k++) {
|
||||
jackSetPassthroughLevel(i,j,k,RD_MUTE_DEPTH);
|
||||
}
|
||||
if(port->inputPortType(j)==RDAudioPort::Analog) {
|
||||
jackSetInputType(i,j,RDCae::Analog);
|
||||
}
|
||||
else {
|
||||
jackSetInputType(i,j,RDCae::AesEbu);
|
||||
}
|
||||
jackSetInputLevel(i,j,RD_BASE_ANALOG+port->inputPortLevel(j));
|
||||
jackSetOutputLevel(i,j,RD_BASE_ANALOG+port->outputPortLevel(j));
|
||||
jackSetInputMode(i,j,port->inputPortMode(j));
|
||||
}
|
||||
break;
|
||||
case RDStation::Jack:
|
||||
for(int j=0;j<RD_MAX_PORTS;j++) {
|
||||
for(int k=0;k<RD_MAX_PORTS;k++) {
|
||||
jackSetPassthroughLevel(i,j,k,RD_MUTE_DEPTH);
|
||||
}
|
||||
if(port->inputPortType(j)==RDAudioPort::Analog) {
|
||||
jackSetInputType(i,j,RDCae::Analog);
|
||||
}
|
||||
else {
|
||||
jackSetInputType(i,j,RDCae::AesEbu);
|
||||
}
|
||||
jackSetInputLevel(i,j,RD_BASE_ANALOG+port->inputPortLevel(j));
|
||||
jackSetOutputLevel(i,j,RD_BASE_ANALOG+port->outputPortLevel(j));
|
||||
jackSetInputMode(i,j,port->inputPortMode(j));
|
||||
}
|
||||
break;
|
||||
|
||||
case RDStation::Alsa:
|
||||
for(int j=0;j<RD_MAX_PORTS;j++) {
|
||||
for(int k=0;k<RD_MAX_PORTS;k++) {
|
||||
alsaSetPassthroughLevel(i,j,k,RD_MUTE_DEPTH);
|
||||
}
|
||||
if(port->inputPortType(j)==RDAudioPort::Analog) {
|
||||
alsaSetInputType(i,j,RDCae::Analog);
|
||||
}
|
||||
else {
|
||||
alsaSetInputType(i,j,RDCae::AesEbu);
|
||||
}
|
||||
alsaSetInputLevel(i,j,RD_BASE_ANALOG+port->inputPortLevel(j));
|
||||
alsaSetOutputLevel(i,j,RD_BASE_ANALOG+port->outputPortLevel(j));
|
||||
alsaSetInputMode(i,j,port->inputPortMode(j));
|
||||
}
|
||||
break;
|
||||
case RDStation::Alsa:
|
||||
for(int j=0;j<RD_MAX_PORTS;j++) {
|
||||
for(int k=0;k<RD_MAX_PORTS;k++) {
|
||||
alsaSetPassthroughLevel(i,j,k,RD_MUTE_DEPTH);
|
||||
}
|
||||
if(port->inputPortType(j)==RDAudioPort::Analog) {
|
||||
alsaSetInputType(i,j,RDCae::Analog);
|
||||
}
|
||||
else {
|
||||
alsaSetInputType(i,j,RDCae::AesEbu);
|
||||
}
|
||||
alsaSetInputLevel(i,j,RD_BASE_ANALOG+port->inputPortLevel(j));
|
||||
alsaSetOutputLevel(i,j,RD_BASE_ANALOG+port->outputPortLevel(j));
|
||||
alsaSetInputMode(i,j,port->inputPortMode(j));
|
||||
}
|
||||
break;
|
||||
|
||||
case RDStation::None:
|
||||
break;
|
||||
case RDStation::None:
|
||||
break;
|
||||
}
|
||||
delete port;
|
||||
}
|
||||
@ -1740,22 +1742,22 @@ void MainObject::KillSocket(int ch)
|
||||
if(record_owner[i][j]==ch) {
|
||||
unsigned len=0;
|
||||
switch(cae_driver[i]) {
|
||||
case RDStation::Hpi:
|
||||
hpiUnloadRecord(i,j,&len);
|
||||
break;
|
||||
case RDStation::Hpi:
|
||||
hpiUnloadRecord(i,j,&len);
|
||||
break;
|
||||
|
||||
case RDStation::Jack:
|
||||
jackUnloadRecord(i,j,&len);
|
||||
break;
|
||||
case RDStation::Jack:
|
||||
jackUnloadRecord(i,j,&len);
|
||||
break;
|
||||
|
||||
case RDStation::Alsa:
|
||||
alsaUnloadRecord(i,j,&len);
|
||||
break;
|
||||
case RDStation::Alsa:
|
||||
alsaUnloadRecord(i,j,&len);
|
||||
break;
|
||||
|
||||
default:
|
||||
RDApplication::syslog(rd_config,LOG_DEBUG,
|
||||
"tried to kill unowned socket!");
|
||||
break;
|
||||
default:
|
||||
RDApplication::syslog(rd_config,LOG_DEBUG,
|
||||
"tried to kill unowned socket!");
|
||||
break;
|
||||
}
|
||||
record_length[i][j]=0;
|
||||
record_threshold[i][j]=-10000;
|
||||
@ -1763,20 +1765,20 @@ void MainObject::KillSocket(int ch)
|
||||
}
|
||||
if(play_owner[i][j]==ch) {
|
||||
switch(cae_driver[i]) {
|
||||
case RDStation::Hpi:
|
||||
hpiUnloadPlayback(i,j);
|
||||
break;
|
||||
case RDStation::Hpi:
|
||||
hpiUnloadPlayback(i,j);
|
||||
break;
|
||||
|
||||
case RDStation::Jack:
|
||||
jackUnloadPlayback(i,j);
|
||||
break;
|
||||
case RDStation::Jack:
|
||||
jackUnloadPlayback(i,j);
|
||||
break;
|
||||
|
||||
case RDStation::Alsa:
|
||||
alsaUnloadPlayback(i,j);
|
||||
break;
|
||||
case RDStation::Alsa:
|
||||
alsaUnloadPlayback(i,j);
|
||||
break;
|
||||
|
||||
case RDStation::None:
|
||||
break;
|
||||
case RDStation::None:
|
||||
break;
|
||||
}
|
||||
play_owner[i][j]=-1;
|
||||
play_length[i][j]=0;
|
||||
|
@ -1468,20 +1468,20 @@ bool MainObject::AlsaStartCaptureDevice(QString &dev,int card,snd_pcm_t *pcm)
|
||||
}
|
||||
RDApplication::syslog(rd_config,LOG_INFO," Device started successfully");
|
||||
switch(alsa_capture_format[card].format) {
|
||||
case SND_PCM_FORMAT_S16_LE:
|
||||
alsa_capture_format[card].card_buffer_size=
|
||||
alsa_capture_format[card].buffer_size*
|
||||
alsa_capture_format[card].channels*2;
|
||||
break;
|
||||
case SND_PCM_FORMAT_S16_LE:
|
||||
alsa_capture_format[card].card_buffer_size=
|
||||
alsa_capture_format[card].buffer_size*
|
||||
alsa_capture_format[card].channels*2;
|
||||
break;
|
||||
|
||||
case SND_PCM_FORMAT_S32_LE:
|
||||
alsa_capture_format[card].card_buffer_size=
|
||||
alsa_capture_format[card].buffer_size*
|
||||
alsa_capture_format[card].channels*4;
|
||||
break;
|
||||
case SND_PCM_FORMAT_S32_LE:
|
||||
alsa_capture_format[card].card_buffer_size=
|
||||
alsa_capture_format[card].buffer_size*
|
||||
alsa_capture_format[card].channels*4;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
alsa_capture_format[card].card_buffer=
|
||||
new char[alsa_capture_format[card].card_buffer_size];
|
||||
@ -1628,18 +1628,18 @@ bool MainObject::AlsaStartPlayDevice(QString &dev,int card,snd_pcm_t *pcm)
|
||||
}
|
||||
RDApplication::syslog(rd_config,LOG_INFO," Device started successfully");
|
||||
switch(alsa_play_format[card].format) {
|
||||
case SND_PCM_FORMAT_S16_LE:
|
||||
alsa_play_format[card].card_buffer_size=
|
||||
alsa_play_format[card].buffer_size*alsa_play_format[card].channels*2;
|
||||
break;
|
||||
case SND_PCM_FORMAT_S16_LE:
|
||||
alsa_play_format[card].card_buffer_size=
|
||||
alsa_play_format[card].buffer_size*alsa_play_format[card].channels*2;
|
||||
break;
|
||||
|
||||
case SND_PCM_FORMAT_S32_LE:
|
||||
alsa_play_format[card].card_buffer_size=
|
||||
alsa_play_format[card].buffer_size*alsa_play_format[card].channels*4;
|
||||
break;
|
||||
case SND_PCM_FORMAT_S32_LE:
|
||||
alsa_play_format[card].card_buffer_size=
|
||||
alsa_play_format[card].buffer_size*alsa_play_format[card].channels*4;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
alsa_play_format[card].card_buffer=
|
||||
new char[alsa_play_format[card].card_buffer_size];
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// The HPI Driver for the Core Audio Engine component of Rivendell
|
||||
//
|
||||
// (C) Copyright 2002-2019 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -195,16 +195,18 @@ bool MainObject::hpiLoadRecord(int card,int stream,int coding,int chans,
|
||||
record[card][stream]->setHeadBitRate(bitrate);
|
||||
record[card][stream]->setMextChunk(true);
|
||||
switch(chans) {
|
||||
case 1:
|
||||
record[card][stream]->setHeadMode(ACM_MPEG_SINGLECHANNEL);
|
||||
break;
|
||||
case 2:
|
||||
record[card][stream]->setHeadMode(ACM_MPEG_STEREO);
|
||||
break;
|
||||
default:
|
||||
delete record[card][stream];
|
||||
record[card][stream]=NULL;
|
||||
return false;
|
||||
case 1:
|
||||
record[card][stream]->setHeadMode(ACM_MPEG_SINGLECHANNEL);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
record[card][stream]->setHeadMode(ACM_MPEG_STEREO);
|
||||
break;
|
||||
|
||||
default:
|
||||
delete record[card][stream];
|
||||
record[card][stream]=NULL;
|
||||
return false;
|
||||
}
|
||||
record[card][stream]->setHeadFlags(ACM_MPEG_ID_MPEG1);
|
||||
}
|
||||
@ -367,24 +369,24 @@ bool MainObject::hpiSetInputMode(int card,int stream,int mode)
|
||||
{
|
||||
#ifdef HPI
|
||||
switch(mode) {
|
||||
case 0:
|
||||
sound_card->setInputMode(card,stream,RDHPISoundCard::Normal);
|
||||
break;
|
||||
case 0:
|
||||
sound_card->setInputMode(card,stream,RDHPISoundCard::Normal);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
sound_card->setInputMode(card,stream,RDHPISoundCard::Swap);
|
||||
break;
|
||||
case 1:
|
||||
sound_card->setInputMode(card,stream,RDHPISoundCard::Swap);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
sound_card->setInputMode(card,stream,RDHPISoundCard::LeftOnly);
|
||||
break;
|
||||
case 2:
|
||||
sound_card->setInputMode(card,stream,RDHPISoundCard::LeftOnly);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
sound_card->setInputMode(card,stream,RDHPISoundCard::RightOnly);
|
||||
break;
|
||||
case 3:
|
||||
sound_card->setInputMode(card,stream,RDHPISoundCard::RightOnly);
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
#else
|
||||
@ -397,24 +399,24 @@ bool MainObject::hpiSetOutputMode(int card,int stream,int mode)
|
||||
{
|
||||
#ifdef HPI
|
||||
switch(mode) {
|
||||
case 0:
|
||||
sound_card->setOutputMode(card,stream,RDHPISoundCard::Normal);
|
||||
break;
|
||||
case 0:
|
||||
sound_card->setOutputMode(card,stream,RDHPISoundCard::Normal);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
sound_card->setOutputMode(card,stream,RDHPISoundCard::Swap);
|
||||
break;
|
||||
case 1:
|
||||
sound_card->setOutputMode(card,stream,RDHPISoundCard::Swap);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
sound_card->setOutputMode(card,stream,RDHPISoundCard::LeftOnly);
|
||||
break;
|
||||
case 2:
|
||||
sound_card->setOutputMode(card,stream,RDHPISoundCard::LeftOnly);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
sound_card->setOutputMode(card,stream,RDHPISoundCard::RightOnly);
|
||||
break;
|
||||
case 3:
|
||||
sound_card->setOutputMode(card,stream,RDHPISoundCard::RightOnly);
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
#else
|
||||
@ -438,16 +440,16 @@ bool MainObject::hpiSetInputType(int card,int port,int type)
|
||||
{
|
||||
#ifdef HPI
|
||||
switch(type) {
|
||||
case 0:
|
||||
sound_card->setInputPortMux(card,port,RDHPISoundCard::LineIn);
|
||||
break;
|
||||
case 0:
|
||||
sound_card->setInputPortMux(card,port,RDHPISoundCard::LineIn);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
sound_card->setInputPortMux(card,port,RDHPISoundCard::AesEbuIn);
|
||||
break;
|
||||
case 1:
|
||||
sound_card->setInputPortMux(card,port,RDHPISoundCard::AesEbuIn);
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user