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 = 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"; sample.\nRange: (-1..1)\n";
pub const trig : &'static str = 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'"; and triggers the playback if the 'pmode' is 'OneShot'";
pub const spos : &'static str = pub const spos : &'static str =
"Sampl spos\nStart position offset.\nRange: (-1..1)\n"; "Sampl spos\nStart position offset.\nRange: (-1..1)\n";
@ -36,13 +36,13 @@ impl Sampl {
pub const pmode : &'static str = pub const pmode : &'static str =
"Sampl pmode\nThe playback mode of the sampler.\n\ "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\ using the 'trig' input in this case.\n\
- 'OneShot' plays back the sample if a trigger is received on 'trig' input.\n"; - 'OneShot' plays back the sample if a trigger is received on 'trig' input.\n";
pub const dclick : &'static str = 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 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."; getting rid of the clicks if spos and epos are modulated.";
pub const sig : &'static str = pub const sig : &'static str =

View file

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