OpenTTD Source 20241224-master-gee860a5c8e
extmidi.cpp File Reference

Playing music via an external player. More...

#include "../stdafx.h"
#include "../debug.h"
#include "../string_func.h"
#include "../core/alloc_func.hpp"
#include "../sound/sound_driver.hpp"
#include "../video/video_driver.hpp"
#include "../gfx_func.h"
#include "extmidi.h"
#include "../base_media_base.h"
#include "../thread.h"
#include "midifile.hpp"
#include <fcntl.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <signal.h>
#include <sys/stat.h>
#include "../safeguards.h"

Go to the source code of this file.

Macros

#define EXTERNAL_PLAYER   "timidity"
 The default external midi player.
 

Functions

static bool KillWait (pid_t &pid, int signal)
 Try to end child process with kill/waitpid for up to 1 second.
 

Variables

static FMusicDriver_ExtMidi iFMusicDriver_ExtMidi
 Factory for the midi player that uses external players.
 

Detailed Description

Playing music via an external player.

Definition in file extmidi.cpp.

Macro Definition Documentation

◆ EXTERNAL_PLAYER

#define EXTERNAL_PLAYER   "timidity"

The default external midi player.

Definition at line 32 of file extmidi.cpp.

Function Documentation

◆ KillWait()

static bool KillWait ( pid_t &  pid,
int  signal 
)
static

Try to end child process with kill/waitpid for up to 1 second.

Parameters
pidThe process ID to end.
signalThe signal type to send.
Returns
True if the process has been ended.

Definition at line 139 of file extmidi.cpp.

References CSleep().

Variable Documentation

◆ iFMusicDriver_ExtMidi

FMusicDriver_ExtMidi iFMusicDriver_ExtMidi
static

Factory for the midi player that uses external players.

Definition at line 36 of file extmidi.cpp.