~njpatel/unity-lens-music/fix-initial-results

« back to all changes in this revision

Viewing changes to src/genre.vala

  • Committer: Alex Launi
  • Date: 2011-08-10 22:06:39 UTC
  • Revision ID: alex.launi@canonical.com-20110810220639-ck7f8izpg9wz72f4
push up filter-parser and genre

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2011 Canonical Ltd
 
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 version 3 as
 
6
 * published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authored by Alex Launi <alex.launi@canonical.com>
 
17
 *
 
18
 */
 
19
 
 
20
using Gee;
 
21
 
 
22
namespace Unity.MusicLens {
 
23
        
 
24
  public class Genre : GLib.Object
 
25
  {
 
26
    public static const string BLUES_ID = "blues";
 
27
    public static const string CLASSIC_ID = "classic";
 
28
    public static const string COUNTRY_ID = "country";
 
29
    public static const string DISCO_ID = "disco";
 
30
    public static const string FUNK_ID = "funk";
 
31
    public static const string ROCK_ID = "rock";
 
32
    public static const string METAL_ID = "metal";
 
33
    public static const string HIPHOP_ID = "hip-hop";
 
34
    public static const string HOUSE_ID = "house";
 
35
    public static const string NEWWAVE_ID = "new-wave";
 
36
    public static const string RANDB_ID = "r-and-b";
 
37
    public static const string PUNK_ID = "punk";
 
38
    public static const string JAZZ_ID = "jazz";
 
39
    public static const string POP_ID = "pop";
 
40
    public static const string REGGAE_ID = "reggae";
 
41
    public static const string SOUL_ID = "soul";
 
42
    public static const string TECHNO_ID = "techno";
 
43
    public static const string OTHER_ID = "other";
 
44
 
 
45
    private static HashMultiMap<string, string> map;
 
46
 
 
47
    /* void set (K, V), Collection<V> get (K key), Collection<V> get_values (K key) */
 
48
    static construct
 
49
    {
 
50
      map = new HashMultiMap<string, string> ();
 
51
 
 
52
      /* blues */
 
53
      map.set (BLUES_ID, "blues");
 
54
 
 
55
      /* classic */
 
56
      map.set (CLASSIC_ID, "classic");
 
57
 
 
58
      /* country */
 
59
      map.set (COUNTRY_ID, "country");
 
60
 
 
61
      /* disco */
 
62
      map.set (DISCO_ID, "disco");
 
63
 
 
64
      /* funk */
 
65
      map.set (FUNK_ID, "funk");
 
66
 
 
67
      /* rock */
 
68
      map.set (ROCK_ID, "rock");
 
69
 
 
70
      /* metal */
 
71
      map.set (METAL_ID, "metal");
 
72
 
 
73
      /*hip hop */
 
74
      map.set (HIPHOP_ID, "hip-hop");
 
75
 
 
76
      /*house*/
 
77
      map.set (HOUSE_ID, "house");
 
78
 
 
79
      /*new wave*/
 
80
      map.set (NEWWAVE_ID, "new-wave");
 
81
 
 
82
      /*r-and-b*/
 
83
      map.set (RANDB_ID, "r-and-b");
 
84
 
 
85
      /*punk*/
 
86
      map.set (PUNK_ID, "punk");
 
87
 
 
88
      /*jazz*/
 
89
      map.set (JAZZ_ID, "jazz");
 
90
 
 
91
      /*pop*/
 
92
      map.set (POP_ID, "pop");
 
93
 
 
94
      /*reggae*/
 
95
      map.set (REGGAE_ID, "reggae");
 
96
 
 
97
      /*soul*/
 
98
      map.set (SOUL_ID, "soul");
 
99
 
 
100
      /*techno*/
 
101
      map.set (TECHNO_ID, "techno");
 
102
 
 
103
      /*other*/
 
104
      map.set (OTHER_ID, "other");
 
105
    }
 
106
 
 
107
    public static Collection<string> get_genre_synonyms (string genre_id)
 
108
    {
 
109
      return map.get (genre_id);
 
110
    }
 
111
  }
 
112
}
 
 
b'\\ No newline at end of file'