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