Merge pull request #6 from dg0tm/master

compiler fixes
pull/8/head
Jonathan Naylor 8 years ago committed by GitHub
commit 2bafb2f67c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

1
.gitignore vendored

@ -8,3 +8,4 @@ Release
*.bak *.bak
.vs .vs
*.a *.a
*.d

@ -19,7 +19,7 @@
class IAudioCallback { class IAudioCallback {
public: public:
virtual void readCallback(const wxFloat32* input, unsigned int nSamples, int id) = 0; virtual void readCallback(const wxFloat32* input, unsigned int nSamples, int id) = 0;
virtual void writeCallback(wxFloat32* output, unsigned int& nSamples, int id) = 0; virtual void writeCallback(wxFloat32* output, int& nSamples, int id) = 0;
private: private:
}; };

@ -591,7 +591,7 @@ void CSoundCardController::readCallback(const wxFloat32* input, unsigned int n,
#endif #endif
} }
void CSoundCardController::writeCallback(wxFloat32* output, unsigned int& n, int id) void CSoundCardController::writeCallback(wxFloat32* output, int& n, int id)
{ {
if (n == 0U) if (n == 0U)
return; return;

@ -52,7 +52,7 @@ public:
virtual bool writeData(const unsigned char* data, unsigned int length, bool end); virtual bool writeData(const unsigned char* data, unsigned int length, bool end);
virtual void readCallback(const wxFloat32* input, unsigned int n, int id); virtual void readCallback(const wxFloat32* input, unsigned int n, int id);
virtual void writeCallback(wxFloat32* output, unsigned int& n, int id); virtual void writeCallback(wxFloat32* output, int& n, int id);
private: private:
CSoundCardReaderWriter m_sound; CSoundCardReaderWriter m_sound;

@ -730,25 +730,25 @@ void* CSoundCardWriter::Entry()
wxLogMessage(wxT("Starting ALSA writer thread")); wxLogMessage(wxT("Starting ALSA writer thread"));
while (!m_killed) { while (!m_killed) {
unsigned int nSamples = 2U * m_blockSize; int nSamples = 2U * m_blockSize;
m_callback->writeCallback(m_buffer, nSamples, m_id); m_callback->writeCallback(m_buffer, nSamples, m_id);
if (nSamples == 0U) { if (nSamples == 0U) {
Sleep(5UL); Sleep(5UL);
} else { } else {
if (m_channels == 1U) { if (m_channels == 1U) {
for (unsigned int n = 0U; n < nSamples; n++) for (int n = 0U; n < nSamples; n++)
m_samples[n] = short(m_buffer[n] * 32767.0F); m_samples[n] = short(m_buffer[n] * 32767.0F);
} else { } else {
unsigned int i = 0U; int i = 0U;
for (unsigned int n = 0U; n < nSamples; n++) { for (int n = 0U; n < nSamples; n++) {
short sample = short(m_buffer[n] * 32767.0F); short sample = short(m_buffer[n] * 32767.0F);
m_samples[i++] = sample; m_samples[i++] = sample;
m_samples[i++] = sample; // Same value to both channels m_samples[i++] = sample; // Same value to both channels
} }
} }
unsigned int offset = 0U; int offset = 0U;
snd_pcm_sframes_t ret; snd_pcm_sframes_t ret;
while ((ret = ::snd_pcm_writei(m_handle, m_samples + offset, nSamples - offset)) != (nSamples - offset)) { while ((ret = ::snd_pcm_writei(m_handle, m_samples + offset, nSamples - offset)) != (nSamples - offset)) {
if (ret < 0) { if (ret < 0) {
@ -759,7 +759,7 @@ void* CSoundCardWriter::Entry()
::snd_pcm_recover(m_handle, ret, 1); ::snd_pcm_recover(m_handle, ret, 1);
} else { } else {
offset += (unsigned int)ret; offset += ret;
} }
} }
} }

@ -503,13 +503,15 @@ void CDStarRepeaterApp::createThread()
wxLogInfo("Split, local: %s:%u, timeout: %u ms", localAddress.c_str(), localPort, timeout); wxLogInfo("Split, local: %s:%u, timeout: %u ms", localAddress.c_str(), localPort, timeout);
for (unsigned int i = 0U; i < transmitterNames.GetCount(); i++) { for (unsigned int i = 0U; i < transmitterNames.GetCount(); i++) {
wxString name = transmitterNames.Item(i); wxString name = transmitterNames.Item(i);
if (!name.IsEmpty()) if (!name.IsEmpty()) {
wxLogInfo("\tTX %u name: %s", i + 1U, name.c_str()); wxLogInfo("\tTX %u name: %s", i + 1U, name.c_str());
}
} }
for (unsigned int i = 0U; i < receiverNames.GetCount(); i++) { for (unsigned int i = 0U; i < receiverNames.GetCount(); i++) {
wxString name = receiverNames.Item(i); wxString name = receiverNames.Item(i);
if (!name.IsEmpty()) if (!name.IsEmpty()) {
wxLogInfo("\tRX %u name: %s", i + 1U, name.c_str()); wxLogInfo("\tRX %u name: %s", i + 1U, name.c_str());
}
} }
modem = new CSplitController(localAddress, localPort, transmitterNames, receiverNames, timeout); modem = new CSplitController(localAddress, localPort, transmitterNames, receiverNames, timeout);
} else if (modemType.IsSameAs("Icom Access Point/Terminal Mode")) { } else if (modemType.IsSameAs("Icom Access Point/Terminal Mode")) {

@ -5,7 +5,7 @@ export BINDIR := "/usr/bin"
export CXX := $(shell wx-config --cxx) export CXX := $(shell wx-config --cxx)
export CFLAGS := -O2 -Wall $(shell wx-config --cxxflags) -DLOG_DIR='$(LOGDIR)' -DCONF_DIR='$(CONFDIR)' -DDATA_DIR='$(DATADIR)' export CFLAGS := -O2 -Wall $(shell wx-config --cxxflags) -DLOG_DIR='$(LOGDIR)' -DCONF_DIR='$(CONFDIR)' -DDATA_DIR='$(DATADIR)'
export GUILIBS := $(shell wx-config --libs adv,core,base) -lasound -lusb-1.0 export GUILIBS := $(shell wx-config --libs adv,core,base) -lasound
export LIBS := $(shell wx-config --libs base) -lasound -lusb-1.0 export LIBS := $(shell wx-config --libs base) -lasound -lusb-1.0
export LDFLAGS := export LDFLAGS :=
@ -39,4 +39,3 @@ clean:
.PHONY: force .PHONY: force
force: force:
@true @true

@ -23,7 +23,7 @@ GUICommon/GUICommon.a: force
Common/Common.a: force Common/Common.a: force
$(MAKE) -C Common $(MAKE) -C Common
.PHONY: .PHONY: install
install: all install: all
$(MAKE) -C Data install $(MAKE) -C Data install
$(MAKE) -C DStarRepeater install $(MAKE) -C DStarRepeater install

Loading…
Cancel
Save

Powered by TurnKey Linux.