1 /* This file is part of Cinaest.
3 * Copyright (C) 2009 Philipp Zabel
5 * Cinaest is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * Cinaest is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with Cinaest. If not, see <http://www.gnu.org/licenses/>.
19 public enum GenreType {
50 public struct Genres {
51 private static const string[] _genre_string = {
84 public string to_string () {
87 for (int i = 0; i < 28; i++) {
88 if ((1 << i) in field) {
92 s += ", " + _genre_string[i];
100 public void set_bit (GenreType genre, bool enable) {
102 field |= (1 << genre);
104 field &= ~(1 << genre);
107 public bool get_bit (GenreType genre) {
108 return (genre in field);
111 public static unowned string genre_string (GenreType genre) {
112 return _genre_string[genre];
116 public static int genre_bit (string genre) {
120 if (_genres[i] == genre) {