Skip to content

Commit

Permalink
devices/liquidsfz/liquidsfz.cc: avoid using printf (use printerr inst…
Browse files Browse the repository at this point in the history
…ead)

Signed-off-by: Stefan Westerfeld <[email protected]>
  • Loading branch information
swesterfeld authored and tim-janik committed Feb 14, 2024
1 parent 966f87f commit 25c0f8a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions devices/liquidsfz/liquidsfz.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ class LiquidSFZLoader
{
if (want_sfz_ != have_sfz_)
{
printf ("LiquidSFZ: loading %s...", want_sfz_.c_str());
fflush (stdout);
printerr ("LiquidSFZ: loading %s...", want_sfz_.c_str());
bool result = synth_.load (want_sfz_);
printf ("%s\n", result ? "OK" : "FAIL");
printerr ("%s\n", result ? "OK" : "FAIL");
// TODO: handle load error

have_sfz_ = want_sfz_;
Expand All @@ -51,22 +50,22 @@ class LiquidSFZLoader
state_.store (STATE_IDLE);
}
}
printf ("run() done\n");
printerr ("LiquidSFZ: run() done\n");
}
public:
LiquidSFZLoader (Synth &synth) :
synth_ (synth)
{
thread_ = std::thread (&LiquidSFZLoader::run, this);
want_sfz_.reserve (4096); // avoid allocations in audio thread
printf ("LiquidSFZLoader()\n");
printerr ("LiquidSFZLoader()\n");
}
~LiquidSFZLoader()
{
quit_.store (1);
sem_.post();
thread_.join();
printf ("~LiquidSFZLoader()\n");
printerr ("~LiquidSFZLoader()\n");
}
// called from audio thread
bool
Expand Down

0 comments on commit 25c0f8a

Please sign in to comment.