wavelength 1.0.0
Loading...
Searching...
No Matches
SampleWin.h
Go to the documentation of this file.
1#pragma once
2
3#include "os/Debug.h"
4#include "synth/AudioIO.h"
6#include "utl/Str.h"
7
14class SampleWin {
15public:
22 explicit SampleWin(const String &filename);
23
30
37 bool Fail();
38
44 int GetID() const {
45 return mID;
46 }
47
54 return mName;
55 }
56
62 void SetName(const String &name) {
63 if (name.size() > 0) {
64 mName = name;
65 }
66 }
67
75 ASSERT(mAudioIO);
76 return *mAudioIO;
77 }
78
85 return mSample;
86 }
87
88private:
89 int mID;
90 String mName;
91 AudioIO *mAudioIO;
92 Sample mSample;
93};
#define ASSERT(cond)
Report a failure when a condition is false.
Definition Debug.h:129
Source WAV file of a sample, and its conversion to the console's formats.
Definition AudioIO.h:29
SampleWin(const String &filename)
Create a sample from a WAV file, naming it after the file.
Sample & GetSample()
Report the playback parameters.
Definition SampleWin.h:84
void SetName(const String &name)
Rename the sample, unless the new name is empty.
Definition SampleWin.h:62
~SampleWin()
Release the reader of the WAV file.
AudioIO & GetAudioIO()
Report the reader of the WAV file.
Definition SampleWin.h:74
String & GetName()
Report the name.
Definition SampleWin.h:53
bool Fail()
Report whether the WAV file is unreadable or is not 16-bit mono.
int GetID() const
Report the identifier.
Definition SampleWin.h:44
One waveform of a bank, as the bank file records it.
Definition sample.h:10
Growable text buffer that is also a PrnStream.
Definition string.h:19
unsigned int size() const
Definition Str.h:226