~ubuntu-branches/ubuntu/precise/rhythmbox/precise-201203091205

« back to all changes in this revision

Viewing changes to shell/rb-play-order-random-by-rating.c

Tags: upstream-0.9.2cvs20060102
ImportĀ upstreamĀ versionĀ 0.9.2cvs20060102

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
static double rb_random_by_rating_get_entry_weight (RBRandomPlayOrder *rorder,
31
31
                                                 RhythmDB *db, RhythmDBEntry *entry);
32
32
 
33
 
static RBPlayOrderClass *parent_class = NULL;
34
 
 
35
 
GType
36
 
rb_random_play_order_by_rating_get_type (void)
37
 
{
38
 
        static GType rb_random_play_order_by_rating_type = 0;
39
 
 
40
 
        if (rb_random_play_order_by_rating_type == 0)
41
 
        {
42
 
                static const GTypeInfo our_info =
43
 
                {
44
 
                        sizeof (RBRandomPlayOrderByRatingClass),
45
 
                        NULL,
46
 
                        NULL,
47
 
                        (GClassInitFunc) rb_random_play_order_by_rating_class_init,
48
 
                        NULL,
49
 
                        NULL,
50
 
                        sizeof (RBRandomPlayOrderByRating),
51
 
                        0,
52
 
                        NULL
53
 
                };
54
 
 
55
 
                rb_random_play_order_by_rating_type = g_type_register_static (RB_TYPE_RANDOM_PLAY_ORDER,
56
 
                                "RBRandomPlayOrderByRating",
57
 
                                &our_info, 0);
58
 
        }
59
 
 
60
 
        return rb_random_play_order_by_rating_type;
61
 
}
 
33
G_DEFINE_TYPE (RBRandomPlayOrderByRating, rb_random_play_order_by_rating, RB_TYPE_RANDOM_PLAY_ORDER)
62
34
 
63
35
static void
64
36
rb_random_play_order_by_rating_class_init (RBRandomPlayOrderByRatingClass *klass)
65
37
{
66
38
        RBRandomPlayOrderClass *rorder;
67
39
 
68
 
        parent_class = g_type_class_peek_parent (klass);
69
 
 
70
40
        rorder = RB_RANDOM_PLAY_ORDER_CLASS (klass);
71
41
        rorder->get_entry_weight = rb_random_by_rating_get_entry_weight;
72
42
}
83
53
        return RB_PLAY_ORDER (rorder);
84
54
}
85
55
 
 
56
static void
 
57
rb_random_play_order_by_rating_init (RBRandomPlayOrderByRating *porder)
 
58
{
 
59
}
 
60
 
86
61
static double
87
62
rb_random_by_rating_get_entry_weight (RBRandomPlayOrder *rorder, RhythmDB *db, RhythmDBEntry *entry)
88
63
{