00001 #ifndef _CONFIG_H_ 00002 #define _CONFIG_H_ 00003 00004 /* 00005 * Copyright (C) 2003 by egnite Software GmbH 00006 * 00007 * All rights reserved. 00008 * 00009 * Redistribution and use in source and binary forms, with or without 00010 * modification, are permitted provided that the following conditions 00011 * are met: 00012 * 00013 * 1. Redistributions of source code must retain the above copyright 00014 * notice, this list of conditions and the following disclaimer. 00015 * 2. Redistributions in binary form must reproduce the above copyright 00016 * notice, this list of conditions and the following disclaimer in the 00017 * documentation and/or other materials provided with the distribution. 00018 * 3. Neither the name of the copyright holders nor the names of 00019 * contributors may be used to endorse or promote products derived 00020 * from this software without specific prior written permission. 00021 * 00022 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00023 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00024 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00025 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00026 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00027 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00028 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 00029 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 00030 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00031 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 00032 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00033 * SUCH DAMAGE. 00034 * 00035 * For additional information see http://www.ethernut.de/ 00036 */ 00037 00042 #define CONFAPP_EE_OFFSET 512 00043 #define CONFAPP_EE_NAME "NUTPIPER" 00044 00045 #define MAXLEN_URL 32 00046 #define MAXNUM_STATIONS 128 00047 00048 #define NEXT_STATION 255 00049 #define PREV_STATION 254 00050 00051 typedef struct { 00052 uint16_t rs_port; 00053 uint32_t rs_ip; 00054 char *rs_url; 00055 char *rs_name; 00056 char *rs_genre; 00057 uint32_t rs_metaint; 00058 uint16_t rs_bitrate; 00059 uint8_t rs_scandead; 00060 char *rs_scantitle; 00061 } RADIOSTATION; 00062 00063 extern RADIOSTATION *station; 00064 00065 #define DIST_NONE 0 00066 #define DIST_WAIT 1 00067 #define DIST_CONNECTING 2 00068 #define DIST_CONNECTED 3 00069 #define DIST_BUFFER 4 00070 #define DIST_TITLE 5 00071 #define DIST_STATION 6 00072 #define DIST_VOLUME 7 00073 #define DIST_DEAD 8 00074 #define DIST_FORCE 9 00075 00076 00077 typedef struct { 00078 uint8_t rc_off; 00079 uint8_t rc_cstatus; 00080 uint8_t rc_dstatus; 00081 uint8_t rc_cstation; 00082 uint8_t rc_rstation; 00083 uint8_t rc_cvolume; 00084 uint8_t rc_rvolume; 00085 uint8_t rc_cmute; 00086 uint8_t rc_rmute; 00087 } RADIOCONTROL; 00088 00089 extern RADIOCONTROL radio; 00090 00091 extern size_t ConfigSize(void); 00092 extern int ConfigLoad(void); 00093 extern void ConfigResetFactory(void); 00094 extern void ConfigSave(void); 00095 extern void ConfigSaveControl(void); 00096 extern int ConfigStation(uint8_t idx, CONST char * url); 00097 00098 #endif