MusicKit  0.0.0
SndAudioProcessorMP3Encoder.h
00001 
00002 //
00003 //  $Id$
00004 //
00005 //  Description:
00006 //
00007 //  Original Author: SKoT McDonald, <skot@tomandandy.com>
00008 //
00009 //  Copyright (c) 2001, The MusicKit Project.  All rights reserved.
00010 //
00011 //  Permission is granted to use and modify this code for commercial and
00012 //  non-commercial purposes so long as the author attribution and copyright
00013 //  messages remain intact and accompany all relevant code.
00014 //
00016 
00017 #ifndef __SNDKIT_SNDAUDIOPROCESSORMP3ENCODER_H__
00018 #define __SNDKIT_SNDAUDIOPROCESSORMP3ENCODER_H__
00019 
00020 #import <Foundation/Foundation.h>
00021 #import "SndAudioProcessor.h"
00022 #import "SndKitConfig.h"
00023 
00024 #if HAVE_LIBMP3LAME && HAVE_LIBSHOUT
00025 
00026 #import <lame/lame.h>
00027 // Note:
00028 // "lame" can be obtained via http://www.mp3dev.org and must be installed before
00029 // the SndKit will compile. LAME encoder is LGPL
00030 // License statement: http://www.sulaco.org/mp3/license.txt
00031 
00032 #import <shout/shout.h>
00033 
00034 // Note:
00035 // The <shout/shout.h> header is NOT part of the shoutcast server, but part of
00036 // the icecast project. Download and install the "libshout" package
00037 // from http://www.icecast.org before compiling the SndKit. If you also want to
00038 // run the icecast server from the same machine, also download the "icecast"
00039 // package from the same location, and install.
00040 // The "libshout" package provides the <shout/shout.h> header, and is the part of
00041 // the mechanism for sending data to the icecast server itself.
00042 //
00043 // The icecast libshout library is under the Lesser GPL license, so before
00044 // using the SndKit with this facility enabled, please ensure that you
00045 // understand the implications of this. The license statement can be found
00046 // in the README file in the libshout source directory.
00047 
00055 enum {
00056   mp3enc_kServerAddress  = 0,
00057   mp3enc_kServerPort     = 1,
00058   mp3enc_kServerPassword = 2,
00059   mp3enc_kNumParams      = 3
00060 };
00061 
00063 
00070 @interface SndAudioProcessorMP3Encoder : SndAudioProcessor 
00071 {
00073   float             *buffer_l;
00075   float             *buffer_r;
00077   long               bufferSizeInSamples;
00079   unsigned char     *mp3buff;
00081   long               mp3BufferSizeInBytes;
00083   NSLock            *encodeNShoutcastLock;
00085   lame_global_flags *lameGlobalFlags;
00087   shout_t           *conn;
00088 }
00093 + (NSString*) defaultServerAddress;
00094 
00099 + (int) defaultSourcePort;
00100 
00105 + (NSString*) defaultSourcePassword;
00106 
00111 - (NSString*) serverAddress;
00112 
00118 - (NSString*) serverPassword;
00119 
00125 - (int) serverPort;
00126 
00134 - setShoutcastServerAddress: (NSString*) address
00135                        port: (int) port
00136                    password: (NSString*) password;
00141 - (BOOL) connectToShoutcastServer;
00142 
00146 - disconnectFromShoutcastServer;
00147 
00148 @end
00149 
00151 #endif
00152 
00153 #endif