branches/gmyth-0.1b/src/gmyth_recorder.h
author rosfran
Wed Feb 14 22:26:33 2007 +0000 (2007-02-14)
branchtrunk
changeset 364 9b20a9775516
permissions -rw-r--r--
[svn r366] Changes on GMyth API.
     1 /**
     2  * GMyth Library
     3  *
     4  * @file gmyth/gmyth_recorder.h
     5  * 
     6  * @brief <p> GMythRecorder class defines functions for playing live tv.
     7  *
     8  * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
     9  * @author Hallyson Luiz de Morais Melo <hallyson.melo@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_RECORDER_H__
    29 #define __GMYTH_RECORDER_H__
    30 
    31 #include <glib-object.h>
    32 
    33 #include "gmyth_socket.h"
    34 #include "gmyth_programinfo.h"
    35 
    36 #include <stdio.h>
    37 #include <stdlib.h>
    38 #include <string.h>
    39 #include <netdb.h>
    40 #include <sys/socket.h>
    41 #include <unistd.h>
    42 
    43 G_BEGIN_DECLS
    44 
    45 #define GMYTH_RECORDER_TYPE               (gmyth_recorder_get_type ())
    46 #define GMYTH_RECORDER(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_RECORDER_TYPE, GMythRecorder))
    47 #define GMYTH_RECORDER_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_RECORDER_TYPE, GMythRecorderClass))
    48 #define IS_GMYTH_RECORDER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_RECORDER_TYPE))
    49 #define IS_GMYTH_RECORDER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_RECORDER_TYPE))
    50 #define GMYTH_RECORDER_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_RECORDER_TYPE, GMythRecorderClass))
    51 
    52 
    53 typedef struct _GMythRecorder         GMythRecorder;
    54 typedef struct _GMythRecorderClass    GMythRecorderClass;
    55 
    56 struct _GMythRecorderClass
    57 {
    58   GObjectClass parent_class;
    59 
    60   /* callbacks */
    61   /* no one for now */
    62 };
    63 
    64 struct _GMythRecorder
    65 {
    66     GObject parent;
    67 
    68     /* socket descriptor */
    69     GMythSocket *myth_socket;
    70     
    71     gint recorder_num;
    72     GString *hostname;
    73     gint port;
    74 };
    75 
    76 typedef enum _GMythRecorderChannelChangeDirection {
    77 	CHANNEL_DIRECTION_UP = 0,
    78 	CHANNEL_DIRECTION_DOWN,
    79 	CHANNEL_DIRECTION_FAVORITE,
    80 	CHANNEL_DIRECTION_SAME
    81 } GMythRecorderChannelChangeDirection;
    82 
    83 GType   gmyth_recorder_get_type   (void);
    84 
    85 GMythRecorder* gmyth_recorder_new    (int num,
    86 	                                     GString *hostname,
    87 	                                     gshort port);
    88 
    89 gboolean gmyth_recorder_setup     (GMythRecorder *recorder);
    90 gboolean gmyth_recorder_spawntv   (GMythRecorder *recorder,
    91                                          GString *tvchain_id);
    92                                          
    93 gboolean gmyth_recorder_spawntv_no_tvchain (GMythRecorder *recorder);
    94 
    95 gboolean gmyth_recorder_stop_livetv (GMythRecorder *recorder);
    96 
    97 gboolean gmyth_recorder_send_frontend_ready_command (GMythRecorder *recorder);
    98 
    99 gboolean gmyth_recorder_check_channel (GMythRecorder *recorder, gint channel);
   100 
   101 gboolean gmyth_recorder_check_channel_name (GMythRecorder *recorder, gchar* channel);
   102 
   103 gboolean gmyth_recorder_set_channel   (GMythRecorder *recorder,
   104                                        gint channel);
   105                                          
   106 gboolean gmyth_recorder_set_channel_name (GMythRecorder *recorder, 
   107 																					const gchar* channel);
   108 																					
   109 gboolean gmyth_recorder_change_channel (GMythRecorder *recorder, 
   110 												const GMythRecorderChannelChangeDirection direction);
   111 																					
   112 gboolean gmyth_recorder_pause_recording ( GMythRecorder *recorder );
   113 
   114 GMythProgramInfo *gmyth_recorder_get_current_program_info ( GMythRecorder *recorder );
   115                                          
   116 gint64 	 gmyth_recorder_get_file_position ( GMythRecorder *recorder );
   117 
   118 gboolean gmyth_recorder_is_recording ( GMythRecorder *recorder );
   119 
   120 G_END_DECLS
   121 
   122 #endif /* __GMYTH_REMOTE_ENCODER_H__ */