- if (path.empty()) {
- click_emphasis_data = const_cast<Sample*> (default_click_emphasis);
- click_emphasis_length = default_click_emphasis_length;
- } else {
- if ((sndfile = sf_open (path.c_str(), SFM_READ, &info)) == 0) {
- char errbuf[256];
- sf_error_str (0, errbuf, sizeof (errbuf) - 1);
- warning << string_compose (_("cannot open click emphasis soundfile %1 (%2)"), path, errbuf) << endmsg;
- return;
- }
-
- click_emphasis_data = new Sample[info.frames];
- click_emphasis_length = info.frames;
-
- if (sf_read_float (sndfile, click_emphasis_data, info.frames) != info.frames) {
- warning << _("cannot read data from click emphasis soundfile") << endmsg;
- delete click_emphasis_data;
- click_emphasis_data = 0;
- }
-
- sf_close (sndfile);
- }
+ if (which == 0 || which == -1) {
+ setup_click_sounds (
+ &click_emphasis_data,
+ default_click_emphasis,
+ &click_emphasis_length,
+ default_click_emphasis_length,
+ Config->get_click_emphasis_sound ()
+ );