struct task task;
};
+extern struct misc_meta_data *mmd;
+
static int server_socket;
static struct command_task command_task_struct;
static struct signal_task signal_task_struct;
current_play_mode = mode;
if (arg != current_mop) {
free(current_mop);
- if (arg)
+ if (arg) {
current_mop = para_strdup(arg);
- else
+ mmd_lock();
+ strcpy(mmd->afs_mode_string, arg); /* FIXME: check length */
+ mmd_unlock();
+ } else {
+ mmd_lock();
+ strcpy(mmd->afs_mode_string, "dummy");
+ mmd_unlock();
current_mop = NULL;
+ }
}
return 1;
}
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:%s\n"
- "%s:%li\n" "%s:%s\n" "%s"
+ "%s:%li\n" "%s:%s\n" "%s:%s\n" "%s"
"%s:%s\n" "%s:%lu.%lu\n" "%s:%lu.%lu\n",
status_item_list[SI_FILE_SIZE], nmmd->size / 1024,
status_item_list[SI_MTIME], mtime,
status_item_list[SI_OFFSET], offset,
status_item_list[SI_FORMAT], audio_format_name(nmmd->audio_format),
+ status_item_list[SI_AFS_MODE], mmd->afs_mode_string,
nmmd->afi.info_string,
status_item_list[SI_UPTIME], ut,
d[SI_AUDIO_INFO3].y = 63;
d[SI_AUDIO_INFO3].len = 100;
- d[SI_DBINFO1].prefix = "";
- d[SI_DBINFO1].postfix = "";
- d[SI_DBINFO1].fg = COLOR_YELLOW;
- d[SI_DBINFO1].bg = COLOR_BLACK;
- d[SI_DBINFO1].align = CENTER;
- d[SI_DBINFO1].x = 0;
- d[SI_DBINFO1].y = 77;
- d[SI_DBINFO1].len = 100;
+ d[SI_AFS_MODE].prefix = "";
+ d[SI_AFS_MODE].postfix = "";
+ d[SI_AFS_MODE].fg = COLOR_YELLOW;
+ d[SI_AFS_MODE].bg = COLOR_BLACK;
+ d[SI_AFS_MODE].align = CENTER;
+ d[SI_AFS_MODE].x = 0;
+ d[SI_AFS_MODE].y = 77;
+ d[SI_AFS_MODE].len = 100;
d[SI_DBINFO2].prefix = "";
d[SI_DBINFO2].postfix = "";
SI_MTIME, SI_LENGTH_MIN, SI_LENGTH_SEC,
SI_FILE_SIZE, SI_STATUS_FLAGS, SI_FORMAT,
SI_SCORE, SI_AUDIO_INFO1, SI_AUDIO_INFO2,
- SI_AUDIO_INFO3, SI_DBINFO1, SI_DBINFO2,
+ SI_AUDIO_INFO3, SI_AFS_MODE, SI_DBINFO2,
SI_DBINFO3, SI_DECODER_FLAGS, SI_AUDIOD_STATUS,
SI_PLAY_TIME, SI_UPTIME, SI_OFFSET,
SI_LENGTH, SI_STREAM_START, SI_CURRENT_TIME,
s[SI_AUDIO_INFO3].font = N_YELLOW;
s[SI_AUDIO_INFO3].align = CENTER;
- s[SI_DBINFO1].name = "dbinfo1:";
- s[SI_DBINFO1].prefix = "";
- s[SI_DBINFO1].postfix = "";
- s[SI_DBINFO1].x = 0;
- s[SI_DBINFO1].y = 83;
- s[SI_DBINFO1].w = 100;
- s[SI_DBINFO1].h = FONT_HEIGHT;
- s[SI_DBINFO1].r = 0;
- s[SI_DBINFO1].g = 0;
- s[SI_DBINFO1].b = 0;
- s[SI_DBINFO1].font = N_YELLOW;
- s[SI_DBINFO1].align = CENTER;
+ s[SI_AFS_MODE].name = "afs_mode:";
+ s[SI_AFS_MODE].prefix = "";
+ s[SI_AFS_MODE].postfix = "";
+ s[SI_AFS_MODE].x = 0;
+ s[SI_AFS_MODE].y = 83;
+ s[SI_AFS_MODE].w = 100;
+ s[SI_AFS_MODE].h = FONT_HEIGHT;
+ s[SI_AFS_MODE].r = 0;
+ s[SI_AFS_MODE].g = 0;
+ s[SI_AFS_MODE].b = 0;
+ s[SI_AFS_MODE].font = N_YELLOW;
+ s[SI_AFS_MODE].align = CENTER;
s[SI_DBINFO2].prefix = "";
s[SI_DBINFO2].postfix = "";
goto err_out;
mmd_mutex = ret;
- mmd->selector_num = 0;
mmd->num_played = 0;
mmd->num_commands = 0;
mmd->events = 0;
/* become daemon */
if (conf.daemon_given)
daemon_init();
-// init_selector();
-// PARA_ERROR_LOG("num: %d\n", mmd->selector_num);
PARA_NOTICE_LOG("%s", "initializing virtual streaming system\n");
afh_init();
vss_init();
/** the process id of para_server */
pid_t server_pid;
/** a string that gets filled in by the current audio file selector */
- char selector_info[MMD_INFO_SIZE];
- /** The number of the current audio file selector. */
- int selector_num;
+ char afs_mode_string[MAXLINE];
/** commands set this to non-zero to change the current selector */
int selector_change;
/** used by the sender command */
[SI_AUDIO_INFO2] = "audio_file_info2",
[SI_AUDIO_INFO3] = "audio_file_info3",
- [SI_DBINFO1] = "dbinfo1",
+ [SI_AFS_MODE] = "afs_mode",
[SI_DBINFO2] = "dbinfo2",
[SI_DBINFO3] = "dbinfo3",
PARA_DEBUG_LOG("%d client(s)\n", num_clients);
}
-
/**
* check if string is a known status item.
*
{
int i;
if (!item || !*item) {
- PARA_ERROR_LOG("%s\n", "no item");
+ PARA_ERROR_LOG("%s\n", "no item");
return -E_UNKNOWN_STAT_ITEM;
}
FOR_EACH_STAT_ITEM(i)
if (!strcmp(status_item_list[i], item))
return i;
+ PARA_ERROR_LOG("invalid stat item: %s\n", item);
return -E_UNKNOWN_STAT_ITEM;
}
status_item_list[SI_AUDIO_INFO2], status_item_list[SI_AUDIO_INFO3]);
strcpy(mmd->afi.info_string, tmp);
free(tmp);
- tmp = make_message("%s:\n%s:\n%s:\n", status_item_list[SI_DBINFO1],
- status_item_list[SI_DBINFO2], status_item_list[SI_DBINFO3]);
- strcpy(mmd->selector_info, tmp);
- free(tmp);
mmd->filename[0] = '\0';
mmd->size = 0;
mmd->events++;