summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drumgizmo/output/alsa/alsa.cc12
-rw-r--r--drumgizmo/output/jackaudio/jackaudio.cc8
-rw-r--r--drumgizmo/output/wavfile/wavfile.cc6
3 files changed, 14 insertions, 12 deletions
diff --git a/drumgizmo/output/alsa/alsa.cc b/drumgizmo/output/alsa/alsa.cc
index dc2ac73..71e0c3d 100644
--- a/drumgizmo/output/alsa/alsa.cc
+++ b/drumgizmo/output/alsa/alsa.cc
@@ -52,15 +52,15 @@ public:
size_t samplerate();
private:
- snd_pcm_t *handle;
- snd_pcm_hw_params_t *params;
- sample_t *data;
- size_t channels;
+ snd_pcm_t *handle{nullptr};
+ snd_pcm_hw_params_t *params{nullptr};
+ sample_t *data{nullptr};
+ size_t channels{0};
// Parameters
std::string device;
- unsigned int srate;
- snd_pcm_uframes_t frames;
+ unsigned int srate{0};
+ snd_pcm_uframes_t frames{0};
};
Alsa::Alsa()
diff --git a/drumgizmo/output/jackaudio/jackaudio.cc b/drumgizmo/output/jackaudio/jackaudio.cc
index 5c04146..511c145 100644
--- a/drumgizmo/output/jackaudio/jackaudio.cc
+++ b/drumgizmo/output/jackaudio/jackaudio.cc
@@ -57,10 +57,10 @@ public:
size_t samplerate();
private:
- JackClient *jackclient;
- jack_port_t *output_port[64];
- size_t nchannels;
- sample_t **channels;
+ JackClient *jackclient{nullptr};
+ jack_port_t *output_port[64] = {};
+ size_t nchannels{0};
+ sample_t **channels{nullptr};
Semaphore sem;
};
diff --git a/drumgizmo/output/wavfile/wavfile.cc b/drumgizmo/output/wavfile/wavfile.cc
index fa4128e..8401f80 100644
--- a/drumgizmo/output/wavfile/wavfile.cc
+++ b/drumgizmo/output/wavfile/wavfile.cc
@@ -28,6 +28,7 @@
#include <audiotypes.h>
#include <string>
+#include <memory.h>
#include <sndfile.h>
@@ -48,8 +49,8 @@ public:
private:
SF_INFO sf_info;
- SNDFILE **fh;
- size_t channels;
+ SNDFILE **fh{nullptr};
+ size_t channels{0};
// Parameters
std::string filename;
@@ -60,6 +61,7 @@ WavFile::WavFile()
fh = NULL;
filename = "output";
+ memset(&sf_info, 0, sizeof(sf_info));
sf_info.channels = 1;//channels;
sf_info.format = SF_FORMAT_WAV | SF_FORMAT_FLOAT;
sf_info.samplerate = 44100;