Compare commits

..

No commits in common. "f6437fcbe724ac1773eac208664d4e85d74a8f80" and "b95c40265cb4a6ee7a07d60388de5c98d271c5c7" have entirely different histories.

7 changed files with 633 additions and 519 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
#ifndef __CDLL_H__
#define __CDLL_H__
#include <windows.h>
#include "VoicemeeterRemote.h"
long initialize_dll_interfaces(T_VBVMR_INTERFACE *iVMR);

View File

@ -3,7 +3,7 @@
void remove_name_in_path(char *szPath);
int replace_multiple_space_with_one(char *s, size_t len);
char *kind_as_string(char *s, int kind, int n);
char *kind_as_string(char *s, enum kind kind, int n);
char *version_as_string(char *, long v, int n);
#endif /* __UTIL_H__ */

View File

@ -6,7 +6,6 @@
enum kind
{
UNKNOWN = -1,
BASIC = 1,
BANANA,
POTATO,

View File

@ -1,6 +1,5 @@
#include <stdbool.h>
#include <stdio.h>
#include <windows.h>
#include "cdll.h"
#include "util.h"

View File

@ -70,9 +70,9 @@ int replace_multiple_space_with_one(char *s, size_t len)
* @param n maximum number of characters to be written to the buffer
* @return char* The kind of Voicemeeter as a string
*/
char *kind_as_string(char *s, int kind, int n)
char *kind_as_string(char *s, enum kind kind, int n)
{
static const char *kinds[] = {
char *kinds[] = {
"Basic",
"Banana",
"Potato",

View File

@ -2,8 +2,6 @@
#include <stdlib.h>
#include <stdbool.h>
#include <getopt.h>
#include <string.h>
#include <ctype.h>
#include "cdll.h"
#include "vmr.h"
#include "log.h"
@ -38,7 +36,7 @@ struct result
void help(void);
enum kind set_kind(char *kval);
int init_voicemeeter(T_VBVMR_INTERFACE *vmr, enum kind kind);
int init_voicemeeter(T_VBVMR_INTERFACE *vmr, int kind);
void interactive(T_VBVMR_INTERFACE *vmr);
void parse_input(T_VBVMR_INTERFACE *vmr, char *input, int len);
void parse_command(T_VBVMR_INTERFACE *vmr, char *command);
@ -48,10 +46,11 @@ bool vflag = false;
int main(int argc, char *argv[])
{
bool iflag = false,
mflag = false,
sflag = false;
bool iflag = false;
bool mflag = false;
bool sflag = false;
int opt;
char *kvalue = "";
int dvalue;
enum kind kind = BANANAX64;
@ -71,12 +70,8 @@ int main(int argc, char *argv[])
help();
exit(EXIT_SUCCESS);
case 'k':
kind = set_kind(optarg);
if (kind == UNKNOWN)
{
log_fatal("Unknown Voicemeeter kind '%s'", optarg);
exit(EXIT_FAILURE);
}
kvalue = optarg;
kind = set_kind(kvalue);
break;
case 'm':
mflag = true;
@ -95,7 +90,7 @@ int main(int argc, char *argv[])
}
else
{
log_warn(
log_error(
"-D arg out of range, expected value from 0 up to 5\n"
"Log level will default to LOG_WARN (3).\n");
}
@ -198,7 +193,8 @@ enum kind set_kind(char *kval)
}
else
{
return UNKNOWN;
log_error("Unknown Voicemeeter kind '%s'\n", kval);
exit(EXIT_FAILURE);
}
}
@ -210,18 +206,18 @@ enum kind set_kind(char *kval)
* @param kind
* @return int
*/
int init_voicemeeter(T_VBVMR_INTERFACE *vmr, enum kind kind)
int init_voicemeeter(T_VBVMR_INTERFACE *vmr, int kind)
{
int rep = initialize_dll_interfaces(vmr);
if (rep < 0)
{
if (rep == -100)
{
log_fatal("Voicemeeter is not installed");
log_error("Voicemeeter is not installed");
}
else
{
log_fatal("Error loading Voicemeeter dll with code %d\n", rep);
log_error("Error loading Voicemeeter dll with code %d\n", rep);
}
return rep;
}
@ -229,7 +225,7 @@ int init_voicemeeter(T_VBVMR_INTERFACE *vmr, enum kind kind)
rep = login(vmr, kind);
if (rep != 0)
{
log_fatal("Error logging into Voicemeeter");
log_error("Error logging into Voicemeeter");
return rep;
}