Skip to content

Commit

Permalink
Fix Windows build failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiw committed Jul 3, 2023
1 parent c3a82ec commit f36923d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 31 deletions.
18 changes: 9 additions & 9 deletions src/config/AudioConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,49 +22,49 @@
#include "AudioConfiguration.h"

template<>
const char* AudioConfiguration::AudioDeviceConfigName<1, AudioConfiguration::IN>::GetDeviceNameConfigName()
const char* AudioConfiguration::AudioDeviceConfigName<1, AudioConfiguration::DIR_IN>::GetDeviceNameConfigName()
{
return "/Audio/soundCard1InDeviceName";
}

template<>
const char* AudioConfiguration::AudioDeviceConfigName<1, AudioConfiguration::OUT>::GetDeviceNameConfigName()
const char* AudioConfiguration::AudioDeviceConfigName<1, AudioConfiguration::DIR_OUT>::GetDeviceNameConfigName()
{
return "/Audio/soundCard1OutDeviceName";
}

template<>
const char* AudioConfiguration::AudioDeviceConfigName<2, AudioConfiguration::IN>::GetDeviceNameConfigName()
const char* AudioConfiguration::AudioDeviceConfigName<2, AudioConfiguration::DIR_IN>::GetDeviceNameConfigName()
{
return "/Audio/soundCard2InDeviceName";
}

template<>
const char* AudioConfiguration::AudioDeviceConfigName<2, AudioConfiguration::OUT>::GetDeviceNameConfigName()
const char* AudioConfiguration::AudioDeviceConfigName<2, AudioConfiguration::DIR_OUT>::GetDeviceNameConfigName()
{
return "/Audio/soundCard2OutDeviceName";
}

template<>
const char* AudioConfiguration::AudioDeviceConfigName<1, AudioConfiguration::IN>::GetSampleRateConfigName()
const char* AudioConfiguration::AudioDeviceConfigName<1, AudioConfiguration::DIR_IN>::GetSampleRateConfigName()
{
return "/Audio/soundCard1InSampleRate";
}

template<>
const char* AudioConfiguration::AudioDeviceConfigName<1, AudioConfiguration::OUT>::GetSampleRateConfigName()
const char* AudioConfiguration::AudioDeviceConfigName<1, AudioConfiguration::DIR_OUT>::GetSampleRateConfigName()
{
return "/Audio/soundCard1OutSampleRate";
}

template<>
const char* AudioConfiguration::AudioDeviceConfigName<2, AudioConfiguration::IN>::GetSampleRateConfigName()
const char* AudioConfiguration::AudioDeviceConfigName<2, AudioConfiguration::DIR_IN>::GetSampleRateConfigName()
{
return "/Audio/soundCard2InSampleRate";
}

template<>
const char* AudioConfiguration::AudioDeviceConfigName<2, AudioConfiguration::OUT>::GetSampleRateConfigName()
const char* AudioConfiguration::AudioDeviceConfigName<2, AudioConfiguration::DIR_OUT>::GetSampleRateConfigName()
{
return "/Audio/soundCard2OutSampleRate";
}
Expand All @@ -91,4 +91,4 @@ void AudioConfiguration::save(wxConfigBase* config)
soundCard1Out.save(config);
soundCard2In.save(config);
soundCard2Out.save(config);
}
}
30 changes: 15 additions & 15 deletions src/config/AudioConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class AudioConfiguration : public WxWidgetsConfigStore
{
public:
enum Direction { IN, OUT };
enum Direction { DIR_IN, DIR_OUT };

template<int DeviceId, AudioConfiguration::Direction AudioDirection>
class AudioDeviceConfigName
Expand All @@ -55,10 +55,10 @@ class AudioConfiguration : public WxWidgetsConfigStore
AudioConfiguration() = default;
virtual ~AudioConfiguration() = default;

SoundDevice<1, AudioConfiguration::IN> soundCard1In;
SoundDevice<1, AudioConfiguration::OUT> soundCard1Out;
SoundDevice<2, AudioConfiguration::IN> soundCard2In;
SoundDevice<2, AudioConfiguration::OUT> soundCard2Out;
SoundDevice<1, Direction::DIR_IN> soundCard1In;
SoundDevice<1, Direction::DIR_OUT> soundCard1Out;
SoundDevice<2, Direction::DIR_IN> soundCard2In;
SoundDevice<2, Direction::DIR_OUT> soundCard2Out;

virtual void load(wxConfigBase* config) override;
virtual void save(wxConfigBase* config) override;
Expand All @@ -71,16 +71,16 @@ const char* AudioConfiguration::AudioDeviceConfigName<DeviceId, AudioDirection>:
}

template<>
const char* AudioConfiguration::AudioDeviceConfigName<1, AudioConfiguration::IN>::GetDeviceNameConfigName();
const char* AudioConfiguration::AudioDeviceConfigName<1, AudioConfiguration::DIR_IN>::GetDeviceNameConfigName();

template<>
const char* AudioConfiguration::AudioDeviceConfigName<1, AudioConfiguration::OUT>::GetDeviceNameConfigName();
const char* AudioConfiguration::AudioDeviceConfigName<1, AudioConfiguration::DIR_OUT>::GetDeviceNameConfigName();

template<>
const char* AudioConfiguration::AudioDeviceConfigName<2, AudioConfiguration::IN>::GetDeviceNameConfigName();
const char* AudioConfiguration::AudioDeviceConfigName<2, AudioConfiguration::DIR_IN>::GetDeviceNameConfigName();

