leo_sobral@2
|
1 |
/* vim: set sw=2: -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2; c-indent-level: 2-*- */
|
leo_sobral@2
|
2 |
|
leo_sobral@2
|
3 |
#ifndef __MYTH_FILE_TRANSFER_H__
|
leo_sobral@2
|
4 |
#define __MYTH_FILE_TRANSFER_H__
|
leo_sobral@2
|
5 |
|
leo_sobral@2
|
6 |
#include <glib-object.h>
|
leo_sobral@2
|
7 |
|
leo_sobral@2
|
8 |
#include <gmyth/gmyth_socket.h>
|
leo_sobral@2
|
9 |
#include "myth_uri.h"
|
leo_sobral@2
|
10 |
#include "myth_livetv.h"
|
leo_sobral@2
|
11 |
|
leo_sobral@2
|
12 |
#include <stdio.h>
|
leo_sobral@2
|
13 |
#include <stdlib.h>
|
leo_sobral@2
|
14 |
#include <string.h>
|
leo_sobral@2
|
15 |
#include <netdb.h>
|
leo_sobral@2
|
16 |
#include <sys/socket.h>
|
leo_sobral@2
|
17 |
#include <unistd.h>
|
leo_sobral@2
|
18 |
|
leo_sobral@2
|
19 |
#define G_BEGIN_DECLS
|
leo_sobral@2
|
20 |
|
leo_sobral@2
|
21 |
#define MYTH_FILE_TRANSFER_TYPE (myth_file_transfer_get_type ())
|
leo_sobral@2
|
22 |
#define MYTH_FILE_TRANSFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MYTH_FILE_TRANSFER_TYPE, MythFileTransfer))
|
leo_sobral@2
|
23 |
#define MYTH_FILE_TRANSFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MYTH_FILE_TRANSFER_TYPE, MythFileTransferClass))
|
leo_sobral@2
|
24 |
#define IS_MYTH_FILE_TRANSFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MYTH_FILE_TRANSFER_TYPE))
|
leo_sobral@2
|
25 |
#define IS_MYTH_FILE_TRANSFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MYTH_FILE_TRANSFER_TYPE))
|
leo_sobral@2
|
26 |
#define MYTH_FILE_TRANSFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MYTH_FILE_TRANSFER_TYPE, MythFileTransferClass))
|
leo_sobral@2
|
27 |
|
leo_sobral@2
|
28 |
|
leo_sobral@2
|
29 |
typedef struct _MythFileTransfer MythFileTransfer;
|
leo_sobral@2
|
30 |
typedef struct _MythFileTransferClass MythFileTransferClass;
|
leo_sobral@2
|
31 |
|
leo_sobral@2
|
32 |
struct _MythFileTransferClass
|
leo_sobral@2
|
33 |
{
|
leo_sobral@2
|
34 |
GObjectClass parent_class;
|
leo_sobral@2
|
35 |
|
leo_sobral@2
|
36 |
/* callbacks */
|
leo_sobral@2
|
37 |
/* no one for now */
|
leo_sobral@2
|
38 |
};
|
leo_sobral@2
|
39 |
|
leo_sobral@2
|
40 |
struct _MythFileTransfer
|
leo_sobral@2
|
41 |
{
|
leo_sobral@2
|
42 |
GObject parent;
|
leo_sobral@2
|
43 |
|
leo_sobral@2
|
44 |
/* Myth URI structure */
|
leo_sobral@2
|
45 |
const MythURI *uri;
|
leo_sobral@2
|
46 |
|
leo_sobral@2
|
47 |
/* MythTV version number */
|
leo_sobral@2
|
48 |
gint mythtv_version;
|
leo_sobral@2
|
49 |
|
leo_sobral@2
|
50 |
/* socket descriptors */
|
leo_sobral@2
|
51 |
GMythSocket *control_sock;
|
leo_sobral@2
|
52 |
GMythSocket *event_sock;
|
leo_sobral@2
|
53 |
GMythSocket *sock;
|
leo_sobral@2
|
54 |
|
leo_sobral@2
|
55 |
guint64 readposition;
|
leo_sobral@2
|
56 |
guint64 filesize;
|
leo_sobral@2
|
57 |
gboolean timeoutisfast;
|
leo_sobral@2
|
58 |
gboolean userreadahead;
|
leo_sobral@2
|
59 |
gboolean live_tv;
|
leo_sobral@2
|
60 |
gint retries;
|
leo_sobral@2
|
61 |
|
leo_sobral@2
|
62 |
GString *query;
|
leo_sobral@2
|
63 |
|
leo_sobral@2
|
64 |
gint rec_id;
|
leo_sobral@2
|
65 |
gint recordernum;
|
leo_sobral@2
|
66 |
gint card_id;
|
leo_sobral@2
|
67 |
GString *hostname;
|
leo_sobral@2
|
68 |
gint port;
|
leo_sobral@2
|
69 |
};
|
leo_sobral@2
|
70 |
|
leo_sobral@2
|
71 |
GType myth_file_transfer_get_type (void);
|
leo_sobral@2
|
72 |
|
leo_sobral@2
|
73 |
MythFileTransfer* myth_file_transfer_new (gint num, GString *hostname, gshort port, gint mythtv_version );
|
leo_sobral@2
|
74 |
|
leo_sobral@2
|
75 |
gint myth_file_transfer_read(MythFileTransfer *transfer, void *data, gint size, gboolean read_unlimited);
|
leo_sobral@2
|
76 |
|
leo_sobral@2
|
77 |
guint64 myth_file_transfer_seek(MythFileTransfer *transfer, guint64 pos, gint whence);
|
leo_sobral@2
|
78 |
|
leo_sobral@2
|
79 |
gboolean myth_file_transfer_playback_setup( MythFileTransfer **transfer, gboolean live_tv );
|
leo_sobral@2
|
80 |
|
leo_sobral@2
|
81 |
gboolean myth_file_transfer_setup( MythFileTransfer **transfer, gboolean live_tv );
|
leo_sobral@2
|
82 |
|
leo_sobral@2
|
83 |
gboolean myth_file_transfer_livetv_setup( MythFileTransfer **transfer, GMythSocket *live_sock );
|
leo_sobral@2
|
84 |
|
leo_sobral@2
|
85 |
void myth_file_transfer_spawntv ( MythFileTransfer *file_transfer, GString *tvchain_id );
|
leo_sobral@2
|
86 |
|
leo_sobral@2
|
87 |
gboolean myth_file_transfer_is_recording( MythFileTransfer *file_transfer );
|
leo_sobral@2
|
88 |
|
leo_sobral@2
|
89 |
guint64 myth_file_transfer_get_file_position( MythFileTransfer *file_transfer );
|
leo_sobral@2
|
90 |
|
leo_sobral@2
|
91 |
#define G_END_DECLS
|
leo_sobral@2
|
92 |
|
leo_sobral@2
|
93 |
#endif /* __MYTH_FILE_TRANSFER_H__ */
|