_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

Classes | Macros | Functions | Variables
midiplayer.c File Reference
#include <windows.h>
#include <mmsystem.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <io.h>

Classes

struct  _mid_header
 
struct  _mid_track
 
struct  trk
 
struct  evt
 

Macros

#define MAX_BUFFER_SIZE   (512 * 12)
 

Functions

static unsigned char * load_file (const unsigned char *filename, unsigned int *len)
 
static unsigned long read_var_long (unsigned char *buf, unsigned int *bytesread)
 
static unsigned short swap_bytes_short (unsigned short in)
 
static unsigned long swap_bytes_long (unsigned long in)
 
static struct evt get_next_event (const struct trk *track)
 
static int is_track_end (const struct evt *e)
 
static void CALLBACK example9_callback (HMIDIOUT out, UINT msg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2)
 
static unsigned int get_buffer (struct trk *tracks, unsigned int ntracks, unsigned int *out, unsigned int *outlen)
 
unsigned int example9 (char *filename)
 
DWORD WINAPI MyThreadFunction (LPVOID lpParam)
 
int main (int argc, char *argv[])
 

Variables

HMIXER sMixerHandle
 
HMIDISTRM sOut
 
HANDLE hWaitingThread
 
int sVolume = 127
 
char * sFilename = NULL
 
unsigned int sDeviceId = 0
 
HANDLE event
 

Macro Definition Documentation

◆ MAX_BUFFER_SIZE

#define MAX_BUFFER_SIZE   (512 * 12)

Function Documentation

◆ example9()

unsigned int example9 ( char *  filename)

◆ example9_callback()

static void CALLBACK example9_callback ( HMIDIOUT  out,
UINT  msg,
DWORD  dwInstance,
DWORD  dwParam1,
DWORD  dwParam2 
)
static

◆ get_buffer()

static unsigned int get_buffer ( struct trk tracks,
unsigned int  ntracks,
unsigned int *  out,
unsigned int *  outlen 
)
static

◆ get_next_event()

static struct evt get_next_event ( const struct trk track)
static

◆ is_track_end()

static int is_track_end ( const struct evt e)
static

◆ load_file()

static unsigned char* load_file ( const unsigned char *  filename,
unsigned int *  len 
)
static

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ MyThreadFunction()

DWORD WINAPI MyThreadFunction ( LPVOID  lpParam)

◆ read_var_long()

static unsigned long read_var_long ( unsigned char *  buf,
unsigned int *  bytesread 
)
static

◆ swap_bytes_long()

static unsigned long swap_bytes_long ( unsigned long  in)
static

◆ swap_bytes_short()

static unsigned short swap_bytes_short ( unsigned short  in)
static

Variable Documentation

◆ event

HANDLE event

◆ hWaitingThread

HANDLE hWaitingThread

◆ sDeviceId

unsigned int sDeviceId = 0

◆ sFilename

char* sFilename = NULL

◆ sMixerHandle

HMIXER sMixerHandle

◆ sOut

HMIDISTRM sOut

◆ sVolume

int sVolume = 127
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.