-/* sc */
-int com_sc(int fd, int argc, char **argv)
-{
- char *name = NULL;
- int ret, old = 0, count = -1; /* print af change forever */
-
- if (argc > 1)
- count = atoi(argv[1]);
-repeat:
- mmd_lock();
- if (old != mmd->num_played) {
- old = mmd->num_played;
- name = para_strdup(mmd->filename);
- }
- mmd_unlock();
- if (name) {
- ret = send_va_buffer(fd, "%s\n", name);
- free(name);
- name = NULL;
- if (ret < 0)
- return ret;
- if (argc > 1 && !--count)
- return 1;
- }
- usleep(500000);
- goto repeat;
-}
-
-/* sb */
-int com_sb(int fd, int argc, char **argv)
-{
- char *sb;
- int ret, nr = -1; /* status bar will be printed that many
- * times. Negative value means: print
- * forever
- */
- if (argc > 1)
- nr = atoi(argv[1]);
- while (nr) {
- mmd_lock();
- sb = get_sb_string(mmd);
- mmd_unlock();
- ret = send_va_buffer(fd, "%s\n", sb);
- free(sb);
- if (ret < 0)
- return ret;
- if (nr == 1)
- return 1;
- usleep(500000);
- if (nr > 0)
- nr--;
- }
- return 1;
+/**
+ * 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]
+ );