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

« back to all changes in this revision

Viewing changes to src/brasero-video-project.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:
 
1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 
2
/*
 
3
 * brasero
 
4
 * Copyright (C) Philippe Rouquier 2005-2008 <bonfire-app@wanadoo.fr>
 
5
 * 
 
6
 * brasero is free software: you can redistribute it and/or modify it
 
7
 * under the terms of the GNU General Public License as published by the
 
8
 * Free Software Foundation, either version 3 of the License, or
 
9
 * (at your option) any later version.
 
10
 * 
 
11
 * brasero is distributed in the hope that it will be useful, but
 
12
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
14
 * See the GNU General Public License for more details.
 
15
 * 
 
16
 * You should have received a copy of the GNU General Public License along
 
17
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
 */
 
19
 
 
20
#ifdef HAVE_CONFIG_H
 
21
#  include <config.h>
 
22
#endif
 
23
 
 
24
#include <glib.h>
 
25
#include <glib/gi18n-lib.h>
 
26
 
 
27
#include "brasero-video-project.h"
 
28
#include "brasero-file-monitor.h"
 
29
#include "brasero-io.h"
 
30
#include "brasero-marshal.h"
 
31
 
 
32
typedef struct _BraseroVideoProjectPrivate BraseroVideoProjectPrivate;
 
33
struct _BraseroVideoProjectPrivate
 
34
{
 
35
        guint ref_count;
 
36
        GHashTable *references;
 
37
 
 
38
        BraseroIO *io;
 
39
        BraseroIOJobBase *load_uri;
 
40
        BraseroIOJobBase *load_dir;
 
41
 
 
42
        BraseroVideoFile *first;
 
43
 
 
44
        guint loading;
 
45
};
 
46
 
 
47
#define BRASERO_VIDEO_PROJECT_PRIVATE(o)  (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_VIDEO_PROJECT, BraseroVideoProjectPrivate))
 
48
 
 
49
#ifdef BUILD_INOTIFY
 
50
 
 
51
#include "brasero-file-monitor.h"
 
52
 
 
53
G_DEFINE_TYPE (BraseroVideoProject, brasero_video_project, BRASERO_TYPE_FILE_MONITOR);
 
54
 
 
55
#else
 
56
 
 
57
G_DEFINE_TYPE (BraseroVideoProject, brasero_video_project, G_TYPE_OBJECT);
 
58
 
 
59
#endif
 
60
 
 
61
enum {
 
62
        PROJECT_LOADED_SIGNAL,
 
63
        SIZE_CHANGED_SIGNAL,
 
64
        DIRECTORY_URI_SIGNAL,
 
65
        UNREADABLE_SIGNAL,
 
66
        NOT_VIDEO_SIGNAL,
 
67
        ACTIVITY_SIGNAL,
 
68
        LAST_SIGNAL
 
69
};
 
70
 
 
71
static guint brasero_video_project_signals [LAST_SIGNAL] = {0};
 
72
 
 
73
/**
 
74
 * Used to send signals with a default answer
 
75
 */
 
76
 
 
77
static gboolean
 
78
brasero_video_project_file_signal (BraseroVideoProject *self,
 
79
                                  guint signal,
 
80
                                  const gchar *name)
 
81
{
 
82
        GValue instance_and_params [2];
 
83
        GValue return_value;
 
84
        GValue *params;
 
85
 
 
86
        /* object which signalled */
 
87
        instance_and_params->g_type = 0;
 
88
        g_value_init (instance_and_params, G_TYPE_FROM_INSTANCE (self));
 
89
        g_value_set_instance (instance_and_params, self);
 
90
 
 
91
        /* arguments of signal (name) */
 
92
        params = instance_and_params + 1;
 
93
        params->g_type = 0;
 
94
        g_value_init (params, G_TYPE_STRING);
 
95
        g_value_set_string (params, name);
 
96
 
 
97
        /* default to FALSE */
 
98
        return_value.g_type = 0;
 
99
        g_value_init (&return_value, G_TYPE_BOOLEAN);
 
100
        g_value_set_boolean (&return_value, FALSE);
 
101
 
 
102
        g_signal_emitv (instance_and_params,
 
103
                        brasero_video_project_signals [signal],
 
104
                        0,
 
105
                        &return_value);
 
106
 
 
107
        g_value_unset (instance_and_params);
 
108
        g_value_unset (params);
 
109
 
 
110
        return g_value_get_boolean (&return_value);
 
111
}
 
112
 
 
113
/**
 
114
 * Manages the references to a node
 
115
 */
 
116
 
 
117
guint
 
118
brasero_video_project_reference_new (BraseroVideoProject *self,
 
119
                                    BraseroVideoFile *node)
 
120
{
 
121
        BraseroVideoProjectPrivate *priv;
 
122
        guint retval;
 
123
 
 
124
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
 
125
 
 
126
        if (!priv->references)
 
127
                priv->references = g_hash_table_new (g_direct_hash, g_direct_equal);
 
128
 
 
129
        retval = priv->ref_count;
 
130
        while (g_hash_table_lookup (priv->references, GINT_TO_POINTER (retval))) {
 
131
                retval ++;
 
132
 
 
133
                if (retval == G_MAXINT)
 
134
                        retval = 1;
 
135
 
 
136
                /* this means there is no more room for reference */
 
137
                if (retval == priv->ref_count)
 
138
                        return 0;
 
139
        }
 
140
 
 
141
        g_hash_table_insert (priv->references,
 
142
                             GINT_TO_POINTER (retval),
 
143
                             node);
 
144
        priv->ref_count = retval + 1;
 
145
        if (priv->ref_count == G_MAXINT)
 
146
                priv->ref_count = 1;
 
147
 
 
148
        return retval;
 
149
}
 
150
 
 
151
void
 
152
brasero_video_project_reference_free (BraseroVideoProject *self,
 
153
                                     guint reference)
 
