Skip to content

Commit

Permalink
build libs with QT_NO_SIGNALS_SLOTS_KEYWORDS
Browse files Browse the repository at this point in the history
Closes #18
  • Loading branch information
pedrolcl committed Dec 10, 2023
1 parent 1dda29b commit 7933d55
Show file tree
Hide file tree
Showing 45 changed files with 112 additions and 105 deletions.
1 change: 1 addition & 0 deletions library/alsa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ target_include_directories(drumstick-alsa PUBLIC
#message(STATUS "ALSA -- HAVE_DBUS: ${HAVE_DBUS}")

target_compile_definitions(drumstick-alsa PRIVATE
QT_NO_SIGNALS_SLOTS_KEYWORDS
$<$<BOOL:${HAVE_DBUS}>:RTKIT_SUPPORT>
)

Expand Down
2 changes: 1 addition & 1 deletion library/alsa/alsaclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ MidiClient::doEvents()
}
} else {
// finally, process signals
emit eventReceived(event->clone());
Q_EMIT eventReceived(event->clone());
}
}
delete event;
Expand Down
8 changes: 4 additions & 4 deletions library/alsa/alsaport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ MidiPort::setMidiClient( MidiClient* seq )
if (m_MidiClient != seq)
{
m_MidiClient = seq;
emit midiClientChanged( this, m_MidiClient );
Q_EMIT midiClientChanged( this, m_MidiClient );
applyPortInfo();
}
}
Expand All @@ -640,7 +640,7 @@ MidiPort::subscribe(Subscription* subs)
{
subs->subscribe(m_MidiClient);
m_Subscriptions.append(*subs);
emit subscribed(this, subs);
Q_EMIT subscribed(this, subs);
}

/**
Expand Down Expand Up @@ -1124,7 +1124,7 @@ MidiPort::attach( MidiClient* seq )
m_MidiClient = seq;
m_MidiClient->portAttach(this);
m_Attached = true;
emit attached(this);
Q_EMIT attached(this);
}
}

Expand All @@ -1137,7 +1137,7 @@ MidiPort::detach()
if (m_Attached && (m_MidiClient != nullptr)) {
m_MidiClient->portDetach(this);
m_Attached = false;
emit detached(this);
Q_EMIT detached(this);
}
}

Expand Down
2 changes: 1 addition & 1 deletion library/alsa/alsatimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@ Timer::doEvents()
if ( m_handler != nullptr )
m_handler->handleTimerEvent(tr.val, msecs);
else
emit timerExpired(tr.val, msecs);
Q_EMIT timerExpired(tr.val, msecs);
}
}

Expand Down
6 changes: 3 additions & 3 deletions library/alsa/playthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,14 @@ void SequencerOutputThread::run()
}
if (stopRequested()) {
m_Queue->clear();
emit playbackStopped();
Q_EMIT playbackStopped();
} else {
drainOutput();
syncOutput();
if (stopRequested())
emit playbackStopped();
Q_EMIT playbackStopped();
else
emit playbackFinished();
Q_EMIT playbackFinished();
}
m_Queue->stop();
} catch (...) {
Expand Down
4 changes: 4 additions & 0 deletions library/file/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ target_link_libraries(drumstick-file PRIVATE
Qt${QT_VERSION_MAJOR}::Core
)

target_compile_definitions(drumstick-file PRIVATE
QT_NO_SIGNALS_SLOTS_KEYWORDS
)

if (QT_VERSION VERSION_GREATER_EQUAL 6.0)
target_link_libraries(drumstick-file PRIVATE
Qt6::Core5Compat
Expand Down
54 changes: 27 additions & 27 deletions library/file/qsmf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void QSmf::readHeader()
d->m_Tracks = read16bit();
d->m_Division = read16bit();
}
emit signalSMFHeader(d->m_fileFormat, d->m_Tracks, d->m_Division);
Q_EMIT signalSMFHeader(d->m_fileFormat, d->m_Tracks, d->m_Division);

/* flush any extra stuff, in case the length of header is not */
while ((d->m_ToBeRead > 0) && !endOfSmf())
Expand Down Expand Up @@ -237,7 +237,7 @@ void QSmf::readTrack()
d->m_OldRealTime = 0;
d->m_CurrTempo = findTempo();

emit signalSMFTrackStart();
Q_EMIT signalSMFTrackStart();

while (!endOfSmf() && (d->m_Interactive || d->m_ToBeRead > 0))
{
Expand Down Expand Up @@ -392,7 +392,7 @@ void QSmf::readTrack()
if (d->m_ToBeRead > 0) {
SMFError(QStringLiteral("Track ended before reading last %1 bytes").arg(d->m_ToBeRead));
}
emit signalSMFTrackEnd();
Q_EMIT signalSMFTrackEnd();
}

