Stream Ripper This program will download MP3 data from SHOUTcast stream and save mp3 file in microSD card. Metadata also will be saved as another file when stream includes metadata.

Dependencies:   EthernetNetIf mbed SDFileSystem

Committer:
xshige
Date:
Mon Sep 20 06:47:33 2010 +0000
Revision:
0:5490b791ee3d

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
xshige 0:5490b791ee3d 1
xshige 0:5490b791ee3d 2 /*
xshige 0:5490b791ee3d 3 Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com)
xshige 0:5490b791ee3d 4
xshige 0:5490b791ee3d 5 Permission is hereby granted, free of charge, to any person obtaining a copy
xshige 0:5490b791ee3d 6 of this software and associated documentation files (the "Software"), to deal
xshige 0:5490b791ee3d 7 in the Software without restriction, including without limitation the rights
xshige 0:5490b791ee3d 8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
xshige 0:5490b791ee3d 9 copies of the Software, and to permit persons to whom the Software is
xshige 0:5490b791ee3d 10 furnished to do so, subject to the following conditions:
xshige 0:5490b791ee3d 11
xshige 0:5490b791ee3d 12 The above copyright notice and this permission notice shall be included in
xshige 0:5490b791ee3d 13 all copies or substantial portions of the Software.
xshige 0:5490b791ee3d 14
xshige 0:5490b791ee3d 15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
xshige 0:5490b791ee3d 16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
xshige 0:5490b791ee3d 17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
xshige 0:5490b791ee3d 18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
xshige 0:5490b791ee3d 19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
xshige 0:5490b791ee3d 20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
xshige 0:5490b791ee3d 21 THE SOFTWARE.
xshige 0:5490b791ee3d 22 */
xshige 0:5490b791ee3d 23
xshige 0:5490b791ee3d 24 /** \file
xshige 0:5490b791ee3d 25 Debugging helpers header file
xshige 0:5490b791ee3d 26 */
xshige 0:5490b791ee3d 27
xshige 0:5490b791ee3d 28 //#ifdef DBG_H
xshige 0:5490b791ee3d 29 //#define DBG_H
xshige 0:5490b791ee3d 30
xshige 0:5490b791ee3d 31 #ifdef __LWIP_DEBUG
xshige 0:5490b791ee3d 32 #define __DEBUG
xshige 0:5490b791ee3d 33 #endif
xshige 0:5490b791ee3d 34
xshige 0:5490b791ee3d 35 /*!
xshige 0:5490b791ee3d 36 \def __DEBUG
xshige 0:5490b791ee3d 37 To define to enable debugging in one file
xshige 0:5490b791ee3d 38 */
xshige 0:5490b791ee3d 39
xshige 0:5490b791ee3d 40 #ifdef __DEBUG
xshige 0:5490b791ee3d 41
xshige 0:5490b791ee3d 42 #ifndef __DEBUGSTREAM
xshige 0:5490b791ee3d 43 #define __DEBUGSTREAM
xshige 0:5490b791ee3d 44
xshige 0:5490b791ee3d 45
xshige 0:5490b791ee3d 46 class DebugStream
xshige 0:5490b791ee3d 47 {
xshige 0:5490b791ee3d 48 public:
xshige 0:5490b791ee3d 49 static void debug(const char* format, ...);
xshige 0:5490b791ee3d 50 static void release();
xshige 0:5490b791ee3d 51 static void breakPoint(const char* file, int line);
xshige 0:5490b791ee3d 52 private:
xshige 0:5490b791ee3d 53
xshige 0:5490b791ee3d 54 };
xshige 0:5490b791ee3d 55
xshige 0:5490b791ee3d 56 #undef DBG
xshige 0:5490b791ee3d 57 #undef DBG_END
xshige 0:5490b791ee3d 58 #undef BREAK
xshige 0:5490b791ee3d 59
xshige 0:5490b791ee3d 60 ///Debug output (if enabled), same syntax as printf, with heading info
xshige 0:5490b791ee3d 61 #define DBG(...) do{ DebugStream::debug("[%s:%s@%d] ", __FILE__, __FUNCTION__, __LINE__); DebugStream::debug(__VA_ARGS__); } while(0);
xshige 0:5490b791ee3d 62
xshige 0:5490b791ee3d 63 ///Debug output (if enabled), same syntax as printf, no heading info
xshige 0:5490b791ee3d 64 #define DBGL(...) do{ DebugStream::debug(__VA_ARGS__); } while(0);
xshige 0:5490b791ee3d 65 #define DBG_END DebugStream::release
xshige 0:5490b791ee3d 66
xshige 0:5490b791ee3d 67 ///Break point usin serial debug interface (if debug enbaled)
xshige 0:5490b791ee3d 68 #define BREAK() DebugStream::breakPoint(__FILE__, __LINE__)
xshige 0:5490b791ee3d 69 #endif
xshige 0:5490b791ee3d 70
xshige 0:5490b791ee3d 71 #else
xshige 0:5490b791ee3d 72 #undef DBG
xshige 0:5490b791ee3d 73 #undef DBG_END
xshige 0:5490b791ee3d 74 #undef BREAK
xshige 0:5490b791ee3d 75 #define DBG(...)
xshige 0:5490b791ee3d 76 #define DBG_END()
xshige 0:5490b791ee3d 77 #define BREAK()
xshige 0:5490b791ee3d 78 #endif
xshige 0:5490b791ee3d 79
xshige 0:5490b791ee3d 80 #ifdef __LWIP_DEBUG
xshige 0:5490b791ee3d 81 #ifndef __SNPRINTF
xshige 0:5490b791ee3d 82 #define __SNPRINTF
xshige 0:5490b791ee3d 83 #include "mbed.h"
xshige 0:5490b791ee3d 84
xshige 0:5490b791ee3d 85 //int snprintf(char *str, int size, const char *format, ...);
xshige 0:5490b791ee3d 86 #endif
xshige 0:5490b791ee3d 87 #endif
xshige 0:5490b791ee3d 88
xshige 0:5490b791ee3d 89 #ifdef __LWIP_DEBUG
xshige 0:5490b791ee3d 90 #undef __DEBUG
xshige 0:5490b791ee3d 91 #endif
xshige 0:5490b791ee3d 92
xshige 0:5490b791ee3d 93 //#endif
xshige 0:5490b791ee3d 94