~ubuntu-branches/ubuntu/vivid/dleyna-core/vivid

« back to all changes in this revision

Viewing changes to libdleyna/core/task-processor.h

  • Committer: Package Import Robot
  • Author(s): Emanuele Aina
  • Date: 2013-06-07 13:51:34 UTC
  • Revision ID: package-import@ubuntu.com-20130607135134-606qkw7c8sskizvm
Tags: upstream-0.1.0
ImportĀ upstreamĀ versionĀ 0.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * dLeyna
 
3
 *
 
4
 * Copyright (C) 2012-2013 Intel Corporation. All rights reserved.
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify it
 
7
 * under the terms and conditions of the GNU Lesser General Public License,
 
8
 * version 2.1, as published by the Free Software Foundation.
 
9
 *
 
10
 * This program is distributed in the hope it will be useful, but WITHOUT
 
11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
 
13
 * for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU Lesser General Public License
 
16
 * along with this program; if not, write to the Free Software Foundation, Inc.,
 
17
 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
 
18
 *
 
19
 * Regis Merlino <regis.merlino@intel.com>
 
20
 *
 
21
 */
 
22
 
 
23
#ifndef DLEYNA_TASK_PROCESSOR_H__
 
24
#define DLEYNA_TASK_PROCESSOR_H__
 
25
 
 
26
#include <gio/gio.h>
 
27
#include <glib.h>
 
28
 
 
29
#include "task-atom.h"
 
30
 
 
31
enum dleyna_task_queue_flag_mask_ {
 
32
        DLEYNA_TASK_QUEUE_FLAG_NONE = 0,
 
33
        DLEYNA_TASK_QUEUE_FLAG_AUTO_START = 1,
 
34
        DLEYNA_TASK_QUEUE_FLAG_AUTO_REMOVE = 1 << 1,
 
35
};
 
36
typedef enum dleyna_task_queue_flag_mask_ dleyna_task_queue_flag_mask;
 
37
 
 
38
typedef struct dleyna_task_processor_t_ dleyna_task_processor_t;
 
39
 
 
40
typedef void (*dleyna_task_process_cb_t)(dleyna_task_atom_t *task,
 
41
                                         gpointer user_data);
 
42
 
 
43
typedef void (*dleyna_task_cancel_cb_t)(dleyna_task_atom_t *task,
 
44
                                        gpointer user_data);
 
45
 
 
46
typedef void (*dleyna_task_delete_cb_t)(dleyna_task_atom_t *task,
 
47
                                        gpointer user_data);
 
48
 
 
49
typedef void (*dleyna_task_finally_cb_t)(gboolean cancelled,
 
50
                                         gpointer user_data);
 
51
 
 
52
dleyna_task_processor_t *dleyna_task_processor_new(GSourceFunc on_quit_cb);
 
53
 
 
54
void dleyna_task_processor_free(dleyna_task_processor_t *processor);
 
55
 
 
56
void dleyna_task_processor_set_quitting(dleyna_task_processor_t *processor);
 
57
 
 
58
const dleyna_task_queue_key_t *dleyna_task_processor_add_queue(
 
59
                                dleyna_task_processor_t *processor,
 
60
                                const gchar *source,
 
61
                                const gchar *sink,
 
62
                                guint32 flags,
 
63
                                dleyna_task_process_cb_t task_process_cb,
 
64
                                dleyna_task_cancel_cb_t task_cancel_cb,
 
65
                                dleyna_task_delete_cb_t task_delete_cb);
 
66
 
 
67
const dleyna_task_queue_key_t *dleyna_task_processor_lookup_queue(
 
68
                                const dleyna_task_processor_t *processor,
 
69
                                const gchar *source,
 
70
                                const gchar *sink);
 
71
 
 
72
void dleyna_task_processor_cancel_queue(
 
73
                                const dleyna_task_queue_key_t *queue_id);
 
74
 
 
75
void dleyna_task_processor_remove_queues_for_source(
 
76
                                        dleyna_task_processor_t *processor,
 
77
                                        const gchar *source);
 
78
 
 
79
void dleyna_task_processor_remove_queues_for_sink(
 
80
                                        dleyna_task_processor_t *processor,
 
81
                                        const gchar *sink);
 
82
 
 
83
void dleyna_task_queue_start(const dleyna_task_queue_key_t *queue_id);
 
84
 
 
85
void dleyna_task_queue_add_task(const dleyna_task_queue_key_t *queue_id,
 
86
                             dleyna_task_atom_t *task);
 
87
 
 
88
void dleyna_task_queue_task_completed(const dleyna_task_queue_key_t *queue_id);
 
89
 
 
90
void dleyna_task_queue_set_finally(const dleyna_task_queue_key_t *queue_id,
 
91
                                   dleyna_task_finally_cb_t finally_cb);
 
92
 
 
93
void dleyna_task_queue_set_user_data(const dleyna_task_queue_key_t *queue_id,
 
94
                                     gpointer user_data);
 
95
 
 
96
gpointer dleyna_task_queue_get_user_data(
 
97
                                const dleyna_task_queue_key_t *queue_id);
 
98
 
 
99
const gchar *dleyna_task_queue_get_source(
 
100
                                const dleyna_task_queue_key_t *queue_id);
 
101
 
 
102
#endif /* DLEYNA_TASK_PROCESSOR_H__ */