clang-format in src/sound

This commit is contained in:
Jasmine Iwanek
2022-07-21 22:01:01 -04:00
parent 4723ee7912
commit 26c5b53ffd

View File

@@ -48,14 +48,12 @@ static RtMidiIn * midiin = nullptr;
static int midi_out_id = 0, midi_in_id = 0;
static const int midi_lengths[8] = { 3, 3, 3, 3, 2, 2, 3, 1 };
int
rtmidi_write(uint8_t val)
{
return 0;
}
void
rtmidi_play_msg(uint8_t *msg)
{
@@ -63,7 +61,6 @@ rtmidi_play_msg(uint8_t *msg)
midiout->sendMessage(msg, midi_lengths[(msg[0] >> 4) & 7]);
}
void
rtmidi_play_sysex(uint8_t *sysex, unsigned int len)
{
@@ -71,7 +68,6 @@ rtmidi_play_sysex(uint8_t *sysex, unsigned int len)
midiout->sendMessage(sysex, len);
}
void*
rtmidi_output_init(const device_t *info)
{
@@ -83,7 +79,8 @@ rtmidi_output_init(const device_t *info)
dev->write = rtmidi_write;
try {
if (!midiout) midiout = new RtMidiOut;
if (!midiout)
midiout = new RtMidiOut;
} catch (RtMidiError &error) {
pclog("Failed to initialize MIDI output: %s\n", error.getMessage().c_str());
return nullptr;
@@ -111,7 +108,6 @@ rtmidi_output_init(const device_t *info)
return dev;
}
void
rtmidi_output_close(void *p)
{
@@ -126,7 +122,6 @@ rtmidi_output_close(void *p)
midi_out_close();
}
int
rtmidi_out_get_num_devs(void)
{
@@ -141,14 +136,12 @@ rtmidi_out_get_num_devs(void)
return midiout ? midiout->getPortCount() : 0;
}
void
rtmidi_out_get_dev_name(int num, char *s)
{
strcpy(s, midiout->getPortName(num).c_str());
}
void
rtmidi_input_callback(double timeStamp, std::vector<unsigned char> *message, void *userData)
{
@@ -158,7 +151,6 @@ rtmidi_input_callback(double timeStamp, std::vector<unsigned char> *message, voi
midi_in_msg(message->data(), message->size());
}
void*
rtmidi_input_init(const device_t *info)
{
@@ -204,7 +196,6 @@ rtmidi_input_init(const device_t *info)
return dev;
}
void
rtmidi_input_close(void *p)
{
@@ -217,7 +208,6 @@ rtmidi_input_close(void* p)
midi_out_close();
}
int
rtmidi_in_get_num_devs(void)
{
@@ -232,7 +222,6 @@ rtmidi_in_get_num_devs(void)
return midiin ? midiin->getPortCount() : 0;
}
void
rtmidi_in_get_dev_name(int num, char *s)
{
@@ -313,5 +302,4 @@ const device_t rtmidi_input_device = {
.force_redraw = NULL,
.config = midi_input_config
};
}