mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-21 21:16:15 +02:00
xxxx
git-svn-id: svn://elaine/murooma/trunk@272 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
16ef1ae634
commit
feabfee936
50 changed files with 1996 additions and 1984 deletions
|
@ -12,37 +12,37 @@ SampleFormat::SampleFormat() : BaseMessage(message_type::sampleformat)
|
|||
|
||||
SampleFormat::SampleFormat(const std::string& format) : BaseMessage(message_type::sampleformat)
|
||||
{
|
||||
setFormat(format);
|
||||
setFormat(format);
|
||||
}
|
||||
|
||||
|
||||
SampleFormat::SampleFormat(uint16_t sampleRate, uint16_t bitsPerSample, uint16_t channelCount) : BaseMessage(message_type::sampleformat)
|
||||
{
|
||||
setFormat(sampleRate, bitsPerSample, channelCount);
|
||||
setFormat(sampleRate, bitsPerSample, channelCount);
|
||||
}
|
||||
|
||||
|
||||
void SampleFormat::setFormat(const std::string& format)
|
||||
{
|
||||
std::vector<std::string> strs;
|
||||
boost::split(strs, format, boost::is_any_of(":"));
|
||||
if (strs.size() == 3)
|
||||
setFormat(
|
||||
boost::lexical_cast<uint16_t>(strs[0]),
|
||||
boost::lexical_cast<uint16_t>(strs[1]),
|
||||
boost::lexical_cast<uint16_t>(strs[2]));
|
||||
std::vector<std::string> strs;
|
||||
boost::split(strs, format, boost::is_any_of(":"));
|
||||
if (strs.size() == 3)
|
||||
setFormat(
|
||||
boost::lexical_cast<uint16_t>(strs[0]),
|
||||
boost::lexical_cast<uint16_t>(strs[1]),
|
||||
boost::lexical_cast<uint16_t>(strs[2]));
|
||||
}
|
||||
|
||||
|
||||
void SampleFormat::setFormat(uint16_t rate, uint16_t bits, uint16_t channels)
|
||||
{
|
||||
this->rate = rate;
|
||||
this->bits = bits;
|
||||
this->channels = channels;
|
||||
sampleSize = bits / 8;
|
||||
if (bits == 24)
|
||||
sampleSize = 4;
|
||||
frameSize = channels*sampleSize;
|
||||
this->rate = rate;
|
||||
this->bits = bits;
|
||||
this->channels = channels;
|
||||
sampleSize = bits / 8;
|
||||
if (bits == 24)
|
||||
sampleSize = 4;
|
||||
frameSize = channels*sampleSize;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue