Exemplo n.º 1
0
static gboolean
xmms_mpg123_plugin_setup (xmms_xform_plugin_t *xform_plugin)
{
	xmms_xform_methods_t methods;
	int result;

	result = mpg123_init ();
	if (result != MPG123_OK) {
	    return FALSE;
	}

	XMMS_XFORM_METHODS_INIT (methods);
	methods.init = xmms_mpg123_init;
	methods.destroy = xmms_mpg123_destroy;
	methods.read = xmms_mpg123_read;
	methods.seek = xmms_mpg123_seek;
	xmms_xform_plugin_methods_set (xform_plugin, &methods);

	xmms_xform_plugin_config_property_register (xform_plugin,
	                                            "id3v1_encoding",
	                                            "ISO8859-1",
	                                            NULL,
	                                            NULL);

	xmms_xform_plugin_config_property_register (xform_plugin, "id3v1_enable",
	                                            "1", NULL, NULL);

	xmms_xform_plugin_indata_add (xform_plugin,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "audio/mpeg",
	                              XMMS_STREAM_TYPE_PRIORITY,
	                              40,
	                              XMMS_STREAM_TYPE_END);

	/* Well, I usually only see mp3 and mp2 ... layer 1 files
	 * are quite rare.
	 */
	xmms_magic_extension_add ("audio/mpeg", "*.mp3");
	xmms_magic_extension_add ("audio/mpeg", "*.mp2");
	xmms_magic_extension_add ("audio/mpeg", "*.mp1");

	/* That's copied from the mad xform. */
	xmms_magic_add ("mpeg header", "audio/mpeg",
	                "0 beshort&0xfff6 0xfff6",
	                "0 beshort&0xfff6 0xfff4",
	                "0 beshort&0xffe6 0xffe2",
	                NULL);

	return TRUE;
}
Exemplo n.º 2
0
static gboolean
xmms_asx_plugin_setup (xmms_xform_plugin_t *xform_plugin)
{
	xmms_xform_methods_t methods;

	XMMS_XFORM_METHODS_INIT (methods);
	methods.browse = xmms_asx_browse;

	xmms_xform_plugin_methods_set (xform_plugin, &methods);

	xmms_xform_plugin_indata_add (xform_plugin,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "application/x-asx-playlist",
	                              XMMS_STREAM_TYPE_END);

	xmms_xform_plugin_set_out_stream_type (xform_plugin,
	                                       XMMS_STREAM_TYPE_MIMETYPE,
	                                       "application/x-xmms2-playlist-entries",
	                                       XMMS_STREAM_TYPE_END);

	xmms_magic_extension_add ("application/x-asx-playlist", "*.asx");

	xmms_magic_add ("ASX header", "application/x-asx-playlist",
	                "0 string/c <asx version=\"3.0\">", NULL);

	return TRUE;
}
Exemplo n.º 3
0
Arquivo: pls.c Projeto: chrippa/xmms2
static gboolean
xmms_pls_plugin_setup (xmms_xform_plugin_t *xform_plugin)
{
	xmms_xform_methods_t methods;

	XMMS_XFORM_METHODS_INIT (methods);
	methods.init = xmms_pls_init;
	methods.destroy = xmms_pls_destroy;
	methods.browse = xmms_pls_browse;

	xmms_xform_plugin_methods_set (xform_plugin, &methods);

	xmms_xform_plugin_indata_add (xform_plugin,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "audio/x-scpls",
	                              NULL);

	xmms_magic_add ("pls header",
	                "audio/x-scpls",
	                "0 string [playlist]\r\n",
	                "0 string [playlist]\n", NULL);

	xmms_magic_extension_add ("audio/x-scpls", "*.pls");

	return TRUE;
}
Exemplo n.º 4
0
static gboolean
xmms_opus_plugin_setup (xmms_xform_plugin_t *xform_plugin)
{
	xmms_xform_methods_t methods;

	XMMS_XFORM_METHODS_INIT (methods);
	methods.init = xmms_opus_init;
	methods.destroy = xmms_opus_destroy;
	methods.read = xmms_opus_read;
	methods.seek = xmms_opus_seek;

	xmms_xform_plugin_methods_set (xform_plugin, &methods);

	xmms_xform_plugin_metadata_mapper_init (xform_plugin,
	                                        basic_mappings,
	                                        G_N_ELEMENTS (basic_mappings),
	                                        mappings,
	                                        G_N_ELEMENTS (mappings));

	xmms_xform_plugin_indata_add (xform_plugin,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "audio/ogg; codecs=opus",
	                              NULL);

	xmms_magic_add ("Opus header", "audio/ogg; codecs=opus",
	                "0 string OggS",
	                ">28 string OpusHead", NULL);

	xmms_magic_extension_add ("audio/ogg; codecs=opus", "*.opus");

	return TRUE;
}
Exemplo n.º 5
0
static gboolean
xmms_wavpack_plugin_setup (xmms_xform_plugin_t *xform_plugin)
{
	xmms_xform_methods_t methods;

	XMMS_XFORM_METHODS_INIT (methods);

	methods.init = xmms_wavpack_init;
	methods.destroy = xmms_wavpack_destroy;
	methods.read = xmms_wavpack_read;
	methods.seek = xmms_wavpack_seek;

	xmms_xform_plugin_methods_set (xform_plugin, &methods);

	xmms_xform_plugin_metadata_mapper_init (xform_plugin,
	                                        basic_mappings,
	                                        G_N_ELEMENTS (basic_mappings),
	                                        mappings,
	                                        G_N_ELEMENTS (mappings));

	xmms_xform_plugin_indata_add (xform_plugin,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "audio/x-wavpack",
	                              NULL);

	xmms_magic_add ("wavpack header v4", "audio/x-wavpack",
	                "0 string wvpk", NULL);

	xmms_magic_extension_add ("audio/x-wavpack", "*.wv");

	return TRUE;
}
Exemplo n.º 6
0
static gboolean
xmms_speex_plugin_setup (xmms_xform_plugin_t *xform_plugin)
{
	xmms_xform_methods_t methods;

	XMMS_XFORM_METHODS_INIT (methods);

	methods.init = xmms_speex_init;
	methods.destroy = xmms_speex_destroy;
	methods.read = xmms_speex_read;

	xmms_xform_plugin_methods_set (xform_plugin, &methods);

	xmms_xform_plugin_indata_add (xform_plugin,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "audio/x-speex",
	                              NULL);

	xmms_magic_add ("ogg/speex header", "audio/x-speex",
	                "0 string OggS", ">4 byte 0",
	                ">>28 string Speex   ", NULL);

	xmms_magic_extension_add ("audio/x-speex", "*.spx");

	xmms_xform_plugin_config_property_register (xform_plugin,
	                                            "perceptual_enhancer",
	                                            "1", NULL, NULL);

	return TRUE;
}
Exemplo n.º 7
0
static gboolean
xmms_vorbis_plugin_setup (xmms_xform_plugin_t *xform_plugin)
{
	xmms_xform_methods_t methods;

	XMMS_XFORM_METHODS_INIT (methods);
	methods.init = xmms_vorbis_init;
	methods.destroy = xmms_vorbis_destroy;
	methods.read = xmms_vorbis_read;
	methods.seek = xmms_vorbis_seek;

	xmms_xform_plugin_methods_set (xform_plugin, &methods);

	xmms_xform_plugin_metadata_mapper_init (xform_plugin,
	                                        basic_mappings,
	                                        G_N_ELEMENTS (basic_mappings),
	                                        mappings,
	                                        G_N_ELEMENTS (mappings));

	xmms_xform_plugin_indata_add (xform_plugin,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "application/ogg",
	                              NULL);


	xmms_magic_add ("ogg/vorbis header",
	                "application/ogg",
	                "0 string OggS", ">4 byte 0",
	                ">>28 string \x01vorbis", NULL);

	xmms_magic_extension_add ("application/ogg", "*.ogg");

	return TRUE;
}
Exemplo n.º 8
0
static gboolean
xmms_html_setup (xmms_xform_plugin_t *xform)
{
	xmms_xform_methods_t methods;
	XMMS_XFORM_METHODS_INIT (methods);

	methods.init = xmms_html_init;
	methods.browse = xmms_html_browse;
	xmms_xform_plugin_methods_set (xform, &methods);

	xmms_xform_plugin_indata_add (xform,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "text/html",
	                              NULL);

	xmms_xform_plugin_indata_add (xform,
	                              XMMS_STREAM_TYPE_MIMETYPE,
				      "application/x-xmms2-xml+html",
				      NULL);

	xmms_magic_extension_add ("text/html", "*.html");
	xmms_magic_extension_add ("text/html", "*.xhtml");

	xmms_magic_add ("html doctype", "text/html",
	                "0 string/c <!DOCTYPE HTML ",
	                NULL);

	xmms_magic_add ("html tag", "text/html",
	                "0 string/c <html ",
	                NULL);

	xmms_magic_add ("html header tag", "text/html",
	                "0 string/c <head ",
	                NULL);

	return TRUE;
}
Exemplo n.º 9
0
static gboolean
xmms_rss_plugin_setup (xmms_xform_plugin_t *xform_plugin)
{
	xmms_xform_methods_t methods;

	XMMS_XFORM_METHODS_INIT (methods);
	methods.init = xmms_rss_init;
	methods.browse = xmms_rss_browse;

	xmms_xform_plugin_methods_set (xform_plugin, &methods);

	xmms_xform_plugin_indata_add (xform_plugin,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "application/x-xmms2-xml+rss",
	                              NULL);

	xmms_magic_extension_add ("application/xml", "*.rss");

	return TRUE;
}
Exemplo n.º 10
0
static gboolean
xmms_mad_plugin_setup (xmms_xform_plugin_t *xform_plugin)
{
	xmms_xform_methods_t methods;

	XMMS_XFORM_METHODS_INIT (methods);
	methods.init = xmms_mad_init;
	methods.destroy = xmms_mad_destroy;
	methods.read = xmms_mad_read;
	methods.seek = xmms_mad_seek;

	xmms_xform_plugin_methods_set (xform_plugin, &methods);

	/*
	  xmms_plugin_info_add (plugin, "URL", "http://xmms2.org/");
	  xmms_plugin_info_add (plugin, "Author", "XMMS Team");
	  xmms_plugin_info_add (plugin, "License", "GPL");
	*/

	xmms_xform_plugin_config_property_register (xform_plugin, "id3v1_encoding",
	                                            "ISO8859-1", NULL, NULL);

	xmms_xform_plugin_config_property_register (xform_plugin, "id3v1_enable",
	                                            "1", NULL, NULL);

	/* xmms_xform_indata_constraint_add */
	xmms_xform_plugin_indata_add (xform_plugin,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "audio/mpeg",
	                              NULL);

	xmms_magic_add ("mpeg header", "audio/mpeg",
	                "0 beshort&0xfff6 0xfff6",
	                "0 beshort&0xfff6 0xfff4",
	                "0 beshort&0xffe6 0xffe2",
	                NULL);

	xmms_magic_extension_add ("audio/mpeg", "*.mp3");

	return TRUE;
}
Exemplo n.º 11
0
static gboolean
xmms_m3u_plugin_setup (xmms_xform_plugin_t *xform_plugin)
{
	xmms_xform_methods_t methods;

	XMMS_XFORM_METHODS_INIT (methods);
	methods.init = xmms_m3u_init;
	methods.destroy = xmms_m3u_destroy;
	methods.browse = xmms_m3u_browse;

	xmms_xform_plugin_methods_set (xform_plugin, &methods);

	xmms_xform_plugin_indata_add (xform_plugin,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "audio/x-mpegurl",
	                              NULL);

	xmms_magic_add ("Extended M3U header", "audio/x-mpegurl",
	                "0 string #EXTM3U", NULL);

	xmms_magic_extension_add ("audio/x-mpegurl", "*.m3u");

	return TRUE;
}
Exemplo n.º 12
0
static gboolean
xmms_cue_plugin_setup (xmms_xform_plugin_t *xform_plugin)
{
	xmms_xform_methods_t methods;

	XMMS_XFORM_METHODS_INIT (methods);
	methods.browse = xmms_cue_browse;

	xmms_xform_plugin_methods_set (xform_plugin, &methods);

	xmms_xform_plugin_indata_add (xform_plugin,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "application/x-cue",
	                              XMMS_STREAM_TYPE_END);

	xmms_xform_plugin_set_out_stream_type (xform_plugin,
	                                       XMMS_STREAM_TYPE_MIMETYPE,
	                                       "application/x-xmms2-playlist-entries",
	                                       XMMS_STREAM_TYPE_END);

	xmms_magic_extension_add ("application/x-cue", "*.cue");

	return TRUE;
}
Exemplo n.º 13
0
static gboolean
xmms_gme_plugin_setup (xmms_xform_plugin_t *xform_plugin)
{
	xmms_xform_methods_t methods;

	XMMS_XFORM_METHODS_INIT (methods);
	methods.init = xmms_gme_init;
	methods.destroy = xmms_gme_destroy;
	methods.read = xmms_gme_read;
	methods.seek = xmms_gme_seek;

	xmms_xform_plugin_methods_set (xform_plugin, &methods);

	xmms_xform_plugin_config_property_register (xform_plugin, "loops", G_STRINGIFY (GME_DEFAULT_SONG_LOOPS), NULL, NULL);
	xmms_xform_plugin_config_property_register (xform_plugin, "maxlength", G_STRINGIFY (GME_DEFAULT_SONG_LENGTH), NULL, NULL);
	xmms_xform_plugin_config_property_register (xform_plugin, "samplerate", G_STRINGIFY (GME_DEFAULT_SAMPLE_RATE), NULL, NULL);
	xmms_xform_plugin_config_property_register (xform_plugin, "stereodepth", G_STRINGIFY (GME_DEFAULT_STEREO_DEPTH), NULL, NULL);

	/* todo: add other mime types */
	xmms_xform_plugin_indata_add (xform_plugin,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "application/x-spc",
	                              NULL);

	xmms_xform_plugin_indata_add (xform_plugin,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "application/x-nsf",
	                              NULL);

	xmms_xform_plugin_indata_add (xform_plugin,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "application/x-nsfe",
	                              NULL);

	xmms_xform_plugin_indata_add (xform_plugin,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "application/x-gbs",
	                              NULL);

	xmms_xform_plugin_indata_add (xform_plugin,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "application/x-gym",
	                              NULL);

	xmms_xform_plugin_indata_add (xform_plugin,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "application/x-vgm",
	                              NULL);

	xmms_xform_plugin_indata_add (xform_plugin,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "application/x-sap",
	                              NULL);

	xmms_xform_plugin_indata_add (xform_plugin,
	                              XMMS_STREAM_TYPE_MIMETYPE,
	                              "application/x-ay",
	                              NULL);

	/* todo: add other magic */
	xmms_magic_add ("SPC700 save state",
	                "application/x-spc",
	                "0 string SNES-SPC700 Sound File Data",
	                NULL);

	xmms_magic_add ("NSF file",
	                "application/x-nsf",
	                "0 string NESM",
	                NULL);

	xmms_magic_add ("NSFE file",
	                "application/x-nsfe",
	                "0 string NSFE",
	                NULL);

	xmms_magic_add ("GBS file",
	                "application/x-gbs",
	                "0 string GBS",
	                NULL);

	xmms_magic_add ("GYM file",
	                "application/x-gym",
	                "0 string GYMX",
	                NULL);

	xmms_magic_add ("VGM file",
	                "application/x-vgm",
	                "0 string Vgm",
	                NULL);

	xmms_magic_add ("SAP file",
	                "application/x-sap",
	                "0 string SAP",
	                NULL);

	xmms_magic_add ("AY file",
	                "application/x-ay",
	                "0 string ZXAYEMU",
	                NULL);

	/* todo: add other file extensions */
	xmms_magic_extension_add ("application/x-spc", "*.spc");
	xmms_magic_extension_add ("application/x-nsf", "*.nsf");
	xmms_magic_extension_add ("application/x-nsfe", "*.nsfe");
	xmms_magic_extension_add ("application/x-gbs", "*.gbs");
	xmms_magic_extension_add ("application/x-gym", "*.gym");
	xmms_magic_extension_add ("application/x-vgm", "*.vgm");
	xmms_magic_extension_add ("application/x-sap", "*.sap");
	xmms_magic_extension_add ("application/x-ay", "*.ay");

	return TRUE;
}