#include "lin_time.h"
#include <SDL/SDL.h>
#include <SDL/SDL_thread.h>
#include <SDL/SDL_mixer.h>
#include <unistd.h>
#include <stdio.h>
#include <pwd.h>
#include <string>
#include <vector>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include "inet.h"
Go to the source code of this file.
void changehome |
( |
bool |
to, |
|
|
bool |
linuxhome = true |
|
) |
| |
Definition at line 213 of file soundserver.mac.notworking.cpp.
215 static std::vector< std::string >paths;
217 char mycurpath[8192];
218 getcwd( mycurpath, 8191 );
219 mycurpath[8191] =
'\0';
220 paths.push_back( std::string( mycurpath ) );
223 struct passwd *pwent;
224 pwent = getpwuid( getuid() );
225 chdir( pwent->pw_dir );
228 chdir(
".vegastrike" );
229 }
else if ( !paths.empty() ) {
230 chdir( paths.back().c_str() );
void cleanExit |
( |
char * |
str, |
|
|
|
... |
|
) |
| |
void errorv |
( |
char * |
str, |
|
|
va_list |
ap |
|
) |
| |
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 275 of file soundserver.mac.notworking.cpp.
References cleanExit(), done, fadein, fadeout, GetMaxVolume(), i, INET_AcceptFrom(), INET_cleanup(), INET_close(), INET_fgetc(), INET_startup(), Music::m, music_finished(), PlayMusic(), and Music::SetVolume().
278 int audio_rate, audio_channels,
281 audio_buffers = 4096;
285 if (SDL_Init( SDL_INIT_AUDIO ) < 0)
290 if ( !FSOUND_Init( 44100, 64, FSOUND_INIT_GLOBALFOCUS ) ) {
291 printf(
"SOUND Error %d\n", FSOUND_GetError() );
300 if (Mix_OpenAudio( 44100, MIX_DEFAULT_FORMAT, 2, audio_buffers ) < 0)
303 Mix_QuerySpec( &audio_rate, &audio_format, &audio_channels );
304 bits = audio_format&0xFF;
306 printf(
"Opened audio at %d Hz %d bit %s, %d bytes audio buffer\n", audio_rate,
307 bits, audio_channels > 1 ?
"stereo" :
"mono", audio_buffers );
309 for (
int i = 0;
i < 10 &&
mysocket == -1;
i++)
313 printf(
"\n[CONNECTED]\n" );
314 char ministr[2] = {
'\0',
'\0'};
326 while (arg !=
'\0' && arg !=
'\n') {
333 printf(
"%s", str.c_str() );
336 || ( !Mix_PlayingMusic() )
341 printf(
"\n[PLAYING %s WITH %d FADEIN AND %d FADEOUT]\n", str.c_str(),
fadein,
fadeout );
345 printf(
"\n[UNABLE TO PLAY %s WITH %d FADEIN AND %d FADEOUT]\n", str.c_str(),
fadein,
fadeout );
349 printf(
"\n[%s WITH %d FADEIN AND %d FADEOUT IS ALREADY PLAYING]\n", str.c_str(),
fadein,
fadeout );
355 while (arg !=
'\0' && arg !=
'\n') {
362 printf(
"%s", str.c_str() );
363 fadein = atoi( str.c_str() );
364 printf(
"\n[SETTING FADEIN TO %d]\n", fadein );
369 while (arg !=
'\0' && arg !=
'\n') {
376 printf(
"%s", str.c_str() );
378 printf(
"\n[SETTING FADEOUT TO %d]\n", fadeout );
383 while (arg !=
'\0' && arg !=
'\n') {
390 printf(
"%s", str.c_str() );
391 volume = atof( str.c_str() );
392 printf(
"\n[SETTING VOLUME TO %f]\n", volume );
400 printf(
"\n[TERMINATING MUSIC SERVER]\n" );
Music PlayMusic |
( |
const char * |
file, |
|
|
Music & |
oldmusic |
|
) |
| |
bool invalid_string = true |