[Import ()]
[CCode (cprefix = "RB", lower_case_cprefix = "rb_")]

namespace RB {
	[CCode (cheader_filename = "rb-shell.h")]
	public class Shell {
		[CCode (array_length = false)]
		[CCode (cname = "rb_shell_get_type")]
		public static GLib.Type get_type ();

		[CCode (array_length = false)]
		[CCode (cname = "rb_shell_get_player")]
		public unowned ShellPlayer get_player ();

		[CCode (array_length = false)]
		[CCode (cname = "rb_shell_get_ui_manager")]
		public unowned GLib.Object get_ui_manager();
	}

	[CCode (cheader_filename = "rb-plugin.h")]
	public abstract class Plugin : GLib.Object {
		[CCode (array_length = false)]
		[CCode (cname = "rb_plugin_get_type")]
		public static GLib.Type get_type ();

		[CCode (array_length = false)]
		[CCode (cname = "rb_plugin_activate")]
		public abstract void activate (RB.Shell shell);

		[CCode (array_length = false)]
		[CCode (cname = "rb_plugin_deactivate")]
		public abstract void deactivate (RB.Shell shell);

		[CCode (array_length = false)]
		[CCode (cname = "rb_plugin_is_configurable")]
		public virtual bool is_configurable ();

		[CCode (array_length = false)]
		[CCode (cname = "rb_plugin_create_configure_dialog")]
		public virtual Gtk.Widget create_configure_dialog ();

		[CCode (array_length = false)]
		[CCode (cname = "rb_plugin_find_file")]
		public virtual unowned string find_file (string file);
	}

	[CCode (cheader_filename = "rb-player-gst-filter.h")]
	public interface PlayerGstFilter : GLib.Object {
		[CCode (array_length = false)]
		[CCode (cname = "rb_player_gst_filter_add_filter")]
		public virtual bool add_filter(Gst.Element e);

		[CCode (array_length = false)]
		[CCode (cname = "rb_player_gst_filter_remove_filter")]
		public virtual bool remove_filter(Gst.Element e);
	}

	[NoCompact, CCode (cheader_filename = "rb-shell-player.h")]
	public class ShellPlayer : Gtk.HBox {

		[CCode (array_length = false)]
		[CCode (cname = "rb_shell_player_pause")]
		public bool pause(ref GLib.Error? err = null);

		[CCode (array_length = false)]
		[CCode (cname = "rb_shell_player_play")]
		public bool play(ref GLib.Error? err = null);

		[CCode (array_length = false)]
		[CCode (cname = "rb_shell_player_stop")]
		public bool stop();

		[CCode (array_length = false)]
		[CCode (cname = "rb_shell_player_get_playing")]
		public bool get_playing(ref bool playing, ref GLib.Error? err = null);

		[CCode (array_length = false)]
		[CCode (cname = "rb_shell_player_do_next")]
		public bool do_next(ref GLib.Error? err = null);

		[CCode (array_length = false)]
		[CCode (cname = "rb_shell_player_do_previous")]
		public bool do_previous(ref GLib.Error? err = null);

		public virtual signal void playing_changed(bool playing);
	}

	[CCode (cheader_filename = "rb-player.h")]
	public interface Player : GLib.Object {
		[CCode (cname = "rb_player_opened")]
		public bool opened();
	}
	[CCode (cheader_filename = "rhythmdb.h")]
	public class MetaData : GLib.Object {
		[CCode (cname = "rb_metadata_new", has_construct_function = false)]
		public MetaData ();
		[CCode (cname = "rb_metadata_can_save")]
		public bool can_save (string mimetype);
		[CCode (cname = "rb_metadata_error_quark")]
		public static GLib.Quark error_quark ();
		[CCode (cname = "rb_metadata_get")]
		public bool @get (RB.MetaDataField field, GLib.Value val);
		[CCode (cname = "rb_metadata_get_field_name")]
		public static unowned string get_field_name (RB.MetaDataField field);
		[CCode (cname = "rb_metadata_get_field_type")]
		public static GLib.Type get_field_type (RB.MetaDataField field);
		[CCode (cname = "rb_metadata_get_mime")]
		public unowned string get_mime ();
		[CCode (cname = "rb_metadata_get_missing_plugins")]
		public bool get_missing_plugins (out unowned string missing_plugins, out unowned string plugin_descriptions);
		[CCode (cname = "rb_metadata_get_saveable_types")]
		public unowned string get_saveable_types ();
		[CCode (cname = "rb_metadata_gst_field_to_gst_tag")]
		public static unowned string gst_field_to_gst_tag (RB.MetaDataField field);
		[CCode (cname = "rb_metadata_gst_register_transforms")]
		public static void gst_register_transforms ();
		[CCode (cname = "rb_metadata_gst_tag_to_field")]
		public static RB.MetaDataField gst_tag_to_field (string tag);
		[CCode (cname = "rb_metadata_has_audio")]
		public bool has_audio ();
		[CCode (cname = "rb_metadata_has_missing_plugins")]
		public bool has_missing_plugins ();
		[CCode (cname = "rb_metadata_has_other_data")]
		public bool has_other_data ();
		[CCode (cname = "rb_metadata_has_video")]
		public bool has_video ();
		[CCode (cname = "rb_metadata_load")]
		public void load (string uri) throws GLib.Error;
		[CCode (cname = "rb_metadata_save")]
		public void save () throws GLib.Error;
		[CCode (cname = "rb_metadata_set")]
		public bool @set (RB.MetaDataField field, GLib.Value val);
	}
	[Compact]
	[CCode (ref_function = "rb_refstring_ref", unref_function = "rb_refstring_unref", type_id = "RB_TYPE_REF_STRING", cheader_filename = "rhythmdb.h")]
	public class RefString {
		[CCode (cname = "rb_refstring_new", has_construct_function = false)]
		public RefString (string init);
		[CCode (cname = "rb_refstring_equal")]
		public static bool equal (void* ap, void* bp);
		[CCode (cname = "rb_refstring_find")]
		public static unowned RB.RefString find (string init);
		[CCode (cname = "rb_refstring_get")]
		public unowned string @get ();
		[CCode (cname = "rb_refstring_get_folded")]
		public unowned string get_folded ();
		[CCode (cname = "rb_refstring_get_sort_key")]
		public unowned string get_sort_key ();
		[CCode (cname = "rb_refstring_hash")]
		public static uint hash (void* p);
		[CCode (cname = "rb_refstring_system_init")]
		public static void system_init ();
		[CCode (cname = "rb_refstring_system_shutdown")]
		public static void system_shutdown ();
	}
	[CCode (cheader_filename = "rhythmdb.h")]
	public class StringValueMap : GLib.Object {
		[CCode (has_construct_function = false)]
		public StringValueMap ();
		public bool @get (string key, GLib.Value @out);
		public GLib.Value peek (string key);
		public bool remove (string key);
		public void @set (string key, GLib.Value value);
		public uint size ();
		public unowned GLib.HashTable steal_hashtable ();
	}
	[CCode (cprefix = "MEDIA_TYPE_", has_type_id = false, cheader_filename = "rhythmdb.h")]
	public enum GstMediaType {
		NONE,
		CONTAINER,
		AUDIO,
		VIDEO,
		OTHER
	}
	[CCode (cprefix = "RB_METADATA_ERROR_", has_type_id = false, cheader_filename = "rhythmdb.h")]
	public enum MetaDataError {
		IO,
		MISSING_PLUGIN,
		UNRECOGNIZED,
		UNSUPPORTED,
		GENERAL,
		INTERNAL,
		EMPTY_FILE
	}
	[CCode (cprefix = "RB_METADATA_FIELD_", has_type_id = false, cheader_filename = "rhythmdb.h")]
	public enum MetaDataField {
		TITLE,
		ARTIST,
		ALBUM,
		DATE,
		GENRE,
		COMMENT,
		TRACK_NUMBER,
		MAX_TRACK_NUMBER,
		DISC_NUMBER,
		MAX_DISC_NUMBER,
		DESCRIPTION,
		VERSION,
		ISRC,
		ORGANIZATION,
		COPYRIGHT,
		CONTACT,
		LICENSE,
		PERFORMER,
		DURATION,
		CODEC,
		BITRATE,
		TRACK_GAIN,
		TRACK_PEAK,
		ALBUM_GAIN,
		ALBUM_PEAK,
		LANGUAGE_CODE,
		MUSICBRAINZ_TRACKID,
		MUSICBRAINZ_ARTISTID,
		MUSICBRAINZ_ALBUMID,
		MUSICBRAINZ_ALBUMARTISTID,
		ARTIST_SORTNAME,
		ALBUM_SORTNAME,
		LAST
	}
	[CCode (cheader_filename="rb-util.h", cname="rb_threads_init")]
	public static void threads_init();
	[CCode (cheader_filename="rb-debug.h", cname="rb_debug_init")]
	public static void debug_init( bool onoff );
	[CCode (cheader_filename="rb-util.h", cname="rb_file_helpers_init")]
	public static void file_helpers_init( bool onoff );
	[CCode (cheader_filename="rb-util.h", cname="rb_file_helpers_shutdown")]
	public static void file_helpers_shutdown();
	[CCode (cheader_filename="rb-file-helpers.h", cname="rb_user_data_dir")]
	public static unowned string user_data_dir();
}
