gmyth/src/gmyth_recorder.h
author rosfran
Mon Mar 19 22:00:25 2007 +0000 (2007-03-19)
branchtrunk
changeset 416 f176c8207077
parent 336 3e34d1a2e403
child 420 c1601c03cc78
permissions -rw-r--r--
[svn r421] Added libosso library dependencies.
rosfran@65
     1
/**
rosfran@65
     2
 * GMyth Library
rosfran@65
     3
 *
rosfran@65
     4
 * @file gmyth/gmyth_recorder.h
rosfran@65
     5
 * 
rosfran@65
     6
 * @brief <p> GMythRecorder class defines functions for playing live tv.
rosfran@65
     7
 *
rosfran@65
     8
 * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
rosfran@65
     9
 * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
rosfran@65
    10
 *
rosfran@65
    11
 *//*
rosfran@65
    12
 * 
rosfran@65
    13
 * This program is free software; you can redistribute it and/or modify
rosfran@65
    14
 * it under the terms of the GNU Lesser General Public License as published by
rosfran@65
    15
 * the Free Software Foundation; either version 2 of the License, or
rosfran@65
    16
 * (at your option) any later version.
rosfran@65
    17
 *
rosfran@65
    18
 * This program is distributed in the hope that it will be useful,
rosfran@65
    19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
rosfran@65
    20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
rosfran@65
    21
 * GNU General Public License for more details.
rosfran@65
    22
 *
rosfran@65
    23
 * You should have received a copy of the GNU Lesser General Public License
rosfran@65
    24
 * along with this program; if not, write to the Free Software
rosfran@65
    25
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
rosfran@65
    26
 */
rosfran@65
    27
rosfran@65
    28
#ifndef __GMYTH_RECORDER_H__
rosfran@65
    29
#define __GMYTH_RECORDER_H__
rosfran@65
    30
rosfran@65
    31
#include <glib-object.h>
rosfran@65
    32
rosfran@65
    33
#include "gmyth_socket.h"
rosfran@291
    34
#include "gmyth_programinfo.h"
rosfran@65
    35
rosfran@65
    36
#include <stdio.h>
rosfran@65
    37
#include <stdlib.h>
rosfran@65
    38
#include <string.h>
rosfran@65
    39
#include <netdb.h>
rosfran@65
    40
#include <sys/socket.h>
rosfran@65
    41
#include <unistd.h>
rosfran@65
    42
rosfran@65
    43
G_BEGIN_DECLS
rosfran@65
    44
rosfran@65
    45
#define GMYTH_RECORDER_TYPE               (gmyth_recorder_get_type ())
rosfran@65
    46
#define GMYTH_RECORDER(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_RECORDER_TYPE, GMythRecorder))
rosfran@65
    47
#define GMYTH_RECORDER_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_RECORDER_TYPE, GMythRecorderClass))
rosfran@65
    48
#define IS_GMYTH_RECORDER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_RECORDER_TYPE))
rosfran@65
    49
#define IS_GMYTH_RECORDER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_RECORDER_TYPE))
rosfran@65
    50
#define GMYTH_RECORDER_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_RECORDER_TYPE, GMythRecorderClass))
rosfran@65
    51
rosfran@65
    52
rosfran@65
    53
typedef struct _GMythRecorder         GMythRecorder;
rosfran@65
    54
typedef struct _GMythRecorderClass    GMythRecorderClass;
rosfran@65
    55
rosfran@65
    56
struct _GMythRecorderClass
rosfran@65
    57
{
rosfran@65
    58
  GObjectClass parent_class;
rosfran@65
    59
rosfran@65
    60
  /* callbacks */
rosfran@65
    61
  /* no one for now */
rosfran@65
    62
};
rosfran@65
    63
rosfran@65
    64
struct _GMythRecorder
rosfran@65
    65
{
rosfran@65
    66
    GObject parent;
rosfran@65
    67
rosfran@65
    68
    /* socket descriptor */
rosfran@65
    69
    GMythSocket *myth_socket;
rosfran@65
    70
    
rosfran@291
    71
    gint recorder_num;
rosfran@65
    72
    GString *hostname;
rosfran@291
    73
    gint port;
rosfran@65
    74
};
rosfran@65
    75
rosfran@309
    76
