gmyth/src/gmyth_livetv.h
author rosfran
Fri Apr 13 20:07:32 2007 +0100 (2007-04-13)
branchtrunk
changeset 545 7f0a3066f6ab
parent 438 2ca84b85d2dd
child 550 aaf53e3d0b26
permissions -rwxr-xr-x
[svn r550] A lot of GObject fixes (using the GType casting), added inheritance to the GMythFile* modules, locks all the the STOP_RECORDING messages.
     1 /**
     2  * GMyth Library
     3  *
     4  * @file gmyth/gmyth_livetv.h
     5  * 
     6  * @brief <p> GMythLiveTV starts a remote TV session with the MythTV backend.
     7  *
     8  * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
     9  * @author Rosfran Lins Borges <rosfran.borges@indt.org.br>
    10  *
    11  *//*
    12  * 
    13  * This program is free software; you can redistribute it and/or modify
    14  * it under the terms of the GNU Lesser General Public License as published by
    15  * the Free Software Foundation; either version 2 of the License, or
    16  * (at your option) any later version.
    17  *
    18  * This program is distributed in the hope that it will be useful,
    19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    21  * GNU General Public License for more details.
    22  *
    23  * You should have received a copy of the GNU Lesser General Public License
    24  * along with this program; if not, write to the Free Software
    25  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    26  */
    27 
    28 #ifndef GMYTH_LIVETV_H_
    29 #define GMYTH_LIVETV_H_
    30 
    31 #include <glib.h>
    32 #include <glib-object.h>
    33 
    34 #include "gmyth_recorder.h"
    35 #include "gmyth_tvchain.h"
    36 #include "gmyth_monitor_handler.h"
    37 #include "gmyth_file_transfer.h"
    38 #include "gmyth_programinfo.h"
    39 #include "gmyth_backendinfo.h"
    40 
    41 G_BEGIN_DECLS
    42 
    43 #define GMYTH_LIVETV_TYPE               (gmyth_livetv_get_type ())
    44 #define GMYTH_LIVETV(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_LIVETV_TYPE, GMythLiveTV))
    45 #define GMYTH_LIVETV_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_LIVETV_TYPE, GMythLiveTVClass))
    46 #define IS_GMYTH_LIVETV(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_LIVETV_TYPE))
    47 #define IS_GMYTH_LIVETV_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_LIVETV_TYPE))
    48 #define GMYTH_LIVETV_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_LIVETV_TYPE, GMythLiveTVClass))
    49 
    50 typedef struct _GMythLiveTV         GMythLiveTV;
    51 typedef struct _GMythLiveTVClass    GMythLiveTVClass;
    52 
    53 struct _GMythLiveTVClass
    54 {
    55     GObjectClass parent_class;
    56 
    57     /* callbacks */
    58 };
    59 
    60 struct _GMythLiveTV
    61 {
    62 	GObject					parent;
    63 	
    64 	GMythSocket				*socket;
    65 	
    66     GString				 	*local_hostname;
    67 	
    68 	GMythBackendInfo        *backend_info;
    69 
    70 	GMythRecorder 	 		*recorder;
    71 	GMythTVChain 			*tvchain;
    72 	GMythProgramInfo 		*proginfo;
    73 	
    74 	GMythFileTransfer 	    *file_transfer;
    75 	
    76 	GMythMonitorHandler     *monitor;
    77 	GMythURI				*uri;
    78 
    79 	gboolean 				is_livetv;
    80 	gboolean 				setup_done;
    81 	
    82 	GMutex 					*mutex;	
    83     gboolean                disposed;
    84 };
    85 
    86 GType           gmyth_livetv_get_type (void);
    87 
    88 GMythLiveTV*    gmyth_livetv_new (GMythBackendInfo *backend_info);
    89 
    90 void            gmyth_livetv_start_playing (GMythLiveTV *livetv);
    91 void            gmyth_livetv_stop_playing (GMythLiveTV *livetv);
    92 
    93 gboolean        gmyth_livetv_setup (GMythLiveTV *livetv);
    94 gboolean        gmyth_livetv_channel_setup ( GMythLiveTV *livetv, gint channel);
    95 gboolean        gmyth_livetv_channel_name_setup ( GMythLiveTV *livetv, gchar* channel);
    96 gboolean        gmyth_livetv_next_program_chain ( GMythLiveTV *livetv );
    97 
    98 GMythFileTransfer*  gmyth_livetv_create_file_transfer( GMythLiveTV *livetv );
    99 
   100 gboolean        gmyth_livetv_monitor_handler_start( GMythLiveTV *livetv );
   101 void            gmyth_livetv_monitor_handler_stop( GMythLiveTV *livetv );
   102 
   103 G_END_DECLS
   104 
   105 #endif /*GMYTH_LIVETV_H_*/