X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=aft.c;h=2d40c235df8cf51fab7c2134e6bce1499769c9bf;hp=a8fe08105912af0ee5235a255f13f400b1f1bf2f;hb=5cf4c974286ded864ccfad07ee0f4c44fced1163;hpb=d20b524267f4c0594e0246643853db8cba68fa10 diff --git a/aft.c b/aft.c index a8fe0810..2d40c235 100644 --- a/aft.c +++ b/aft.c @@ -1031,6 +1031,10 @@ void make_empty_status_items(char *buf) "%s: \n" /* seconds total */ "%s: \n" /* num played */ "%s: \n" /* last played */ + "%s: \n" /* audio file info */ + "%s: \n" /* taginfo1 */ + "%s: \n" /* taginfo2 */ + "%s: \n" /* amplification */ , status_item_list[SI_PATH], status_item_list[SI_DIRECTORY], @@ -1050,7 +1054,11 @@ void make_empty_status_items(char *buf) status_item_list[SI_DURATION], status_item_list[SI_SECONDS_TOTAL], status_item_list[SI_NUM_PLAYED], - status_item_list[SI_LAST_PLAYED] + status_item_list[SI_LAST_PLAYED], + status_item_list[SI_AUDIO_FILE_INFO], + status_item_list[SI_TAGINFO1], + status_item_list[SI_TAGINFO2], + status_item_list[SI_AMPLIFICATION] ); } @@ -1808,6 +1816,7 @@ static int add_one_audio_file(const char *path, void *private_data) afhi_ptr = &afhi; } munmap(map.data, map.size); + close(fd); if (pad->flags & ADD_FLAG_VERBOSE) { send_ret = send_va_buffer(pad->fd, "adding %s\n", path); if (send_ret < 0) @@ -1925,7 +1934,7 @@ struct com_touch_options { /** New image id. */ int32_t image_id; /** New amplification value. */ - uint8_t amp; + int32_t amp; /** Command line flags (see \ref touch_flags). */ unsigned flags; }; @@ -1947,7 +1956,7 @@ static int touch_audio_file(__a_unused struct osl_table *table, struct osl_object obj; struct afs_info old_afsi, new_afsi; int ret, no_options = tad->cto->num_played < 0 && tad->cto->last_played < 0 && - tad->cto->lyrics_id < 0 && tad->cto->image_id < 0; + tad->cto->lyrics_id < 0 && tad->cto->image_id < 0 && tad->cto->amp < 0; struct afsi_change_event_data aced; ret = get_afsi_object_of_row(row, &obj); @@ -1981,7 +1990,8 @@ static int touch_audio_file(__a_unused struct osl_table *table, new_afsi.num_played = tad->cto->num_played; if (tad->cto->last_played >= 0) new_afsi.last_played = tad->cto->last_played; - new_afsi.amp = tad->cto->amp; + if (tad->cto->amp >= 0) + new_afsi.amp = tad->cto->amp; } tad->num_matches++; save_afsi(&new_afsi, &obj); /* in-place update */ @@ -2030,7 +2040,7 @@ int com_touch(int fd, int argc, char * const * const argv) .last_played = -1, .lyrics_id = -1, .image_id = -1, - .amp = 0, + .amp = -1, }; struct osl_object query = {.data = &cto, .size = sizeof(cto)}; int i, ret;