Skip to content

Commit

Permalink
audiogeneralsettings: Squash a few cland-tidy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-kendall committed Mar 3, 2020
1 parent 3a596b9 commit f6ba4a6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
15 changes: 11 additions & 4 deletions mythtv/programs/mythfrontend/audiogeneralsettings.cpp
Expand Up @@ -586,6 +586,13 @@ void AudioConfigSettings::UpdateAudioTest()
m_audioTest->UpdateCapabilities(out, passthrough, channels, settings);
}

ChannelChangedEvent::ChannelChangedEvent(QString channame, bool fulltest)
: QEvent(kEventType),
m_channel(std::move(channame)),
m_fulltest(fulltest)
{
}

AudioTestThread::AudioTestThread(QObject *parent,
QString main, QString passthrough,
int channels,
Expand All @@ -610,7 +617,7 @@ AudioTestThread::AudioTestThread(QObject *parent,
}

QEvent::Type ChannelChangedEvent::kEventType =
(QEvent::Type) QEvent::registerEventType();
static_cast<QEvent::Type>(QEvent::registerEventType());

AudioTestThread::~AudioTestThread()
{
Expand Down Expand Up @@ -655,8 +662,8 @@ void AudioTestThread::run()

if (m_audioOutput)
{
char *frames_in = new char[m_channels * 1024 * sizeof(int32_t) + 15];
char *frames = (char *)(((long)frames_in + 15) & ~0xf);
char *frames_in = new char[static_cast<unsigned long>(m_channels) * 1024 * sizeof(int32_t) + 15];
char *frames = reinterpret_cast<char *>(reinterpret_cast<long>(frames_in + 15) & ~0xf);

m_audioOutput->Pause(false);

Expand Down Expand Up @@ -959,7 +966,7 @@ bool AudioTest::event(QEvent *event)
if (event->type() != ChannelChangedEvent::kEventType)
return QObject::event(event); //not handled

auto *cce = (ChannelChangedEvent*)(event);
auto *cce = static_cast<ChannelChangedEvent*>(event);
QString channel = cce->m_channel;

if (!cce->m_fulltest)
Expand Down
9 changes: 4 additions & 5 deletions mythtv/programs/mythfrontend/audiogeneralsettings.h
Expand Up @@ -43,8 +43,8 @@ class AudioConfigSettings : public GroupSetting

using ADCMap = QMap<QString,AudioOutput::AudioDeviceConfig>;

ADCMap &AudioDeviceMap(void) { return m_audioDevs; };
AudioOutput::ADCVect &AudioDeviceVect(void) { return m_devices; };
ADCMap &AudioDeviceMap(void) { return m_audioDevs; }
AudioOutput::ADCVect &AudioDeviceVect(void) { return m_devices; }

void CheckConfiguration(void);

Expand Down Expand Up @@ -133,8 +133,7 @@ class AudioDeviceComboBox : public HostComboBoxSetting
class ChannelChangedEvent : public QEvent
{
public:
ChannelChangedEvent(QString channame, bool fulltest) :
QEvent(kEventType), m_channel(std::move(channame)), m_fulltest(fulltest) {}
ChannelChangedEvent(QString channame, bool fulltest);
~ChannelChangedEvent() override = default;

QString m_channel;
Expand All @@ -145,7 +144,7 @@ class ChannelChangedEvent : public QEvent

class AudioTestThread : public MThread
{
Q_DECLARE_TR_FUNCTIONS(AudioTestThread);
Q_DECLARE_TR_FUNCTIONS(AudioTestThread)

public:

Expand Down

0 comments on commit f6ba4a6

Please sign in to comment.