1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
3 * arch-tag: Interface to audio encoder backend
5 * Copyright (C) 2006 James Livingston <jrl@ids.org.au>
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.
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.
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.
23 #ifndef __RB_ENCODER_H__
24 #define __RB_ENCODER_H__
26 #include <glib-object.h>
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))
39 RB_ENCODER_ERROR_FORMAT_UNSUPPORTED
,
40 RB_ENCODER_ERROR_INTERNAL
,
41 RB_ENCODER_ERROR_FILE_ACCESS
,
44 #define RB_ENCODER_ERROR rb_encoder_error_quark ()
46 GQuark
rb_encoder_error_quark (void);
48 typedef struct _RBEncoder RBEncoder
;
52 GTypeInterface g_iface
;
55 gboolean (*encode
) (RBEncoder
*encoder
,
58 const char *mime_type
);
59 void (*cancel
) (RBEncoder
*encoder
);
62 void (*progress
) (RBEncoder
*encoder
, double fraction
);
63 void (*completed
) (RBEncoder
*encoder
);
64 void (*error
) (RBEncoder
*encoder
, GError
*error
);
67 RBEncoder
* rb_encoder_new (void);
68 GType
rb_encoder_get_type (void);
70 gboolean
rb_encoder_encode (RBEncoder
*encoder
,
73 const char *mime_type
);
74 void rb_encoder_cancel (RBEncoder
*encoder
);
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
);
83 #endif /* __RB_ENCODER_H__ */