diff options
Diffstat (limited to 'src/sample.cc')
-rw-r--r-- | src/sample.cc | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/sample.cc b/src/sample.cc index c375645..5a06331 100644 --- a/src/sample.cc +++ b/src/sample.cc @@ -31,25 +31,11 @@ #include <sndfile.h> -Sample::Sample(char *file) +Sample::Sample(std::string name) { - SF_INFO sf_info; - SNDFILE *fh = sf_open(file, SFM_READ, &sf_info); - - size = sf_seek(fh, 0, SEEK_END); - data = (jack_default_audio_sample_t*)malloc(sizeof(jack_default_audio_sample_t)*size); - - printf("Loading %s, %d samples\n", file, size); - - sf_seek(fh, 0, SEEK_SET); - sf_read_float(fh, data, size); - - sf_close(fh); + this->name = name; } Sample::~Sample() { - free(data); - data = NULL; - size = 0; } |