2 * ANSI pedantic test for the Carla Backend & Host API
3 * Copyright (C) 2013-2014 Filipe Coelho <falktx@falktx.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * For a full copy of the GNU General Public License see the doc/GPL.txt file.
18 #include "CarlaBackend.h"
19 #include "CarlaHost.h"
20 #include "CarlaNative.h"
21 #include "CarlaMIDI.h"
24 # include "CarlaEngine.hpp"
25 # include "CarlaPlugin.hpp"
28 # ifdef CARLA_PROPER_CPP11_SUPPORT
37 int main(int argc
, char* argv
[])
40 CARLA_BACKEND_USE_NAMESPACE
47 EngineDriverDeviceInfo e
;
50 /*CarlaCachedPluginInfo g;*/
53 CarlaScalePointInfo j
;
56 /*const char* licenseText;
57 const char* fileExtensions;*/
61 /*licenseText = carla_get_complete_license_text();
62 printf("LICENSE:\n%s\n", licenseText);
64 fileExtensions = carla_get_supported_file_extensions();
65 printf("FILE EXTENSIONS:\n%s\n", fileExtensions);*/
67 count
= carla_get_engine_driver_count();
68 printf("DRIVER COUNT: %i\n", count
);
70 for (l
=0; l
< count
; ++l
)
72 const char* driverName
;
73 const char* const* driverDeviceNames
;
76 driverName
= carla_get_engine_driver_name(l
);
77 driverDeviceNames
= carla_get_engine_driver_device_names(l
);
78 printf("DRIVER %i/%i: \"%s\" : DEVICES:\n", l
+1, count
, driverName
);
81 while (driverDeviceNames
[count2
] != NULL
)
84 for (m
= 0; m
< count2
; ++m
)
86 printf("DRIVER DEVICE %i/%i: \"%s\"\n", m
+1, count2
, driverDeviceNames
[m
]);
90 if (carla_engine_init("JACK", "ansi-test"))
93 CarlaEngine
* const engine(carla_get_engine());
94 assert(engine
!= nullptr);
95 engine
->getLastError();
97 if (carla_add_plugin(BINARY_NATIVE
, PLUGIN_INTERNAL
, NULL
, NULL
, "audiofile", 0, NULL
, 0x0))
100 CarlaPlugin
* const plugin(engine
->getPlugin(0));
101 assert(plugin
!= nullptr);
104 carla_set_custom_data(0, CUSTOM_DATA_TYPE_STRING
, "file", "/home/falktx/Music/test.wav");
105 carla_transport_play();
109 printf("%s\n", carla_get_last_error());
112 engine
->setAboutToClose();
114 carla_engine_close();
118 EngineControlEvent e1
;
121 e3
.fillFromMidiData(0, nullptr);
123 EngineTimeInfoBBT e5
;
130 (void)a
; (void)b
; (void)c
; (void)d
; (void)e
;
131 (void)f
; /*(void)g;*/ (void)h
; (void)i
; (void)j
; (void)k
;
133 (void)e1
; (void)e2
; (void)e4
; (void)e5
; (void)e6
;