2006-12-14 Francisco Javier F. Serrador <serrador@openshine.com>
[rhythmbox.git] / shell / rb-play-order-random.h
blobb80c03e23c05842c429c507cc4b01a415796278f
1 /*
2 * arch-tag: Header for base class for weighted random play orders
4 * Copyright (C) 2003 Jeffrey Yasskin <jyasskin@mail.utexas.edu>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef __RB_PLAY_ORDER_RANDOM_H
23 #define __RB_PLAY_ORDER_RANDOM_H
25 #include "rb-play-order.h"
27 #include "rb-shell-player.h"
29 G_BEGIN_DECLS
31 #define RB_TYPE_RANDOM_PLAY_ORDER (rb_random_play_order_get_type ())
32 #define RB_RANDOM_PLAY_ORDER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), RB_TYPE_RANDOM_PLAY_ORDER, RBRandomPlayOrder))
33 #define RB_RANDOM_PLAY_ORDER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), RB_TYPE_RANDOM_PLAY_ORDER, RBRandomPlayOrderClass))
34 #define RB_IS_RANDOM_PLAY_ORDER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), RB_TYPE_RANDOM_PLAY_ORDER))
35 #define RB_IS_RANDOM_PLAY_ORDER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), RB_TYPE_RANDOM_PLAY_ORDER))
36 #define RB_RANDOM_PLAY_ORDER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), RB_TYPE_RANDOM_PLAY_ORDER, RBRandomPlayOrderClass))
38 typedef struct RBRandomPlayOrderPrivate RBRandomPlayOrderPrivate;
40 typedef struct
42 RBPlayOrder parent;
44 RBRandomPlayOrderPrivate *priv;
45 } RBRandomPlayOrder;
47 typedef struct
49 RBPlayOrderClass parent_class;
51 /**
52 * This method should return a weight for the given @entry.
54 * The @db will be locked when this method is called.
56 double (*get_entry_weight) (RBRandomPlayOrder *rorder, RhythmDB *db, RhythmDBEntry *entry);
57 } RBRandomPlayOrderClass;
59 GType rb_random_play_order_get_type (void);
61 G_END_DECLS
63 #endif /* __RB_PLAY_ORDER_RANDOM_H */