loading empty samples is not done anymore

This commit is contained in:
Weird Constructor 2021-05-28 05:14:56 +02:00
parent cd2bbafcb6
commit 663e88efeb
2 changed files with 19 additions and 14 deletions

View file

@ -20,11 +20,11 @@ impl Sampl {
}
}
pub const freq : &'static str =
"Sampl freq\nPitch input for the sampler, giving the playback speed of the\
"Sampl freq\nPitch input for the sampler, giving the playback speed of the \
sample.\nRange: (-1..1)\n";
pub const trig : &'static str =
"Sampl trig\nThe trigger input causes a resync of the playback phase\
"Sampl trig\nThe trigger input causes a resync of the playback phase \
and triggers the playback if the 'pmode' is 'OneShot'";
pub const spos : &'static str =
"Sampl spos\nStart position offset.\nRange: (-1..1)\n";
@ -36,13 +36,13 @@ impl Sampl {
pub const pmode : &'static str =
"Sampl pmode\nThe playback mode of the sampler.\n\
- 'Loop' constantly plays back the sample. You can reset/sync the phase\
- 'Loop' constantly plays back the sample. You can reset/sync the phase \
using the 'trig' input in this case.\n\
- 'OneShot' plays back the sample if a trigger is received on 'trig' input.\n";
pub const dclick : &'static str =
"Sampl dclick\nIf this is enabled and the 'pmode' is 'OneShot'\
"Sampl dclick\nIf this is enabled and the 'pmode' is 'OneShot' \
this will enable short fade in and out ramps.\n\
This if useful if you don't want to add an envelope just for\
This if useful if you don't want to add an envelope just for \
getting rid of the clicks if spos and epos are modulated.";
pub const sig : &'static str =

View file

@ -308,18 +308,23 @@ impl NodeConfigurator {
if param.is_atom() {
let at =
if let SAtom::AudioSample((path, None)) = at.clone() {
if path.len() > 0 {
match self.sample_lib.load(&path) {
Ok(sample) => sample.clone(),
Err(e) => {
self.errors.push(
format!(
"Couldn't load sample '{}': {:?}",
"Sample Loading Error\n\
Couldn't load sample '{}':\n{:?}",
path, e));
at
},
}
} else {
at
}
} else {
at
};
self.atom_values.insert(param, at.clone());