OpenTTD Source: src/music/win32_m.cpp File Reference

OpenTTD Source 14.0-beta3

Data Structures | Functions | Variables
win32_m.cpp File Reference
`#include "../stdafx.h"`
`#include "../string_func.h"`
`#include "win32_m.h"`
`#include <windows.h>`
`#include <mmsystem.h>`
`#include "../os/windows/win32.h"`
`#include "../debug.h"`
`#include "midifile.hpp"`
`#include "midi.h"`
`#include "../base_media_base.h"`
`#include "../core/mem_func.hpp"`
`#include <mutex>`
`#include "../safeguards.h"`

Go to the source code of this file.

## Data Structures
struct | PlaybackSegment

## Functions
static byte | ScaleVolume (byte original, byte scale)
void CALLBACK | MidiOutProc (HMIDIOUT hmo, UINT wMsg, DWORD_PTR, DWORD_PTR dwParam1, DWORD_PTR)
static void | TransmitChannelMsg (byte status, byte p1, byte p2=0)
static void | TransmitSysex (const byte *&msg_start, size_t &remaining)
static void | TransmitStandardSysex (MidiSysexMessage msg)
void CALLBACK | TimerCallback (UINT uTimerID, UINT, DWORD_PTR, DWORD_PTR, DWORD_PTR)
| Realtime MIDI playback service routine. More...

## Variables
struct {
UINT time_period
| obtained timer precision value
HMIDIOUT midi_out
| handle to open midiOut
UINT timer_id
| ID of active multimedia timer.
std::mutex lock
| synchronization for playback status fields
bool playing
| flag indicating that playback is active
int do_start
| flag for starting playback of next_file at next opportunity
bool do_stop
| flag for stopping playback at next opportunity
byte current_volume
| current effective volume setting
byte new_volume
| volume setting to change to
MidiFile current_file
| file currently being played from
PlaybackSegment current_segment
| segment info for current playback
DWORD playback_start_time
| timestamp current file began playback
size_t current_block
| next block index to send
MidiFile next_file
| upcoming file to play
PlaybackSegment next_segment
| segment info for upcoming file
byte channel_volumes [16]
| last seen volume controller values in raw data
} | _midi
static FMusicDriver_Win32 | iFMusicDriver_Win32

## Detailed Description

Music playback for Windows.

Definition in file win32_m.cpp.

## Function Documentation

## ◆ TimerCallback()

void CALLBACK TimerCallback | ( | UINT | uTimerID,
|  | UINT | ,
|  | DWORD_PTR | ,
|  | DWORD_PTR | ,
|  | DWORD_PTR |
| ) |  |

Realtime MIDI playback service routine.

This is called by the multimedia timer.

Definition at line 111 of file win32_m.cpp.

References _midi, and Debug.

Referenced by MusicDriver_Win32::PlaySong().