#include <sys/types.h>
#include <dirent.h>
#include <openssl/rc4.h>
+#include <osl.h>
#include "para.h"
#include "error.h"
"%s: %li\n" /* offset */
"%s: %s\n" /* afs mode */
"%s: %lu.%lu\n" /* stream start */
- "%s: %lu.%lu\n" /* current server time */
- "%s", /* afs status info */
+ "%s: %lu.%lu\n", /* current server time */
status_item_list[SI_FILE_SIZE], nmmd->size / 1024,
status_item_list[SI_MTIME], mtime,
status_item_list[SI_STATUS], status,
(long unsigned)nmmd->stream_start.tv_usec,
status_item_list[SI_CURRENT_TIME],
(long unsigned)current_time.tv_sec,
- (long unsigned)current_time.tv_usec,
-
- nmmd->afd.verbose_ls_output
-
+ (long unsigned)current_time.tv_usec
);
free(flags);
free(status);
);
}
+/**
+ * Write a list of audio-file related status items with empty values.
+ *
+ * This is used by vss when currently no audio file is open.
+ */
+static char *empty_status_items(void)
+{
+ return make_message(
+ "%s: \n" /* path */
+ "%s: \n" /* dirname */
+ "%s: \n" /* basename */
+ "%s: \n" /* score */
+ "%s: \n" /* attributes bitmap */
+ "%s: \n" /* attributes txt */
+ "%s: \n" /* hash */
+ "%s: \n" /* image id */
+ "%s: \n" /* image name */
+ "%s: \n" /* lyrics id */
+ "%s: \n" /* lyrics name */
+ "%s: \n" /* bitrate */
+ "%s: \n" /* format */
+ "%s: \n" /* frequency */
+ "%s: \n" /* channels */
+ "%s: \n" /* duration */
+ "%s: \n" /* seconds total */
+ "%s: \n" /* num played */
+ "%s: \n" /* last played */
+ "%s: \n" /* techinfo */
+ "%s: \n" /* artist */
+ "%s: \n" /* title */
+ "%s: \n" /* year */
+ "%s: \n" /* album */
+ "%s: \n" /* comment */
+ "%s: \n" /* amplification */
+ ,
+ status_item_list[SI_PATH],
+ status_item_list[SI_DIRECTORY],
+ status_item_list[SI_BASENAME],
+ status_item_list[SI_SCORE],
+ status_item_list[SI_ATTRIBUTES_BITMAP],
+ status_item_list[SI_ATTRIBUTES_TXT],
+ status_item_list[SI_HASH],
+ status_item_list[SI_IMAGE_ID],
+ status_item_list[SI_IMAGE_NAME],
+ status_item_list[SI_LYRICS_ID],
+ status_item_list[SI_LYRICS_NAME],
+ status_item_list[SI_BITRATE],
+ status_item_list[SI_FORMAT],
+ status_item_list[SI_FREQUENCY],
+ status_item_list[SI_CHANNELS],
+ 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_TECHINFO],
+ status_item_list[SI_ARTIST],
+ status_item_list[SI_TITLE],
+ status_item_list[SI_YEAR],
+ status_item_list[SI_ALBUM],
+ status_item_list[SI_COMMENT],
+ status_item_list[SI_AMPLIFICATION]
+ );
+}
+
/* stat */
int com_stat(int fd, int argc, char * const * argv)
{
free(s);
if (ret < 0)
goto out;
+ if (nmmd->vss_status_flags & VSS_NEXT) {
+ static char *esi;
+ if (!esi)
+ esi = empty_status_items();
+ ret = send_buffer(fd, esi);
+ if (ret < 0)
+ goto out;
+ } else
+ send_afs_status(fd);
ret = 1;
if (num > 0 && !--num)
goto out;