mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-06 17:28:36 +01:00
Broadcast radio receiver in the cab
Plays internet radio streams (http, mp3) through a positional emitter in the cab, with analog tuning, inter-station noise and two speaker profiles. Stations are listed in fmradio.txt, cab controls are defined with fmradio entries in the .mmd file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -216,6 +216,7 @@ class TTrain {
|
||||
void update_sounds_runningnoise( sound_source &Sound );
|
||||
void update_sounds_resonancenoise( sound_source &Sound ) const;
|
||||
void update_sounds_radio();
|
||||
void update_sounds_fmradio( double const Deltatime );
|
||||
inline
|
||||
end cab_to_end( int const End ) const {
|
||||
return End == 2 ? end::rear : end::front; }
|
||||
@@ -485,6 +486,13 @@ class TTrain {
|
||||
static void OnCommand_radiovolumeincrease(TTrain *Train, command_data const &Command);
|
||||
static void OnCommand_radiovolumedecrease(TTrain *Train, command_data const &Command);
|
||||
static void OnCommand_radiovolumeset(TTrain *Train, command_data const &Command);
|
||||
static void OnCommand_fmradiotoggle(TTrain *Train, command_data const &Command);
|
||||
static void OnCommand_fmradiovolumeincrease(TTrain *Train, command_data const &Command);
|
||||
static void OnCommand_fmradiovolumedecrease(TTrain *Train, command_data const &Command);
|
||||
static void OnCommand_fmradiovolumeset(TTrain *Train, command_data const &Command);
|
||||
static void OnCommand_fmradiotuneincrease(TTrain *Train, command_data const &Command);
|
||||
static void OnCommand_fmradiotunedecrease(TTrain *Train, command_data const &Command);
|
||||
static void OnCommand_fmradiotuneset(TTrain *Train, command_data const &Command);
|
||||
static void OnCommand_cabchangeforward( TTrain *Train, command_data const &Command );
|
||||
static void OnCommand_cabchangebackward( TTrain *Train, command_data const &Command );
|
||||
static void OnCommand_generictoggle( TTrain *Train, command_data const &Command );
|
||||
@@ -919,6 +927,17 @@ private:
|
||||
bool m_couplingdisconnect { false };
|
||||
bool m_couplingdisconnectback { false };
|
||||
float m_radiovolume { Global.DefaultRadioVolume };
|
||||
// broadcast radio receiver
|
||||
bool m_fmradiopresent { false }; // the cab is equipped with the receiver
|
||||
audio::fmradio_type m_fmradiotype { audio::fmradio_type::cheap };
|
||||
bool m_fmradiopower { false };
|
||||
bool m_fmradiotuned { false }; // helper, the tuning knob was set to its initial position
|
||||
float m_fmradiovolume { 0.5f }; // position of the volume knob, in range 0-1
|
||||
float m_fmradiodial { 50.f }; // position of the tuning knob, in range 0-100 covering the whole band. NOTE: gauges ignore changes of bound value smaller than 0.01, hence the wide range
|
||||
int m_fmradiovolumechange { 0 }; // direction in which the volume knob is being turned
|
||||
int m_fmradiotunechange { 0 }; // direction in which the tuning knob is being turned
|
||||
float m_fmradiotunetime { 0.f }; // how long the tuning knob is being turned, it gets faster with time
|
||||
sound_source m_fmradiosound { sound_placement::internal, 2 * EU07_SOUND_CABCONTROLSCUTOFFRANGE }; // provides location and soundproofing of the receiver
|
||||
|
||||
public:
|
||||
float fPress[20][7]; // cisnienia dla wszystkich czlonow
|
||||
|
||||
Reference in New Issue
Block a user