/*
 * call-seq:
 * xc.coll_query_info(coll, fetch, [order], [start], [len], [group]) -> result
 *
 * Retrieves media info of media matched by the collection. _fetch_ should
 * contain an array of properties to retrieve from the collection. _order_
 * specifies a list of properties to order by or no order if omitted. _start_
 * and _len_ determine the offset at which to start retrieving info and the
 * maximum number of ids to retrieve, respectively. _group_ defines a list
 * of properties to group by or no grouping if omitted.
 */
static VALUE
c_coll_query_info (int argc, VALUE *argv, VALUE self)
{
        VALUE coll, order = Qnil, start, len, fetch, group = Qnil;
        xmmsv_t *cfetch = NULL, *corder = NULL, *cgroup = NULL;
        METHOD_HANDLER_HEADER

        rb_scan_args (argc, argv, "24", &coll, &fetch, &order, &start, &len,
                      &group);

        cfetch = parse_string_array2 (fetch);

        if (!NIL_P (order))
                corder = parse_string_array2 (order);

        if (!NIL_P (group))
                cgroup = parse_string_array2 (group);

        res = xmmsc_coll_query_infos (xmms->real,
                                    FROM_XMMS_CLIENT_COLLECTION (coll),
                                    corder,
                                    NIL_P (start) ? 0 : NUM2UINT (start),
                                    NIL_P (start) ? 0 : NUM2UINT (len),
                                    cfetch,
                                    cgroup);
        xmmsv_unref (cfetch);
        xmmsv_unref (corder);
        xmmsv_unref (cgroup);

        METHOD_HANDLER_FOOTER
}