~ubuntu-branches/ubuntu/precise/rhythmbox/precise-201203091205

« back to all changes in this revision

Viewing changes to backends/rb-encoder.h

Tags: upstream-0.9.5
ImportĀ upstreamĀ versionĀ 0.9.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
2
/*
 
3
 * arch-tag: Interface to audio encoder backend  
 
4
 *
 
5
 * Copyright (C) 2006 James Livingston <jrl@ids.org.au>
 
6
 *
 
7
 * This program is free software; you can redistribute it and/or
 
8
 * modify it under the terms of the GNU General Public License as
 
9
 * published by the Free Software Foundation; either version 2 of the
 
10
 * License, or (at your option) any later version.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
 * General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public
 
18
 * License along with this program; if not, write to the
 
19
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 
20
 * Boston, MA 02110-1301  USA.
 
21
 */
 
22
 
 
23
#ifndef __RB_ENCODER_H__
 
24
#define __RB_ENCODER_H__
 
25
 
 
26
#include <glib-object.h>
 
27
 
 
28
#include "rhythmdb.h"
 
29
 
 
30
G_BEGIN_DECLS
 
31
 
 
32
#define RB_TYPE_ENCODER            (rb_encoder_get_type ())
 
33
#define RB_ENCODER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), RB_TYPE_ENCODER, RBEncoder))
 
34
#define RB_IS_ENCODER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RB_TYPE_ENCODER))
 
35
#define RB_ENCODER_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), RB_TYPE_ENCODER, RBEncoderIface))
 
36
 
 
37
 
 
38
enum
 
39
{
 
40
        RB_ENCODER_ERROR_FORMAT_UNSUPPORTED,
 
41
        RB_ENCODER_ERROR_INTERNAL,
 
42
};
 
43
 
 
44
#define RB_ENCODER_ERROR rb_encoder_error_quark ()
 
45
 
 
46
GQuark rb_encoder_error_quark (void);
 
47
 
 
48
typedef struct _RBEncoder RBEncoder;
 
49
 
 
50
typedef struct
 
51
{
 
52
        GTypeInterface g_iface;
 
53
 
 
54
        /* vtable */
 
55
        gboolean        (*encode)       (RBEncoder *encoder,
 
56
                                         RhythmDBEntry *entry,
 
57
                                         const char *dest,
 
58
                                         const char *mime_type);
 
59
        void            (*cancel)       (RBEncoder *encoder);
 
60
 
 
61
        /* signals */
 
62
        void (*progress) (RBEncoder *encoder,  double fraction);
 
63
        void (*completed) (RBEncoder *encoder);
 
64
        void (*error) (RBEncoder *encoder, GError *error);
 
65
} RBEncoderIface;
 
66
 
 
67
RBEncoder*      rb_encoder_new          (void);
 
68
GType rb_encoder_get_type (void);
 
69
 
 
70
gboolean        rb_encoder_encode       (RBEncoder *encoder,
 
71
                                         RhythmDBEntry *entry,
 
72
                                         const char *dest,
 
73
                                         const char *mime_type);
 
74
void            rb_encoder_cancel       (RBEncoder *encoder);
 
75
 
 
76
/* obly to be used by subclasses */
 
77
void    _rb_encoder_emit_progress (RBEncoder *encoder, double fraction);
 
78
void    _rb_encoder_emit_completed (RBEncoder *encoder);
 
79
void    _rb_encoder_emit_error (RBEncoder *encoder, GError *error);
 
80
 
 
81
G_END_DECLS
 
82
 
 
83
#endif /* __RB_ENCODER_H__ */