mirror of
				https://github.com/onyx-and-iris/vmrcli.git
				synced 2025-11-04 07:01:47 +00:00 
			
		
		
		
	Compare commits
	
		
			5 Commits
		
	
	
		
			b95c40265c
			...
			f6437fcbe7
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| f6437fcbe7 | |||
| fb54c4a492 | |||
| 8aeb793a41 | |||
| b6b4b04a8a | |||
| b7fa15d87d | 
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -1,7 +1,6 @@
 | 
				
			|||||||
#ifndef __CDLL_H__
 | 
					#ifndef __CDLL_H__
 | 
				
			||||||
#define __CDLL_H__
 | 
					#define __CDLL_H__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <windows.h>
 | 
					 | 
				
			||||||
#include "VoicemeeterRemote.h"
 | 
					#include "VoicemeeterRemote.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
long initialize_dll_interfaces(T_VBVMR_INTERFACE *iVMR);
 | 
					long initialize_dll_interfaces(T_VBVMR_INTERFACE *iVMR);
 | 
				
			||||||
 | 
				
			|||||||
@ -3,7 +3,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void remove_name_in_path(char *szPath);
 | 
					void remove_name_in_path(char *szPath);
 | 
				
			||||||
int replace_multiple_space_with_one(char *s, size_t len);
 | 
					int replace_multiple_space_with_one(char *s, size_t len);
 | 
				
			||||||
char *kind_as_string(char *s, enum kind kind, int n);
 | 
					char *kind_as_string(char *s, int kind, int n);
 | 
				
			||||||
char *version_as_string(char *, long v, int n);
 | 
					char *version_as_string(char *, long v, int n);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif /* __UTIL_H__ */
 | 
					#endif /* __UTIL_H__ */
 | 
				
			||||||
@ -6,6 +6,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
enum kind
 | 
					enum kind
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    UNKNOWN = -1,
 | 
				
			||||||
    BASIC = 1,
 | 
					    BASIC = 1,
 | 
				
			||||||
    BANANA,
 | 
					    BANANA,
 | 
				
			||||||
    POTATO,
 | 
					    POTATO,
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,6 @@
 | 
				
			|||||||
#include <stdbool.h>
 | 
					#include <stdbool.h>
 | 
				
			||||||
#include <stdio.h>
 | 
					#include <stdio.h>
 | 
				
			||||||
 | 
					#include <windows.h>
 | 
				
			||||||
#include "cdll.h"
 | 
					#include "cdll.h"
 | 
				
			||||||
