tag: move enum tag_type to TagType.h

This commit is contained in:
Max Kellermann 2013-07-30 20:10:24 +02:00
parent 9a0061c511
commit 6a9ab8bc0e
15 changed files with 73 additions and 45 deletions

View File

@ -216,6 +216,7 @@ src_mpd_SOURCES = \
src/SocketUtil.cxx src/SocketUtil.hxx \
src/StateFile.cxx src/StateFile.hxx \
src/Stats.cxx \
src/TagType.h \
src/Tag.cxx \
src/TagTable.hxx \
src/TagNames.c \

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2003-2012 The Music Player Daemon Project
* Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@ -21,7 +21,7 @@
#define MPD_MEMORY_DATABASE_PLUGIN_HXX
#include "DatabaseVisitor.hxx"
#include "tag.h"
#include "TagType.h"
#include "gcc.h"
class Database;

View File

@ -27,12 +27,9 @@
#define MPD_DATABASE_PLUGIN_HXX
#include "DatabaseVisitor.hxx"
#include "TagType.h"
#include "gcc.h"
extern "C" {
#include "tag.h"
}
struct config_param;
struct DatabaseSelection;
struct db_visitor;

View File

@ -20,7 +20,7 @@
#ifndef MPD_ICY_META_DATA_SERVER_HXX
#define MPD_ICY_META_DATA_SERVER_HXX
#include "tag.h"
#include "TagType.h"
class Page;

View File

@ -19,6 +19,7 @@
#include "config.h"
#include "TagHandler.hxx"
#include "tag.h"
#include <glib.h>

View File

@ -21,7 +21,7 @@
#define MPD_TAG_HANDLER_HXX
#include "check.h"
#include "tag.h"
#include "TagType.h"
#include <assert.h>

View File

@ -20,7 +20,7 @@
#ifndef MPD_TAG_INTERNAL_HXX
#define MPD_TAG_INTERNAL_HXX
#include "tag.h"
#include "TagType.h"
extern bool ignore_tag_items[TAG_NUM_OF_ITEM_TYPES];

View File

@ -18,7 +18,7 @@
*/
#include "config.h"
#include "tag.h"
#include "TagType.h"
const char *tag_item_names[TAG_NUM_OF_ITEM_TYPES] = {
[TAG_ARTIST] = "Artist",

View File

@ -19,6 +19,7 @@
#include "config.h"
#include "TagPool.hxx"
#include "tag.h"
#include <glib.h>

View File

@ -20,7 +20,7 @@
#ifndef MPD_TAG_POOL_HXX
#define MPD_TAG_POOL_HXX
#include "tag.h"
#include "TagType.h"
#include "thread/Mutex.hxx"
extern Mutex tag_pool_lock;

View File

@ -20,11 +20,13 @@
#ifndef MPD_TAG_TABLE_HXX
#define MPD_TAG_TABLE_HXX
#include "tag.h"
#include "TagType.h"
#include "gcc.h"
#include <glib.h>
#include <string.h>
struct tag_table {
const char *name;

56
src/TagType.h Normal file
View File

@ -0,0 +1,56 @@
/*
* Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_TAG_TYPE_H
#define MPD_TAG_TYPE_H
/**
* Codes for the type of a tag item.
*/
enum tag_type {
TAG_ARTIST,
TAG_ARTIST_SORT,
TAG_ALBUM,
TAG_ALBUM_ARTIST,
TAG_ALBUM_ARTIST_SORT,
TAG_TITLE,
TAG_TRACK,
TAG_NAME,
TAG_GENRE,
TAG_DATE,
TAG_COMPOSER,
TAG_PERFORMER,
TAG_COMMENT,
TAG_DISC,
TAG_MUSICBRAINZ_ARTISTID,
TAG_MUSICBRAINZ_ALBUMID,
TAG_MUSICBRAINZ_ALBUMARTISTID,
TAG_MUSICBRAINZ_TRACKID,
TAG_NUM_OF_ITEM_TYPES
};
/**
* An array of strings, which map the #tag_type to its machine
* readable name (specific to the MPD protocol).
*/
extern const char *tag_item_names[];
#endif

View File

@ -28,6 +28,7 @@
#include "Mapper.hxx"
#include "fs/Path.hxx"
#include "TagHandler.hxx"
#include "tag.h"
#include <glib.h>

View File

@ -26,6 +26,7 @@
#include "Song.hxx"
#include "gcc.h"
#include "conf.h"
#include "tag.h"
extern "C" {
#include "db_error.h"

View File

@ -20,6 +20,7 @@
#ifndef MPD_TAG_H
#define MPD_TAG_H
#include "TagType.h"
#include "gcc.h"
#include <stdint.h>
@ -27,39 +28,6 @@
#include <stdbool.h>
#include <string.h>
/**
* Codes for the type of a tag item.
*/
enum tag_type {
TAG_ARTIST,
TAG_ARTIST_SORT,
TAG_ALBUM,
TAG_ALBUM_ARTIST,
TAG_ALBUM_ARTIST_SORT,
TAG_TITLE,
TAG_TRACK,
TAG_NAME,
TAG_GENRE,
TAG_DATE,
TAG_COMPOSER,
TAG_PERFORMER,
TAG_COMMENT,
TAG_DISC,
TAG_MUSICBRAINZ_ARTISTID,
TAG_MUSICBRAINZ_ALBUMID,
TAG_MUSICBRAINZ_ALBUMARTISTID,
TAG_MUSICBRAINZ_TRACKID,
TAG_NUM_OF_ITEM_TYPES
};
/**
* An array of strings, which map the #tag_type to its machine
* readable name (specific to the MPD protocol).
*/
extern const char *tag_item_names[];
/**
* One tag value. It is a mapping of #tag_type to am arbitrary string
* value. Each tag can have multiple items of one tag type (although