Add support for import musicbar properties.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 22 Feb 2005 19:22:58 +0000 (20:22 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 22 Feb 2005 19:22:58 +0000 (20:22 +0100)
(Patch by Matthias Vogelgesang)

Makefile
ptb.c
ptb.h

index 4e79fa6a95260de9ab5dfa1206fb89455573258c..aef767a642328b39390f0b948bb4bf842e2b0f49 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ ptb2xml.o: ptb2xml.c
        $(CC) $(CFLAGS) -c $< 
 
 ptb.dll ptb.def ptb.dll.a: $(PTBSO_OBJS)
-       $(CC) -shared $(CFLAGS) -o $@ $^ -Wl,--out-implib,$@.a,--output-def,ptb.def
+       $(CC) -shared $(CFLAGS) -o $@ $^ -Wl,--out-implib,ptb.dll.a,--output-def,ptb.def
 
 libptb.so.$(VERSION): $(PTBSO_OBJS)
        $(CC) -shared $(CFLAGS) -o $@ $^
diff --git a/ptb.c b/ptb.c
index fde9c950a1c37d3a3de76778152b5bc70ec0044a..7e15b0b7015192a313f6062c671f8868b61b3972 100644 (file)
--- a/ptb.c
+++ b/ptb.c
@@ -872,7 +872,9 @@ static int handle_CSectionSymbol (struct ptbf *bf, const char *section, struct p
 static int handle_CMusicBar (struct ptbf *bf, const char *section, struct ptb_list **dest) { 
        struct ptb_musicbar *musicbar = GET_ITEM(bf, dest, struct ptb_musicbar);
                                                                                         
-       ptb_data_unknown(bf, 8); /* FIXME */
+       ptb_data_unknown(bf, 1);
+       ptb_data(bf, &musicbar->properties, 1);
+       ptb_data_unknown(bf, 6);
        ptb_data(bf, &musicbar->letter, 1);
        ptb_data_string(bf, &musicbar->description);
 
diff --git a/ptb.h b/ptb.h
index 4ddc4a77897c48ce25e6630e1bee35d891d2aa07..4086ed7c80588f53bf3dc1d5e98f1dc6c9655482 100644 (file)
--- a/ptb.h
+++ b/ptb.h
@@ -31,6 +31,8 @@
 typedef unsigned char uint8_t;
 typedef unsigned short uint16_t;
 typedef unsigned long uint32_t;
+#else
+#include <stdint.h>
 #endif
 
 #ifdef __cplusplus
@@ -321,6 +323,14 @@ struct ptb_sectionsymbol {
 struct ptb_musicbar {
        struct ptb_musicbar *prev, *next;
 
+#define MUSICBAR_PROPERTY_SINGLE_BAR    0x00
+#define MUSICBAR_PROPERTY_DOUBLE_BAR    0x20
+#define MUSICBAR_PROPERTY_FREE_BAR      0x40
+#define MUSICBAR_PROPERTY_REPEAT_BEGIN  0x60
+#define MUSICBAR_PROPERTY_REPEAT_END    0x80
+#define MUSICBAR_PROPERTY_END_BAR       0xA0
+       /* Number of times to repeat OR-ed only with REPEAT_END property */
+       uint8_t properties;
        char letter;
        char *description;
 };