本文整理汇总了C++中AudioPlayer::canPlaylist方法的典型用法代码示例。如果您正苦于以下问题:C++ AudioPlayer::canPlaylist方法的具体用法?C++ AudioPlayer::canPlaylist怎么用?C++ AudioPlayer::canPlaylist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AudioPlayer
的用法示例。
在下文中一共展示了AudioPlayer::canPlaylist方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
json_t *JsonApi::buildJsonAudio()
{
json_t *jdata = json_array();
for (int i = 0;i < AudioManager::Instance().get_size();i++)
{
AudioPlayer *player = AudioManager::Instance().get_player(i);
json_t *jaudio = json_object();
json_object_set_new(jaudio, "id", json_string(Utils::to_string(i).c_str()));
json_object_set_new(jaudio, "input_id", json_string(player->get_param("iid").c_str()));
json_object_set_new(jaudio, "output_id", json_string(player->get_param("oid").c_str()));
json_object_set_new(jaudio, "name", json_string(player->get_param("name").c_str()));
json_object_set_new(jaudio, "type", json_string(player->get_param("type").c_str()));
json_object_set_new(jaudio, "playlist", json_string(player->canPlaylist()?"true":"false"));
json_object_set_new(jaudio, "database", json_string(player->canDatabase()?"true":"false"));
if (player->get_params().Exists("amp"))
json_object_set_new(jaudio, "avr", json_string(player->get_param("amp").c_str()));
json_array_append_new(jdata, jaudio);
//don't query detailed player infos here, other informations need to be queried to the squeezecenter
//so the get_home request will be delayed by all the squeezecenter's requests.
//To be faster, only return the basic infos here, and call get_state for each players to get detailed infos
}
return jdata;
}