Minor stuff

This commit is contained in:
Henrik Rydgard 2012-05-06 12:45:59 +02:00
parent 9d158fcf2d
commit a8eda0db12
5 changed files with 16 additions and 3 deletions

View file

@ -135,7 +135,7 @@ const short *clip_data(const Clip *clip)
return clip->data;
}
int clip_length(const Clip *clip) {
size_t clip_length(const Clip *clip) {
return clip->length;
}

View file

@ -33,7 +33,7 @@ Clip *clip_load(const char *filename);
void clip_destroy(Clip *clip);
const short *clip_data(const Clip *clip);
int clip_length(const Clip *clip);
size_t clip_length(const Clip *clip);
void clip_set_loop(int start, int end);

View file

@ -50,7 +50,12 @@ const json_value *json_value::get(const char *child_name, json_type type) const
}
const char *json_value::getString(const char *child_name) const {
return get(child_name, JSON_STRING)->string_value;
const json_value *val = get(child_name, JSON_STRING);
if (val)
return val->string_value;
else
FLOG("String %s missing from node %s", child_name, this->name);
return 0;
}
const char *json_value::getString(const char *child_name, const char *default_value) const {

View file

@ -107,3 +107,10 @@ private:
DISALLOW_COPY_AND_ASSIGN(JsonReader);
};
// TODO: Make this a push/pop interface similar to JsonWriter. Maybe
// we can get to the point where reading and writing is near identical or the same code.
class JsonCursor {
public:
};

View file

@ -16,6 +16,7 @@ typedef void *MidiDevice;
class MidiListener
{
public:
virtual ~MidiListener() {}
virtual void midiEvent(const uint8_t *cmd) = 0;
};