154
{
 
155
        BraseroVideoProjectPrivate *priv;
 
156
 
 
157
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
 
158
        g_hash_table_remove (priv->references, GINT_TO_POINTER (reference));
 
159
}
 
160
 
 
161
BraseroVideoFile *
 
162
brasero_video_project_reference_get (BraseroVideoProject *self,
 
163
                                    guint reference)
 
164
{
 
165
        BraseroVideoProjectPrivate *priv;
 
166
 
 
167
        /* if it was invalidated then the node returned is NULL */
 
168
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
 
169
        return g_hash_table_lookup (priv->references, GINT_TO_POINTER (reference));
 
170
}
 
171
 
 
172
static gboolean
 
173
brasero_video_project_reference_remove_children_cb (gpointer key,
 
174
                                                   gpointer data,
 
175
                                                   gpointer callback_data)
 
176
{
 
177
        BraseroVideoFile *node = data;
 
178
        BraseroVideoFile *removable = callback_data;
 
179
 
 
180
        if (node == removable)
 
181
                return TRUE;
 
182
 
 
183
        return FALSE;
 
184
}
 
185
 
 
186
static void
 
187
brasero_video_project_reference_invalidate (BraseroVideoProject *self,
 
188
                                           BraseroVideoFile *node)
 
189
{
 
190
        BraseroVideoProjectPrivate *priv;
 
191
 
 
192
        /* used internally to invalidate reference whose node was removed */
 
193
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
 
194
        g_hash_table_foreach_remove (priv->references,
 
195
                                     (GHRFunc) brasero_video_project_reference_remove_children_cb,
 
196
                                     node);
 
197
}
 
198
 
 
199
/**
 
200
 * Move functions
 
201
 */
 
202
 
 
203
void
 
204
brasero_video_project_rename (BraseroVideoProject *self,
 
205
                              BraseroVideoFile *file,
 
206
                              const gchar *name)
 
207
{
 
208
        gchar *tmp;
 
209
        BraseroVideoProjectClass *klass;
 
210
 
 
211
        tmp = file->info->title;
 
212
        file->info->title = g_strdup (name);
 
213
        g_free (tmp);
 
214
 
 
215
        file->title_set = TRUE;
 
216
 
 
217
        klass = BRASERO_VIDEO_PROJECT_GET_CLASS (self);
 
218
        if (klass->node_changed)
 
219
                klass->node_changed (self, file);
 
220
}
 
221
 
 
222
void
 
223
brasero_video_project_move (BraseroVideoProject *self,
 
224
                            BraseroVideoFile *file,
 
225
                            BraseroVideoFile *next_file)
 
226
{
 
227
        BraseroVideoFile *prev, *next;
 
228
        BraseroVideoProjectClass *klass;
 
229
        BraseroVideoProjectPrivate *priv;
 
230
 
 
231
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
 
232
        if (!file)
 
233
                return;
 
234
 
 
235
        if (file == next_file)
 
236
                return;
 
237
 
 
238
        /* unlink it */
 
239
        prev = file->prev;
 
240
        next = file->next;
 
241
 
 
242
        if (next)
 
243
                next->prev = prev;
 
244
 
 
245
        if (prev)
 
246
                prev->next = next;
 
247
        else
 
248
                priv->first = next;
 
249
 
 
250
        /* tell the model */
 
251
        klass = BRASERO_VIDEO_PROJECT_GET_CLASS (self);
 
252
        if (klass->node_removed)
 
253
                klass->node_removed (self, file);
 
254
 
 
255
        /* relink it */
 
256
        if (next_file) {
 
257
                file->next = next_file;
 
258
                file->prev = next_file->prev;
 
259
                next_file->prev = file;
 
260
 
 
261
                if (file->prev)
 
262
                        file->prev->next = file;
 
263
                else
 
264
                        priv->first = file;
 
265
        }
 
266
        else if (priv->first) {
 
267
                BraseroVideoFile *last;
 
268
 
 
269
                /* Put it at the end */
 
270
                last = priv->first;
 
271
                while (last->next) last = last->next;
 
272
 
 
273
                file->next = NULL;
 
274
                file->prev = last;
 
275
                last->next = file;
 
276
        }
 
277
        else {
 
278
                priv->first = file;
 
279
                file->next = NULL;
 
280
                file->prev = NULL;
 
281
        }
 
282
 
 
283
        /* tell the model */
 
284
        if (klass->node_added)
 
285
                klass->node_added (self, file);
 
286
}
 
287
 
 
288
/**
 
289
 * Remove functions
 
290
 */
 
291
 
 
292
void
 
293
brasero_video_file_free (BraseroVideoFile *file)
 
294
{
 
295
        if (file->uri)
 
296
                g_free (file->uri);
 
297
 
 
298
        if (file->snapshot)
 
299
                g_object_unref (file->snapshot);
 
300
 
 
301
        if (file->info)
 
302
                brasero_song_info_free (file->info);
 
303
 
 
304
        g_free (file);
 
305
}
 
306
 
 
307
static gboolean
 
308
brasero_video_project_foreach_monitor_cancel_cb (gpointer data,
 
309
                                                 gpointer user_data)
 
310
{
 
311
        BraseroVideoFile *node = data;
 
312
        BraseroVideoFile *file = user_data;
 
313
 
 
314
        if (node == file)
 
315
                return TRUE;
 
316
 
 
317
        return FALSE;
 
318
}
 
319
 
 
320
void
 
321
brasero_video_project_remove_file (BraseroVideoProject *self,
 
322
                                   BraseroVideoFile *file)
 
323
{
 
324
        BraseroVideoFile *prev, *next;
 
325
        BraseroVideoProjectClass *klass;
 
326
        BraseroVideoProjectPrivate *priv;
 
327
 
 
328
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
 
329
 
 
330
        if (!file)
 
331
                return;
 
332
 
 
333
        /* Unlink it */
 
334
        prev = file->prev;
 
335
        next = file->next;
 
336
 
 
337
        if (next)
 
338
                next->prev = prev;
 
339
 
 
340
        if (prev)
 
341
                prev->next = next;
 
342
        else
 
343
                priv->first = next;
 
344
 
 
345
        klass = BRASERO_VIDEO_PROJECT_GET_CLASS (self);
 
346
        if (klass->node_removed)
 
347
                klass->node_removed (self, file);
 
348
 
 
349
        brasero_video_project_reference_invalidate (self, file);
 
350
 
 
351
#ifdef BUILD_INOTIFY
 
352
 
 
353
        /* Stop monitoring */
 
354
        if (file->is_monitored)
 
355
                brasero_file_monitor_foreach_cancel (BRASERO_FILE_MONITOR (self),
 
356
                                                     brasero_video_project_foreach_monitor_cancel_cb,
 
357
                                                     file);
 
358
 
 
359
#endif
 
360
 
 
361
        /* Free data */
 
362
        brasero_video_file_free (file);
 
363
 
 
364
        g_signal_emit (self,
 
365
                       brasero_video_project_signals [SIZE_CHANGED_SIGNAL],
 
366
                       0);
 
367
}
 
368
 
 
369
void
 
370
brasero_video_project_reset (BraseroVideoProject *self)
 
371
{
 
372
        BraseroVideoProjectPrivate *priv;
 
373
        BraseroVideoProjectClass *klass;
 
374
        BraseroVideoFile *iter, *next;
 
375
        guint num_nodes = 0;
 
376
 
 
377
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
 
378
 
 
379
        /* cancel all VFS operations */
 
380
        if (priv->io) {
 
381
                brasero_io_cancel_by_base (priv->io, priv->load_uri);
 
382
                brasero_io_cancel_by_base (priv->io, priv->load_dir);
 
383
 
 
384
                g_free (priv->load_uri);
 
385
                priv->load_uri = NULL;
 
386
 
 
387
                g_free (priv->load_dir);
 
388
                priv->load_dir = NULL;
 
389
        }
 
390
 
 
391
        /* destroy all references */
 
392
        if (priv->references) {
 
393
                g_hash_table_destroy (priv->references);
 
394
                priv->references = g_hash_table_new (g_direct_hash, g_direct_equal);
 
395
        }
 
396
 
 
397
#ifdef BUILD_INOTIFY
 
398
 
 
399
        brasero_file_monitor_reset (BRASERO_FILE_MONITOR (self));
 
400
 
 
401
#endif
 
402
 
 
403
        /* empty tree */
 
404
        for (iter = priv->first; iter; iter = next) {
 
405
                next = iter->next;
 
406
                brasero_video_project_remove_file (self, iter);
 
407
        }
 
408
        priv->first = NULL;
 
409
 
 
410
        priv->loading = 0;
 
411
 
 
412
        klass = BRASERO_VIDEO_PROJECT_GET_CLASS (self);
 
413
        if (klass->reset)
 
414
                klass->reset (self, num_nodes);
 
415
}
 
416
 
 
417
/**
 
418
 * Add functions
 
419
 */
 
420
 
 
421
static BraseroVideoFile *
 
422
brasero_video_project_add_video_file (BraseroVideoProject *self,
 
423
                                      const gchar *uri,
 
424
                                      BraseroVideoFile *sibling,
 
425
                                      guint64 start,
 
426
                                      guint64 end)
 
427
{
 
428
        BraseroVideoProjectPrivate *priv;
 
429
        BraseroVideoFile *file;
 
430
 
 
431
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
 
432
 
 
433
        /* create new file and insert it */
 
434
        file = g_new0 (BraseroVideoFile, 1);
 
435
        file->uri = g_strdup (uri);
 
436
 
 
437
        if (start > -1)
 
438
                file->start = start;
 
439
 
 
440
        if (end > -1)
 
441
                file->end = end;
 
442
 
 
443
        if (sibling) {
 
444
                file->next = sibling;
 
445
                file->prev = sibling->prev;
 
446
 
 
447
                if (sibling->prev)
 
448
                        sibling->prev->next = file;
 
449
                else
 
450
                        priv->first = file;
 
451
 
 
452
                sibling->prev = file;
 
453
        }
 
454
        else if (priv->first) {
 
455
                BraseroVideoFile *last;
 
456
 
 
457
                /* Put it at the end */
 
458
                last = priv->first;
 
459
                while (last->next) last = last->next;
 
460
 
 
461
                file->prev = last;
 
462
                file->next = NULL;
 
463
                last->next = file;
 
464
        }
 
465
        else {
 
466
                priv->first = file;
 
467
                file->next = NULL;
 
468
                file->prev = NULL;
 
469
        }
 
470
 
 
471
        return file;
 
472
}
 
473
 
 
474
static void
 
475
brasero_video_project_set_file_information (BraseroVideoProject *self,
 
476
                                            BraseroVideoFile *file,
 
477
                                            GFileInfo *info)
 
478
{
 
479
        guint64 len;
 
480
        GdkPixbuf *snapshot;
 
481
        BraseroVideoProjectPrivate *priv;
 
482
 
 
483
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
 
484
 
 
485
        /* For reloading files no need to go further, we just want to check that
 
486
         * they are still readable and still holds video. */
 
487
        if (file->is_reloading) {
 
488
                file->is_reloading = FALSE;
 
489
                return;
 
490
        }
 
491
 
 
492
        file->is_loading = FALSE;
 
493
 
 
494
        if (g_file_info_get_is_symlink (info)) {
 
495
                gchar *sym_uri;
 
496
 
 
497
                sym_uri = g_strconcat ("file://", g_file_info_get_symlink_target (info), NULL);
 
498
                g_free (file->uri);
 
499
 
 
500
                file->uri = sym_uri;
 
501
        }
 
502
 
 
503
        /* Set the snapshot */
 
504
        snapshot = GDK_PIXBUF (g_file_info_get_attribute_object (info, BRASERO_IO_THUMBNAIL));
 
505
        if (snapshot) {
 
506
                GdkPixbuf *scaled;
 
507
 
 
508
                scaled = gdk_pixbuf_scale_simple (snapshot,
 
509
                                                  48 * gdk_pixbuf_get_width (snapshot) / gdk_pixbuf_get_height (snapshot),
 
510
                                                  48,
 
511
                                                  GDK_INTERP_BILINEAR);
 
512
                file->snapshot = scaled;
 
513
        }
 
514
 
 
515
        /* size */
 
516
        if (!file->len_set) {
 
517
                len = g_file_info_get_attribute_uint64 (info, BRASERO_IO_LEN);
 
518
                if (file->end > len)
 
519
                        file->end = len;
 
520
                else if (file->end <= 0)
 
521
                        file->end = len;
 
522
        }
 
523
 
 
524
        /* Get the song info */
 
525
        if (!file->info)
 
526
                file->info = g_new0 (BraseroSongInfo, 1);
 
527
 
 
528
        if (!file->title_set) {
 
529
                if (file->info->title)
 
530
                        g_free (file->info->title);
 
531
 
 
532
                file->info->title = g_strdup (g_file_info_get_attribute_string (info, BRASERO_IO_TITLE));
 
533
        }
 
534
 
 
535
        if (!file->artist_set) {
 
536
                if (file->info->artist)
 
537
                        g_free (file->info->artist);
 
538
 
 
539
                file->info->artist = g_strdup (g_file_info_get_attribute_string (info, BRASERO_IO_ARTIST));
 
540
        }
 
541
 
 
542
        if (!file->composer_set) {
 
543
                if (file->info->composer)
 
544
                        g_free (file->info->composer);
 
545
 
 
546
                file->info->composer = g_strdup (g_file_info_get_attribute_string (info, BRASERO_IO_COMPOSER));
 
547
        }
 
548
 
 
549
        if (!file->isrc_set)
 
550
                file->info->isrc = g_file_info_get_attribute_int32 (info, BRASERO_IO_ISRC);
 
551
 
 
552
#ifdef BUILD_INOTIFY
 
553
 
 
554
        /* Start monitoring */
 
555
        file->is_monitored = TRUE;
 
556
        brasero_file_monitor_single_file (BRASERO_FILE_MONITOR (self),
 
557
                                          file->uri,
 
558
                                          file);
 
559
 
 
560
#endif
 
561
}
 
562
 
 
563
static void
 
564
brasero_video_project_vfs_operation_finished (GObject *object,
 
565
                                              gboolean cancelled,
 
566
                                              gpointer null_data)
 
567
{
 
568
        BraseroVideoProjectPrivate *priv;
 
569
 
 
570
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (object);
 
571
 
 
572
        priv->loading --;
 
573
        g_signal_emit (object,
 
574
                       brasero_video_project_signals [ACTIVITY_SIGNAL],
 
575
                       0,
 
576
                       priv->loading > 0);
 
577
}
 
578
 
 
579
static void
 
580
brasero_video_project_add_directory_contents_result (GObject *obj,
 
581
                                                     GError *error,
 
582
                                                     const gchar *uri,
 
583
                                                     GFileInfo *info,
 
584
                                                     gpointer user_data)
 
585
{
 
586
        BraseroVideoFile *file;
 
587
        BraseroVideoFile *sibling;
 
588
        BraseroVideoProjectClass *klass;
 
589
        guint ref = GPOINTER_TO_INT (user_data);
 
590
 
 
591
        /* Check the return status for this file */
 
592
        if (error)
 
593
                return;
 
594
 
 
595
        if (g_file_info_get_file_type (info) != G_FILE_TYPE_REGULAR
 
596
        || !g_file_info_get_attribute_boolean (info, BRASERO_IO_HAS_VIDEO))
 
597
                return;
 
598
 
 
599
        sibling = brasero_video_project_reference_get (BRASERO_VIDEO_PROJECT (obj), ref);
 
600
 
 
601
        /* Add a video file and set all information */
 
602
        file = brasero_video_project_add_video_file (BRASERO_VIDEO_PROJECT (obj),
 
603
                                                     uri,
 
604
                                                     sibling,
 
605
                                                     -1,
 
606
                                                     -1);
 
607
                                                     
 
608
        brasero_video_project_set_file_information (BRASERO_VIDEO_PROJECT (obj),
 
609
                                                    file,
 
610
                                                    info);
 
611
 
 
612
        /* Tell model we added a node */
 
613
        klass = BRASERO_VIDEO_PROJECT_GET_CLASS (obj);
 
614
        if (klass->node_added)
 
615
                klass->node_added (BRASERO_VIDEO_PROJECT (obj), file);
 
616
 
 
617
        /* update size */
 
618
        g_signal_emit (BRASERO_VIDEO_PROJECT (obj),
 
619
                       brasero_video_project_signals [SIZE_CHANGED_SIGNAL],
 
620
                       0);
 
621
}
 
622
 
 
623
static void
 
624
brasero_video_project_add_directory_contents (BraseroVideoProject *self,
 
625
                                              const gchar *uri,
 
626
                                              BraseroVideoFile *sibling)
 
627
{
 
628
        BraseroVideoProjectPrivate *priv;
 
629
        guint ref;
 
630
 
 
631
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
 
632
 
 
633
        if (!priv->io)
 
634
                priv->io = brasero_io_get_default ();
 
635
 
 
636
        if (!priv->load_dir)
 
637
                priv->load_dir = brasero_io_register (G_OBJECT (self),
 
638
                                                      brasero_video_project_add_directory_contents_result,
 
639
                                                      brasero_video_project_vfs_operation_finished,
 
640
                                                      NULL);
 
641
 
 
642
        priv->loading ++;
 
643
        g_signal_emit (self,
 
644
                       brasero_video_project_signals [ACTIVITY_SIGNAL],
 
645
                       0,
 
646
                       priv->loading != 0);
 
647
 
 
648
        ref = brasero_video_project_reference_new (self, sibling);
 
649
 
 
650
        brasero_io_load_directory (priv->io,
 
651
                                   uri,
 
652
                                   priv->load_dir,
 
653
                                   BRASERO_IO_INFO_MIME|
 
654
                                   BRASERO_IO_INFO_PERM|
 
655
                                   BRASERO_IO_INFO_METADATA|
 
656
                                   BRASERO_IO_INFO_METADATA_MISSING_CODEC|
 
657
                                   BRASERO_IO_INFO_RECURSIVE|
 
658
                                   BRASERO_IO_INFO_METADATA_THUMBNAIL,
 
659
                                   GINT_TO_POINTER (ref));
 
660
}
 
661
 
 
662
static void
 
663
brasero_video_project_result_cb (GObject *obj,
 
664
                                 GError *error,
 
665
                                 const gchar *uri,
 
666
                                 GFileInfo *info,
 
667
                                 gpointer user_data)
 
668
{
 
669
        BraseroVideoFile *file;
 
670
        BraseroVideoProject *self;
 
671
        BraseroVideoProjectClass *klass;
 
672
        BraseroVideoProjectPrivate *priv;
 
673
        guint ref = GPOINTER_TO_INT (user_data);
 
674
 
 
675
        self = BRASERO_VIDEO_PROJECT (obj);
 
676
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (obj);
 
677
 
 
678
        /* Get the reference for the node */
 
679
        file = brasero_video_project_reference_get (self, ref);
 
680
        if (!file)
 
681
                return;
 
682
 
 
683
        /* Check the return status for this file */
 
684
        if (error) {
 
685
                g_signal_emit (self,
 
686
                               brasero_video_project_signals [UNREADABLE_SIGNAL],
 
687
                               0,
 
688
                               error,
 
689
                               uri);
 
690
 
 
691
                brasero_video_project_remove_file (self, file);
 
692
                return;
 
693
        }
 
694
 
 
695
        if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) {
 
696
                gboolean result;
 
697
 
 
698
                /* Ask the user */
 
699
                result = brasero_video_project_file_signal (self,
 
700
                                                            DIRECTORY_URI_SIGNAL,
 
701
                                                            uri);
 
702
 
 
703
                /* NOTE: we need to pass a sibling here even if that the file
 
704
                 * that's going to be deleted just after. */
 
705
                if (result)
 
706
                        brasero_video_project_add_directory_contents (self,
 
707
                                                                      uri,
 
708
                                                                      file->next?file->next:file);
 
709
 
 
710
                /* remove the file */
 
711
                brasero_video_project_remove_file (self, file);
 
712
                return;
 
713
        }
 
714
 
 
715
        if (g_file_info_get_file_type (info) != G_FILE_TYPE_REGULAR
 
716
        || !g_file_info_get_attribute_boolean (info, BRASERO_IO_HAS_VIDEO)) {
 
717
                g_signal_emit (self,
 
718
                               brasero_video_project_signals [NOT_VIDEO_SIGNAL],
 
719
                               0,
 
720
                               uri);
 
721
 
 
722
                brasero_video_project_remove_file (self, file);
 
723
                return;
 
724
        }
 
725
 
 
726
        brasero_video_project_set_file_information (BRASERO_VIDEO_PROJECT (obj),
 
727
                                                    file,
 
728
                                                    info);
 
729
 
 
730
        /* Tell upper object that the node status and information changed */
 
731
        klass = BRASERO_VIDEO_PROJECT_GET_CLASS (self);
 
732
        if (klass->node_changed)
 
733
                klass->node_changed (self, file);
 
734
 
 
735
        /* update size */
 
736
        g_signal_emit (self,
 
737
                       brasero_video_project_signals [SIZE_CHANGED_SIGNAL],
 
738
                       0);
 
739
}
 
740
 
 
741
BraseroVideoFile *
 
742
brasero_video_project_add_uri (BraseroVideoProject *self,
 
743
                               const gchar *uri,
 
744
                               BraseroSongInfo *info,
 
745
                               BraseroVideoFile *sibling,
 
746
                               gint64 start,
 
747
                               gint64 end)
 
748
{
 
749
        BraseroVideoProjectPrivate *priv;
 
750
        BraseroVideoProjectClass *klass;
 
751
        BraseroVideoFile *file;
 
752
        guint ref;
 
753
 
 
754
        g_return_val_if_fail (uri != NULL, NULL);
 
755
 
 
756
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
 
757
 
 
758
        /* create new file and insert it */
 
759
        file = g_new0 (BraseroVideoFile, 1);
 
760
        file->uri = g_strdup (uri);
 
761
 
 
762
        if (info) {
 
763
                file->info = brasero_song_info_copy (info);
 
764
 
 
765
                if (info->isrc)
 
766
                        file->isrc_set = TRUE;
 
767
                if (info->title)
 
768
                        file->title_set = TRUE;
 
769
                if (info->artist)
 
770
                        file->artist_set = TRUE;
 
771
                if (info->composer)
 
772
                        file->composer_set = TRUE;
 
773
        }
 
774
        else
 
775
                file->info = g_new0 (BraseroSongInfo, 1);
 
776
 
 
777
        if (start > -1)
 
778
                file->start = start;
 
779
 
 
780
        if (end > -1) {
 
781
                file->end = end;
 
782
                file->len_set = TRUE;
 
783
        }
 
784
 
 
785
        if (sibling) {
 
786
                file->next = sibling;
 
787
                file->prev = sibling->prev;
 
788
 
 
789
                if (sibling->prev)
 
790
                        sibling->prev->next = file;
 
791
                else
 
792
                        priv->first = file;
 
793
 
 
794
                sibling->prev = file;
 
795
        }
 
796
        else if (priv->first) {
 
797
                BraseroVideoFile *last;
 
798
 
 
799
                /* Put it at the end */
 
800
                last = priv->first;
 
801
                while (last->next) last = last->next;
 
802
 
 
803
                file->prev = last;
 
804
                file->next = NULL;
 
805
                last->next = file;
 
806
        }
 
807
        else {
 
808
                priv->first = file;
 
809
                file->next = NULL;
 
810
                file->prev = NULL;
 
811
        }
 
812
 
 
813
        /* Tell model we added a node */
 
814
        klass = BRASERO_VIDEO_PROJECT_GET_CLASS (self);
 
815
        if (klass->node_added)
 
816
                klass->node_added (self, file);
 
817
 
 
818
        /* get info async for the file */
 
819
        if (!priv->io)
 
820
                priv->io = brasero_io_get_default ();
 
821
 
 
822
        if (!priv->load_uri)
 
823
                priv->load_uri = brasero_io_register (G_OBJECT (self),
 
824
                                                      brasero_video_project_result_cb,
 
825
                                                      brasero_video_project_vfs_operation_finished,
 
826
                                                      NULL);
 
827
 
 
828
        file->is_loading = 1;
 
829
        priv->loading ++;
 
830
 
 
831
        ref = brasero_video_project_reference_new (self, file);
 
832
        brasero_io_get_file_info (priv->io,
 
833
                                  uri,
 
834
                                  priv->load_uri,
 
835
                                  BRASERO_IO_INFO_PERM|
 
836
                                  BRASERO_IO_INFO_MIME|
 
837
                                  BRASERO_IO_INFO_URGENT|
 
838
                                  BRASERO_IO_INFO_METADATA|
 
839
                                  BRASERO_IO_INFO_METADATA_MISSING_CODEC|
 
840
                                  BRASERO_IO_INFO_METADATA_THUMBNAIL,
 
841
                                  GINT_TO_POINTER (ref));
 
842
 
 
843
        g_signal_emit (self,
 
844
                       brasero_video_project_signals [ACTIVITY_SIGNAL],
 
845
                       0,
 
846
                       (priv->loading > 0));
 
847
 
 
848
        return file;
 
849
}
 
850
 
 
851
void
 
852
brasero_video_project_resize_file (BraseroVideoProject *self,
 
853
                                   BraseroVideoFile *file,
 
854
                                   gint64 start,
 
855
                                   gint64 end)
 
856
{
 
857
        BraseroVideoProjectPrivate *priv;
 
858
        BraseroVideoProjectClass *klass;
 
859
 
 
860
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
 
861
 
 
862
        file->start = start;
 
863
        file->end = end;
 
864
 
 
865
        klass = BRASERO_VIDEO_PROJECT_GET_CLASS (self);
 
866
        if (klass->node_changed)
 
867
                klass->node_changed (self, file);
 
868
 
 
869
        /* update size */
 
870
        g_signal_emit (self,
 
871
                       brasero_video_project_signals [SIZE_CHANGED_SIGNAL],
 
872
                       0);
 
873
}
 
874
 
 
875
guint64
 
876
brasero_video_project_get_size (BraseroVideoProject *self)
 
877
{
 
878
        BraseroVideoProjectPrivate *priv;
 
879
        BraseroVideoFile *iter;
 
880
        guint size = 0;
 
881
 
 
882
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
 
883
 
 
884
        /* FIXME: duration to sectors is not correct here, that's not audio... */
 
885
        for (iter = priv->first; iter; iter = iter->next)
 
886
                size += BRASERO_DURATION_TO_SECTORS (iter->end - iter->start);
 
887
 
 
888
        return size;
 
889
}
 
890
 
 
891
guint
 
892
brasero_video_project_get_file_num (BraseroVideoProject *self)
 
893
{
 
894
        BraseroVideoProjectPrivate *priv;
 
895
        BraseroVideoFile *item;
 
896
        guint num = 0;
 
897
 
 
898
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
 
899
        for (item = priv->first; item; item = item->next)
 
900
                num ++;
 
901
 
 
902
        return num;
 
903
}
 
904
 
 
905
BraseroVideoFile *
 
906
brasero_video_project_get_nth_item (BraseroVideoProject *self,
 
907
                                    guint nth)
 
908
{
 
909
        BraseroVideoFile *item;
 
910
        BraseroVideoProjectPrivate *priv;
 
911
 
 
912
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
 
913
        if (!nth)
 
914
                return priv->first;
 
915
 
 
916
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
 
917
        for (item = priv->first; item; item = item->next) {
 
918
                if (nth <= 0)
 
919
                        return item;
 
920
 
 
921
                nth --;
 
922
        }
 
923
 
 
924
        return NULL;
 
925
}
 
926
 
 
927
guint
 
928
brasero_video_project_get_item_index (BraseroVideoProject *self,
 
929
                                      BraseroVideoFile *file)
 
930
{
 
931
        guint nth = 0;
 
932
        BraseroVideoFile *item;
 
933
        BraseroVideoProjectPrivate *priv;
 
934
 
 
935
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
 
936
 
 
937
        for (item = priv->first; item; item = item->next) {
 
938
                if (item == file)
 
939
                        return nth;
 
940
 
 
941
                nth ++;
 
942
        }
 
943
 
 
944
        return nth;
 
945
}
 
946
 
 
947
BraseroDiscResult
 
948
brasero_video_project_get_status (BraseroVideoProject *self,
 
949
                                  gint *remaining,
 
950
                                  gchar **current_task)
 
951
{
 
952
        BraseroVideoProjectPrivate *priv;
 
953
 
 
954
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
 
955
 
 
956
        if (priv->loading) {
 
957
                if (remaining)
 
958
                        *remaining = priv->loading;
 
959
 
 
960
                if (current_task)
 
961
                        *current_task = g_strdup (_("Analysing video files"));
 
962
 
 
963
                return BRASERO_DISC_NOT_READY;
 
964
        }
 
965
 
 
966
        if (!priv->first)
 
967
                return BRASERO_DISC_ERROR_EMPTY_SELECTION;
 
968
 
 
969
        return BRASERO_DISC_OK;
 
970
}
 
971
 
 
972
GSList *
 
973
brasero_video_project_get_contents (BraseroVideoProject *self,
 
974
                                    gboolean values_set)
 
975
{
 
976
        GSList *tracks = NULL;
 
977
        BraseroVideoFile *file;
 
978
        BraseroVideoProjectPrivate *priv;
 
979
 
 
980
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
 
981
        if (!priv->first)
 
982
                return NULL;
 
983
 
 
984
        for (file = priv->first; file; file = file->next) {
 
985
                BraseroSongInfo *info = NULL;
 
986
                BraseroTrack *track;
 
987
 
 
988
                if (file->info) {
 
989
                        info = brasero_song_info_copy (file->info);
 
990
 
 
991
                        if (values_set) {
 
992
                                if (!file->title_set) {
 
993
                                        g_free (info->title);
 
994
                                        info->title = NULL;
 
995
                                }
 
996
                                if (!file->artist_set) {
 
997
                                        g_free (info->artist);
 
998
                                        info->artist = NULL;
 
999
                                }
 
1000
                                if (!file->composer_set) {
 
1001
                                        g_free (info->composer);
 
1002
                                        info->composer = NULL;
 
1003
                                }
 
1004
                                if (!file->isrc_set)
 
1005
                                        info->isrc = 0;
 
1006
                        }
 
1007
                }
 
1008
                else
 
1009
                        info = NULL;
 
1010
 
 
1011
                track = brasero_track_new (BRASERO_TRACK_TYPE_AUDIO);
 
1012
                brasero_track_set_audio_source (track,
 
1013
                                                file->uri,
 
1014
                                                BRASERO_AUDIO_FORMAT_UNDEFINED|
 
1015
                                                BRASERO_VIDEO_FORMAT_UNDEFINED);
 
1016
 
 
1017
                if (!values_set || file->len_set)
 
1018
                        brasero_track_set_audio_boundaries (track,
 
1019
                                                            file->start,
 
1020
                                                            file->end,
 
1021
                                                            -1);
 
1022
                else
 
1023
                        brasero_track_set_audio_boundaries (track,
 
1024
                                                            file->start,
 
1025
                                                            0,
 
1026
                                                            -1);
 
1027
 
 
1028
                brasero_track_set_audio_info (track, info);
 
1029
                tracks = g_slist_prepend (tracks, track);
 
1030
        }
 
1031
 
 
1032
        tracks = g_slist_reverse (tracks);
 
1033
        return tracks;
 
1034
}
 
1035
 
 
1036
static void
 
1037
brasero_video_project_init (BraseroVideoProject *object)
 
1038
{
 
1039
        BraseroVideoProjectPrivate *priv;
 
1040
 
 
1041
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (object);
 
1042
        priv->ref_count = 1;
 
1043
}
 
1044
 
 
1045
static void
 
1046
brasero_video_project_finalize (GObject *object)
 
1047
{
 
1048
        BraseroVideoProjectPrivate *priv;
 
1049
        BraseroVideoFile *iter, *next;
 
1050
 
 
1051
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (object);
 
1052
 
 
1053
        for (iter = priv->first; iter; iter = next) {
 
1054
                next = iter->next;
 
1055
                g_free (iter->uri);
 
1056
                brasero_song_info_free (iter->info);
 
1057
                g_free (iter);
 
1058
        }
 
1059
 
 
1060
        if (priv->references) {
 
1061
                g_hash_table_destroy (priv->references);
 
1062
                priv->references = NULL;
 
1063
        }
 
1064
 
 
1065
        G_OBJECT_CLASS (brasero_video_project_parent_class)->finalize (object);
 
1066
}
 
1067
/**
 
1068
 * Callbacks for inotify backend
 
1069
 */
 
1070
 
 
1071
#ifdef BUILD_INOTIFY
 
1072
 
 
1073
static void
 
1074
brasero_video_project_file_renamed (BraseroFileMonitor *monitor,
 
1075
                                    BraseroFileMonitorType type,
 
1076
                                    gpointer callback_data,
 
1077
                                    const gchar *old_name,
 
1078
                                    const gchar *new_name)
 
1079
{
 
1080
        brasero_video_project_rename (BRASERO_VIDEO_PROJECT (monitor),
 
1081
                                      callback_data,
 
1082
                                      new_name);
 
1083
}
 
1084
 
 
1085
static void
 
1086
brasero_video_project_file_removed (BraseroFileMonitor *monitor,
 
1087
                                    BraseroFileMonitorType type,
 
1088
                                    gpointer callback_data,
 
1089
                                    const gchar *name)
 
1090
{
 
1091
        brasero_video_project_remove_file (BRASERO_VIDEO_PROJECT (monitor),
 
1092
                                           callback_data);
 
1093
}
 
1094
 
 
1095
static void
 
1096
brasero_video_project_file_modified (BraseroFileMonitor *monitor,
 
1097
                                     gpointer callback_data,
 
1098
                                     const gchar *name)
 
1099
{
 
1100
        BraseroVideoProjectPrivate *priv;
 
1101
        BraseroVideoFile *file;
 
1102
        guint ref;
 
1103
 
 
1104
        priv = BRASERO_VIDEO_PROJECT_PRIVATE (monitor);
 
1105
 
 
1106
        /* priv->load_uri has already been initialized otherwise the tree would
 
1107
         * be empty. But who knows... */
 
1108
        if (!priv->io || !priv->load_uri)
 
1109
                return;
 
1110
 
 
1111
        file = callback_data;
 
1112
        file->is_reloading = TRUE;
 
1113
 
 
1114
        ref = brasero_video_project_reference_new (BRASERO_VIDEO_PROJECT (monitor), file);
 
1115
        brasero_io_get_file_info (priv->io,
 
1116
                                  file->uri,
 
1117
                                  priv->load_uri,
 
1118
                                  BRASERO_IO_INFO_PERM|
 
1119
                                  BRASERO_IO_INFO_MIME|
 
1120
                                  BRASERO_IO_INFO_URGENT|
 
1121
                                  BRASERO_IO_INFO_METADATA|
 
1122
                                  BRASERO_IO_INFO_METADATA_MISSING_CODEC|
 
1123
                                  BRASERO_IO_INFO_METADATA_THUMBNAIL,
 
1124
                                  GINT_TO_POINTER (ref));
 
1125
}
 
