- -( dyne // software :: culture :: events :: planet :: discussion :: museum \\ freaknet )- -
 
Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | File Members

shouter.h

Go to the documentation of this file.
00001 /* MuSE - Multiple Streaming Engine
00002  * Copyright (C) 2000-2002 Denis Rojo aka jaromil <jaromil@dyne.org>
00003  *
00004  * This source code is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Public License as published 
00006  * by the Free Software Foundation; either version 2 of the License,
00007  * or (at your option) any later version.
00008  *
00009  * This source code is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00012  * Please refer to the GNU Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Public License along with
00015  * this source code; if not, write to:
00016  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017  *
00018  * "$Id: shouter.h,v 1.8 2005/03/28 13:59:06 jaromil Exp $"
00019  *
00020  */
00021 
00022 #ifndef __SHOUTER_H__
00023 #define __SHOUTER_H__
00024 
00025 extern "C" {
00026 #include "shout/shout.h"
00027 }
00028 
00029 #include <linklist.h>
00030 #include <jutils.h>
00031 
00032 #define ERRORMSG 128
00033 #define RETRY_DELAY 60 /* time to retry connect on broken icecasts, in seconds */
00034 #define MAX_VALUE_SIZE 512
00035 
00036 class Shouter : public Entry {
00037  private:
00038   shout_t *ice;
00039 
00040   int errors;
00041   
00042  public:
00043   Shouter();
00044   ~Shouter();
00045 
00046   /* ======= GUI SETTINGS HERE
00047      the following macros declare two functions for each variable:
00048      set_variable(value); assign value to variable
00049      get_variable(); returns value of variable */
00050   CHAR_SET(ip,_ip);
00051   CHAR_SET(host,_host);
00052   char streamurl[MAX_VALUE_SIZE];
00053   INT_SET(port,_port);
00054   CHAR_SET(user,_user);
00055   CHAR_SET(pass,_pass);
00056   CHAR_SET(mount,_mount);
00057   
00058   /* setted by the encoder */
00059   CHAR_SET(bps,_bps);
00060   CHAR_SET(freq,_freq);
00061   CHAR_SET(channels,_channels);
00062 
00063   INT_SET(login,_login);
00064   CHAR_SET(name,_name);
00065   CHAR_SET(url,_url);
00066   CHAR_SET(desc,_desc);
00067   int format;
00068   
00069   bool start();
00070   bool stop();
00071   int send(short int *buf, unsigned int enc);
00072   
00073   bool running;
00074   time_t retry;
00075 
00076   bool apply_profile();
00077   bool profile_changed;
00078 
00079 };
00080 
00081 
00082 #endif