OpenTTD Source 20260206-master-g4d4e37dbf1
extmidi.cpp File Reference

Playing music via an external player. More...

#include "../stdafx.h"
#include "../debug.h"
#include "../string_func.h"
#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 "table/strings.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 33 of file extmidi.cpp.

Referenced by MusicDriver_ExtMidi::Start().

Function Documentation

◆ KillWait()

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 37 of file extmidi.cpp.