Skip to content

Commit

Permalink
Remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
btrkeks committed Aug 26, 2024
1 parent 39d1f67 commit 4c6a7c7
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 32 deletions.
1 change: 0 additions & 1 deletion include/platformdep/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include <utils/str.h>

void play_audio_sync(s8 filepath);
void play_audio_async(s8 filepath);

#endif // AUDIO_H
21 changes: 0 additions & 21 deletions src/jppron/jppron.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,6 @@ static void process_audio_subdirectory(const char *audio_dir_path, char *subdir_
dbg("Index file of folder '%s' not existing or not accessible", subdir_name);
}

static void jppron_create_database(const char *audio_dir_path, s8 dbpth) {
jdb_remove(dbpth);
createdir(dbpth);

_drop_(jppron_close_db) PronDatabase *db = jppron_open_db(false);

_drop_(closedir) DIR *audio_dir = opendir(audio_dir_path);
err_ret_on(!audio_dir, "Failed to open audio directory '%s': %s", audio_dir_path,
strerror(errno));

struct dirent *entry;
while ((entry = readdir(audio_dir)) != NULL) {
s8 fn = fromcstr_(entry->d_name);

if (s8equals(fn, S(".")) || s8equals(fn, S("..")))
continue;

process_audio_subdirectory(audio_dir_path, entry->d_name, db);
}
}

static s8 normalize_reading(s8 reading) {
s8 r = s8dup(reading);
kata2hira(r);
Expand Down
10 changes: 0 additions & 10 deletions src/platformdep/audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@
#include "utils/messages.h"
#include <utils/str.h>

void play_audio_sync(s8 filepath) {
_drop_(frees8) s8 cmd =
concat(S("ffplay -nodisp -nostats -hide_banner -autoexit '"), filepath, S("'"));

g_autoptr(GError) error = NULL;
g_spawn_command_line_sync((char *)cmd.s, NULL, NULL, NULL, &error);
if (error)
err("Failed to play file %s: %s", (char *)filepath.s, error->message);
}

static void child_watch_cb(GPid pid, gint status, gpointer user_data) {
g_spawn_close_pid(pid);
}
Expand Down

0 comments on commit 4c6a7c7

Please sign in to comment.