template<>
const char* AudioConfiguration::AudioDeviceConfigName<2, AudioConfiguration::OUT>::GetDeviceNameConfigName();
const char* AudioConfiguration::AudioDeviceConfigName<2, AudioConfiguration::DIR_OUT>::GetDeviceNameConfigName();

template<int DeviceId, AudioConfiguration::Direction AudioDirection>
const char* AudioConfiguration::AudioDeviceConfigName<DeviceId, AudioDirection>::GetSampleRateConfigName()
Expand All @@ -89,20 +89,20 @@ const char* AudioConfiguration::AudioDeviceConfigName<DeviceId, AudioDirection>:
}

template<>
const char* AudioConfiguration::AudioDeviceConfigName<1, AudioConfiguration::IN>::GetSampleRateConfigName();
const char* AudioConfiguration::AudioDeviceConfigName<1, AudioConfiguration::DIR_IN>::GetSampleRateConfigName();

template<>
const char* AudioConfiguration::AudioDeviceConfigName<1, AudioConfiguration::OUT>::GetSampleRateConfigName();
const char* AudioConfiguration::AudioDeviceConfigName<1, AudioConfiguration::DIR_OUT>::GetSampleRateConfigName();

template<>
const char* AudioConfiguration::AudioDeviceConfigName<2, AudioConfiguration::IN>::GetSampleRateConfigName();
const char* AudioConfiguration::AudioDeviceConfigName<2, AudioConfiguration::DIR_IN>::GetSampleRateConfigName();

template<>
const char* AudioConfiguration::AudioDeviceConfigName<2, AudioConfiguration::OUT>::GetSampleRateConfigName();
const char* AudioConfiguration::AudioDeviceConfigName<2, AudioConfiguration::DIR_OUT>::GetSampleRateConfigName();

template<int DeviceId, AudioConfiguration::Direction AudioDirection>
AudioConfiguration::SoundDevice<DeviceId, AudioDirection>::SoundDevice()
: deviceName(AudioConfiguration::AudioDeviceConfigName<DeviceId, AudioDirection>::GetDeviceNameConfigName(), _("none"))
: deviceName(AudioConfiguration::AudioDeviceConfigName<DeviceId, AudioDirection>::GetDeviceNameConfigName(), "none")
, sampleRate(AudioConfiguration::AudioDeviceConfigName<DeviceId, AudioDirection>::GetSampleRateConfigName(), -1)
{
// empty
Expand All @@ -122,4 +122,4 @@ void AudioConfiguration::SoundDevice<DeviceId, AudioDirection>::save(wxConfigBas
save_(config, sampleRate);
}

#endif // AUDIO_CONFIGURATION_H
#endif // AUDIO_CONFIGURATION_H
10 changes: 5 additions & 5 deletions src/config/RigControlConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ RigControlConfiguration::RigControlConfiguration()
, hamlibEnableFreqModeChanges("/Hamlib/EnableFreqModeChanges", true)
, hamlibUseAnalogModes("/Hamlib/UseAnalogModes", false)
, hamlibIcomCIVAddress("/Hamlib/IcomCIVHex", 0)
, hamlibRigName("/Hamlib/RigNameStr", _(""))
, hamlibRigName("/Hamlib/RigNameStr", "")
, hamlibPTTType("/Hamlib/PttType", 0)
, hamlibSerialRate("/Hamlib/SerialRate", 0)
, hamlibSerialPort("/Hamlib/SerialPort", _(""))
, hamlibSerialPort("/Hamlib/SerialPort", "")

, useSerialPTT("/Rig/UseSerialPTT", false)
, serialPTTPort("/Rig/Port", _(""))
, serialPTTPort("/Rig/Port", "")
, serialPTTUseRTS("/Rig/UseRTS", true)
, serialPTTPolarityRTS("/Rig/RTSPolarity", true)
, serialPTTUseDTR("/Rig/UseDTR", false)
, serialPTTPolarityDTR("/Rig/DTRPolarity", false)

, useSerialPTTInput("/Rig/UseSerialPTTInput", false)
, serialPTTInputPort("/Rig/PttInPort", _(""))
, serialPTTInputPort("/Rig/PttInPort", "")
, serialPTTInputPolarityCTS("/Rig/CTSPolarity", false)

, leftChannelVoxTone("/Rig/leftChannelVoxTone", false)
Expand Down Expand Up @@ -95,4 +95,4 @@ void RigControlConfiguration::save(wxConfigBase* config)
save_(config, serialPTTInputPolarityCTS);

save_(config, leftChannelVoxTone);
}
}
2 changes: 1 addition & 1 deletion src/dlg_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ void OptionsDlg::OnDebugConsole(wxScrollEvent& event) {
int ret = AllocConsole();
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
if (g_verbose) fprintf(stderr, "AllocConsole: %d m_debug_console: %d\n", ret, wxGetApp().appConfiguration.debugConsoleEnabled);
if (g_verbose) fprintf(stderr, "AllocConsole: %d m_debug_console: %d\n", ret, wxGetApp().appConfiguration.debugConsoleEnabled.get());
}
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent, wxID_ANY, _("FreeDV ")
int ret = AllocConsole();
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
fprintf(stderr, "AllocConsole: %d m_debug_console: %d\n", ret, wxGetApp().appConfiguration.debugConsoleEnabled);
fprintf(stderr, "AllocConsole: %d m_debug_console: %d\n", ret, wxGetApp().appConfiguration.debugConsoleEnabled.get());
}
#endif

Expand Down

0 comments on commit f36923d

Please sign in to comment.