1126
 
 
1127
static void
 
1128
brasero_video_project_file_moved (BraseroFileMonitor *monitor,
 
1129
                                  BraseroFileMonitorType type,
 
1130
                                  gpointer callback_src,
 
1131
                                  const gchar *name_src,
 
1132
                                  gpointer callback_dest,
 
1133
                                  const gchar *name_dest)
 
1134
{
 
1135
        /* This is a file removed since we won't monitor all folders to get its
 
1136
         * new path */
 
1137
        /* FIXME: what about files moved to one of the URI in the list ? */
 
1138
        brasero_video_project_remove_file (BRASERO_VIDEO_PROJECT (monitor),
 
1139
                                           callback_src);
 
1140
}
 
1141
 
 
1142
#endif
 
1143
 
 
1144
static void
 
1145
brasero_video_project_class_init (BraseroVideoProjectClass *klass)
 
1146
{
 
1147
        GObjectClass* object_class = G_OBJECT_CLASS (klass);
 
1148
 
 
1149
        g_type_class_add_private (klass, sizeof (BraseroVideoProjectPrivate));
 
1150
 
 
1151
        object_class->finalize = brasero_video_project_finalize;
 
1152
 
 
1153
        brasero_video_project_signals [SIZE_CHANGED_SIGNAL] = 
 
1154
            g_signal_new ("size_changed",
 
1155
                          G_TYPE_FROM_CLASS (klass),
 
1156
                          G_SIGNAL_RUN_LAST|G_SIGNAL_NO_RECURSE,
 
1157
                          0,
 
1158
                          NULL, NULL,
 
1159
                          g_cclosure_marshal_VOID__VOID,
 
1160
                          G_TYPE_NONE,
 
1161
                          0,
 
1162
                          G_TYPE_NONE);
 
1163
 
 
1164
        brasero_video_project_signals [PROJECT_LOADED_SIGNAL] = 
 
1165
            g_signal_new ("project-loaded",
 
1166
                          G_TYPE_FROM_CLASS (klass),
 
1167
                          G_SIGNAL_RUN_LAST|G_SIGNAL_NO_RECURSE,
 
1168
                          0,
 
1169
                          NULL, NULL,
 
1170
                          g_cclosure_marshal_VOID__INT,
 
1171
                          G_TYPE_NONE,
 
1172
                          1,
 
1173
                          G_TYPE_INT);
 
1174
 
 
1175
        brasero_video_project_signals [UNREADABLE_SIGNAL] = 
 
1176
            g_signal_new ("unreadable_uri",
 
1177
                          G_TYPE_FROM_CLASS (klass),
 
1178
                          G_SIGNAL_RUN_FIRST,
 
1179
                          0,
 
1180
                          NULL, NULL,
 
1181
                          brasero_marshal_VOID__POINTER_STRING,
 
1182
                          G_TYPE_NONE,
 
1183
                          2,
 
1184
                          G_TYPE_POINTER,
 
1185
                          G_TYPE_STRING);
 
1186
 
 
1187
        brasero_video_project_signals [NOT_VIDEO_SIGNAL] = 
 
1188
            g_signal_new ("not_video_uri",
 
1189
                          G_TYPE_FROM_CLASS (klass),
 
1190
                          G_SIGNAL_RUN_FIRST,
 
1191
                          0,
 
1192
                          NULL, NULL,
 
1193
                          g_cclosure_marshal_VOID__STRING,
 
1194
                          G_TYPE_NONE,
 
1195
                          1,
 
1196
                          G_TYPE_STRING);
 
1197
 
 
1198
        brasero_video_project_signals [DIRECTORY_URI_SIGNAL] = 
 
1199
            g_signal_new ("directory_uri",
 
1200
                          G_TYPE_FROM_CLASS (klass),
 
1201
                          G_SIGNAL_RUN_LAST|G_SIGNAL_NO_RECURSE,
 
1202
                          0,
 
1203
                          NULL, NULL,
 
1204
                          brasero_marshal_BOOLEAN__STRING,
 
1205
                          G_TYPE_BOOLEAN,
 
1206
                          1,
 
1207
                          G_TYPE_STRING);
 
1208
 
 
1209
        brasero_video_project_signals [ACTIVITY_SIGNAL] = 
 
1210
            g_signal_new ("vfs_activity",
 
1211
                          G_TYPE_FROM_CLASS (klass),
 
1212
                          G_SIGNAL_RUN_FIRST|G_SIGNAL_NO_RECURSE,
 
1213
                          0,
 
1214
                          NULL, NULL,
 
1215
                          g_cclosure_marshal_VOID__BOOLEAN,
 
1216
                          G_TYPE_NONE,
 
1217
                          1,
 
1218
                          G_TYPE_BOOLEAN);
 
1219
 
 
1220
#ifdef BUILD_INOTIFY
 
1221
 
 
1222
        BraseroFileMonitorClass *monitor_class = BRASERO_FILE_MONITOR_CLASS (klass);
 
1223
 
 
1224
        /* NOTE: file_added is not needed here since there aren't any directory */
 
1225
        monitor_class->file_moved = brasero_video_project_file_moved;
 
1226
        monitor_class->file_removed = brasero_video_project_file_removed;
 
1227
        monitor_class->file_renamed = brasero_video_project_file_renamed;
 
1228
        monitor_class->file_modified = brasero_video_project_file_modified;
 
1229
 
 
1230
#endif
 
1231
}