/**
Expand Down Expand Up @@ -427,7 +427,7 @@ void QSmf::SMFWrite()
d->m_LastStatus = 0;
if (d->m_fileFormat == 1)
{
emit signalSMFWriteTempoTrack();
Q_EMIT signalSMFWriteTempoTrack();
}
for (i = 0; i < d->m_Tracks; ++i)
{
Expand Down Expand Up @@ -515,7 +515,7 @@ void QSmf::writeTrackChunk(int track)
write32bit(trklength);
d->m_NumBytesWritten = 0;

emit signalSMFWriteTrack(track);
Q_EMIT signalSMFWriteTrack(track);

place_marker = d->m_IOStream->device()->pos();
d->m_IOStream->device()->seek(offset);
Expand Down Expand Up @@ -976,7 +976,7 @@ double QSmf::ticksToSecs(quint64 ticks, quint16 division, quint64 tempo)

void QSmf::SMFError(const QString& s)
{
emit signalSMFError(s);
Q_EMIT signalSMFError(s);
}

void QSmf::channelMessage(quint8 status, quint8 c1, quint8 c2)
Expand All @@ -997,26 +997,26 @@ void QSmf::channelMessage(quint8 status, quint8 c1, quint8 c2)
switch (status & midi_command_mask)
{
case note_off:
emit signalSMFNoteOff(chan, c1, c2);
Q_EMIT signalSMFNoteOff(chan, c1, c2);
break;
case note_on:
emit signalSMFNoteOn(chan, c1, c2);
Q_EMIT signalSMFNoteOn(chan, c1, c2);
break;
case poly_aftertouch:
emit signalSMFKeyPress(chan, c1, c2);
Q_EMIT signalSMFKeyPress(chan, c1, c2);
break;
case control_change:
emit signalSMFCtlChange(chan, c1, c2);
Q_EMIT signalSMFCtlChange(chan, c1, c2);
break;
case program_chng:
emit signalSMFProgram(chan, c1);
Q_EMIT signalSMFProgram(chan, c1);
break;
case channel_aftertouch:
emit signalSMFChanPress(chan, c1);
Q_EMIT signalSMFChanPress(chan, c1);
break;
case pitch_wheel:
k = c1 + (c2 << 7) - 8192;
emit signalSMFPitchBend(chan, k);
Q_EMIT signalSMFPitchBend(chan, k);
break;
default:
SMFError(QString("Invalid MIDI status %1. Unhandled event").arg(status));
Expand All @@ -1032,7 +1032,7 @@ void QSmf::metaEvent(quint8 b)
switch (b)
{
case sequence_number:
emit signalSMFSequenceNum(to16bit(m[0], m[1]));
Q_EMIT signalSMFSequenceNum(to16bit(m[0], m[1]));
break;
case text_event:
case copyright_notice:
Expand All @@ -1043,25 +1043,25 @@ void QSmf::metaEvent(quint8 b)
case cue_point: {
QString s;
if (d->m_codec == nullptr) {
emit signalSMFText2(b, m);
Q_EMIT signalSMFText2(b, m);
} else {
s = d->m_codec->toUnicode(m);
emit signalSMFText(b, s);
Q_EMIT signalSMFText(b, s);
}
}
break;
case forced_channel:
emit signalSMFforcedChannel(m[0]);
Q_EMIT signalSMFforcedChannel(m[0]);
break;
case forced_port:
emit signalSMFforcedPort(m[0]);
Q_EMIT signalSMFforcedPort(m[0]);
break;
case end_of_track:
emit signalSMFendOfTrack();
Q_EMIT signalSMFendOfTrack();
break;
case set_tempo:
d->m_CurrTempo = to32bit(0, m[0], m[1], m[2]);
emit signalSMFTempo(d->m_CurrTempo);
Q_EMIT signalSMFTempo(d->m_CurrTempo);
rec = d->m_TempoList.last();
if (rec.tempo == d->m_CurrTempo)
{
Expand All @@ -1074,28 +1074,28 @@ void QSmf::metaEvent(quint8 b)
addTempo(d->m_CurrTempo, d->m_CurrTime);
break;
case smpte_offset:
emit signalSMFSmpte(m[0], m[1], m[2], m[3], m[4]);
Q_EMIT signalSMFSmpte(m[0], m[1], m[2], m[3], m[4]);
break;
case time_signature:
emit signalSMFTimeSig(m[0], m[1], m[2], m[3]);
Q_EMIT signalSMFTimeSig(m[0], m[1], m[2], m[3]);
break;
case key_signature:
emit signalSMFKeySig(m[0], m[1]);
Q_EMIT signalSMFKeySig(m[0], m[1]);
break;
case sequencer_specific:
emit signalSMFSeqSpecific(m);
Q_EMIT signalSMFSeqSpecific(m);
break;
default:
emit signalSMFMetaUnregistered(b, m);
Q_EMIT signalSMFMetaUnregistered(b, m);
break;
}
emit signalSMFMetaMisc(b, m);
Q_EMIT signalSMFMetaMisc(b, m);
}

void QSmf::sysEx()
{
QByteArray varr(d->m_MsgBuff);
emit signalSMFSysex(varr);
Q_EMIT signalSMFSysex(varr);
}

void QSmf::badByte(quint8 b, int p)
Expand Down
2 changes: 1 addition & 1 deletion library/file/qwrk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ void QWrk::processNewStream()

void QWrk::processEndChunk()
{
emit signalWRKEnd();
Q_EMIT signalWRKEnd();
}

int QWrk::readChunk()
Expand Down
4 changes: 2 additions & 2 deletions library/file/rmid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void Rmidi::processINFO(int size)
size -= length;
QString cktype = toString(chunkID);
QByteArray data = readByteArray(length);
emit signalRiffInfo(cktype, data);
Q_EMIT signalRiffInfo(cktype, data);
}
}

Expand Down Expand Up @@ -258,7 +258,7 @@ void Rmidi::processData(const QString& dataType, int size)
//qDebug() << Q_FUNC_INFO << size;
QByteArray memdata(size, '\0');
m_stream->readRawData(memdata.data(), size);
emit signalRiffData(dataType, memdata);
Q_EMIT signalRiffData(dataType, memdata);
}

void Rmidi::read()
Expand Down
2 changes: 1 addition & 1 deletion library/include/drumstick/alsaclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ class DRUMSTICK_ALSA_EXPORT MidiClient : public QObject
void setRealTimeInput(bool enabled);
bool realTimeInputEnabled();

signals:
Q_SIGNALS:
/** Signal emitted when an event is received
* @param ev pointer to the received event
*/
Expand Down
2 changes: 1 addition & 1 deletion library/include/drumstick/alsaport.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class DRUMSTICK_ALSA_EXPORT MidiPort : public QObject
void setTimestampReal(bool value);
void setTimestampQueue(int queueId);

