{
struct avrcp_player *player;
struct media_player *mp;
+ struct media_item *item;
uint16_t namelen;
char name[255];
uint64_t uid;
player = session->player;
mp = player->user_data;
- return media_player_create_item(mp, name, PLAYER_ITEM_TYPE_AUDIO, uid);
+ item = media_player_create_item(mp, name, PLAYER_ITEM_TYPE_AUDIO, uid);
+ if (item == NULL)
+ return NULL;
+
+ media_item_set_playable(item, true);
+
+ return item;
}
static struct media_item *parse_media_folder(struct avrcp *session,
{ }
};
+void media_item_set_playable(struct media_item *item, bool value)
+{
+ if (item->playable == value)
+ return;
+
+ item->playable = value;
+
+ g_dbus_emit_property_changed(btd_get_dbus_connection(), item->path,
+ MEDIA_ITEM_INTERFACE, "Playable");
+}
+
struct media_item *media_player_create_item(struct media_player *mp,
const char *name,
player_item_type_t type,
player_item_type_t type,
uint64_t uid);
+void media_item_set_playable(struct media_item *item, bool value);
void media_player_list_complete(struct media_player *mp, GSList *items,
int err);