TIM_OPT_SPEEX_DTX,
TIM_OPT_SPEEX_COMPLEXITY,
TIM_OPT_SPEEX_NFRAMES,
+ TIM_OPT_VORBIS_COMMENT,
+ TIM_OPT_VORBIS_EMBED_LOOP,
TIM_OPT_OUTPUT_FILE,
TIM_OPT_PATCH_FILE,
TIM_OPT_POLYPHONY,
{ "speex-complexity", required_argument, NULL, TIM_OPT_SPEEX_COMPLEXITY },
{ "speex-nframes", required_argument, NULL, TIM_OPT_SPEEX_NFRAMES },
#endif /* AU_SPEEX */
+#ifdef AU_VORBIS
+ { "vorbis-comment", required_argument, NULL, TIM_OPT_VORBIS_COMMENT },
+#ifdef SUPPORT_LOOPEVENT
+ { "vorbis-embed-loop", no_argument, NULL, TIM_OPT_VORBIS_EMBED_LOOP },
+#endif /* SUPPORT_LOOPEVENT */
+#endif /* AU_VORBIS */
{ "output-file", required_argument, NULL, TIM_OPT_OUTPUT_FILE },
{ "patch-file", required_argument, NULL, TIM_OPT_PATCH_FILE },
{ "polyphony", required_argument, NULL, TIM_OPT_POLYPHONY },
{ "compute-thread-num", required_argument, NULL, TIM_OPT_COMPUTE_THREAD_NUM },
{ "trace-mode-update-time", required_argument, NULL, TIM_OPT_TRACE_MODE_UPDATE },
{ "load-all-instrument", required_argument, NULL, TIM_OPT_LOAD_ALL_INSTRUMENT },
+#ifdef SUPPORT_LOOPEVENT
{ "loop-repeat", required_argument, NULL, TIM_OPT_LOOP_REPEAT },
{ "loop-filter", required_argument, NULL, TIM_OPT_LOOP_FILTER },
+#endif /* SUPPORT_LOOPEVENT */
{ "cache-size", required_argument, NULL, TIM_OPT_CACHE_SIZE },
{ "sampling-freq", required_argument, NULL, TIM_OPT_SAMPLE_FREQ },
static inline int parse_opt_speex_complexity(const char *);
static inline int parse_opt_speex_nframes(const char *);
#endif /* AU_SPEEX */
+#ifdef AU_VORBIS
+static inline int parse_opt_vorbis_comment(const char *);
+#ifdef SUPPORT_LOOPEVENT
+static inline int parse_opt_vorbis_embed_loop(const char*);
+#endif /* SUPPORT_LOOPEVENT */
+#endif /* AU_VORBIS */
static inline int parse_opt_o(const char *);
static inline int parse_opt_P(const char *);
static inline int parse_opt_p(const char *);
case TIM_OPT_SPEEX_NFRAMES:
return parse_opt_speex_nframes(arg);
#endif /* AU_SPEEX */
+#ifdef AU_VORBIS
+ case TIM_OPT_VORBIS_COMMENT:
+ return parse_opt_vorbis_comment(arg);
+#ifdef SUPPORT_LOOPEVENT
+ case TIM_OPT_VORBIS_EMBED_LOOP:
+ return parse_opt_vorbis_embed_loop(arg);
+#endif /* SUPPORT_LOOPEVENT */
+#endif /* AU_VORBIS */
case TIM_OPT_OUTPUT_FILE:
return parse_opt_o(arg);
case TIM_OPT_PATCH_FILE:
}
#endif /* AU_SPEEX */
+#ifdef AU_VORBIS
+
+extern void vorbis_set_option_vorbis_comment(const char *tag, const char *contents);
+
+static inline int parse_opt_vorbis_comment(const char *arg)
+{
+ if (!arg) return 0;
+
+ const char *eq = strchr(arg, '=');
+ const char *tagend = eq ? eq : arg;
+
+ char tag[64] = {0};
+ char contents[256] = {0};
+ ptr_size_t taglen = tagend - arg < sizeof(tag) ? tagend - arg : sizeof(tag) - 1;
+ strncpy(tag, arg, taglen);
+ tag[taglen] = '\0';
+
+ strncpy(contents, eq ? eq + 1 : arg, sizeof(contents) - 1);
+ contents[sizeof(contents) - 1] = '\0';
+
+ vorbis_set_option_vorbis_comment(tag, contents);
+ return 0;
+}
+
+#ifdef SUPPORT_LOOPEVENT
+
+extern int ogg_vorbis_embed_loop;
+
+static inline int parse_opt_vorbis_embed_loop(const char *arg)
+{
+ ogg_vorbis_embed_loop = 1;
+ return 0;
+}
+
+#endif /* SUPPORT_LOOPEVENT */
+#endif /* AU_VORBIS */
+
static inline int parse_opt_o(const char *arg)
{
if (!arg) return 0;