Skip to content

Commit

Permalink
Tweak MIDNAM model name -- #14
Browse files Browse the repository at this point in the history
Suffix "AVL-Drumkits-LV2" with colon and 64bit unique ID
  • Loading branch information
x42 committed Nov 13, 2019
1 parent 457275e commit 5f5f204
Show file tree
Hide file tree
Showing 2 changed files with 143 additions and 138 deletions.
20 changes: 12 additions & 8 deletions src/avldrums.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,21 +592,25 @@ mn_file (LV2_Handle instance)
#include "midnam.h"
AVLSynth* self = (AVLSynth*)instance;
char* mn = strdup (AVL_Drumkits_midnam);
char inst[13];
snprintf (inst, 12, "%p", self);
memcpy (&mn[0x142], inst, strlen(inst));
char inst[11];
snprintf (inst, 10, "%p", self);
inst[10] = '\0';
memcpy (&mn[339], inst, strlen(inst));
printf ("'%s'\n", mn);
return mn;
}

static char*
mn_model (LV2_Handle instance)
{
AVLSynth* self = (AVLSynth*)instance;
char inst[13];
char* rv = malloc (17 * sizeof (char));
sprintf (rv, "AVL-Drumkits-LV2");
snprintf (inst, 12, "%p", self);
memcpy (rv, inst, strlen(inst));
char* rv = strdup ("AVL-Drumkits-LV2:0xXXXXXXXX");
sprintf (rv, "AVL-Drumkits-LV2:0xXXXXXXXX");
char inst[11];
snprintf (inst, 10, "%p", self);
inst[10] = '\0';
memcpy (&rv[17], inst, strlen(inst));
printf ("MIDNAM: '%s'\n", rv);
return rv;
}

Expand Down
Loading

0 comments on commit 5f5f204

Please sign in to comment.