/** * Remove all the occurences of the operand in the given collection. * @param coll The collection to remove the operand from. * @param op The operand to remove. */ void xmmsv_coll_remove_operand (xmmsv_t *coll, xmmsv_t *op) { xmmsv_list_iter_t *it; x_return_if_fail (coll); x_return_if_fail (op); if (!xmmsv_get_list_iter (coll->value.coll->operands, &it)) return; if (_xmmsv_coll_operand_find (it, op)) { xmmsv_list_iter_remove (it); } else { x_api_warning ("with an operand not in operand list"); } xmmsv_list_iter_explicit_destroy (it); }
/** * Recursively scan a directory for media files. * * @return a reverse sorted list of encoded urls */ static gboolean process_dir (xmms_medialib_t *medialib, xmmsv_t *entries, const gchar *directory, xmms_error_t *error) { xmmsv_list_iter_t *it; xmmsv_t *list, *val; list = xmms_xform_browse (directory, error); if (!list) { return FALSE; } xmmsv_get_list_iter (list, &it); while (xmmsv_list_iter_entry (it, &val)) { const gchar *str; gint isdir; xmmsv_dict_entry_get_string (val, "path", &str); xmmsv_dict_entry_get_int (val, "isdir", &isdir); if (isdir == 1) { process_dir (medialib, entries, str, error); } else { xmms_medialib_session_t *session; xmms_medialib_entry_t entry; do { session = xmms_medialib_session_begin (medialib); entry = xmms_medialib_entry_new_encoded (session, str, error); } while (!xmms_medialib_session_commit (session)); if (entry) { xmmsv_coll_idlist_append (entries, entry); } } xmmsv_list_iter_remove (it); } xmmsv_unref (list); return TRUE; }