#include "util.h"
 | 
					#include "util.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -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
 | 
					 * @param n maximum number of characters to be written to the buffer
 | 
				
			||||||
 * @return char* The kind of Voicemeeter as a string
 | 
					 * @return char* The kind of Voicemeeter as a string
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
char *kind_as_string(char *s, enum kind kind, int n)
 | 
					char *kind_as_string(char *s, int kind, int n)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    char *kinds[] = {
 | 
					    static const char *kinds[] = {
 | 
				
			||||||
        "Basic",
 | 
					        "Basic",
 | 
				
			||||||
        "Banana",
 | 
					        "Banana",
 | 
				
			||||||
        "Potato",
 | 
					        "Potato",
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										32
									
								
								src/vmrcli.c
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								src/vmrcli.c
									
									
									
									
									
								
							@ -2,6 +2,8 @@
 | 
				
			|||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
#include <stdbool.h>
 | 
					#include <stdbool.h>
 | 
				
			||||||
#include <getopt.h>
 | 
					#include <getopt.h>
 | 
				
			||||||
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					#include <ctype.h>
 | 
				
			||||||
#include "cdll.h"
 | 
					#include "cdll.h"
 | 
				
			||||||
#include "vmr.h"
 | 
					#include "vmr.h"
 | 
				
			||||||
#include "log.h"
 | 
					#include "log.h"
 | 
				
			||||||
@ -36,7 +38,7 @@ struct result
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void help(void);
 | 
					void help(void);
 | 
				
			||||||
enum kind set_kind(char *kval);
 | 
					enum kind set_kind(char *kval);
 | 
				
			||||||
int init_voicemeeter(T_VBVMR_INTERFACE *vmr, int kind);
 | 
					int init_voicemeeter(T_VBVMR_INTERFACE *vmr, enum kind kind);
 | 
				
			||||||
void interactive(T_VBVMR_INTERFACE *vmr);
 | 
					void interactive(T_VBVMR_INTERFACE *vmr);
 | 
				
			||||||
void parse_input(T_VBVMR_INTERFACE *vmr, char *input, int len);
 | 
					void parse_input(T_VBVMR_INTERFACE *vmr, char *input, int len);
 | 
				
			||||||
void parse_command(T_VBVMR_INTERFACE *vmr, char *command);
 | 
					void parse_command(T_VBVMR_INTERFACE *vmr, char *command);
 | 
				
			||||||
@ -46,11 +48,10 @@ bool vflag = false;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
int main(int argc, char *argv[])
 | 
					int main(int argc, char *argv[])
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    bool iflag = false;
 | 
					    bool iflag = false,
 | 
				
			||||||
    bool mflag = false;
 | 
					         mflag = false,
 | 
				
			||||||
    bool sflag = false;
 | 
					         sflag = false;
 | 
				
			||||||
    int opt;
 | 
					    int opt;
 | 
				
			||||||
    char *kvalue = "";
 | 
					 | 
				
			||||||
    int dvalue;
 | 
					    int dvalue;
 | 
				
			||||||
    enum kind kind = BANANAX64;
 | 
					    enum kind kind = BANANAX64;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -70,8 +71,12 @@ int main(int argc, char *argv[])
 | 
				
			|||||||
            help();
 | 
					            help();
 | 
				
			||||||
            exit(EXIT_SUCCESS);
 | 
					            exit(EXIT_SUCCESS);
 | 
				
			||||||
        case 'k':
 | 
					        case 'k':
 | 
				
			||||||
            kvalue = optarg;
 | 
					            kind = set_kind(optarg);
 | 
				
			||||||
            kind = set_kind(kvalue);
 | 
					            if (kind == UNKNOWN)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                log_fatal("Unknown Voicemeeter kind '%s'", optarg);
 | 
				
			||||||
 | 
					                exit(EXIT_FAILURE);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
        case 'm':
 | 
					        case 'm':
 | 
				
			||||||
            mflag = true;
 | 
					            mflag = true;
 | 
				
			||||||
@ -90,7 +95,7 @@ int main(int argc, char *argv[])
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                log_error(
 | 
					                log_warn(
 | 
				
			||||||
                    "-D arg out of range, expected value from 0 up to 5\n"
 | 
					                    "-D arg out of range, expected value from 0 up to 5\n"
 | 
				
			||||||
                    "Log level will default to LOG_WARN (3).\n");
 | 
					                    "Log level will default to LOG_WARN (3).\n");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@ -193,8 +198,7 @@ enum kind set_kind(char *kval)
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        log_error("Unknown Voicemeeter kind '%s'\n", kval);
 | 
					        return UNKNOWN;
 | 
				
			||||||
        exit(EXIT_FAILURE);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -206,18 +210,18 @@ enum kind set_kind(char *kval)
 | 
				
			|||||||
 * @param kind
 | 
					 * @param kind
 | 
				
			||||||
 * @return int
 | 
					 * @return int
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
int init_voicemeeter(T_VBVMR_INTERFACE *vmr, int kind)
 | 
					int init_voicemeeter(T_VBVMR_INTERFACE *vmr, enum kind kind)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int rep = initialize_dll_interfaces(vmr);
 | 
					    int rep = initialize_dll_interfaces(vmr);
 | 
				
			||||||
    if (rep < 0)
 | 
					    if (rep < 0)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (rep == -100)
 | 
					        if (rep == -100)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            log_error("Voicemeeter is not installed");
 | 
					            log_fatal("Voicemeeter is not installed");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            log_error("Error loading Voicemeeter dll with code %d\n", rep);
 | 
					            log_fatal("Error loading Voicemeeter dll with code %d\n", rep);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return rep;
 | 
					        return rep;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -225,7 +229,7 @@ int init_voicemeeter(T_VBVMR_INTERFACE *vmr, int kind)
 | 
				
			|||||||
    rep = login(vmr, kind);
 | 
					    rep = login(vmr, kind);
 | 
				
			||||||
    if (rep != 0)
 | 
					    if (rep != 0)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        log_error("Error logging into Voicemeeter");
 | 
					        log_fatal("Error logging into Voicemeeter");
 | 
				
			||||||
        return rep;
 | 
					        return rep;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user