hythmbox-2.98/shell/rb-play-order-random-equal-weights.c

No issues found

 1 /*
 2  *  Copyright (C) 2003 Jeffrey Yasskin <jyasskin@mail.utexas.edu>
 3  *
 4  *  This program is free software; you can redistribute it and/or modify
 5  *  it under the terms of the GNU General Public License as published by
 6  *  the Free Software Foundation; either version 2 of the License, or
 7  *  (at your option) any later version.
 8  *
 9  *  The Rhythmbox authors hereby grant permission for non-GPL compatible
10  *  GStreamer plugins to be used and distributed together with GStreamer
11  *  and Rhythmbox. This permission is above and beyond the permissions granted
12  *  by the GPL license by which Rhythmbox is covered. If you modify this code
13  *  you may extend this exception to your version of the code, but you are not
14  *  obligated to do so. If you do not wish to do so, delete this exception
15  *  statement from your version.
16  *
17  *  This program is distributed in the hope that it will be useful,
18  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  *  GNU General Public License for more details.
21  *
22  *  You should have received a copy of the GNU General Public License
23  *  along with this program; if not, write to the Free Software
24  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
25  *
26  */
27 
28 #include "config.h"
29 
30 #include "rb-play-order-random-equal-weights.h"
31 
32 static void rb_random_play_order_equal_weights_class_init (RBRandomPlayOrderEqualWeightsClass *klass);
33 
34 static double rb_random_equal_weights_get_entry_weight (RBRandomPlayOrder *rorder,
35 							RhythmDB *db, RhythmDBEntry *entry);
36 
37 G_DEFINE_TYPE (RBRandomPlayOrderEqualWeights,
38 	       rb_random_play_order_equal_weights,
39 	       RB_TYPE_RANDOM_PLAY_ORDER)
40 
41 static void
42 rb_random_play_order_equal_weights_class_init (RBRandomPlayOrderEqualWeightsClass *klass)
43 {
44 	RBRandomPlayOrderClass *rorder;
45 
46 	rorder = RB_RANDOM_PLAY_ORDER_CLASS (klass);
47 	rorder->get_entry_weight = rb_random_equal_weights_get_entry_weight;
48 }
49 
50 RBPlayOrder *
51 rb_random_play_order_equal_weights_new (RBShellPlayer *player)
52 {
53 	RBRandomPlayOrderEqualWeights *rorder;
54 
55 	rorder = g_object_new (RB_TYPE_RANDOM_PLAY_ORDER_EQUAL_WEIGHTS,
56 			"player", player,
57 			NULL);
58 
59 	return RB_PLAY_ORDER (rorder);
60 }
61 
62 static void
63 rb_random_play_order_equal_weights_init (RBRandomPlayOrderEqualWeights *porder)
64 {
65 }
66 
67 static double
68 rb_random_equal_weights_get_entry_weight (RBRandomPlayOrder *rorder, RhythmDB *db, RhythmDBEntry *entry)
69 {
70 	return 1.0;
71 }