Arnaud G. GIBERT
84e23826c3
- Add preliminary LV2 sample loading support, - Add LV2 multy layer sample play, - Add LV2 Bank select & Program change midi message support, - Fix minor bugs... - No GFX
123 lines
2.6 KiB
C
123 lines
2.6 KiB
C
/*---------------------------------------------------------------------------------*/
|
|
/* Includes */
|
|
/*---------------------------------------------------------------------------------*/
|
|
|
|
#define _DRUMMER_C_
|
|
|
|
|
|
|
|
#include <drummer.h>
|
|
|
|
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------------------*/
|
|
/* DR_Init */
|
|
/*---------------------------------------------------------------------------------*/
|
|
|
|
DRT_Status DR_Init( DRT_Base *Base_Ptr)
|
|
{
|
|
DRT_Status status;
|
|
|
|
|
|
if( ( status = DR_DataStruct_Init( Base_Ptr, DRD_SAMPLE_RATE_DEFAULT)) != DRS_OK)
|
|
{
|
|
fprintf( stderr, "Can't init data structures (%d) !", status);
|
|
return( status);
|
|
}
|
|
|
|
return( status);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------------------*/
|
|
/* DR_DeInit */
|
|
/*---------------------------------------------------------------------------------*/
|
|
|
|
DRT_Status DR_DeInit( DRT_Base *Base_Ptr)
|
|
{
|
|
DRT_Status status;
|
|
|
|
|
|
if( ( status = DR_DataStruct_DeInit( Base_Ptr)) != DRS_OK)
|
|
{
|
|
printf( "Can't deinit data structures (%d)!\n", status);
|
|
return( status);
|
|
}
|
|
|
|
return( status);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------------------*/
|
|
/* main */
|
|
/*---------------------------------------------------------------------------------*/
|
|
|
|
int main( int argc, char **argv)
|
|
{
|
|
DRT_Base base;
|
|
DRT_Status status;
|
|
DRT_Kit *kit_ptr;
|
|
|
|
|
|
if( ( status = DR_Init( &base)) != DRS_OK)
|
|
{
|
|
exit( -1);
|
|
}
|
|
|
|
if( ( status = DR_Kits_Load( &base)) != DRS_OK)
|
|
{
|
|
exit( -1);
|
|
}
|
|
|
|
|
|
if( ( status = DR_Kit_Id_Find( &kit_ptr, base.Kit_DS_Ptr, 0)) != DRS_OK)
|
|
// if( ( status = DR_Kit_Name_Find( &kit_ptr, base.Kit_DS_Ptr, "Mars LM1: 01-777 Clean Kit")) != DRS_OK)
|
|
{
|
|
exit( -1);
|
|
}
|
|
else
|
|
{
|
|
if( ( status = DR_Kit_Sample_Load( kit_ptr, base.SampleRate)) != DRS_OK)
|
|
{
|
|
exit( -1);
|
|
}
|
|
/*
|
|
fprintf( stderr, "Before!\n");
|
|
|
|
if( ( status = DR_Kit_Sample_UnLoad( kit_ptr)) != DRS_OK)
|
|
{
|
|
exit( -1);
|
|
}
|
|
*/
|
|
fprintf( stderr, "After!\n");
|
|
|
|
if( ( status = DR_Kit_Sample_Load( kit_ptr, base.SampleRate)) != DRS_OK)
|
|
{
|
|
exit( -1);
|
|
}
|
|
}
|
|
|
|
fprintf( stderr, "hello world!\n");
|
|
|
|
if( ( status = DR_Kits_Dump( &base)) != DRS_OK)
|
|
{
|
|
exit( -1);
|
|
}
|
|
|
|
if( ( status = DR_DeInit( &base)) != DRS_OK)
|
|
{
|
|
exit( -1);
|
|
}
|
|
|
|
exit( 0);
|
|
}
|