~ubuntu-branches/debian/wheezy/brasero/wheezy

« back to all changes in this revision

Viewing changes to src/brasero-player.c

  • Committer: Bazaar Package Importer
  • Author(s): Josselin Mouette, Pedro Fragoso, Luca Bruno, Josselin Mouette, Emilio Pozuelo Monfort
  • Date: 2009-06-24 18:59:46 UTC
  • mfrom: (1.2.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20090624185946-iyxkgf3gjptir5y3
Tags: 2.26.2-1
[ Pedro Fragoso ]
* Add myself to Maintainer field
  - Thanks Ondřej Surý
* New upstream version (Closes: #528945)
  - Split package into brasero, libbrasero-media0 and libbrasero-dev
  - Add Replaces to libbrasero-media0
  - Bump libgtk to 2.14.0
  - Remove libnotify Build-dep
  - Add Build-dep libnautilus-extension-dev (>= 2.22.2)
    and install it.
  - Add Build-dep to libsm-dev
  - Add Build-dep on intltool
* Install omf files to prevent crash on Help
* Move gstreamer0.10-plugins-bad to Suggests, and add
  dvdauthor and vcdimager
* Recommends gvfs (Closes: #491827)
* Pass --disable-scrollkeeper in DEB_CONFIGURE_EXTRA_FLAGS
* debian/patches/007-fix-gnome-doc-utils-path.patch:
  - Removed, not needed anymore
* debian/patches/008-fix-volume-identifier-crash.patch:
  - Removed, merged upstream
* debian/patches/011_nautilus_menu_move.patch:
 - Move CD/DVD Creator Menu to Acessories, taken from Ubuntu

[ Luca Bruno ]
* debian/control.in:
  - Add Build-Depend gtk-doc-tools 1.9.
* debian/patches/006-fix-libdvdcss.patch:
  - Removed as applied upstream.

[ Josselin Mouette ]
* New upstream release.
* Update build-dependencies.
* Move the translations and data to a new brasero-common package.
* Rewrite the descriptions.
* Add -dev depends to the development package.
* Remove inappropriate recommends in the library package.
* Let’s not forget dvd+rw-tools so that we can write DVDs too.
* Rework dependencies accordingly.
* Put the nautilus extension in brasero.
* Conflict against nautilus-cd-burner to avoid having two burning 
  extensions.
* Include clean-la.mk and gnome-version.mk; build-depend on 
  gnome-pkg-tools 0.7.
* Don’t run dh_makeshlibs on brasero and libbrasero-plugins.
* 011_nautilus_menu_move.patch: add NoDisplay=true, this icon is 
  duplicating existing functionality (brasero icon in sound&video 
  menu, and nautilus autorun).
* Update list of copyright holders.

[ Emilio Pozuelo Monfort ]
* debian/copyright: updated.

[ Josselin Mouette ]
* copyright: improve indentation, and point to versioned LGPL.
* 090_relibtoolize.patch: add a relibtoolization patch to avoid the 
  rpath crap.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
****************************************************************************/
8
8
 
9
9
/*
10
 
 *  This program is free software; you can redistribute it and/or modify
 
10
 *  Brasero is free software; you can redistribute it and/or modify
11
11
 *  it under the terms of the GNU General Public License as published by
12
12
 *  the Free Software Foundation; either version 2 of the License, or
13
13
 *  (at your option) any later version.
14
14
 *
15
 
 *  This program is distributed in the hope that it will be useful,
 
15
 *  Brasero is distributed in the hope that it will be useful,
16
16
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
17
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
18
 *  GNU Library General Public License for more details.
19
19
 *
20
20
 *  You should have received a copy of the GNU General Public License
21
 
 *  along with this program; if not, write to the Free Software
22
 
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
21
 *  along with this program; if not, write to:
 
22
 *      The Free Software Foundation, Inc.,
 
23
 *      51 Franklin Street, Fifth Floor
 
24
 *      Boston, MA  02110-1301, USA.
23
25
 */
24
26
 
25
27
#ifdef HAVE_CONFIG_H
31
33
#include <glib.h>
32
34
#include <glib/gi18n-lib.h>
33
35
 
34
 
#include <gtk/gtkwidget.h>
35
 
#include <gtk/gtklabel.h>
36
 
#include <gtk/gtkhbox.h>
37
 
#include <gtk/gtkbutton.h>
38
 
#include <gtk/gtkstock.h>
39
 
#include <gtk/gtkscale.h>
40
 
#include <gtk/gtkrange.h>
41
 
#include <gtk/gtkhscale.h>
42
 
#include <gtk/gtkwindow.h>
43
 
#include <gtk/gtkdialog.h>
44
 
#include <gtk/gtkalignment.h>
45
 
#include <gtk/gtkmessagedialog.h>
 
36
#include <gtk/gtk.h>
46
37
 
47
38
#include <gconf/gconf-client.h>
48
39
 
264
255
                return;
265
256
 
266
257
        adjustment = gtk_range_get_adjustment (GTK_RANGE (player->priv->progress));
267
 
        len_string = brasero_utils_get_time_string (player->priv->end - player->priv->start, FALSE, FALSE);
 
258
        len_string = brasero_units_get_time_string (player->priv->end - player->priv->start, FALSE, FALSE);
268
259
 
269
260
        value = gtk_range_get_value (GTK_RANGE (player->priv->progress));
270
 
        pos_string = brasero_utils_get_time_string (value, FALSE, FALSE);
 
261
        pos_string = brasero_units_get_time_string (value, FALSE, FALSE);
271
262
 
 
263
        /**
 
264
         * Translators: this is the position being played in the stream. The 
 
265
         * first %s is the position and the second %s is the whole length of
 
266
         * the stream. I chose to make that translatable in case some languages
 
267
         * don't allow the "/" */
272
268
        result = g_strdup_printf (_("%s / %s"), pos_string, len_string);
273
269
        g_free (len_string);
274
270
        g_free (pos_string);
296
292
static void
297
293
brasero_player_set_length (BraseroPlayer *player)
298
294
{
299
 
        if (player->priv->progress)
 
295
        if (player->priv->progress && player->priv->end - player->priv->start != 0)
300
296
                gtk_range_set_range (GTK_RANGE (player->priv->progress),
301
297
                                     0.0,
302
298
                                     (gdouble) player->priv->end - player->priv->start);
804
800
        BRASERO_GET_BASENAME_FOR_DISPLAY (path, name);
805
801
        g_free (path);
806
802
 
807
 
        string = g_strdup_printf (_("<span weight=\"bold\">Name:</span>\t %s"), name);
 
803
        string = g_strdup_printf ("<span weight=\"bold\">%s</span>\t %s",
 
804
                                  _("Name:"),
 
805
                                  name);
808
806
        g_free (name);
809
807
 
810
808
        gtk_label_set_markup (GTK_LABEL (player->priv->header), string);
841
839
 
842
840
        }
843
841
        else if (title) {
844
 
                header = g_markup_printf_escaped (_("<span weight=\"bold\">%s</span>\n"),
845
 
                                                  title);
 
842
                header = g_markup_printf_escaped ("<span weight=\"bold\">%s</span>\n", title);
846
843
                gtk_label_set_ellipsize (GTK_LABEL (player->priv->header),
847
844
                                         PANGO_ELLIPSIZE_END);
848
845
        }
850
847
                gchar *name;
851
848
 
852
849
                BRASERO_GET_BASENAME_FOR_DISPLAY (player->priv->uri, name);
853
 
                header = g_markup_printf_escaped (_("<span weight=\"bold\">%s</span>\n"),
854
 
                                                  name);
 
850
                header = g_markup_printf_escaped ("<span weight=\"bold\">%s</span>\n", name);
855
851
                g_free (name);
856
852
                gtk_label_set_ellipsize (GTK_LABEL (player->priv->header),
857
853
                                         PANGO_ELLIPSIZE_END);
869
865
                                   gpointer null_data)
870
866
{
871
867
        BraseroPlayer *player = BRASERO_PLAYER (obj);
 
868
        const gchar *mime;
872
869
 
873
870
        if (player->priv->pixbuf) {
874
871
                gtk_image_set_from_pixbuf (GTK_IMAGE (player->priv->image_display), NULL);
887
884
                return;
888
885
        }
889
886
 
 
887
        mime = g_file_info_get_content_type (info);
 
888
 
890
889
        /* based on the mime type, we try to determine the type of file */
891
890
        if (g_file_info_get_attribute_boolean (info, BRASERO_IO_HAS_VIDEO)) {
892
891
                /* video */
913
912
                else
914
913
                        gtk_widget_set_sensitive (player->priv->progress, FALSE);
915
914
        }
916
 
        else if (!strncmp ("image/", g_file_info_get_content_type (info), 6)) {
917
 
                brasero_player_image (player);
 
915
        else if (mime && !strncmp ("image/", mime, 6)) {
 
916
                /* Only do that if the image is < 20 M otherwise that's crap
 
917
                 * FIXME: maybe a sort of error message here? or use thumbnail? */
 
918
                if (g_file_info_get_size (info) > 100000000) {
 
919
                        brasero_player_no_multimedia_stream (player);
 
920
                        g_signal_emit (player,
 
921
                                       brasero_player_signals [ERROR_SIGNAL],
 
922
                                       0);
 
923
                }
 
924
                else
 
925
                        brasero_player_image (player);
 
926
 
918
927
                return;
919
928
        }
920
929
        else {