@@ -60,9 +60,9 @@ OnixDeviceType AnalogIO::getDeviceType()
6060
6161int AnalogIO::configureDevice ()
6262{
63- if (deviceContext == nullptr || !deviceContext->isInitialized ())
63+ if (deviceContext == nullptr || !deviceContext->isInitialized ())
6464 throw error_str (" Device context is not initialized properly for " + getName ());
65-
65+
6666 return deviceContext->writeRegister (deviceIdx, (uint32_t )AnalogIORegisters::ENABLE, (oni_reg_val_t )(isEnabled () ? 1 : 0 ));
6767}
6868
@@ -135,13 +135,8 @@ void AnalogIO::addFrame(oni_frame_t* frame)
135135
136136void AnalogIO::addSourceBuffers (OwnedArray<DataBuffer>& sourceBuffers)
137137{
138- for (StreamInfo streamInfo : streamInfos)
139- {
140- sourceBuffers.add (new DataBuffer (streamInfo.getNumChannels (), (int )streamInfo.getSampleRate () * bufferSizeInSeconds));
141-
142- if (streamInfo.getChannelPrefix ().equalsIgnoreCase (" AnalogInput" ))
143- analogInputBuffer = sourceBuffers.getLast ();
144- }
138+ sourceBuffers.add (new DataBuffer (streamInfos.getFirst ().getNumChannels (), (int )streamInfos.getFirst ().getSampleRate () * bufferSizeInSeconds));
139+ analogInputBuffer = sourceBuffers.getLast ();
145140}
146141
147142void AnalogIO::processFrames ()
@@ -155,7 +150,7 @@ void AnalogIO::processFrames()
155150
156151 int dataOffset = 4 ;
157152
158- for (int i = 0 ; i < numChannels; i++)
153+ for (size_t i = 0 ; i < numChannels; i++)
159154 {
160155 if (dataType == AnalogIODataType::S16)
161156 analogInputSamples[currentFrame + i * numFrames] += *(dataPtr + dataOffset + i);
@@ -167,7 +162,7 @@ void AnalogIO::processFrames()
167162
168163 if (currentAverageFrame >= framesToAverage)
169164 {
170- for (int i = 0 ; i < numChannels; i++)
165+ for (size_t i = 0 ; i < numChannels; i++)
171166 {
172167 analogInputSamples[currentFrame + i * numFrames] /= framesToAverage;
173168 }
0 commit comments