____                _       __
    / __ )____  _____   | |     / /___ ___________
   / __  / __ \/ ___/   | | /| / / __ `/ ___/ ___/
  / /_/ / /_/ (__  )    | |/ |/ / /_/ / /  (__  )
 /_____/\____/____/     |__/|__/\__,_/_/  /____/

       A futuristic real-time strategy game.
          This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project. Distributed under the "GNU General Public License"

music.cpp File Reference

Background music support. More...

#include "stratagus.h"
#include <stdio.h>
#include "SDL.h"
#include "sound_server.h"
#include "script.h"

Go to the source code of this file.

Defines

#define SoundFrequency   44100

Functions

static void MusicFinishedCallback (void)
void CheckMusicFinished (bool force)
 < Check if music is finished and play the next song
void InitMusic (void)
 Turn music stopped callback on.

Variables

static SDL_mutex * MusicFinishedMutex
 Mutex for MusicFinished.
static bool MusicFinished
 Music ended and we need a new file.
bool CallbackMusic
 flag true callback ccl if stops


Detailed Description

Background music support.

Definition in file music.cpp.


Define Documentation

#define SoundFrequency   44100

Definition at line 48 of file music.cpp.


Function Documentation

void CheckMusicFinished ( bool  force  ) 

< Check if music is finished and play the next song

Check if music is finished and play the next song

Definition at line 77 of file music.cpp.

References CallbackMusic, IsMusicEnabled(), Lua, LuaCall(), MusicFinished, MusicFinishedMutex, SoundEnabled(), and StopMusic().

Referenced by EditorMainLoop(), GameMainLoop(), PatchEditorMainLoop(), and UiToggleSound().

void InitMusic ( void   ) 

Turn music stopped callback on.

Init music

Definition at line 101 of file music.cpp.

References MusicFinished, MusicFinishedCallback(), MusicFinishedMutex, and SetMusicFinishedCallback().

Referenced by main1().

static void MusicFinishedCallback ( void   )  [static]

Callback for when music has finished Note: we are in the sdl audio thread

Definition at line 67 of file music.cpp.

References MusicFinished, and MusicFinishedMutex.

Referenced by InitMusic().


Variable Documentation

flag true callback ccl if stops

global range control (max cut off distance for sound)

Definition at line 57 of file music.cpp.

Referenced by CheckMusicFinished().

bool MusicFinished [static]

Music ended and we need a new file.

Definition at line 55 of file music.cpp.

Referenced by CheckMusicFinished(), InitMusic(), and MusicFinishedCallback().

SDL_mutex* MusicFinishedMutex [static]

Mutex for MusicFinished.

Definition at line 54 of file music.cpp.

Referenced by CheckMusicFinished(), InitMusic(), and MusicFinishedCallback().


Generated on Sat Feb 21 00:28:17 2009 for Bos Wars by  doxygen 1.5.6