[svn r468] Function to free the remotely allocated TV tuner.
4 * @file gmyth/gmyth_recorder.h
6 * @brief <p> GMythRecorder defines functions for playing live tv.
8 * The remote encoder is used by gmyth_tvplayer to setup livetv.
10 * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
11 * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
12 * @author Rosfran Borges <rosfran.borges@indt.org.br>
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU Lesser General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU Lesser General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 #ifndef __GMYTH_RECORDER_H__
32 #define __GMYTH_RECORDER_H__
34 #include <glib-object.h>
36 #include "gmyth_socket.h"
37 #include "gmyth_programinfo.h"
43 #include <sys/socket.h>
48 #define GMYTH_RECORDER_TYPE (gmyth_recorder_get_type ())
49 #define GMYTH_RECORDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_RECORDER_TYPE, GMythRecorder))
50 #define GMYTH_RECORDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_RECORDER_TYPE, GMythRecorderClass))
51 #define IS_GMYTH_RECORDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_RECORDER_TYPE))
52 #define IS_GMYTH_RECORDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_RECORDER_TYPE))
53 #define GMYTH_RECORDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_RECORDER_TYPE, GMythRecorderClass))
56 typedef struct _GMythRecorder GMythRecorder;
57 typedef struct _GMythRecorderClass GMythRecorderClass;
59 struct _GMythRecorderClass
61 GObjectClass parent_class;
71 /* socket descriptor */
72 GMythSocket *myth_socket;
78 GList* progs_info_list;
83 typedef enum _GMythRecorderChannelChangeDirection {
84 CHANNEL_DIRECTION_UP = 0,
85 CHANNEL_DIRECTION_DOWN,
86 CHANNEL_DIRECTION_FAVORITE,
87 CHANNEL_DIRECTION_SAME
88 } GMythRecorderChannelChangeDirection;
90 typedef enum _GMythRecorderBrowseDirection {
91 BROWSE_DIRECTION_SAME = 0, /* Stay in the same place */
92 BROWSE_DIRECTION_UP, /* Move up one slot (down one channel) */
93 BROWSE_DIRECTION_DOWN, /* Move down one slot (up one channel) */
94 BROWSE_DIRECTION_LEFT, /* Move left one slot (down one time slot) */
95 BROWSE_DIRECTION_RIGHT, /* Move right one slot (up one time slot) */
96 BROWSE_DIRECTION_FAVORITE /* Move to the next favorite slot */
97 } GMythRecorderBrowseDirection;
99 GType gmyth_recorder_get_type (void);
101 GMythRecorder* gmyth_recorder_new (int num,
105 void gmyth_recorder_close (GMythRecorder *recorder);
107 gboolean gmyth_recorder_setup (GMythRecorder *recorder);
108 gboolean gmyth_recorder_spawntv (GMythRecorder *recorder,
109 GString *tvchain_id);
111 gboolean gmyth_recorder_spawntv_no_tvchain (GMythRecorder *recorder);
113 gboolean gmyth_recorder_stop_livetv (GMythRecorder *recorder);
115 gboolean gmyth_recorder_send_frontend_ready_command (GMythRecorder *recorder);
117 gboolean gmyth_recorder_check_channel (GMythRecorder *recorder, gint channel);
119 gboolean gmyth_recorder_check_channel_name (GMythRecorder *recorder, gchar* channel);
121 gboolean gmyth_recorder_set_channel (GMythRecorder *recorder,
124 gboolean gmyth_recorder_set_channel_name (GMythRecorder *recorder,
125 const gchar* channel);
127 gboolean gmyth_recorder_change_channel (GMythRecorder *recorder,
128 const GMythRecorderChannelChangeDirection direction);
130 gboolean gmyth_recorder_pause_recording ( GMythRecorder *recorder );
132 GMythProgramInfo *gmyth_recorder_get_current_program_info ( GMythRecorder *recorder );
134 GMythProgramInfo *gmyth_recorder_get_next_program_info ( GMythRecorder *recorder,
135 const GMythRecorderBrowseDirection direction);
137 GMythRecorder *gmyth_recorder_get_recorder_from_num ( gint rec_id );
139 gint64 gmyth_recorder_get_file_position ( GMythRecorder *recorder );
141 gboolean gmyth_recorder_is_recording ( GMythRecorder *recorder );
143 gboolean gmyth_recorder_finish_recording ( GMythRecorder *recorder );
145 gboolean gmyth_recorder_stop_playing( GMythRecorder *recorder);
147 gboolean gmyth_recorder_free_tuner( GMythRecorder *recorder);
151 #endif /* __GMYTH_REMOTE_ENCODER_H__ */