gmyth/src/gmyth_file_local.h
author rosfran
Tue May 15 21:39:04 2007 +0100 (2007-05-15)
branchtrunk
changeset 655 ad1457d65f74
parent 529 dfa28b22a36c
child 698 9019388af980
permissions -rwxr-xr-x
[svn r661] Fixed starvation loop when reading an unlimited-size buffer (LiveTV) from the FileTransfer; MonitorHandler is a GThread now.
rosfran@513
     1
/**
rosfran@513
     2
 * GMyth Library
rosfran@513
     3
 *
rosfran@513
     4
 * @file gmyth/gmyth_file_local_local.h
rosfran@513
     5
 * 
rosfran@513
     6
 * @brief <p> GMythFileLocal is the parent GMythFile that deals with the file streaming 
rosfran@513
     7
 * media local transfering from the MythTV backend.
rosfran@513
     8
 *
rosfran@513
     9
 * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
rosfran@513
    10
 * @author Rosfran Lins Borges <rosfran.borges@indt.org.br>
rosfran@513
    11
 *
rosfran@513
    12
 *//*
rosfran@513
    13
 * 
rosfran@513
    14
 * This program is free software; you can redistribute it and/or modify
rosfran@513
    15
 * it under the terms of the GNU Lesser General Public License as published by
rosfran@513
    16
 * the Free Software Foundation; either version 2 of the License, or
rosfran@513
    17
 * (at your option) any later version.
rosfran@513
    18
 *
rosfran@513
    19
 * This program is distributed in the hope that it will be useful,
rosfran@513
    20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
rosfran@513
    21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
rosfran@513
    22
 * GNU General Public License for more details.
rosfran@513
    23
 *
rosfran@513
    24
 * You should have received a copy of the GNU Lesser General Public License
rosfran@513
    25
 * along with this program; if not, write to the Free Software
rosfran@513
    26
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
rosfran@513
    27
 */
rosfran@513
    28
 
rosfran@513
    29
#ifndef __GMYTH_FILE_LOCAL_H__
rosfran@513
    30
#define __GMYTH_FILE_LOCAL_H__
rosfran@513
    31
rosfran@513
    32
#include <glib-object.h>
rosfran@513
    33
#include <glib.h>
rosfran@513
    34
rosfran@513
    35
#include "gmyth_file.h"
rosfran@513
    36
#include "gmyth_uri.h"
rosfran@513
    37
#include "gmyth_backendinfo.h"
rosfran@513
    38
rosfran@513
    39
#include <stdio.h>
rosfran@513
    40
#include <stdlib.h>
rosfran@513
    41
#include <string.h>
rosfran@513
    42
#include <netdb.h>
rosfran@513
    43
#include <sys/socket.h>
rosfran@513
    44
#include <unistd.h>
rosfran@513
    45
rosfran@513
    46
G_BEGIN_DECLS
rosfran@513
    47
rosfran@513
    48
#define GMYTH_FILE_LOCAL_TYPE               (gmyth_file_local_get_type ())
rosfran@518
    49
#define GMYTH_FILE_LOCAL(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_FILE_LOCAL_TYPE, GMythFileLocal))
rosfran@513
    50
#define GMYTH_FILE_LOCAL_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_FILE_LOCAL_TYPE, GMythFileLocalClass))
rosfran@545
    51
#define IS_GMYTH_FILE_LOCAL(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_FILE_LOCAL_TYPE))
rosfran@513
    52
#define IS_GMYTH_FILE_LOCAL_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_FILE_LOCAL_TYPE))
rosfran@513
    53
#define GMYTH_FILE_LOCAL_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_FILE_LOCAL_TYPE, GMythFileLocalClass))
rosfran@513
    54
rosfran@513
    55
typedef struct _GMythFileLocal         GMythFileLocal;
rosfran@513
    56
typedef struct _GMythFileLocalClass    GMythFileLocalClass;
rosfran@513
    57
typedef struct _GMythFileLocalPrivate  GMythFileLocalPrivate;
rosfran@513
    58
rosfran@513
    59
struct _GMythFileLocal
rosfran@513
    60
{
rosfran@513
    61
	GMythFile          parent;
rosfran@513
    62
};
rosfran@513
    63
rosfran@513
    64
struct _GMythFileLocalClass
rosfran@513
    65
{
rosfran@513
    66
	GMythFileClass     parent_class;
rosfran@513
    67
};
rosfran@513
    68
rosfran@513
    69
rosfran@513
    70
GType               gmyth_file_local_get_type        (void);
rosfran@513
    71
GMythFileLocal*     gmyth_file_local_new             (GMythBackendInfo *backend_info);
rosfran@529
    72
GMythFileLocal*     gmyth_file_local_new_with_uri    (const gchar* uri);
rosfran@513
    73
gchar*              gmyth_file_local_get_file_name   (GMythFileLocal *file_local);
rosfran@518
    74
void                gmyth_file_local_set_file_name   (GMythFileLocal *file_local, const gchar* filename);
rosfran@518
    75
gboolean            gmyth_file_local_open            (GMythFileLocal *file_local);
rosfran@513
    76
void                gmyth_file_local_close           (GMythFileLocal *file_local);
rosfran@513
    77
gboolean            gmyth_file_local_is_open         (GMythFileLocal *file_local);
rosfran@518
    78
GMythFileReadResult
rosfran@513
    79
                    gmyth_file_local_read            (GMythFileLocal *file_local, 
rosfran@513
    80
                                                         GByteArray *data, 
rosfran@513
    81
                                                         gint size, 
rosfran@513
    82
                                                         gboolean read_unlimited);
rosfran@529
    83
rosfran@529
    84
gint64              gmyth_file_local_seek           (GMythFileLocal *file_local, 
rosfran@529
    85
                                                         gint64 pos, GSeekType whence);
rosfran@529
    86
rosfran@513
    87
guint64             gmyth_file_local_get_filesize   (GMythFileLocal *file_local);
rosfran@513
    88
void                gmyth_file_local_set_filesize   (GMythFileLocal *file, guint64 filesize);
rosfran@513
    89
rosfran@518
    90
gint64              gmyth_file_local_get_offset     (GMythFileLocal *file_local);
rosfran@518
    91
void                gmyth_file_local_set_offset     (GMythFileLocal *file_local, gint64 offset);
rosfran@513
    92
rosfran@513
    93
G_END_DECLS
rosfran@513
    94
rosfran@513
    95
#endif /* __GMYTH_FILE_LOCAL_H__ */