This commit adds an operation for xfer backend to print help text.
In this time, content of the help is not implemented yet.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
state->log = NULL;
}
+static void xfer_libasound_help(struct xfer_context *xfer)
+{
+ printf(" (placeholder)\n");
+}
+
const struct xfer_data xfer_libasound = {
.s_opts = S_OPTS,
.l_opts = l_opts,
.pause = xfer_libasound_pause,
.post_process = xfer_libasound_post_process,
.destroy = xfer_libasound_destroy,
+ .help = xfer_libasound_help,
},
.private_size = sizeof(struct libasound_state),
};
state->guid_literal = NULL;
}
+static void xfer_libffado_help(struct xfer_context *xfer)
+{
+ printf(" (placeholder)\n");
+}
+
const struct xfer_data xfer_libffado = {
.s_opts = S_OPTS,
.l_opts = l_opts,
.pause = xfer_libffado_pause,
.post_process = xfer_libffado_post_process,
.destroy = xfer_libffado_destroy,
+ .help = xfer_libffado_help,
},
.private_size = sizeof(struct libffado_state),
};
if (xfer->help) {
print_help();
+ if (xfer->ops->help) {
+ printf("\n");
+ printf(" BACKEND-OPTIONS (%s) =\n",
+ xfer_label_from_type(xfer->type));
+ xfer->ops->help(xfer);
+ }
return 0;
}
return XFER_TYPE_UNSUPPORTED;
}
+const char *xfer_label_from_type(enum xfer_type type)
+{
+ return xfer_type_labels[type];
+}
+
int xfer_context_init(struct xfer_context *xfer, enum xfer_type type,
snd_pcm_stream_t direction, int argc, char *const *argv)
{
};
enum xfer_type xfer_type_from_label(const char *label);
+const char *xfer_label_from_type(enum xfer_type type);
int xfer_context_init(struct xfer_context *xfer, enum xfer_type type,
snd_pcm_stream_t direction, int argc, char *const *argv);
void (*post_process)(struct xfer_context *xfer);
void (*destroy)(struct xfer_context *xfer);
void (*pause)(struct xfer_context *xfer, bool enable);
+ void (*help)(struct xfer_context *xfer);
};
struct xfer_data {