1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/branches/gmyth-0.1b/src/gmyth_recorder.h Tue Feb 06 00:33:35 2007 +0000
1.3 @@ -0,0 +1,122 @@
1.4 +/**
1.5 + * GMyth Library
1.6 + *
1.7 + * @file gmyth/gmyth_recorder.h
1.8 + *
1.9 + * @brief <p> GMythRecorder class defines functions for playing live tv.
1.10 + *
1.11 + * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
1.12 + * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
1.13 + *
1.14 + *//*
1.15 + *
1.16 + * This program is free software; you can redistribute it and/or modify
1.17 + * it under the terms of the GNU Lesser General Public License as published by
1.18 + * the Free Software Foundation; either version 2 of the License, or
1.19 + * (at your option) any later version.
1.20 + *
1.21 + * This program is distributed in the hope that it will be useful,
1.22 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.23 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.24 + * GNU General Public License for more details.
1.25 + *
1.26 + * You should have received a copy of the GNU Lesser General Public License
1.27 + * along with this program; if not, write to the Free Software
1.28 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1.29 + */
1.30 +
1.31 +#ifndef __GMYTH_RECORDER_H__
1.32 +#define __GMYTH_RECORDER_H__
1.33 +
1.34 +#include <glib-object.h>
1.35 +
1.36 +#include "gmyth_socket.h"
1.37 +#include "gmyth_programinfo.h"
1.38 +
1.39 +#include <stdio.h>
1.40 +#include <stdlib.h>
1.41 +#include <string.h>
1.42 +#include <netdb.h>
1.43 +#include <sys/socket.h>
1.44 +#include <unistd.h>
1.45 +
1.46 +G_BEGIN_DECLS
1.47 +
1.48 +#define GMYTH_RECORDER_TYPE (gmyth_recorder_get_type ())
1.49 +#define GMYTH_RECORDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_RECORDER_TYPE, GMythRecorder))
1.50 +#define GMYTH_RECORDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_RECORDER_TYPE, GMythRecorderClass))
1.51 +#define IS_GMYTH_RECORDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_RECORDER_TYPE))
1.52 +#define IS_GMYTH_RECORDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_RECORDER_TYPE))
1.53 +#define GMYTH_RECORDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_RECORDER_TYPE, GMythRecorderClass))
1.54 +
1.55 +
1.56 +typedef struct _GMythRecorder GMythRecorder;
1.57 +typedef struct _GMythRecorderClass GMythRecorderClass;
1.58 +
1.59 +struct _GMythRecorderClass
1.60 +{
1.61 + GObjectClass parent_class;
1.62 +
1.63 + /* callbacks */
1.64 + /* no one for now */
1.65 +};
1.66 +
1.67 +struct _GMythRecorder
1.68 +{
1.69 + GObject parent;
1.70 +
1.71 + /* socket descriptor */
1.72 + GMythSocket *myth_socket;
1.73 +
1.74 + gint recorder_num;
1.75 + GString *hostname;
1.76 + gint port;
1.77 +};
1.78 +
1.79 +typedef enum _GMythRecorderChannelChangeDirection {
1.80 + CHANNEL_DIRECTION_UP = 0,
1.81 + CHANNEL_DIRECTION_DOWN,
1.82 + CHANNEL_DIRECTION_FAVORITE,
1.83 + CHANNEL_DIRECTION_SAME
1.84 +} GMythRecorderChannelChangeDirection;
1.85 +
1.86 +GType gmyth_recorder_get_type (void);
1.87 +
1.88 +GMythRecorder* gmyth_recorder_new (int num,
1.89 + GString *hostname,
1.90 + gshort port);
1.91 +
1.92 +gboolean gmyth_recorder_setup (GMythRecorder *recorder);
1.93 +gboolean gmyth_recorder_spawntv (GMythRecorder *recorder,
1.94 + GString *tvchain_id);
1.95 +
1.96 +gboolean gmyth_recorder_spawntv_no_tvchain (GMythRecorder *recorder);
1.97 +
1.98 +gboolean gmyth_recorder_stop_livetv (GMythRecorder *recorder);
1.99 +
1.100 +gboolean gmyth_recorder_send_frontend_ready_command (GMythRecorder *recorder);
1.101 +
1.102 +gboolean gmyth_recorder_check_channel (GMythRecorder *recorder, gint channel);
1.103 +
1.104 +gboolean gmyth_recorder_check_channel_name (GMythRecorder *recorder, gchar* channel);
1.105 +
1.106 +gboolean gmyth_recorder_set_channel (GMythRecorder *recorder,
1.107 + gint channel);
1.108 +
1.109 +gboolean gmyth_recorder_set_channel_name (GMythRecorder *recorder,
1.110 + const gchar* channel);
1.111 +
1.112 +gboolean gmyth_recorder_change_channel (GMythRecorder *recorder,
1.113 + const GMythRecorderChannelChangeDirection direction);
1.114 +
1.115 +gboolean gmyth_recorder_pause_recording ( GMythRecorder *recorder );
1.116 +
1.117 +GMythProgramInfo *gmyth_recorder_get_current_program_info ( GMythRecorder *recorder );
1.118 +
1.119 +gint64 gmyth_recorder_get_file_position ( GMythRecorder *recorder );
1.120 +
1.121 +gboolean gmyth_recorder_is_recording ( GMythRecorder *recorder );
1.122 +
1.123 +G_END_DECLS
1.124 +
1.125 +#endif /* __GMYTH_REMOTE_ENCODER_H__ */