JNIEXPORT jobjectArray JNICALL Java_org_helllabs_android_xmp_Xmp_getFormats(JNIEnv *env, jobject obj) { jstring s; jclass stringClass; jobjectArray stringArray; int i, num; struct xmp_fmt_info *f, *fmt; char buf[80]; xmp_get_fmt_info(&fmt); for (num = 0, f = fmt; f; num++, f = f->next); stringClass = (*env)->FindClass(env,"java/lang/String"); if (stringClass == NULL) return NULL; stringArray = (*env)->NewObjectArray(env, num, stringClass, NULL); if (stringArray = NULL) return NULL; for (i = 0, f = fmt; i < num; i++, f = f->next) { snprintf(buf, 80, "%s (%s)", f->id, f->tracker); s = (*env)->NewStringUTF(env, buf); (*env)->SetObjectArrayElement(env, stringArray, i, s); (*env)->DeleteLocalRef(env, s); } return stringArray; }
JNIEXPORT jint JNICALL Java_org_helllabs_android_xmp_Xmp_getFormatCount(JNIEnv *env, jobject obj) { int num; struct xmp_fmt_info *f, *fmt; xmp_get_fmt_info(&fmt); for (num = 0, f = fmt; f; num++, f = f->next); return num; }
static void aboutbox() { GtkWidget *vbox1; GtkWidget *label1; GtkWidget *about_exit; GtkWidget *scroll1; GtkWidget *table1; GtkWidget *label_fmt, *label_trk; struct xmp_fmt_info *f, *fmt; int i; if (about_window) { gdk_window_raise(about_window->window); return; } about_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_object_set_data(GTK_OBJECT(about_window), "about_window", about_window); gtk_window_set_title(GTK_WINDOW(about_window),"About the XMP Plugin"); gtk_window_set_policy(GTK_WINDOW(about_window), FALSE, FALSE, FALSE); gtk_signal_connect(GTK_OBJECT(about_window), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &about_window); gtk_container_border_width(GTK_CONTAINER(about_window), 10); gtk_widget_realize(about_window); vbox1 = gtk_vbox_new(FALSE, 4); gtk_container_add(GTK_CONTAINER(about_window), vbox1); gtk_object_set_data(GTK_OBJECT(about_window), "vbox1", vbox1); gtk_widget_show(vbox1); gtk_container_border_width(GTK_CONTAINER(vbox1), 10); label1 = gtk_label_new( "Extended Module Player " VERSION "\n" "Written by Claudio Matsuoka and Hipolito Carraro Jr.\n" "\n" "Portions Copyright (C) 1998,2000 Olivier Lapicque,\n" "(C) 1998 Tammo Hinrichs, (C) 1998 Sylvain Chipaux,\n" "(C) 1997 Bert Jahn, (C) 1999 Tatsuyuki Satoh, (C)\n" "2001-2006 Russell Marks\n" "\n" "Supported module formats:" ); gtk_object_set_data(GTK_OBJECT(label1), "label1", label1); gtk_box_pack_start(GTK_BOX(vbox1), label1, TRUE, TRUE, 0); scroll1 = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll1), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); gtk_widget_set_size_request(scroll1, 290, 100); gtk_object_set_data(GTK_OBJECT(scroll1), "scroll1", scroll1); gtk_widget_set (scroll1, "height", 100, NULL); gtk_box_pack_start(GTK_BOX(vbox1), scroll1, TRUE, TRUE, 0); xmp_get_fmt_info(&fmt); table1 = gtk_table_new(100, 2, FALSE); for (i = 0, f = fmt; f; i++, f = f->next) { label_fmt = gtk_label_new(f->id); label_trk = gtk_label_new(f->tracker); gtk_label_set_justify (GTK_LABEL (label_fmt), GTK_JUSTIFY_LEFT); gtk_label_set_justify (GTK_LABEL (label_trk), GTK_JUSTIFY_LEFT); gtk_table_attach_defaults (GTK_TABLE (table1), label_fmt, 0, 1, i, i + 1); gtk_table_attach_defaults (GTK_TABLE (table1), label_trk, 1, 2, i, i + 1); } gtk_table_resize (GTK_TABLE (table1), i + 1, 3); gtk_object_set_data(GTK_OBJECT(table1), "table1", table1); gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll1), table1); about_exit = gtk_button_new_with_label("Ok"); gtk_signal_connect_object(GTK_OBJECT(about_exit), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(about_window)); gtk_object_set_data(GTK_OBJECT(about_window), "about_exit", about_exit); gtk_box_pack_start(GTK_BOX(vbox1), about_exit, FALSE, FALSE, 0); gtk_widget_show_all(about_window); }
static void usage(char *s, struct xmp_options *opt) { struct xmp_fmt_info *f, *fmt; struct xmp_drv_info *d, *drv; char **hlp, buf[80]; int i; copyright_header (); printf ("%s\n", xmp_build); printf ("Usage: %s [options] [modules]\n", s); printf ("\nSupported module formats:\n"); xmp_get_fmt_info(&fmt); list_wrap (NULL, 3, 78, 1); for (i = 0, f = fmt; f; i++, f = f->next) { snprintf(buf, 80, "%s (%s)", f->id, f->tracker); list_wrap(buf, 3, 0, 1); } snprintf(buf, 80, "[%d known formats]", i); list_wrap(buf, 3, 0, 0); printf ("\n"); printf("\nAvailable drivers:\n"); xmp_get_drv_info(&drv); list_wrap (NULL, 3, 78, 1); for (d = drv; d; d = d->next) { snprintf(buf, 80, "%s (%s)", d->id, d->description); list_wrap(buf, 3, 0, 1); } printf("\n"); for (d = drv; d; d = d->next) { if (d->help) printf ("\n%s options:\n", d->description); for (hlp = d->help; hlp && *hlp; hlp += 2) printf (" -D%-20.20s %s\n", hlp[0], hlp[1]); } printf ( "\nPlayer control options:\n" " -D parameter[=val] Pass configuration parameter to the output driver\n" " -d --driver name Force output to the specified device\n" " --fix-sample-loops Use sample loop start /2 in MOD/UNIC/NP3\n" " --offset-bug-emulation Emulate Protracker 2.x bug in effect 9\n" " -l --loop Enable module looping\n" " -M --mute ch-list Mute the specified channels\n" " --modrange Limit the octave range to 3 octaves in MOD files\n" " --nocmd Disable interactive commands\n" " --norc Don't read configuration files\n" " -R --random Random order playing\n" #ifdef HAVE_SYS_RTPRIO_H " --realtime Run in real-time priority\n" #endif " -S --solo ch-list Set channels to solo mode\n" " -s --start num Start from the specified order\n" " -T --tempo num Initial tempo (default 6)\n" " -t --time num Maximum playing time in seconds\n" "\nPlayer sound options:\n" " -8 --8bit Convert 16 bit samples to 8 bit\n" " --chorus num Chorus depth (if supported)\n" " -m --mono Mono output\n" " --nofilter Disable IT filter\n" " --nopan Disable dynamic panning\n" " -P --pan pan Percentual pan amplitude (default %d%%)\n" " -r --reverse Reverse left/right stereo channels\n" " --reverb num Reverb depth (if supported)\n" " --stereo Stereo output\n" "\nSoftware mixer options:\n" " -b --bits {8|16} Software mixer resolution (8 or 16 bits)\n" " -c --stdout Mix the module to stdout\n" " -f --frequency rate Sampling rate in hertz (default %d Hz)\n" " -i --interpolate Use linear interpolation (default %s)\n" " -n --nearest Use nearest neighbor interpolation\n" " -o --output-file name Mix the module to file ('-' for stdout)\n" " -u --unsigned Set the mixer to use unsigned samples\n" "\nInformation options:\n" " -h --help Print a summary of the command line options\n" " --load-only Load module and exit\n" " --probe-only Probe audio device and exit\n" " -q --quiet Quiet mode (verbosity level = 0)\n" " -V --version Print version information\n" " -v --verbose Verbose mode (incremental)\n" ,opt->mix, opt->freq, opt->flags & XMP_CTL_ITPT ? "enabled" : "disabled" ); }