Audio::XMMSClient::Collection - Media collections for Audio::XMMSClient
use Audio::XMMSClient; my $coll = Audio::XMMSClient::Collection->new('match', { artist => 'Solche', });
my $coll = Audio::XMMSClient::Collection->new('match', { artist => 'Solche', });
Create a new collection instance of type $type
. Also sets the collections %attributes
, if given.
my $coll = Audio::XMMSClient::Collection->parse("artist:Solche +compilation");
Try to parse the given $pattern
to produce a collection structure.
$coll->set_idlist(qw/1 42 1337/);
Set the list of ids in the given collection. Note that the idlist is only relevant for idlist collections.
$coll->add_operand($other_coll);
Add the $operand
to a given collection.
$coll->remove_operand($other_coll);
Remove all the occurences of the $operand
in the given collection.
my $success = $coll->idlist_append(5);
Append an $id
to the idlist.
my $success = $coll->idlist_insert(42, 2);
Insert an $id
at a given $index
in the idlist.
my $success = $coll->idlist_move(0, 3);
Move a value of the idlist to a new position.
my $success = $coll->idlist_clear;
Empties the idlist.
my $value = $coll->idlist_get_index(2);
Retrieves the value at the given $index
in the idlist.
my $success = $coll->idlist_set_index(3, 1);
Sets the $value
at the given $index
in the idlist.
my $size = $coll->idlist_get_size;
Get the size of the idlist.
my $type = $coll->get_type;
Return the type of the collection. Valid types are "reference", "union", "intersection", "complement", "has", "equals", "notequal", "match", "smaller", "smallereq", "greater", "greatereq", "order", "limit", "mediaset", "idlist"
my @ids = $coll->get_idlist;
Return the list of ids stored in the collection. Note that this must not be confused with the content of the collection, which must be queried using "coll_query_ids" in Audio::XMMSClient.
my @operands = $coll->operands;
Get a list of operands of the collection.
$coll->attribute_set(field => 'artist');
Set an attribute $key
to $value
in the given collection.
my $success = $coll->attribute_remove;
Remove an attribute $key
from the given collection. The return value indicated whether the attribute was found (and removed).
my $value = $coll->attribute_get('field');
Retrieve the $value
of the attribute $key
of the given collection.
my %attributes = $coll->attributes_list;
Get a hash of all %attributes
of the given collection.
my $universe = Audio::XMMSClient::Collection->universe;
Returns a collection referencing the whole media library, i.e. the "All Media" collection.
Florian Ragwitz <rafl@debian.org>
Copyright (C) 2006-2008, Florian Ragwitz
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.