Fortraneries/SoundBrotching/c-tools/support.c

47 lines
1.2 KiB
C
Raw Normal View History

2022-03-08 21:33:01 +11:00
/*
* C SUPPORT FUNCTIONS
*/
#include <stdio.h>
#include <stdlib.h>
#include <sndfile.h>
#include "support.h"
/* --------------------------------------------------------------- */
2023-12-18 10:49:51 +11:00
int display_sf_info(SF_INFO *psf, char *text, int bla)
2022-03-08 21:33:01 +11:00
{
2023-12-18 10:49:51 +11:00
if (bla) {
fprintf(stderr, " +-- sf info [%s] %p\n", text, psf);
fprintf(stderr, " | samplerate %d\n", psf->samplerate);
fprintf(stderr, " | channels %d\n", psf->channels);
fprintf(stderr, " | frames %ld\n", psf->frames);
fprintf(stderr, " | format 0x%x\n", psf->format);
}
else {
fprintf(stderr, "%-25s %6d %2d %10ld 0x%x\n", text, \
psf->samplerate, psf->channels, psf->frames, psf->format);
}
2022-03-08 21:33:01 +11:00
return 0;
}
/* --------------------------------------------------------------- */
void print_version(char *msg)
{
2023-01-04 07:59:38 +11:00
fprintf(stderr, "=== %s, support compiled %s, %s\n", \
2022-03-08 21:33:01 +11:00
msg, __DATE__, __TIME__);
}
/* --------------------------------------------------------------- */
2023-01-04 07:59:38 +11:00
int check_textfile_validity(char *filename, int what)
{
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, filename, what);
#endif
return -1;
}
/* --------------------------------------------------------------- */