-void print_volume(const char *fmt, const char *device, const char *mixer, int mixer_idx) {
-/* Printing volume only works with ALSA at the moment */
- if (output_format == O_I3BAR)
- printf("{\"name\":\"volume\", \"instance\": \"%s.%s.%d\", \"full_text\":\"", device, mixer, mixer_idx);
+void print_volume(yajl_gen json_gen, char *buffer, const char *fmt, const char *device, const char *mixer, int mixer_idx) {
+ char *outwalk = buffer;
+ int pbval = 1;
+
+ /* Printing volume only works with ALSA at the moment */
+ if (output_format == O_I3BAR) {
+ char *instance;
+ asprintf(&instance, "%s.%s.%d", device, mixer, mixer_idx);
+ INSTANCE(instance);
+ free(instance);
+ }