Skip to content
Snippets Groups Projects
Commit d5e52e74 authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

audio: remove use of libsndfile for UWP build

- remove the referencing of sndfile objects, as UWP implements
  the playing of ringtone files client-side.

Change-Id: I88e12b31c2fd66d3e171d971960eb66bdf8875a4
Tuleap: #790
parent a6daed12
Branches
Tags
No related merge requests found
...@@ -28,7 +28,9 @@ ...@@ -28,7 +28,9 @@
#include "fileutils.h" #include "fileutils.h"
#include "manager.h" #include "manager.h"
#ifndef RING_UWP
#include <sndfile.hh> #include <sndfile.hh>
#endif
#include <algorithm> #include <algorithm>
#include <sstream> // for stringstream #include <sstream> // for stringstream
...@@ -147,6 +149,7 @@ std::string AudioRecord::getFilename() const ...@@ -147,6 +149,7 @@ std::string AudioRecord::getFilename() const
bool bool
AudioRecord::openFile() AudioRecord::openFile()
{ {
#ifndef RING_UWP
fileHandle_.reset(); // do it before calling fileExists() fileHandle_.reset(); // do it before calling fileExists()
const bool doAppend = fileExists(); const bool doAppend = fileExists();
...@@ -170,6 +173,9 @@ AudioRecord::openFile() ...@@ -170,6 +173,9 @@ AudioRecord::openFile()
RING_WARN("Couldn't seek to the end of the file "); RING_WARN("Couldn't seek to the end of the file ");
return true; return true;
#else
return false;
#endif
} }
void void
...@@ -218,6 +224,7 @@ AudioRecord::stopRecording() const noexcept ...@@ -218,6 +224,7 @@ AudioRecord::stopRecording() const noexcept
void void
AudioRecord::recData(AudioBuffer& buffer) AudioRecord::recData(AudioBuffer& buffer)
{ {
#ifndef RING_UWP
if (not recordingEnabled_) if (not recordingEnabled_)
return; return;
...@@ -228,6 +235,7 @@ AudioRecord::recData(AudioBuffer& buffer) ...@@ -228,6 +235,7 @@ AudioRecord::recData(AudioBuffer& buffer)
} else { } else {
fileHandle_->writeSync(); fileHandle_->writeSync();
} }
#endif
} }
} // namespace ring } // namespace ring
...@@ -26,7 +26,10 @@ ...@@ -26,7 +26,10 @@
#include <cstring> #include <cstring>
#include <vector> #include <vector>
#include <climits> #include <climits>
#ifndef RING_UWP
#include <sndfile.hh> #include <sndfile.hh>
#endif
#include "audiofile.h" #include "audiofile.h"
#include "audio/resampler.h" #include "audio/resampler.h"
...@@ -59,6 +62,7 @@ AudioFile::onBufferFinish() ...@@ -59,6 +62,7 @@ AudioFile::onBufferFinish()
AudioFile::AudioFile(const std::string &fileName, unsigned int sampleRate) : AudioFile::AudioFile(const std::string &fileName, unsigned int sampleRate) :
AudioLoop(sampleRate), filepath_(fileName), updatePlaybackScale_(0) AudioLoop(sampleRate), filepath_(fileName), updatePlaybackScale_(0)
{ {
#ifndef RING_UWP
int format; int format;
bool hasHeader = true; bool hasHeader = true;
...@@ -127,6 +131,7 @@ AudioFile::AudioFile(const std::string &fileName, unsigned int sampleRate) : ...@@ -127,6 +131,7 @@ AudioFile::AudioFile(const std::string &fileName, unsigned int sampleRate) :
delete buffer_; delete buffer_;
buffer_ = buffer; buffer_ = buffer;
} }
#endif
} }
} // namespace ring } // namespace ring
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment