RetroArch
midi_driver.h
Go to the documentation of this file.
1 /* RetroArch - A frontend for libretro.
2  * Copyright (C) 2018 The RetroArch team
3  *
4  * RetroArch is free software: you can redistribute it and/or modify it under the terms
5  * of the GNU General Public License as published by the Free Software Found-
6  * ation, either version 3 of the License, or (at your option) any later version.
7  *
8  * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10  * PURPOSE. See the GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License along with RetroArch.
13  * If not, see <http://www.gnu.org/licenses/>.
14  */
15 
16 #ifndef __MIDI_DRIVER__H
17 #define __MIDI_DRIVER__H
18 
19 #include <boolean.h>
20 #include <retro_common_api.h>
21 
23 
24 struct string_list;
25 
26 typedef struct
27 {
29  size_t data_size;
31 } midi_event_t;
32 
33 typedef struct midi_driver
34 {
39  const char *ident;
40 
58  bool (*get_avail_inputs)(struct string_list *inputs);
59 
77  bool (*get_avail_outputs)(struct string_list *outputs);
78 
96  void *(*init)(const char *input, const char *output);
97 
106  void (*free)(void *p);
107 
123  bool (*set_input)(void *p, const char *input);
124 
140  bool (*set_output)(void *p, const char *output);
141 
164  bool (*read)(void *p, midi_event_t *event);
165 
186  bool (*write)(void *p, const midi_event_t *event);
187 
201  bool (*flush)(void *p);
202 } midi_driver_t;
203 
204 const void *midi_driver_find_handle(int index);
205 const char *midi_driver_find_ident(int index);
206 
209 
211 bool midi_driver_set_volume(unsigned volume);
212 
213 bool midi_driver_init(void);
214 void midi_driver_free(void);
215 
216 bool midi_driver_set_input(const char *input);
217 bool midi_driver_set_output(const char *output);
218 
219 bool midi_driver_input_enabled(void);
220 bool midi_driver_output_enabled(void);
221 
224 bool midi_driver_flush(void);
225 
237 size_t midi_driver_get_event_size(uint8_t status);
238 
240 
241 #endif
size_t data_size
Definition: midi_driver.h:29
void(* free)(void *p)
Definition: midi_driver.h:106
bool midi_driver_set_all_sounds_off(void)
Definition: midi_driver.c:106
const char * ident
Definition: midi_driver.h:39
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
bool(* flush)(void *p)
Definition: midi_driver.h:201
static float delta_time
Definition: menu_animation.c:68
bool(* read)(void *p, midi_event_t *event)
Definition: midi_driver.h:164
bool midi_driver_set_output(const char *output)
Definition: midi_driver.c:347
const void * midi_driver_find_handle(int index)
Definition: midi_driver.c:81
unsigned char byte
Definition: jsonsax_full.c:47
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
uint8_t * data
Definition: midi_driver.h:28
GLenum GLenum GLenum input
Definition: glext.h:9938
bool midi_driver_set_input(const char *input)
Definition: midi_driver.c:315
typedef bool(RETRO_CALLCONV *retro_replace_image_index_t)(unsigned index
bool midi_driver_output_enabled(void)
Definition: midi_driver.c:395
bool midi_driver_write(uint8_t byte, uint32_t delta_time)
Definition: midi_driver.c:453
struct string_list * midi_driver_get_avail_inputs(void)
Definition: midi_driver.c:97
bool midi_driver_read(uint8_t *byte)
Definition: midi_driver.c:400
void midi_driver_free(void)
Definition: midi_driver.c:281
bool(* write)(void *p, const midi_event_t *event)
Definition: midi_driver.h:186
bool(* get_avail_inputs)(struct string_list *inputs)
Definition: midi_driver.h:58
uint32_t delta_time
Definition: midi_driver.h:30
GLfloat GLfloat p
Definition: glext.h:9809
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
Definition: midi_driver.h:33
GLuint index
Definition: glext.h:6671
bool midi_driver_init(void)
Definition: midi_driver.c:182
bool midi_driver_set_volume(unsigned volume)
Definition: midi_driver.c:137
bool midi_driver_flush(void)
Definition: midi_driver.c:557
std::string output
Definition: Config.FromFile.cpp:44
bool(* set_input)(void *p, const char *input)
Definition: midi_driver.h:123
struct string_list * midi_driver_get_avail_outputs(void)
Definition: midi_driver.c:102
bool(* set_output)(void *p, const char *output)
Definition: midi_driver.h:140
bool(* get_avail_outputs)(struct string_list *outputs)
Definition: midi_driver.h:77
Definition: midi_driver.h:26
struct _cl_event * event
Definition: glext.h:8406
size_t midi_driver_get_event_size(uint8_t status)
Definition: midi_driver.c:573
struct midi_driver midi_driver_t
unsigned char uint8_t
Definition: stdint.h:124
unsigned int uint32_t
Definition: stdint.h:126
bool midi_driver_input_enabled(void)
Definition: midi_driver.c:390
const char * midi_driver_find_ident(int index)
Definition: midi_driver.c:89
Definition: string_list.h:47