typedef enum _GMythRecorderChannelChangeDirection {
rosfran@309
    77
	CHANNEL_DIRECTION_UP = 0,
rosfran@309
    78
	CHANNEL_DIRECTION_DOWN,
rosfran@309
    79
	CHANNEL_DIRECTION_FAVORITE,
rosfran@309
    80
	CHANNEL_DIRECTION_SAME
rosfran@309
    81
} GMythRecorderChannelChangeDirection;
rosfran@65
    82
rosfran@321
    83
typedef enum _GMythRecorderBrowseDirection {
rosfran@321
    84
	BROWSE_DIRECTION_SAME = 0,     	  /* Stay in the same place */
rosfran@321
    85
 	BROWSE_DIRECTION_UP,          		/* Move up one slot (down one channel) */
rosfran@321
    86
	BROWSE_DIRECTION_DOWN,        		/* Move down one slot (up one channel) */
rosfran@321
    87
	BROWSE_DIRECTION_LEFT,        		/* Move left one slot (down one time slot) */
rosfran@321
    88
	BROWSE_DIRECTION_RIGHT,       		/* Move right one slot (up one time slot) */
rosfran@321
    89
	BROWSE_DIRECTION_FAVORITE    			/* Move to the next favorite slot */
rosfran@321
    90
} GMythRecorderBrowseDirection;
rosfran@321
    91
rosfran@321
    92
GType   gmyth_recorder_get_type   	(void);
rosfran@65
    93
rosfran@65
    94
GMythRecorder* gmyth_recorder_new    (int num,
rosfran@65
    95
	                                     GString *hostname,
rosfran@65
    96
	                                     gshort port);
rosfran@336
    97
	                                     
rosfran@336
    98
void		 gmyth_recorder_close  (GMythRecorder *recorder);
rosfran@65
    99
rosfran@65
   100
gboolean gmyth_recorder_setup     (GMythRecorder *recorder);
rosfran@65
   101
gboolean gmyth_recorder_spawntv   (GMythRecorder *recorder,
rosfran@65
   102
                                         GString *tvchain_id);
rosfran@310
   103
                                         
rosfran@310
   104
gboolean gmyth_recorder_spawntv_no_tvchain (GMythRecorder *recorder);
rosfran@310
   105
rosfran@65
   106
gboolean gmyth_recorder_stop_livetv (GMythRecorder *recorder);
rosfran@65
   107
rosfran@104
   108
gboolean gmyth_recorder_send_frontend_ready_command (GMythRecorder *recorder);
rosfran@104
   109
rosfran@65
   110
gboolean gmyth_recorder_check_channel (GMythRecorder *recorder, gint channel);
rosfran@65
   111
rosfran@307
   112
gboolean gmyth_recorder_check_channel_name (GMythRecorder *recorder, gchar* channel);
rosfran@307
   113
rosfran@65
   114
gboolean gmyth_recorder_set_channel   (GMythRecorder *recorder,
rosfran@287
   115
                                       gint channel);
rosfran@287
   116
                                         
rosfran@287
   117
gboolean gmyth_recorder_set_channel_name (GMythRecorder *recorder, 
rosfran@287
   118
																					const gchar* channel);
rosfran@287
   119
																					
rosfran@309
   120
gboolean gmyth_recorder_change_channel (GMythRecorder *recorder, 
rosfran@309
   121
												const GMythRecorderChannelChangeDirection direction);
rosfran@309
   122
																					
rosfran@287
   123
gboolean gmyth_recorder_pause_recording ( GMythRecorder *recorder );
rosfran@291
   124
rosfran@291
   125
GMythProgramInfo *gmyth_recorder_get_current_program_info ( GMythRecorder *recorder );
rosfran@321
   126
rosfran@321
   127
GMythProgramInfo *gmyth_recorder_get_next_program_info ( GMythRecorder *recorder,
rosfran@321
   128
												const GMythRecorderBrowseDirection direction);
rosfran@321
   129
												
rosfran@321
   130
GMythRecorder *gmyth_recorder_get_recorder_from_num ( gint rec_id );
rosfran@321
   131
rosfran@115
   132
gint64 	 gmyth_recorder_get_file_position ( GMythRecorder *recorder );
rosfran@65
   133
rosfran@292
   134
gboolean gmyth_recorder_is_recording ( GMythRecorder *recorder );
rosfran@292
   135
rosfran@356
   136
gboolean 	gmyth_recorder_finish_recording ( GMythRecorder *recorder );
rosfran@356
   137
rosfran@65
   138
G_END_DECLS
rosfran@65
   139
rosfran@65
   140
#endif /* __GMYTH_REMOTE_ENCODER_H__ */