summaryrefslogtreecommitdiff
path: root/src/plugins/properties
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2011-01-22 20:57:16 +0000
committerPhilip Withnall <philip@tecnocode.co.uk>2011-01-22 20:57:16 +0000
commitada23c9ebccaf5ad31071ffc145da94910bb0b1c (patch)
tree9238891c5e454703c7c6b18b8c557a1f21a62bff /src/plugins/properties
parentdec323d0a3cd23274f05ba8b589d12a03bfb8ecf (diff)
downloadtotem-ada23c9ebccaf5ad31071ffc145da94910bb0b1c.tar.gz
Bug 640048 — Build failure due libbaconvideowidgetproperties.la
Move libbaconvideowidgetproperties.la from src/plugins/properties to src/properties, as it's needed by both the plugins and the main libraries, but the plugins need the main libraries to be built first for GIR, and libbaconvideowidgetproperties.la was only being built with the plugins. Closes: bgo#640048
Diffstat (limited to 'src/plugins/properties')
-rw-r--r--src/plugins/properties/Makefile.am13
-rw-r--r--src/plugins/properties/bacon-video-widget-properties.c324
-rw-r--r--src/plugins/properties/bacon-video-widget-properties.h56
3 files changed, 4 insertions, 389 deletions
diff --git a/src/plugins/properties/Makefile.am b/src/plugins/properties/Makefile.am
index 294fefb51..7c4be2d34 100644
--- a/src/plugins/properties/Makefile.am
+++ b/src/plugins/properties/Makefile.am
@@ -2,20 +2,15 @@ include $(top_srcdir)/src/plugins/Makefile.plugins
plugindir = $(PLUGINDIR)/properties
plugin_LTLIBRARIES = libmovie-properties.la
-noinst_LTLIBRARIES = libbaconvideowidgetproperties.la
plugin_in_files = movie-properties.plugin.in
libmovie_properties_la_SOURCES = totem-movie-properties.c
libmovie_properties_la_LDFLAGS = $(plugin_ldflags)
-libmovie_properties_la_LIBADD = libbaconvideowidgetproperties.la
+libmovie_properties_la_LIBADD = $(top_builddir)/src/properties/libbaconvideowidgetproperties.la
libmovie_properties_la_CFLAGS = $(plugin_cflags)
-
-libbaconvideowidgetproperties_la_SOURCES = \
- bacon-video-widget-properties.c \
- bacon-video-widget-properties.h
-libbaconvideowidgetproperties_la_CFLAGS = \
- $(DEPENDENCY_CFLAGS) \
- $(WARN_CFLAGS)
+libmovie_properties_la_CPPFLAGS = \
+ -I$(top_srcdir)/src/properties/ \
+ $(AM_CPPFLAGS)
-include $(top_srcdir)/git.mk
diff --git a/src/plugins/properties/bacon-video-widget-properties.c b/src/plugins/properties/bacon-video-widget-properties.c
deleted file mode 100644
index 77bec28f0..000000000
--- a/src/plugins/properties/bacon-video-widget-properties.c
+++ /dev/null
@@ -1,324 +0,0 @@
-/* bacon-video-widget-properties.c
-
- Copyright (C) 2002 Bastien Nocera
-
- The Gnome Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The Gnome 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the Gnome Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301 USA.
-
- Author: Bastien Nocera <hadess@hadess.net>
- */
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include <string.h>
-
-#include "backend/bacon-video-widget.h"
-#include "backend/video-utils.h"
-#include "totem-interface.h"
-
-#include "bacon-video-widget-properties.h"
-
-/* used in bacon_video_widget_properties_update() */
-#define UPDATE_FROM_STRING(type, name) \
- do { \
- const char *temp; \
- bacon_video_widget_get_metadata (BACON_VIDEO_WIDGET (bvw), \
- type, &value); \
- if ((temp = g_value_get_string (&value)) != NULL) { \
- bacon_video_widget_properties_set_label (props, name, \
- temp); \
- } \
- g_value_unset (&value); \
- } while (0)
-
-#define UPDATE_FROM_INT(type, name, format, empty) \
- do { \
- char *temp; \
- bacon_video_widget_get_metadata (BACON_VIDEO_WIDGET (bvw), \
- type, &value); \
- if (g_value_get_int (&value) != 0) \
- temp = g_strdup_printf (gettext (format), \
- g_value_get_int (&value)); \
- else \
- temp = g_strdup (empty); \
- bacon_video_widget_properties_set_label (props, name, temp); \
- g_free (temp); \
- g_value_unset (&value); \
- } while (0)
-
-#define UPDATE_FROM_INT2(type1, type2, name, format) \
- do { \
- int x, y; \
- char *temp; \
- bacon_video_widget_get_metadata (BACON_VIDEO_WIDGET (bvw), \
- type1, &value); \
- x = g_value_get_int (&value); \
- g_value_unset (&value); \
- bacon_video_widget_get_metadata (BACON_VIDEO_WIDGET (bvw), \
- type2, &value); \
- y = g_value_get_int (&value); \
- g_value_unset (&value); \
- temp = g_strdup_printf (gettext (format), x, y); \
- bacon_video_widget_properties_set_label (props, name, temp); \
- g_free (temp); \
- } while (0)
-
-static void bacon_video_widget_properties_dispose (GObject *object);
-
-struct BaconVideoWidgetPropertiesPrivate {
- GtkBuilder *xml;
- int time;
-};
-
-#define BACON_VIDEO_WIDGET_PROPERTIES_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), BACON_TYPE_VIDEO_WIDGET_PROPERTIES, BaconVideoWidgetPropertiesPrivate))
-
-G_DEFINE_TYPE (BaconVideoWidgetProperties, bacon_video_widget_properties, GTK_TYPE_VBOX)
-
-static void
-bacon_video_widget_properties_class_init (BaconVideoWidgetPropertiesClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- g_type_class_add_private (klass, sizeof (BaconVideoWidgetPropertiesPrivate));
-
- object_class->dispose = bacon_video_widget_properties_dispose;
-}
-
-static void
-bacon_video_widget_properties_init (BaconVideoWidgetProperties *props)
-{
- props->priv = G_TYPE_INSTANCE_GET_PRIVATE (props, BACON_TYPE_VIDEO_WIDGET_PROPERTIES, BaconVideoWidgetPropertiesPrivate);
-}
-
-static void
-bacon_video_widget_properties_dispose (GObject *object)
-{
- BaconVideoWidgetPropertiesPrivate *priv = BACON_VIDEO_WIDGET_PROPERTIES_GET_PRIVATE (object);
-
- if (priv->xml != NULL)
- g_object_unref (priv->xml);
- priv->xml = NULL;
-
- G_OBJECT_CLASS (bacon_video_widget_properties_parent_class)->dispose (object);
-}
-
-static void
-bacon_video_widget_properties_set_label (BaconVideoWidgetProperties *props,
- const char *name, const char *text)
-{
- GtkLabel *item;
-
- item = GTK_LABEL (gtk_builder_get_object (props->priv->xml, name));
- gtk_label_set_text (item, text);
-}
-
-void
-bacon_video_widget_properties_reset (BaconVideoWidgetProperties *props)
-{
- GtkWidget *item;
-
- g_return_if_fail (props != NULL);
- g_return_if_fail (BACON_IS_VIDEO_WIDGET_PROPERTIES (props));
-
- item = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "video_vbox"));
- gtk_widget_show (item);
- item = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "video"));
- gtk_widget_set_sensitive (item, FALSE);
- item = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "audio"));
- gtk_widget_set_sensitive (item, FALSE);
-
- /* Title */
- bacon_video_widget_properties_set_label (props, "title", _("Unknown"));
- /* Artist */
- bacon_video_widget_properties_set_label (props, "artist", _("Unknown"));
- /* Album */
- bacon_video_widget_properties_set_label (props, "album", _("Unknown"));
- /* Year */
- bacon_video_widget_properties_set_label (props, "year", _("Unknown"));
- /* Duration */
- bacon_video_widget_properties_from_time (props, 0);
- /* Comment */
- bacon_video_widget_properties_set_label (props, "comment", "");
-
- /* Dimensions */
- bacon_video_widget_properties_set_label (props, "dimensions", C_("Dimensions", "N/A"));
- /* Video Codec */
- bacon_video_widget_properties_set_label (props, "vcodec", C_("Video codec", "N/A"));
- /* Video Bitrate */
- bacon_video_widget_properties_set_label (props, "video_bitrate",
- C_("Video bit rate", "N/A"));
- /* Framerate */
- bacon_video_widget_properties_set_label (props, "framerate",
- C_("Frame rate", "N/A"));
- /* Audio Bitrate */
- bacon_video_widget_properties_set_label (props, "audio_bitrate",
- C_("Audio bit rate", "N/A"));
- /* Audio Codec */
- bacon_video_widget_properties_set_label (props, "acodec", C_("Audio codec", "N/A"));
- /* Sample rate */
- bacon_video_widget_properties_set_label (props, "samplerate", _("0 Hz"));
- /* Channels */
- bacon_video_widget_properties_set_label (props, "channels", _("0 Channels"));
-}
-
-void
-bacon_video_widget_properties_from_time (BaconVideoWidgetProperties *props,
- int _time)
-{
- char *string;
-
- g_return_if_fail (props != NULL);
- g_return_if_fail (BACON_IS_VIDEO_WIDGET_PROPERTIES (props));
-
- if (_time == props->priv->time)
- return;
-
- string = totem_time_to_string_text (_time);
- bacon_video_widget_properties_set_label (props, "duration", string);
- g_free (string);
-
- props->priv->time = _time;
-}
-
-void
-bacon_video_widget_properties_update (BaconVideoWidgetProperties *props,
- GtkWidget *widget)
-{
- GtkWidget *item;
- GValue value = { 0, };
- gboolean has_type;
- BaconVideoWidget *bvw;
-
- g_return_if_fail (BACON_IS_VIDEO_WIDGET_PROPERTIES (props));
- g_return_if_fail (BACON_IS_VIDEO_WIDGET (widget));
-
- bvw = BACON_VIDEO_WIDGET (widget);
-
- /* General */
- UPDATE_FROM_STRING (BVW_INFO_TITLE, "title");
- UPDATE_FROM_STRING (BVW_INFO_ARTIST, "artist");
- UPDATE_FROM_STRING (BVW_INFO_ALBUM, "album");
- UPDATE_FROM_STRING (BVW_INFO_YEAR, "year");
- UPDATE_FROM_STRING (BVW_INFO_COMMENT, "comment");
-
- bacon_video_widget_get_metadata (BACON_VIDEO_WIDGET (bvw),
- BVW_INFO_DURATION, &value);
- bacon_video_widget_properties_from_time (props,
- g_value_get_int (&value) * 1000);
- g_value_unset (&value);
-
- /* Video */
- item = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "video"));
- bacon_video_widget_get_metadata (BACON_VIDEO_WIDGET (bvw),
- BVW_INFO_HAS_VIDEO, &value);
- has_type = g_value_get_boolean (&value);
- gtk_widget_set_sensitive (item, has_type);
- g_value_unset (&value);
-
- item = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "video_vbox"));
-
- if (has_type != FALSE)
- {
- UPDATE_FROM_INT2 (BVW_INFO_DIMENSION_X, BVW_INFO_DIMENSION_Y,
- "dimensions", N_("%d x %d"));
- UPDATE_FROM_STRING (BVW_INFO_VIDEO_CODEC, "vcodec");
- UPDATE_FROM_INT (BVW_INFO_VIDEO_BITRATE, "video_bitrate",
- N_("%d kbps"), C_("Video bit rate", "N/A"));
-
- /* The FPS has to be done differently because it's a plural string */
- {
- gchar *temp;
- bacon_video_widget_get_metadata (BACON_VIDEO_WIDGET (bvw), BVW_INFO_FPS, &value);
- if (g_value_get_int (&value) != 0) {
- temp = g_strdup_printf (ngettext ("%d frame per second", "%d frames per second", g_value_get_int (&value)),
- g_value_get_int (&value));
- } else {
- temp = g_strdup (C_("Frame rate", "N/A"));
- }
- bacon_video_widget_properties_set_label (props, "framerate", temp);
- g_free (temp);
- g_value_unset (&value);
- }
-
- gtk_widget_show (item);
- } else {
- gtk_widget_hide (item);
- }
-
- /* Audio */
- item = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "audio"));
- bacon_video_widget_get_metadata (BACON_VIDEO_WIDGET (bvw),
- BVW_INFO_HAS_AUDIO, &value);
- has_type = g_value_get_boolean (&value);
- gtk_widget_set_sensitive (item, has_type);
- g_value_unset (&value);
-
- if (has_type != FALSE)
- {
- UPDATE_FROM_INT (BVW_INFO_AUDIO_BITRATE, "audio_bitrate",
- N_("%d kbps"), C_("Audio bit rate", "N/A"));
- UPDATE_FROM_STRING (BVW_INFO_AUDIO_CODEC, "acodec");
- UPDATE_FROM_INT (BVW_INFO_AUDIO_SAMPLE_RATE, "samplerate",
- N_("%d Hz"), C_("Sample rate", "N/A"));
- UPDATE_FROM_STRING (BVW_INFO_AUDIO_CHANNELS, "channels");
- }
-
-#undef UPDATE_FROM_STRING
-#undef UPDATE_FROM_INT
-#undef UPDATE_FROM_INT2
-}
-
-GtkWidget*
-bacon_video_widget_properties_new (void)
-{
- BaconVideoWidgetProperties *props;
- GtkBuilder *xml;
- GtkWidget *vbox;
- GtkSizeGroup *group;
- const char *labels[] = { "title_label", "artist_label", "album_label",
- "year_label", "duration_label", "comment_label",
- "dimensions_label", "vcodec_label", "framerate_label",
- "vbitrate_label", "abitrate_label", "acodec_label",
- "samplerate_label", "channels_label" };
- guint i;
-
- xml = totem_interface_load ("properties.ui", TRUE, NULL, NULL);
-
- if (xml == NULL)
- return NULL;
-
- props = BACON_VIDEO_WIDGET_PROPERTIES (g_object_new
- (BACON_TYPE_VIDEO_WIDGET_PROPERTIES, NULL));
-
- props->priv->xml = xml;
- vbox = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "vbox1"));
- gtk_box_pack_start (GTK_BOX (props), vbox, FALSE, FALSE, 0);
-
- bacon_video_widget_properties_reset (props);
-
- group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
-
- for (i = 0; i < G_N_ELEMENTS (labels); i++)
- gtk_size_group_add_widget (group, GTK_WIDGET (gtk_builder_get_object (xml, labels[i])));
-
- g_object_unref (group);
-
- gtk_widget_show_all (GTK_WIDGET (props));
-
- return GTK_WIDGET (props);
-}
-
diff --git a/src/plugins/properties/bacon-video-widget-properties.h b/src/plugins/properties/bacon-video-widget-properties.h
deleted file mode 100644
index ce3645aaa..000000000
--- a/src/plugins/properties/bacon-video-widget-properties.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* bacon-video-widget-properties.h: Properties dialog for BaconVideoWidget
-
- Copyright (C) 2002 Bastien Nocera <hadess@hadess.net>
-
- The Gnome Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The Gnome 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the Gnome Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301 USA.
-
- Author: Bastien Nocera <hadess@hadess.net>
- */
-
-#ifndef BACON_VIDEO_WIDGET_PROPERTIES_H
-#define BACON_VIDEO_WIDGET_PROPERTIES_H
-
-#include <gtk/gtk.h>
-
-#define BACON_TYPE_VIDEO_WIDGET_PROPERTIES (bacon_video_widget_properties_get_type ())
-#define BACON_VIDEO_WIDGET_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BACON_TYPE_VIDEO_WIDGET_PROPERTIES, BaconVideoWidgetProperties))
-#define BACON_VIDEO_WIDGET_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BACON_TYPE_VIDEO_WIDGET_PROPERTIES, BaconVideoWidgetPropertiesClass))
-#define BACON_IS_VIDEO_WIDGET_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BACON_TYPE_VIDEO_WIDGET_PROPERTIES))
-#define BACON_IS_VIDEO_WIDGET_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BACON_TYPE_VIDEO_WIDGET_PROPERTIES))
-
-typedef struct BaconVideoWidgetProperties BaconVideoWidgetProperties;
-typedef struct BaconVideoWidgetPropertiesClass BaconVideoWidgetPropertiesClass;
-typedef struct BaconVideoWidgetPropertiesPrivate BaconVideoWidgetPropertiesPrivate;
-
-struct BaconVideoWidgetProperties {
- GtkVBox parent;
- BaconVideoWidgetPropertiesPrivate *priv;
-};
-
-struct BaconVideoWidgetPropertiesClass {
- GtkVBoxClass parent_class;
-};
-
-GType bacon_video_widget_properties_get_type (void);
-GtkWidget *bacon_video_widget_properties_new (void);
-
-void bacon_video_widget_properties_reset (BaconVideoWidgetProperties *props);
-void bacon_video_widget_properties_update (BaconVideoWidgetProperties *props,
- GtkWidget *bvw);
-void bacon_video_widget_properties_from_time (BaconVideoWidgetProperties *props,
- int _time);
-
-#endif /* BACON_VIDEO_WIDGET_PROPERTIES_H */