rosfran@512
|
1 |
/**
|
rosfran@512
|
2 |
* GMyth Library
|
rosfran@512
|
3 |
*
|
rosfran@512
|
4 |
* @file gmyth/gmyth_file.h
|
rosfran@512
|
5 |
*
|
rosfran@512
|
6 |
* @brief <p> GMythFile is the parent GMObject that deals with the file streaming
|
rosfran@512
|
7 |
* media remote/local transfering to the MythTV frontend.
|
rosfran@512
|
8 |
*
|
rosfran@512
|
9 |
* Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
|
rosfran@512
|
10 |
* @author Rosfran Lins Borges <rosfran.borges@indt.org.br>
|
rosfran@512
|
11 |
*
|
rosfran@701
|
12 |
*
|
rosfran@701
|
13 |
* This program is free software; you can redistribute it and/or modify
|
rosfran@701
|
14 |
* it under the terms of the GNU Lesser General Public License as published by
|
rosfran@701
|
15 |
* the Free Software Foundation; either version 2 of the License, or
|
rosfran@701
|
16 |
* (at your option) any later version.
|
rosfran@701
|
17 |
*
|
rosfran@701
|
18 |
* This program is distributed in the hope that it will be useful,
|
rosfran@701
|
19 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
rosfran@701
|
20 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
rosfran@701
|
21 |
* GNU General Public License for more details.
|
rosfran@701
|
22 |
*
|
rosfran@701
|
23 |
* You should have received a copy of the GNU Lesser General Public License
|
rosfran@701
|
24 |
* along with this program; if not, write to the Free Software
|
rosfran@701
|
25 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
rosfran@701
|
26 |
*/
|
rosfran@698
|
27 |
|
rosfran@512
|
28 |
#ifndef __GMYTH_FILE_H__
|
rosfran@512
|
29 |
#define __GMYTH_FILE_H__
|
rosfran@512
|
30 |
|
rosfran@512
|
31 |
#include <glib-object.h>
|
rosfran@512
|
32 |
#include <glib.h>
|
rosfran@512
|
33 |
|
rosfran@512
|
34 |
#include "gmyth_uri.h"
|
rosfran@512
|
35 |
#include "gmyth_backendinfo.h"
|
rosfran@512
|
36 |
|
rosfran@512
|
37 |
#include <stdio.h>
|
rosfran@512
|
38 |
#include <stdlib.h>
|
rosfran@512
|
39 |
#include <string.h>
|
rosfran@512
|
40 |
#include <netdb.h>
|
rosfran@512
|
41 |
#include <sys/socket.h>
|
rosfran@512
|
42 |
#include <unistd.h>
|
rosfran@512
|
43 |
|
rosfran@512
|
44 |
G_BEGIN_DECLS
|
rosfran@512
|
45 |
#define GMYTH_FILE_TYPE (gmyth_file_get_type ())
|
rosfran@512
|
46 |
#define GMYTH_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_FILE_TYPE, GMythFile))
|
rosfran@512
|
47 |
#define GMYTH_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_FILE_TYPE, GMythFileClass))
|
rosfran@545
|
48 |
#define IS_GMYTH_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_FILE_TYPE))
|
rosfran@512
|
49 |
#define IS_GMYTH_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_FILE_TYPE))
|
rosfran@512
|
50 |
#define GMYTH_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_FILE_TYPE, GMythFileClass))
|
renatofilho@755
|
51 |
|
renatofilho@755
|
52 |
typedef enum {
|
renatofilho@754
|
53 |
GMYTH_FILE_READ_OK = 0,
|
renatofilho@754
|
54 |
GMYTH_FILE_READ_NEXT_PROG_CHAIN = 1,
|
renatofilho@754
|
55 |
GMYTH_FILE_READ_ERROR = 2,
|
renatofilho@754
|
56 |
GMYTH_FILE_READ_EOF = 3
|
renatofilho@750
|
57 |
} GMythFileReadResult;
|
rosfran@512
|
58 |
|
rosfran@698
|
59 |
typedef struct _GMythFile GMythFile;
|
rosfran@698
|
60 |
typedef struct _GMythFileClass GMythFileClass;
|
rosfran@698
|
61 |
typedef struct _GMythFilePrivate GMythFilePrivate;
|
rosfran@512
|
62 |
|
renatofilho@754
|
63 |
struct _GMythFile {
|
renatofilho@754
|
64 |
GObject parent;
|
renatofilho@754
|
65 |
GMythFilePrivate *priv;
|
renatofilho@750
|
66 |
};
|
rosfran@512
|
67 |
|
renatofilho@754
|
68 |
struct _GMythFileClass {
|
renatofilho@754
|
69 |
GObjectClass parent_class;
|
renatofilho@750
|
70 |
};
|
rosfran@512
|
71 |
|
renatofilho@755
|
72 |
GType gmyth_file_get_type (void);
|
renatofilho@755
|
73 |
GMythFile *gmyth_file_new (GMythBackendInfo *backend_info);
|
renatofilho@755
|
74 |
gchar *gmyth_file_get_file_name (GMythFile *file);
|
renatofilho@755
|
75 |
void gmyth_file_set_file_name (GMythFile *file,
|
renatofilho@755
|
76 |
const gchar *filename);
|
renatofilho@755
|
77 |
gboolean gmyth_file_setup (GMythFile *file,
|
renatofilho@755
|
78 |
const gchar *filename);
|
renatofilho@755
|
79 |
void gmyth_file_close (GMythFile *file);
|
renatofilho@755
|
80 |
gboolean gmyth_file_is_open (GMythFile *file);
|
renatofilho@755
|
81 |
guint64 gmyth_file_get_filesize (GMythFile *file);
|
renatofilho@755
|
82 |
void gmyth_file_set_filesize (GMythFile *file,
|
renatofilho@755
|
83 |
guint64 filesize);
|
renatofilho@755
|
84 |
gint64 gmyth_file_get_offset (GMythFile *file);
|
renatofilho@755
|
85 |
void gmyth_file_set_offset (GMythFile *file,
|
renatofilho@755
|
86 |
gint64 offset);
|
renatofilho@755
|
87 |
gchar *gmyth_file_get_uri (GMythFile *file);
|
rosfran@552
|
88 |
|
rosfran@512
|
89 |
G_END_DECLS
|
renatofilho@754
|
90 |
#endif /* __GMYTH_FILE_H__ */
|