Skip to content
Snippets Groups Projects
Commit 6b6da1ce authored by Sven Gestegård Robertz's avatar Sven Gestegård Robertz
Browse files

temporarily unbroke java register: stop sending type defs

parent ddb59c80
No related branches found
No related tags found
No related merge requests found
......@@ -27,8 +27,10 @@ public class EncoderChannel implements Encoder {
}
public void register(SampleDispatcher dispatcher) throws IOException {
if(dispatcher.getTypeDeclTag() == Constant.SAMPLE_DEF) {
int index = def_registry.add(dispatcher);
begin(Constant.SAMPLE_DEF);
//begin(Constant.SAMPLE_DEF);
begin(dispatcher.getTypeDeclTag());
encodePacked32(index);
encodeString(dispatcher.getName());
byte[] signature = dispatcher.getSignature();
......@@ -38,6 +40,7 @@ public class EncoderChannel implements Encoder {
}
end(null);
}
}
public void registerSampleRef(SampleDispatcher dispatcher) throws IOException {
System.err.println(dispatcher);
......
......@@ -11,5 +11,11 @@ public interface SampleDispatcher <T> {
public void decodeAndHandle(Decoder decoder,
SampleHandler handler) throws Exception;
/** return the tag SAMPLE_DEF or TYPE_DEF, for use
* by encoder.register.
* TODO: refactor types, moving this to a super-interface
* applicable to both type and sample defs.
*/
public byte getTypeDeclTag();
}
......@@ -848,7 +848,7 @@ class Decoder(Codec):
decl = self.index_to_decl[index].decode_decl(self)
value = None
elif index < i_USER:
raise exception("Invalid type index %d" % index)
raise Exception("Invalid type index %d" % index)
else:
decl = self.index_to_decl[index]
value = decl.decode(self)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment