2018-03-18 Fred Gleason <fredg@paravelsystems.com>

* Updated switch() statement formatting in 'rdhpi/'.
This commit is contained in:
Fred Gleason 2018-03-18 10:56:34 -04:00
parent 25e9d6fb28
commit c1fc523072
4 changed files with 317 additions and 325 deletions

View File

@ -16612,3 +16612,5 @@
* Incremented the package version to 2.19.0.
2018-03-17 Fred Gleason <fredg@paravelsystems.com>
* Added support for DMA bus-mastering to the HPI driver.
2018-03-18 Fred Gleason <fredg@paravelsystems.com>
* Updated switch() statement formatting in 'rdhpi/'.

View File

@ -209,46 +209,36 @@ bool RDHPIPlayStream::formatSupported(RDWaveFile::Format format)
case RDWaveFile::Pcm16:
LogHpi(HPI_FormatCreate(&hpi_format,getChannels(),
HPI_FORMAT_PCM16_SIGNED,
getSamplesPerSec(),getHeadBitRate(),0),
__LINE__);
state=LogHpi(HPI_OutStreamQueryFormat(NULL,hostream,&hpi_format),
__LINE__);
getSamplesPerSec(),getHeadBitRate(),0),__LINE__);
state=LogHpi(HPI_OutStreamQueryFormat(NULL,hostream,&hpi_format),__LINE__);
break;
case RDWaveFile::Pcm24:
LogHpi(HPI_FormatCreate(&hpi_format,getChannels(),
HPI_FORMAT_PCM24_SIGNED,
getSamplesPerSec(),getHeadBitRate(),0),
__LINE__);
state=LogHpi(HPI_OutStreamQueryFormat(NULL,hostream,&hpi_format),
__LINE__);
getSamplesPerSec(),getHeadBitRate(),0),__LINE__);
state=LogHpi(HPI_OutStreamQueryFormat(NULL,hostream,&hpi_format),__LINE__);
break;
case RDWaveFile::MpegL1:
LogHpi(HPI_FormatCreate(&hpi_format,getChannels(),
HPI_FORMAT_MPEG_L1,
getSamplesPerSec(),getHeadBitRate(),0),
__LINE__);
state=LogHpi(HPI_OutStreamQueryFormat(NULL,hostream,&hpi_format),
__LINE__);
getSamplesPerSec(),getHeadBitRate(),0),__LINE__);
state=LogHpi(HPI_OutStreamQueryFormat(NULL,hostream,&hpi_format),__LINE__);
break;
case RDWaveFile::MpegL2:
LogHpi(HPI_FormatCreate(&hpi_format,getChannels(),
HPI_FORMAT_MPEG_L2,
getSamplesPerSec(),getHeadBitRate(),0),
__LINE__);
state=LogHpi(HPI_OutStreamQueryFormat(NULL,hostream,&hpi_format),
__LINE__);
break;;
getSamplesPerSec(),getHeadBitRate(),0),__LINE__);
state=LogHpi(HPI_OutStreamQueryFormat(NULL,hostream,&hpi_format),__LINE__);
break;
case RDWaveFile::MpegL3:
LogHpi(HPI_FormatCreate(&hpi_format,getChannels(),
HPI_FORMAT_MPEG_L3,
getSamplesPerSec(),getHeadBitRate(),0),
__LINE__);
state=LogHpi(HPI_OutStreamQueryFormat(NULL,hostream,&hpi_format),
__LINE__);
getSamplesPerSec(),getHeadBitRate(),0),__LINE__);
state=LogHpi(HPI_OutStreamQueryFormat(NULL,hostream,&hpi_format),__LINE__);
break;
default:
@ -451,56 +441,56 @@ bool RDHPIPlayStream::play()
case WAVE_FORMAT_VORBIS:
switch(getBitsPerSample()) {
case 8:
LogHpi(HPI_FormatCreate(&format,getChannels(),
HPI_FORMAT_PCM8_UNSIGNED,
LogHpi(HPI_FormatCreate(&format,getChannels(),HPI_FORMAT_PCM8_UNSIGNED,
getSamplesPerSec(),0,0),__LINE__);
break;
case 16:
LogHpi(HPI_FormatCreate(&format,getChannels(),
HPI_FORMAT_PCM16_SIGNED,
LogHpi(HPI_FormatCreate(&format,getChannels(),HPI_FORMAT_PCM16_SIGNED,
getSamplesPerSec(),0,0),__LINE__);
break;
case 24:
LogHpi(HPI_FormatCreate(&format,getChannels(),
HPI_FORMAT_PCM24_SIGNED,
LogHpi(HPI_FormatCreate(&format,getChannels(),HPI_FORMAT_PCM24_SIGNED,
getSamplesPerSec(),0,0),__LINE__);
break;
case 32:
LogHpi(HPI_FormatCreate(&format,getChannels(),
HPI_FORMAT_PCM32_SIGNED,
LogHpi(HPI_FormatCreate(&format,getChannels(),HPI_FORMAT_PCM32_SIGNED,
getSamplesPerSec(),0,0),__LINE__);
break;
default:
LogHpi(HPI_AdapterClose(NULL,card_index[card_number]),__LINE__);
return false;
break;
}
break;
case WAVE_FORMAT_MPEG:
switch(getHeadLayer()) {
case 1:
LogHpi(HPI_FormatCreate(&format,getChannels(),
HPI_FORMAT_MPEG_L1,getSamplesPerSec(),
getHeadBitRate(),getHeadFlags()),
__LINE__);
LogHpi(HPI_FormatCreate(&format,getChannels(),HPI_FORMAT_MPEG_L1,
getSamplesPerSec(),getHeadBitRate(),
getHeadFlags()),__LINE__);
break;
case 2:
LogHpi(HPI_FormatCreate(&format,getChannels(),
HPI_FORMAT_MPEG_L2,getSamplesPerSec(),
getHeadBitRate(),getHeadFlags()),
__LINE__);
LogHpi(HPI_FormatCreate(&format,getChannels(),HPI_FORMAT_MPEG_L2,
getSamplesPerSec(),getHeadBitRate(),
getHeadFlags()),__LINE__);
break;
case 3:
LogHpi(HPI_FormatCreate(&format,getChannels(),
HPI_FORMAT_MPEG_L3,getSamplesPerSec(),
getHeadBitRate(),getHeadFlags()),
__LINE__);
getHeadBitRate(),getHeadFlags()),__LINE__);
break;
default:
LogHpi(HPI_AdapterClose(NULL,card_index[card_number]),__LINE__);
return false;
}
break;
default:
return false;
}
@ -681,6 +671,7 @@ bool RDHPIPlayStream::setPosition(unsigned samples)
seekWave((int)((double)samples_skipped*(double)getBlockAlign()),
SEEK_SET);
break;
case WAVE_FORMAT_MPEG:
samples_skipped=
(unsigned)((double)getBlockAlign()*

View File

@ -222,47 +222,38 @@ bool RDHPIRecordStream::formatSupported(RDWaveFile::Format format)
}
switch(format) {
case RDWaveFile::Pcm8:
LogHpi(HPI_FormatCreate(&hformat,getChannels(),
HPI_FORMAT_PCM8_UNSIGNED,
getSamplesPerSec(),getHeadBitRate(),0),
__LINE__);
LogHpi(HPI_FormatCreate(&hformat,getChannels(),HPI_FORMAT_PCM8_UNSIGNED,
getSamplesPerSec(),getHeadBitRate(),0),__LINE__);
state=LogHpi(HPI_InStreamQueryFormat(NULL,histream,&hformat),__LINE__);
break;
case RDWaveFile::Pcm16:
LogHpi(HPI_FormatCreate(&hformat,getChannels(),
HPI_FORMAT_PCM16_SIGNED,
getSamplesPerSec(),getHeadBitRate(),0),
__LINE__);
LogHpi(HPI_FormatCreate(&hformat,getChannels(),HPI_FORMAT_PCM16_SIGNED,
getSamplesPerSec(),getHeadBitRate(),0),__LINE__);
state=LogHpi(HPI_InStreamQueryFormat(NULL,histream,&hformat),__LINE__);
break;
case RDWaveFile::Pcm24:
LogHpi(HPI_FormatCreate(&hformat,getChannels(),
HPI_FORMAT_PCM24_SIGNED,
getSamplesPerSec(),getHeadBitRate(),0),
__LINE__);
LogHpi(HPI_FormatCreate(&hformat,getChannels(),HPI_FORMAT_PCM24_SIGNED,
getSamplesPerSec(),getHeadBitRate(),0),__LINE__);
state=LogHpi(HPI_InStreamQueryFormat(NULL,histream,&hformat),__LINE__);
break;
case RDWaveFile::MpegL1:
LogHpi(HPI_FormatCreate(&hformat,getChannels(),HPI_FORMAT_MPEG_L1,
getSamplesPerSec(),getHeadBitRate(),0),
__LINE__);
getSamplesPerSec(),getHeadBitRate(),0),__LINE__);
state=LogHpi(HPI_InStreamQueryFormat(NULL,histream,&hformat),__LINE__);
break;
case RDWaveFile::MpegL2:
LogHpi(HPI_FormatCreate(&hformat,getChannels(),HPI_FORMAT_MPEG_L2,
getSamplesPerSec(),getHeadBitRate(),0),
__LINE__);
getSamplesPerSec(),getHeadBitRate(),0),__LINE__);
state=LogHpi(HPI_InStreamQueryFormat(NULL,histream,&hformat),__LINE__);
break;
case RDWaveFile::MpegL3:
LogHpi(HPI_FormatCreate(&hformat,getChannels(),HPI_FORMAT_MPEG_L3,
getSamplesPerSec(),getHeadBitRate(),0),
__LINE__);
getSamplesPerSec(),getHeadBitRate(),0),__LINE__);
state=LogHpi(HPI_InStreamQueryFormat(NULL,histream,&hformat),__LINE__);
break;

View File

@ -168,12 +168,14 @@ bool RDHPISoundCard::setClockSource(int card,RDHPISoundCard::ClockSource src)
clock_source_control[card],
HPI_SAMPLECLOCK_SOURCE_LOCAL);
break;
case RDHPISoundCard::AesEbu:
case RDHPISoundCard::SpDiff:
hpi_err=LogHpi(HPI_SampleClock_SetSource(NULL,
clock_source_control[card],
HPI_SAMPLECLOCK_SOURCE_AESEBU_SYNC),__LINE__);
break;
case RDHPISoundCard::WordClock:
hpi_err=LogHpi(HPI_SampleClock_SetSource(NULL,
clock_source_control[card],
@ -241,6 +243,7 @@ bool RDHPISoundCard::setInputPortMux(int card,int port,RDHPISoundCard::SourceNod
return false;
}
break;
case RDHPISoundCard::AesEbuIn:
if(LogHpi(HPI_Multiplexer_SetSource(NULL,
input_mux_control[card][port],node,
@ -249,6 +252,7 @@ bool RDHPISoundCard::setInputPortMux(int card,int port,RDHPISoundCard::SourceNod
return false;
}
break;
default:
return false;
break;
@ -283,6 +287,7 @@ void RDHPISoundCard::setFadeProfile(RDHPISoundCard::FadeProfile profile)
case RDHPISoundCard::Linear:
hpi_fade_type=HPI_VOLUME_AUTOFADE_LINEAR;
break;
case RDHPISoundCard::Log:
hpi_fade_type=HPI_VOLUME_AUTOFADE_LOG;
break;
@ -439,9 +444,11 @@ bool RDHPISoundCard::queryInputPortMux(int card,int port,SourceNode node) const
case RDHPISoundCard::LineIn:
return input_port_mux_type[card][port][0];
break;
case RDHPISoundCard::AesEbuIn:
return input_port_mux_type[card][port][1];
break;
default:
return false;
break;
@ -807,6 +814,7 @@ void RDHPISoundCard::HPIProbe()
input_port_mux_type[i][j][0]=true;
input_mux_index[i][j][0]=index;
break;
case HPI_SOURCENODE_AESEBU_IN:
input_port_mux_type[i][j][1]=true;
input_mux_index[i][j][1]=index;