signals:
Q_SIGNALS:
/**
* Signal emitted when an internal subscription is done.
* @param port MIDI port object pointer
Expand Down
2 changes: 1 addition & 1 deletion library/include/drumstick/alsatimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ class DRUMSTICK_ALSA_EXPORT Timer : public QObject
protected:
void doEvents();

signals:
Q_SIGNALS:
/**
* This signal is emitted when the timer has expired, if there is not an
* event hander installed.
Expand Down
2 changes: 1 addition & 1 deletion library/include/drumstick/pianokeybd.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ namespace drumstick { namespace widgets {

void setStartKey(const int startKey);

signals:
Q_SIGNALS:
/**
* This signal is emitted for each Note On MIDI event created using
* the computer keyboard, mouse or touch screen. It is not emitted if
Expand Down
4 changes: 2 additions & 2 deletions library/include/drumstick/playthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class DRUMSTICK_ALSA_EXPORT SequencerOutputThread : public QThread
*/
virtual void stop();

signals:
Q_SIGNALS:
/**
* Signal emitted when the sequence play-back has finished.
*/
Expand All @@ -106,7 +106,7 @@ class DRUMSTICK_ALSA_EXPORT SequencerOutputThread : public QThread
*/
void playbackStopped();

public slots:
public Q_SLOTS:
void start( QThread::Priority priority = InheritPriority );

protected:
Expand Down
2 changes: 1 addition & 1 deletion library/include/drumstick/qsmf.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class DRUMSTICK_FILE_EXPORT QSmf : public QObject
Q_DECL_DEPRECATED QTextCodec* getTextCodec();
Q_DECL_DEPRECATED void setTextCodec(QTextCodec *codec);

signals:
Q_SIGNALS:
/**
* Emitted for a SMF read or write error
* @param errorStr Error string
Expand Down
2 changes: 1 addition & 1 deletion library/include/drumstick/rmid.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class DRUMSTICK_FILE_EXPORT Rmidi : public QObject
void readFromFile(QString fileName);
void readFromStream(QDataStream* ds);

signals:
Q_SIGNALS:
/**
* @brief signalRMidInfo is emitted for each RIFF INFO element
* @param infoType Type of data (chunk ID) as defined in the spec (Source: www.midi.org rp29spec.pdf).
Expand Down
Loading

0 comments on commit 7933d55

Please sign in to comment.