X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=command.c;h=6e2cf5633891a9dd185d5e9cbf8f270eb9a39e4a;hp=b2dca3a36b4665e8423042b2eea26b759cb96c92;hb=51cab2aba416fc1d57336f4e72da6b76ec60174c;hpb=cbec60cc7923bdcb4bb00c183c6f3a632889ed1d diff --git a/command.c b/command.c index b2dca3a3..6e2cf563 100644 --- a/command.c +++ b/command.c @@ -97,7 +97,7 @@ static char *vss_get_status_flags(unsigned int flags) static char *get_status(struct misc_meta_data *nmmd) { - char *basename, *dirname, *ret, mtime[30] = ""; + char *ret, mtime[30] = ""; char *status, *flags; /* vss status info */ char *ut = uptime_str(); long offset = (nmmd->offset + 500) / 1000; @@ -107,32 +107,29 @@ static char *get_status(struct misc_meta_data *nmmd) /* report real status */ status = vss_status_tohuman(nmmd->vss_status_flags); flags = vss_get_status_flags(nmmd->vss_status_flags); - basename = para_basename(nmmd->afd.path); - dirname = para_dirname(nmmd->afd.path); - if (basename) { + if (nmmd->size) { /* parent currently has an audio file open */ localtime_r(&nmmd->mtime, &mtime_tm); strftime(mtime, 29, "%a %b %d %Y", &mtime_tm); } gettimeofday(&now, NULL); ret = make_message( - "%s:%zu\n" "%s:%s\n" "%s:%lu\n" "%s:%u\n" - "%s:%s\n" "%s:%s\n" "%s:%s\n" "%s:%u\n" - "%s:%li\n" "%s:%s\n" "%s" - "%s:%s\n" "%s:%lu.%lu\n" "%s:%lu.%lu\n" - "%s:%s\n" "%s:%u\n" "%s\n", + "%s:%zu\n" /* file size */ + "%s:%s\n" /* mtime */ + "%s:%s\n" /* status */ + "%s:%s\n" /* status flags */ + "%s:%li\n" /* offset */ + "%s:%s\n" /* afs mode */ + "%s:%s\n" /* server uptime */ + "%s:%lu.%lu\n" /* stream start */ + "%s:%lu.%lu\n" /* current server time */ + "%s\n", /* afs status info */ status_item_list[SI_FILE_SIZE], nmmd->size / 1024, status_item_list[SI_MTIME], mtime, - status_item_list[SI_LENGTH], nmmd->afd.afhi.seconds_total, - status_item_list[SI_NUM_PLAYED], nmmd->num_played, - - status_item_list[SI_BASENAME], basename ? basename : "(none)", status_item_list[SI_STATUS], status, status_item_list[SI_STATUS_FLAGS], flags, - status_item_list[SI_IMAGE_ID], nmmd->afd.afsi.image_id, status_item_list[SI_OFFSET], offset, status_item_list[SI_AFS_MODE], mmd->afs_mode_string, - nmmd->afd.afhi.info_string, status_item_list[SI_UPTIME], ut, status_item_list[SI_STREAM_START], @@ -142,13 +139,9 @@ static char *get_status(struct misc_meta_data *nmmd) (long unsigned)now.tv_sec, (long unsigned)now.tv_usec, - status_item_list[SI_DIRECTORY], dirname? dirname : "(none)", - status_item_list[SI_LYRICS_ID], nmmd->afd.afsi.lyrics_id, nmmd->afd.afs_status_info ); - free(basename); - free(dirname); free(flags); free(status); free(ut);