OpenTTD Source: SoundDriver_SDL Class Reference

OpenTTD Source 15.0-RC2

Public Member Functions
SoundDriver_SDL Class Reference

Implementation of the SDL sound driver. More...

`#include <sdl_s.h>`

Inheritance diagram for SoundDriver_SDL:

## Public Member Functions
std::optional< std::string_view > | Start (const StringList &param) override
| Start this driver.
void | Stop () override
| Stop this driver.
std::string_view | GetName () const override
| Get the name of this driver.
Public Member Functions inherited from SoundDriver
virtual void | MainLoop ()
| Called once every tick.
virtual bool | HasOutput () const
| Whether the driver has an output from which the user can hear sound.

## Additional Inherited Members
Public Types inherited from Driver
enum | Type : uint8_t { DT_BEGIN = 0 , DT_MUSIC = 0 , DT_SOUND , DT_VIDEO , DT_END }
| The type of driver. More...
Static Public Member Functions inherited from SoundDriver
static SoundDriver * | GetInstance ()
| Get the currently active instance of the sound driver.

## Detailed Description

Implementation of the SDL sound driver.

Definition at line 16 of file sdl_s.h.

## Member Function Documentation

## ◆ GetName()

std::string_view SoundDriver_SDL::GetName | ( |  | ) | const
| inlineoverridevirtual

Get the name of this driver.

Returns
  The name of the driver.

Implements Driver.

Definition at line 21 of file sdl_s.h.

## ◆ Start()

std::optional< std::string_view > SoundDriver_SDL::Start | ( | const StringList & | parm | ) |
| overridevirtual

Start this driver.

Parameters

  parm | Parameters passed to the driver.

Returns
  std::nullopt if everything went okay, otherwise an error message.

Implements Driver.

Definition at line 33 of file sdl2_s.cpp.

References fill_sound_buffer(), and GetDriverParamInt().

## ◆ Stop()

void SoundDriver_SDL::Stop | ( |  | ) |
| overridevirtual

Stop this driver.

Implements Driver.

Definition at line 58 of file sdl2_s.cpp.

The documentation for this class was generated from the following files:

- src/sound/sdl_s.h
- src/sound/sdl2_s.cpp