summaryrefslogtreecommitdiff
path: root/src/sample.cc
diff options
context:
space:
mode:
authordeva <deva>2008-07-22 21:00:01 +0000
committerdeva <deva>2008-07-22 21:00:01 +0000
commitf6cabfe8fe888e00388a815541084b0fa332a462 (patch)
treed39301b9e194e2e58a24c92ec5526d05fa1b4a3a /src/sample.cc
parent14309bc447960536c34a438dffb93f520dad40fa (diff)
DrumKit parser. Internal drumkit now used in events. This is the first milestone.
Diffstat (limited to 'src/sample.cc')
-rw-r--r--src/sample.cc18
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;
}