initial commit
This commit is contained in:
commit
36ca6059c1
49 changed files with 5290 additions and 0 deletions
40
bankconv.c
Normal file
40
bankconv.c
Normal file
|
@ -0,0 +1,40 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdarg.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "strings.h"
|
||||
#include "dmx.h"
|
||||
#define ARGPARSE_DE
|
||||
#include "../argparse.h"
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
char *dmxname = NULL;
|
||||
char *drumname = NULL;
|
||||
char *skbname = NULL;
|
||||
int32_t usedrum = 0;
|
||||
|
||||
argp_t *argspec = arg_alloc(4);
|
||||
arg_add_nstr(argspec, STR_ARGS_BANK, true, &dmxname);
|
||||
arg_add_nstr(argspec, STR_ARGS_SKB, true, &skbname);
|
||||
arg_add_str(argspec, 'q', STR_ARGS_DBANK, &drumname);
|
||||
arg_add_bool(argspec, 'Q', STR_ARGS_USEDRM, &usedrum);
|
||||
if(arg_parse(argspec, argc, argv) ^ 1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
bank_instr *instr = bnk_read_banks(dmxname, drumname, usedrum);
|
||||
if(instr == NULL) {
|
||||
return 1;
|
||||
}
|
||||
if(skb_write_bank(instr, skbname) ^ 1) {
|
||||
free(instr);
|
||||
return 1;
|
||||
}
|
||||
free(instr);
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue