mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pw-cat: dump midi events in vebose mode
This commit is contained in:
parent
70fc09b891
commit
33102abe4d
1 changed files with 13 additions and 2 deletions
|
|
@ -50,6 +50,7 @@
|
||||||
#include "midifile.h"
|
#include "midifile.h"
|
||||||
|
|
||||||
#define DEFAULT_MEDIA_TYPE "Audio"
|
#define DEFAULT_MEDIA_TYPE "Audio"
|
||||||
|
#define DEFAULT_MIDI_MEDIA_TYPE "Midi"
|
||||||
#define DEFAULT_MEDIA_CATEGORY_PLAYBACK "Playback"
|
#define DEFAULT_MEDIA_CATEGORY_PLAYBACK "Playback"
|
||||||
#define DEFAULT_MEDIA_CATEGORY_RECORD "Capture"
|
#define DEFAULT_MEDIA_CATEGORY_RECORD "Capture"
|
||||||
#define DEFAULT_MEDIA_ROLE "Music"
|
#define DEFAULT_MEDIA_ROLE "Music"
|
||||||
|
|
@ -989,6 +990,9 @@ static int midi_play(struct data *d, void *src, unsigned int n_frames)
|
||||||
|
|
||||||
midi_file_read_event(d->midi.file, &ev);
|
midi_file_read_event(d->midi.file, &ev);
|
||||||
|
|
||||||
|
if (d->verbose)
|
||||||
|
midi_file_dump_event(&ev);
|
||||||
|
|
||||||
if (ev.data[0] == 0xff)
|
if (ev.data[0] == 0xff)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
@ -1027,6 +1031,9 @@ static int midi_record(struct data *d, void *src, unsigned int n_frames)
|
||||||
ev.data = SPA_POD_BODY(&c->value),
|
ev.data = SPA_POD_BODY(&c->value),
|
||||||
ev.size = SPA_POD_BODY_SIZE(&c->value);
|
ev.size = SPA_POD_BODY_SIZE(&c->value);
|
||||||
|
|
||||||
|
if (d->verbose)
|
||||||
|
midi_file_dump_event(&ev);
|
||||||
|
|
||||||
midi_file_write_event(d->midi.file, &ev);
|
midi_file_write_event(d->midi.file, &ev);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -1361,8 +1368,12 @@ int main(int argc, char *argv[])
|
||||||
goto error_usage;
|
goto error_usage;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data.media_type)
|
if (!data.media_type) {
|
||||||
data.media_type = DEFAULT_MEDIA_TYPE;
|
if (data.is_midi)
|
||||||
|
data.media_type = DEFAULT_MIDI_MEDIA_TYPE;
|
||||||
|
else
|
||||||
|
data.media_type = DEFAULT_MEDIA_TYPE;
|
||||||
|
}
|
||||||
if (!data.media_category)
|
if (!data.media_category)
|
||||||
data.media_category = data.mode == mode_playback ?
|
data.media_category = data.mode == mode_playback ?
|
||||||
DEFAULT_MEDIA_CATEGORY_PLAYBACK :
|
DEFAULT_MEDIA_CATEGORY_PLAYBACK :
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue