Commit e61e8cac authored by Carlos Garnacho's avatar Carlos Garnacho

Initial commit

parents
Carlos Garnacho <carlosg@gnome.org>
This diff is collapsed.
SUBDIRS = src
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
PKG_NAME="tracker-movie-miner"
(test -f $srcdir/src/tracker-miner-media.c) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level $PKG_NAME directory"
exit 1
}
# if the AC_CONFIG_MACRO_DIR() macro is used, create that directory
# This is a automake bug fixed in automake 1.13.2
# See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13514
if [ -n "m4" ]; then
mkdir -p m4
fi
intltoolize --force --copy --automake || exit 1
autoreconf --verbose --force --install || exit 1
$srcdir/configure "$@" && echo "Now type \"make\" to compile $PKG_NAME" || exit 1
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
AC_INIT([tracker-miner-media],
[0.1.0],
[http://bugzilla.gnome.org/],
[tracker-miner-media],
[https://wiki.gnome.org/Projects/Tracker])
AC_PREREQ(2.63)
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AM_INIT_AUTOMAKE([dist-xz no-dist-gzip tar-ustar])
AM_MAINTAINER_MODE([enable])
AC_PROG_CC
AC_PROG_CC_C_O
AC_HEADER_STDC
PKG_PROG_PKG_CONFIG
LT_INIT([])
#dependencies
PKG_CHECK_MODULES(DEPS, [tracker-miner-1.0 libgdata >= 0.17])
AC_CONFIG_FILES([
Makefile
src/Makefile
])
AC_OUTPUT
libexec_PROGRAMS = tracker-miner-media
tracker_miner_media_SOURCES = \
tracker-miner-media.c \
tracker-miner-media.h \
main.c
tracker_miner_media_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Tmm\" \
-I$(top_srcdir)/src \
$(DEPS_CFLAGS)
tracker_miner_media_LDADD = \
$(DEPS_LIBS)
#include <locale.h>
#include "tracker-miner-media.h"
int
main (int argc,
char *argv[])
{
TrackerMiner *decorator;
GMainLoop *main_loop;
GError *error = NULL;
setlocale (LC_ALL, "");
main_loop = g_main_loop_new (NULL, FALSE);
decorator = tmm_decorator_new ();
if (!g_initable_init (G_INITABLE (decorator), NULL, &error)) {
g_critical ("Could not start miner: %s\n", error->message);
g_error_free (error);
return EXIT_FAILURE;
}
tracker_miner_start (decorator);
g_main_loop_run (main_loop);
tracker_miner_stop (decorator);
g_main_loop_unref (main_loop);
g_object_unref (decorator);
return EXIT_SUCCESS;
}
/*
* Copyright (C) 2014 Carlos Garnacho <carlosg@gnome.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "tracker-miner-media.h"
#include <gdata/gdata.h>
#define TMM_DATA_SOURCE "tmm:urn:83443497-b4cf-4341-8ac8-74058828f6db"
typedef struct _TmmDecoratorPrivate TmmDecoratorPrivate;
struct _TmmDecoratorPrivate
{
GDataFreebaseService *freebase_service;
GCancellable *cancellable;
};
G_DEFINE_TYPE_WITH_PRIVATE (TmmDecorator, tmm_decorator, TRACKER_TYPE_DECORATOR_FS)
static void
tmm_decorator_finalize (GObject *object)
{
TmmDecoratorPrivate *priv;
priv = tmm_decorator_get_instance_private (TMM_DECORATOR (object));
g_object_unref (priv->freebase_service);
}
static void
tmm_decorator_class_init (TmmDecoratorClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = tmm_decorator_finalize;
}
static void
tmm_decorator_init (TmmDecorator *decorator)
{
TmmDecoratorPrivate *priv;
priv = tmm_decorator_get_instance_private (decorator);
priv->freebase_service = gdata_freebase_service_new (NULL, NULL);
priv->cancellable = g_cancellable_new ();
}
TrackerMiner *
tmm_decorator_new (void)
{
gchar *classes[] = {
"nfo:Video",
NULL
};
return g_object_new (TMM_TYPE_DECORATOR,
"name", "Media",
"data-source", TMM_DATA_SOURCE,
"class-names", classes,
NULL);
}
/*
* Copyright (C) 2014 Carlos Garnacho <carlosg@gnome.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __TMM_DECORATOR_H__
#define __TMM_DECORATOR_H__
#include <libtracker-miner/tracker-miner.h>
G_BEGIN_DECLS
#define TMM_TYPE_DECORATOR (tmm_decorator_get_type())
#define TMM_DECORATOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TMM_TYPE_DECORATOR, TmmDecorator))
#define TMM_DECORATOR_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), TMM_TYPE_DECORATOR, TmmDecoratorClass))
#define TMM_IS_DECORATOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TMM_TYPE_DECORATOR))
#define TMM_IS_DECORATOR_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), TMM_TYPE_DECORATOR))
#define TMM_DECORATOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TMM_TYPE_DECORATOR, TmmDecoratorClass))
typedef struct _TmmDecorator TmmDecorator;
typedef struct _TmmDecoratorClass TmmDecoratorClass;
struct _TmmDecorator {
TrackerDecoratorFS parent_instance;
};
struct _TmmDecoratorClass {
TrackerDecoratorFSClass parent_class;
};
GType tmm_decorator_get_type (void) G_GNUC_CONST;
TrackerMiner * tmm_decorator_new (void);
G_END_DECLS
#endif /* __TMM_DECORATOR_H__ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment