2024-04-14 16:17:19 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* drummer.h */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* This file is part of Drummer. */
|
|
|
|
/* */
|
|
|
|
/* Drummer is free software: you can redistribute it and/or modify it */
|
|
|
|
/* under the terms of the GNU General Public License as published by */
|
|
|
|
/* the Free Software Foundation, either version 3 of the License, or */
|
|
|
|
/* (at your option) any later version. */
|
|
|
|
/* */
|
|
|
|
/* Drummer is distributed in the hope that it will be useful, */
|
|
|
|
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
|
|
|
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
|
|
|
/* GNU General Public License for more details. */
|
|
|
|
/* */
|
|
|
|
/* You should have received a copy of the GNU General Public License */
|
|
|
|
/* along with Drummer. If not, see <https://www.gnu.org/licenses/>. */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2024-04-21 20:16:18 +02:00
|
|
|
|
|
|
|
|
2024-04-14 16:17:19 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* Includes */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2022-03-20 23:46:24 +01:00
|
|
|
|
|
|
|
#ifndef _DRUMMER_H_
|
|
|
|
#define _DRUMMER_H_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdarg.h>
|
2022-04-29 20:48:54 +02:00
|
|
|
#include <stdbool.h>
|
2022-03-20 23:46:24 +01:00
|
|
|
#include <ctype.h>
|
2022-03-23 22:57:26 +01:00
|
|
|
#include <math.h>
|
2022-04-27 23:13:33 +02:00
|
|
|
#include <unistd.h>
|
2022-05-14 23:53:23 +02:00
|
|
|
#include <errno.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <sys/time.h>
|
2022-03-23 22:57:26 +01:00
|
|
|
#include <libgen.h>
|
2022-03-20 23:46:24 +01:00
|
|
|
#include <glob.h>
|
2023-07-28 01:14:53 +02:00
|
|
|
#include <pthread.h>
|
|
|
|
|
2022-03-20 23:46:24 +01:00
|
|
|
|
2024-04-21 20:16:18 +02:00
|
|
|
#include <log.h>
|
2022-03-23 22:57:26 +01:00
|
|
|
#include <node.h>
|
|
|
|
|
2022-03-20 23:46:24 +01:00
|
|
|
#include <libxml/tree.h>
|
|
|
|
#include <libxml/parser.h>
|
|
|
|
#include <libxml/xpath.h>
|
|
|
|
#include <libxml/xpathInternals.h>
|
|
|
|
|
2022-03-23 22:57:26 +01:00
|
|
|
#include <sndfile.h>
|
|
|
|
#include <samplerate.h>
|
|
|
|
|
|
|
|
|
2022-03-20 23:46:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* Global definitions */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
typedef short DRT_Boolean;
|
|
|
|
|
|
|
|
#define DRD_FALSE ( DRT_Boolean) 0
|
|
|
|
#define DRD_TRUE ( DRT_Boolean) 1
|
|
|
|
|
2022-04-27 23:13:33 +02:00
|
|
|
#define DR_BOOLEAN_VALUE_FALSE_IS( v) ( (v) == DRD_FALSE)
|
|
|
|
#define DR_BOOLEAN_VALUE_TRUE_IS( v) ( (v) == DRD_TRUE)
|
|
|
|
|
|
|
|
#define DR_BOOLEAN_VALUE_ASCII_GET( v) ( DR_BOOLEAN_VALUE_FALSE_IS( (v)) ? "FALSE" : ( DR_BOOLEAN_VALUE_TRUE_IS( (v)) ? "TRUE" : "???"))
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-20 23:46:24 +01:00
|
|
|
#define DRD_NO 'n'
|
|
|
|
#define DRD_YES 'y'
|
|
|
|
|
2022-04-21 01:27:08 +02:00
|
|
|
#define DR_MAX(A,B) (((A) < (B)) ? (B) : (A))
|
|
|
|
#define DR_MIN(A,B) (((A) > (B)) ? (B) : (A))
|
2022-03-20 23:46:24 +01:00
|
|
|
|
2022-04-27 23:13:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
#define DRD_SAMPLE_RATE_DEFAULT 44100
|
2022-04-29 20:48:54 +02:00
|
|
|
|
2022-03-20 23:46:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* Status definition */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2022-03-23 22:57:26 +01:00
|
|
|
typedef short DRT_Status;
|
2022-03-20 23:46:24 +01:00
|
|
|
|
|
|
|
#define DRS_OK ( DRT_Status) 0
|
|
|
|
|
|
|
|
#define DRS_KO ( DRT_Status) 1
|
|
|
|
#define DRS_NO_IDENT ( DRT_Status) -2
|
|
|
|
#define DRS_BAD_FORMAT ( DRT_Status) -3
|
|
|
|
#define DRS_ROLLBACK ( DRT_Status) -4
|
|
|
|
|
|
|
|
#define DRS_NO_DATA ( DRT_Status) 3
|
|
|
|
#define DRS_SIGNAL ( DRT_Status) 4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-27 23:13:33 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* Drummer Includes */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2022-04-21 01:27:08 +02:00
|
|
|
|
2022-04-27 23:13:33 +02:00
|
|
|
#include <datastruct.h>
|
2024-04-14 16:17:19 +02:00
|
|
|
#include <utils.h>
|
2024-04-10 23:53:45 +02:00
|
|
|
#include <lv2_utils.h>
|
2022-04-27 23:13:33 +02:00
|
|
|
#include <lv2_plugin.h>
|
2023-07-28 01:14:53 +02:00
|
|
|
#include <lv2_ui.h>
|
2022-03-20 23:46:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-21 20:16:18 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* DRD_API definition */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* DRD DATA & API definition */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
# ifdef _DRUMMER_C_
|
|
|
|
# define DRD_DRU_DATA
|
|
|
|
# define DRD_DRU_API
|
|
|
|
# else
|
|
|
|
# define DRD_DRU_DATA extern
|
|
|
|
# define DRD_DRU_API extern
|
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* Public Data */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* Public Prototypes */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ifdef _DRUMMER_C_
|
|
|
|
|
|
|
|
|
2022-05-14 23:53:23 +02:00
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* Private Definitions */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
#define DRD_MODULE_NAME "dru"
|
2024-04-21 20:16:18 +02:00
|
|
|
#define LGD_MODULE_NAME "dru"
|
2022-05-14 23:53:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-20 23:46:24 +01:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* Prototypes */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* DR_Init */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2022-05-14 23:53:23 +02:00
|
|
|
DRT_Status DR_Init();
|
2022-03-20 23:46:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* DeInit */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2022-05-14 23:53:23 +02:00
|
|
|
DRT_Status DR_DeInit();
|
2022-03-20 23:46:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* main */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* ArgC: argument number */
|
|
|
|
/* ArgV: Argument tab */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
int main( int, char **);
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-21 20:16:18 +02:00
|
|
|
# else // ifdef _DRUMMER_C_
|
2022-05-14 23:53:23 +02:00
|
|
|
|
2024-04-21 20:16:18 +02:00
|
|
|
# endif // ifdef _DRUMMER_C_
|
2022-05-14 23:53:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-20 23:46:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2022-04-20 12:37:32 +02:00
|
|
|
|
2022-05-14 23:53:23 +02:00
|
|
|
#endif // ifndef _DRUMMER_H_
|