diff --git a/bass-sys/linux/bass24/3dtest/3dtest.c b/bass-sys/linux/bass24/3dtest/3dtest.c new file mode 100644 index 0000000..fd58084 --- /dev/null +++ b/bass-sys/linux/bass24/3dtest/3dtest.c @@ -0,0 +1,315 @@ +/* + BASS 3D test + Copyright (c) 1999-2012 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include +#include +#include "bass.h" + +// path to glade file +#ifndef GLADE_PATH +#define GLADE_PATH "" +#endif + +GladeXML *glade; +GtkWidget *win = 0; +GtkWidget *filesel; + +// channel (sample/music) info structure +typedef struct { + DWORD channel; // the channel + BASS_3DVECTOR pos, vel; // position,velocity +} Channel; + +Channel *chans = NULL; // the channels +int chanc = 0, chan = -1; // number of channels, current channel + +#define TIMERPERIOD 50 // timer period (ms) +#define MAXDIST 50 // maximum distance of the channels (m) +#define SPEED 12 // speed of the channels' movement (m/s) + +// display error messages +void Error(const char *es) +{ + GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); +} + +#define GetWidget(id) glade_xml_get_widget(glade,id) + +void WindowDestroy(GtkObject *obj, gpointer data) +{ + gtk_main_quit(); +} + +// Update the button states +void UpdateButtons() +{ + gtk_widget_set_sensitive(GetWidget("remove"), chan == -1 ? FALSE : TRUE); + gtk_widget_set_sensitive(GetWidget("play"), chan == -1 ? FALSE : TRUE); + gtk_widget_set_sensitive(GetWidget("stop"), chan == -1 ? FALSE : TRUE); + gtk_widget_set_sensitive(GetWidget("movex"), chan == -1 ? FALSE : TRUE); + gtk_widget_set_sensitive(GetWidget("movez"), chan == -1 ? FALSE : TRUE); + gtk_widget_set_sensitive(GetWidget("movereset"), chan == -1 ? FALSE : TRUE); + if (chan != -1) { + gtk_spin_button_set_value(GTK_SPIN_BUTTON(GetWidget("movex")), fabs(chans[chan].vel.x)); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(GetWidget("movez")), fabs(chans[chan].vel.z)); + } +} + +gboolean ListSelectionChange(GtkTreeView *treeview, gpointer data) +{ // the selected channel has (probably) changed + GtkTreeSelection *ts; + GtkTreeModel *tm; + GtkTreeIter it; + ts = gtk_tree_view_get_selection(GTK_TREE_VIEW(GetWidget("channels"))); + if (gtk_tree_selection_get_selected(ts, &tm, &it)) { + char *rows = gtk_tree_model_get_string_from_iter(tm, &it); + chan = atoi(rows); + g_free(rows); + } else + chan = -1; + UpdateButtons(); + return TRUE; +} + +gboolean FileExtensionFilter(const GtkFileFilterInfo *info, gpointer data) +{ + return !regexec((regex_t*)data, info->filename, 0, NULL, 0); +} + +void AddClicked(GtkButton *obj, gpointer data) +{ // add a channel + int resp = gtk_dialog_run(GTK_DIALOG(filesel)); + gtk_widget_hide(filesel); + if (resp == GTK_RESPONSE_ACCEPT) { + char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filesel)); + DWORD newchan; + // Load a music or sample from "file" + if ((newchan = BASS_MusicLoad(FALSE, file, 0, 0, BASS_MUSIC_RAMP | BASS_SAMPLE_LOOP | BASS_SAMPLE_3D, 1)) + || (newchan = BASS_SampleLoad(FALSE, file, 0, 0, 1, BASS_SAMPLE_LOOP | BASS_SAMPLE_3D | BASS_SAMPLE_MONO))) { + Channel *c; + chanc++; + chans = (Channel*)realloc((void*)chans, chanc * sizeof(Channel)); + c = chans + chanc - 1; + memset(c, 0, sizeof(Channel)); + c->channel = newchan; + BASS_SampleGetChannel(newchan, FALSE); // initialize sample channel + { // add it to the list + GtkTreeView *tree = GTK_TREE_VIEW(GetWidget("channels")); + GtkListStore *tm = GTK_LIST_STORE(gtk_tree_view_get_model(tree)); + GtkTreeIter it; + gtk_list_store_append(tm, &it); + gtk_list_store_set(tm, &it, 0, strrchr(file, '/') + 1, -1); + } + } else + Error("Can't load file (note samples must be mono)"); + g_free(file); + } +} + +void RemoveClicked(GtkButton *obj, gpointer data) +{ // remove a channel + GtkTreeModel *tm = gtk_tree_view_get_model(GTK_TREE_VIEW(GetWidget("channels"))); + GtkTreeIter it; + if (gtk_tree_model_iter_nth_child(tm, &it, NULL, chan)) { + Channel *c = chans + chan; + // free both MOD and stream, it must be one of them! :) + BASS_SampleFree(c->channel); + BASS_MusicFree(c->channel); + chanc--; + memmove(c, c + 1, (chanc - chan) * sizeof(Channel)); + gtk_list_store_remove(GTK_LIST_STORE(tm), &it); + } +} + +void PlayClicked(GtkButton *obj, gpointer data) +{ + BASS_ChannelPlay(chans[chan].channel, FALSE); +} + +void StopClicked(GtkButton *obj, gpointer data) +{ + BASS_ChannelPause(chans[chan].channel); +} + +void MoveXChanged(GtkSpinButton *spinbutton, gpointer data) +{ // X velocity + float value = gtk_spin_button_get_value(GTK_SPIN_BUTTON(GetWidget("movex"))); + if (fabs(chans[chan].vel.x) != value) chans[chan].vel.x = value; +} + +void MoveZChanged(GtkSpinButton *spinbutton, gpointer data) +{ // Y velocity + float value = gtk_spin_button_get_value(GTK_SPIN_BUTTON(GetWidget("movez"))); + if (fabs(chans[chan].vel.z) != value) chans[chan].vel.z = value; +} + +void MoveResetClicked(GtkButton *obj, gpointer data) +{ // reset the position and velocity to 0 + memset(&chans[chan].pos, 0, sizeof(chans[chan].pos)); + memset(&chans[chan].vel, 0, sizeof(chans[chan].vel)); + UpdateButtons(); +} + +void RolloffChanged(GtkRange *range, gpointer data) +{ + // change the rolloff factor + double value = gtk_range_get_value(range); + BASS_Set3DFactors(-1, pow(2, (value - 10) / 5.0), -1); +} + +void DopplerChanged(GtkRange *range, gpointer data) +{ + // change the doppler factor + double value = gtk_range_get_value(range); + BASS_Set3DFactors(-1, -1, pow(2, (value - 10) / 5.0)); +} + +gboolean Update(gpointer data) +{ + int c, x, y, cx, cy; + GtkWidget *dc = GetWidget("drawingarea1"); + GdkGC *gc = dc->style->fg_gc[GTK_WIDGET_STATE(dc)]; + GdkGCValues gcsave; + + gdk_gc_get_values(gc, &gcsave); + + cx = dc->allocation.width / 2; + cy = dc->allocation.height / 2; + + { // clear the display + GdkColor c = { 0,0xffff,0xffff,0xffff }; + gdk_gc_set_rgb_fg_color(gc, &c); + gdk_draw_rectangle(dc->window, gc, TRUE, 0, 0, dc->allocation.width, dc->allocation.height); + } + + { // Draw the listener + GdkColor c = { 0,0x8000,0x8000,0x8000 }; + gdk_gc_set_rgb_fg_color(gc, &c); + gdk_draw_arc(dc->window, gc, TRUE, cx - 4, cy - 4, 8, 8, 0, 360 * 64); + } + + for (c = 0; c < chanc; c++) { + // If the channel's playing then update it's position + if (BASS_ChannelIsActive(chans[c].channel) == BASS_ACTIVE_PLAYING) { + // Check if channel has reached the max distance + if (chans[c].pos.z >= MAXDIST || chans[c].pos.z <= -MAXDIST) + chans[c].vel.z = -chans[c].vel.z; + if (chans[c].pos.x >= MAXDIST || chans[c].pos.x <= -MAXDIST) + chans[c].vel.x = -chans[c].vel.x; + // Update channel position + chans[c].pos.z += chans[c].vel.z * TIMERPERIOD / 1000; + chans[c].pos.x += chans[c].vel.x * TIMERPERIOD / 1000; + BASS_ChannelSet3DPosition(chans[c].channel, &chans[c].pos, NULL, &chans[c].vel); + } + { // Draw the channel position indicator + static GdkColor cols[2] = { {0,0xffff,0xc000,0xc000},{0,0xffff,0,0} }; + gdk_gc_set_rgb_fg_color(gc, &cols[chan == c]); + x = cx + (int)((cx - 10) * chans[c].pos.x / MAXDIST); + y = cy - (int)((cy - 10) * chans[c].pos.z / MAXDIST); + gdk_draw_arc(dc->window, gc, TRUE, x - 4, y - 4, 8, 8, 0, 360 * 64); + } + } + // Apply the 3D changes + BASS_Apply3D(); + + gdk_gc_set_values(gc, &gcsave, GDK_GC_FOREGROUND); + + return TRUE; +} + +int main(int argc, char* argv[]) +{ + regex_t fregex[2]; + + gtk_init(&argc, &argv); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + Error("An incorrect version of BASS was loaded"); + return 0; + } + + // Initialize the output device with 3D support + if (!BASS_Init(-1, 44100, BASS_DEVICE_3D, NULL, NULL)) { + Error("Can't initialize device"); + return 0; + } + + { + BASS_INFO i; + BASS_GetInfo(&i); + if (i.speakers > 2) { + GtkWidget *dialog = gtk_message_dialog_new(NULL, 0, + GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "Multiple speakers were detected. Would you like to use them?"); + if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_NO) + BASS_SetConfig(BASS_CONFIG_3DALGORITHM, BASS_3DALG_OFF); + gtk_widget_destroy(dialog); + } + } + + // Use meters as distance unit, real world rolloff, real doppler effect + BASS_Set3DFactors(1, 1, 1); + + // initialize GUI + glade = glade_xml_new(GLADE_PATH"3dtest.glade", NULL, NULL); + if (!glade) return 0; + win = GetWidget("window1"); + if (!win) return 0; + glade_xml_signal_autoconnect(glade); + g_signal_connect(gtk_tree_view_get_selection(GTK_TREE_VIEW(GetWidget("channels"))), "changed", G_CALLBACK(ListSelectionChange), NULL); + + { // setup list + GtkTreeView *list = GTK_TREE_VIEW(GetWidget("channels")); + GtkTreeViewColumn *col = gtk_tree_view_column_new(); + gtk_tree_view_append_column(list, col); + GtkCellRenderer *renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_column_pack_start(col, renderer, TRUE); + gtk_tree_view_column_add_attribute(col, renderer, "text", 0); + GtkListStore *liststore = gtk_list_store_new(1, G_TYPE_STRING); + gtk_tree_view_set_model(list, GTK_TREE_MODEL(liststore)); + g_object_unref(liststore); + } + + { // initialize file selector + GtkFileFilter *filter; + filesel = gtk_file_chooser_dialog_new("Open File", GTK_WINDOW(win), GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "Streamable files (wav/aif/mp3/mp2/mp1/ogg)"); + regcomp(&fregex[0], "\\.(mp[1-3]|ogg|wav|aif)$", REG_ICASE | REG_NOSUB | REG_EXTENDED); + gtk_file_filter_add_custom(filter, GTK_FILE_FILTER_FILENAME, FileExtensionFilter, &fregex[0], NULL); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "MOD music files (mo3/xm/mod/s3m/it/mtm/umx)"); + regcomp(&fregex[1], "\\.(mo3|xm|mod|s3m|it|umx)$", REG_ICASE | REG_NOSUB | REG_EXTENDED); + gtk_file_filter_add_custom(filter, GTK_FILE_FILTER_FILENAME, FileExtensionFilter, &fregex[1], NULL); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "All files"); + gtk_file_filter_add_pattern(filter, "*"); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + } + + g_timeout_add(TIMERPERIOD, Update, NULL); + + UpdateButtons(); + + gtk_main(); + + gtk_widget_destroy(filesel); + regfree(&fregex[0]); + regfree(&fregex[1]); + + BASS_Free(); // close output + + return 0; +} diff --git a/bass-sys/linux/bass24/3dtest/3dtest.glade b/bass-sys/linux/bass24/3dtest/3dtest.glade new file mode 100644 index 0000000..9cb02f1 --- /dev/null +++ b/bass-sys/linux/bass24/3dtest/3dtest.glade @@ -0,0 +1,334 @@ + + + + + True + 5 + BASS - 3D test + False + GTK_WIN_POS_CENTER + + + + True + 5 + + + True + 5 + + + True + 0 + GTK_SHADOW_OUT + + + True + 5 + 5 + 5 + + + True + 5 + + + 200 + True + True + False + True + + + + + True + 5 + True + + + True + True + True + Add... + 0 + + + + + + True + True + True + Remove + 0 + + + + 1 + + + + + False + False + 1 + + + + + True + 5 + True + + + True + True + True + Play + 0 + + + + + + True + True + True + Stop + 0 + + + + 1 + + + + + False + False + 2 + + + + + + + + + True + Channels + True + + + label_item + + + + + + + True + 0 + GTK_SHADOW_OUT + + + True + 5 + 5 + 5 + + + True + 5 + + + True + x: + + + + + True + True + 0 0 100 1 10 0 + True + + + + 1 + + + + + True + z: + + + 2 + + + + + True + True + 0 0 100 1 10 0 + True + + + + 3 + + + + + True + True + True + Reset + 0 + + + + 4 + + + + + + + + + True + Movement + True + + + label_item + + + + + 1 + + + + + + + True + 5 + + + True + 0 + GTK_SHADOW_OUT + + + True + 5 + 5 + 5 + + + 200 + 200 + True + + + + + + + True + True + + + label_item + + + + + + + True + 0 + GTK_SHADOW_OUT + + + True + 5 + 5 + 5 + + + True + True + 10 0 20 1 10 0 + False + + + + + + + + True + Rolloff factor + True + + + label_item + + + + + 1 + + + + + True + 0 + GTK_SHADOW_OUT + + + True + 5 + 5 + 5 + + + True + True + 10 0 20 1 10 0 + False + + + + + + + + True + Doppler factor + True + + + label_item + + + + + 2 + + + + + 1 + + + + + + diff --git a/bass-sys/linux/bass24/3dtest/makefile b/bass-sys/linux/bass24/3dtest/makefile new file mode 100644 index 0000000..9f1b4cd --- /dev/null +++ b/bass-sys/linux/bass24/3dtest/makefile @@ -0,0 +1,9 @@ +TARGET = 3dtest +PACKAGES = gtk+-2.0 libglade-2.0 + +include ../makefile.in + +all: $(TARGET) + +clean: + $(RM) $(TARGET) diff --git a/bass-sys/bass24/bass.chm b/bass-sys/linux/bass24/bass.chm similarity index 100% rename from bass-sys/bass24/bass.chm rename to bass-sys/linux/bass24/bass.chm diff --git a/bass-sys/bass24/c/bass.h b/bass-sys/linux/bass24/bass.h similarity index 100% rename from bass-sys/bass24/c/bass.h rename to bass-sys/linux/bass24/bass.h diff --git a/bass-sys/bass24/bass.txt b/bass-sys/linux/bass24/bass.txt similarity index 100% rename from bass-sys/bass24/bass.txt rename to bass-sys/linux/bass24/bass.txt diff --git a/bass-sys/linux/bass24/basstest/basstest.c b/bass-sys/linux/bass24/basstest/basstest.c new file mode 100644 index 0000000..66f66d4 --- /dev/null +++ b/bass-sys/linux/bass24/basstest/basstest.c @@ -0,0 +1,294 @@ +/* + BASS simple playback test + Copyright (c) 1999-2012 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include +#include "bass.h" + +// path to glade file +#ifndef GLADE_PATH +#define GLADE_PATH "" +#endif + +GladeXML *glade; +GtkWidget *win = 0; +GtkWidget *filesel; + +// display error messages +void Error(const char *es) +{ + GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); +} + +#define GetWidget(id) glade_xml_get_widget(glade,id) + +void AddListEntry(const char *list, DWORD handle, const char *text) +{ + GtkTreeView *tree = GTK_TREE_VIEW(GetWidget(list)); + GtkListStore *tm = GTK_LIST_STORE(gtk_tree_view_get_model(tree)); + GtkTreeIter it; + gtk_list_store_append(tm, &it); + gtk_list_store_set(tm, &it, 0, text, 1, handle, -1); +} + +DWORD GetSelectedHandle(int mode) +{ + DWORD handle; + char list[10]; + GtkTreeSelection *ts; + GtkTreeModel *tm; + GtkTreeIter it; + sprintf(list, "list%d", mode); + ts = gtk_tree_view_get_selection(GTK_TREE_VIEW(GetWidget(list))); + if (!gtk_tree_selection_get_selected(ts, &tm, &it)) return 0; + gtk_tree_model_get(tm, &it, 1, &handle, -1); + return handle; +} + +void WindowDestroy(GtkObject *obj, gpointer data) +{ + gtk_main_quit(); +} + +gboolean FileExtensionFilter(const GtkFileFilterInfo *info, gpointer data) +{ + return !regexec((regex_t*)data, info->filename, 0, NULL, 0); +} + +void AddClicked(GtkButton *obj, gpointer data) +{ + int resp = gtk_dialog_run(GTK_DIALOG(filesel)); + gtk_widget_hide(filesel); + if (resp == GTK_RESPONSE_ACCEPT) { + char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filesel)); + const gchar *objname = gtk_widget_get_name(GTK_WIDGET(obj)); + int mode = atoi(objname + 3); // get mode from button name ("addX") + switch (mode) { + case 1: // add a stream + { + HSTREAM handle; + if (handle = BASS_StreamCreateFile(FALSE, file, 0, 0, 0)) + AddListEntry("list1", handle, strrchr(file, '/') + 1); + else + Error("Can't open stream"); + } + break; + case 2: // add a music + { + HMUSIC handle; + if (handle = BASS_MusicLoad(FALSE, file, 0, 0, BASS_MUSIC_RAMP, 1)) + AddListEntry("list2", handle, strrchr(file, '/') + 1); + else + Error("Can't load music"); + } + break; + case 3: // add a sample + { + HSAMPLE sam; + /* load a sample from "file" and give it a max of 3 simultaneous + playings using playback position as override decider */ + if (sam = BASS_SampleLoad(FALSE, file, 0, 0, 3, BASS_SAMPLE_OVER_POS)) + AddListEntry("list3", sam, strrchr(file, '/') + 1); + else + Error("Can't load sample"); + } + break; + } + g_free(file); + } +} + +void RemoveClicked(GtkButton *obj, gpointer data) +{ + const gchar *objname = gtk_widget_get_name(GTK_WIDGET(obj)); + int mode = atoi(objname + 6); // get mode from button name ("removeX") + char list[10]; + sprintf(list, "list%d", mode); // associated list name + GtkTreeView *tree = GTK_TREE_VIEW(GetWidget(list)); + GtkTreeSelection *ts = gtk_tree_view_get_selection(tree); + GtkTreeModel *tm; + GtkTreeIter it; + if (gtk_tree_selection_get_selected(ts, &tm, &it)) { + DWORD handle; + gtk_tree_model_get(tm, &it, 1, &handle, -1); + switch (mode) { + case 1: + BASS_StreamFree(handle); // free stream + break; + case 2: + BASS_MusicFree(handle); // free MOD music + break; + case 3: + BASS_SampleFree(handle); // free sample + break; + } + gtk_list_store_remove(GTK_LIST_STORE(tm), &it); // remove list entry + } +} + +void PlayClicked(GtkButton *obj, gpointer data) +{ + DWORD handle; + const gchar *objname = gtk_widget_get_name(GTK_WIDGET(obj)); + int mode = atoi(objname + 4); // get mode from button name ("playX") + handle = GetSelectedHandle(mode); // get selected stream/music/sample handle + if (mode == 3) { // sample: get a channel and set volume=50% and pan=random + handle = BASS_SampleGetChannel(handle, FALSE); + BASS_ChannelSetAttribute(handle, BASS_ATTRIB_VOL, 0.5f); + BASS_ChannelSetAttribute(handle, BASS_ATTRIB_PAN, ((rand() % 201) - 100) / 100.f); + } + if (!BASS_ChannelPlay(handle, FALSE)) // play it + Error("Can't play channel"); +} + +void StopClicked(GtkButton *obj, gpointer data) +{ + DWORD handle; + const gchar *objname = gtk_widget_get_name(GTK_WIDGET(obj)); + int mode = atoi(objname + 4); // get mode from button name ("playX") + handle = GetSelectedHandle(mode); // get selected stream/music/sample handle + BASS_ChannelStop(handle); // stop it +} + +void RestartClicked(GtkButton *obj, gpointer data) +{ + DWORD handle; + const gchar *objname = gtk_widget_get_name(GTK_WIDGET(obj)); + int mode = atoi(objname + 7); // get mode from button name ("restartX") + handle = GetSelectedHandle(mode); // get selected stream/music/sample handle + if (!BASS_ChannelPlay(handle, TRUE)) // restart it + Error("Can't play channel"); +} + +void GVolumeChanged(GtkRange *range, gpointer data) +{ + const gchar *objname = gtk_widget_get_name(GTK_WIDGET(range)); + int mode = atoi(objname + 7); // get mode from name ("gvolumeX") + double value = gtk_range_get_value(range); + switch (mode) { + case 1: + BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, value * 100); // global stream volume (0-10000) + break; + case 2: + BASS_SetConfig(BASS_CONFIG_GVOL_MUSIC, value * 100); // global MOD volume (0-10000) + break; + case 3: + BASS_SetConfig(BASS_CONFIG_GVOL_SAMPLE, value * 100); // global sample volume (0-10000) + break; + } +} + +void VolumeChanged(GtkRange *range, gpointer data) +{ + double value = gtk_range_get_value(range); + BASS_SetVolume(value / 100.f); // output volume (0-1) +} + +void StopAllClicked(GtkButton *obj, gpointer data) +{ + BASS_Pause(); // pause output +} + +void ResumeAllClicked(GtkButton *obj, gpointer data) +{ + BASS_Start(); // resume output +} + +void ThreadsToggled(GtkToggleButton *obj, gpointer data) +{ + BASS_SetConfig(BASS_CONFIG_UPDATETHREADS, obj->active ? 2 : 1); // set 1 or 2 update threads +} + +gboolean TimerProc(gpointer data) +{ // update the CPU usage % display + char text[16]; + sprintf(text, "CPU%% %.2f", BASS_GetCPU()); + gtk_label_set_text(GTK_LABEL(GetWidget("cpu")), text); + return TRUE; +} + +int main(int argc, char* argv[]) +{ + regex_t fregex[2]; + + gtk_init(&argc, &argv); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + Error("An incorrect version of BASS was loaded"); + return 0; + } + + // initialize default output device + if (!BASS_Init(-1, 44100, 0, NULL, NULL)) { + Error("Can't initialize device"); + return 0; + } + + // initialize GUI + glade = glade_xml_new(GLADE_PATH"basstest.glade", NULL, NULL); + if (!glade) return 0; + win = GetWidget("window1"); + if (!win) return 0; + glade_xml_signal_autoconnect(glade); + + { // setup lists + int a; + for (a = 1; a <= 3; a++) { + char name[8]; + sprintf(name, "list%d", a); + GtkTreeView *list = GTK_TREE_VIEW(GetWidget(name)); + GtkTreeViewColumn *col = gtk_tree_view_column_new(); + gtk_tree_view_append_column(list, col); + GtkCellRenderer *renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_column_pack_start(col, renderer, TRUE); + gtk_tree_view_column_add_attribute(col, renderer, "text", 0); + GtkListStore *liststore = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); + gtk_tree_view_set_model(list, GTK_TREE_MODEL(liststore)); + g_object_unref(liststore); + } + } + + // initialize volume slider + gtk_range_set_value(GTK_RANGE(GetWidget("volume")), BASS_GetVolume() * 100); + + { // initialize file selector + GtkFileFilter *filter; + filesel = gtk_file_chooser_dialog_new("Open File", GTK_WINDOW(win), GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "Streamable files (wav/aif/mp3/mp2/mp1/ogg)"); + regcomp(&fregex[0], "\\.(mp[1-3]|ogg|wav|aif)$", REG_ICASE | REG_NOSUB | REG_EXTENDED); + gtk_file_filter_add_custom(filter, GTK_FILE_FILTER_FILENAME, FileExtensionFilter, &fregex[0], NULL); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "MOD music files (mo3/xm/mod/s3m/it/mtm/umx)"); + regcomp(&fregex[1], "\\.(mo3|xm|mod|s3m|it|umx)$", REG_ICASE | REG_NOSUB | REG_EXTENDED); + gtk_file_filter_add_custom(filter, GTK_FILE_FILTER_FILENAME, FileExtensionFilter, &fregex[1], NULL); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "All files"); + gtk_file_filter_add_pattern(filter, "*"); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + } + + g_timeout_add(500, TimerProc, NULL); + + gtk_main(); + + gtk_widget_destroy(filesel); + regfree(&fregex[0]); + regfree(&fregex[1]); + + BASS_Free(); // close output + + return 0; +} diff --git a/bass-sys/linux/bass24/basstest/basstest.glade b/bass-sys/linux/bass24/basstest/basstest.glade new file mode 100644 index 0000000..5d3397b --- /dev/null +++ b/bass-sys/linux/bass24/basstest/basstest.glade @@ -0,0 +1,580 @@ + + + + + True + 5 + BASS - simple playback test + False + GTK_WIN_POS_CENTER + + + + True + 5 + + + True + 5 + True + + + True + 0 + GTK_SHADOW_OUT + + + True + 5 + 5 + 5 + + + True + 5 + + + 200 + True + True + False + True + + + + + True + 5 + True + + + True + True + True + Play + 0 + + + + + + True + True + True + Stop + 0 + + + + 1 + + + + + True + True + True + Restart + 0 + + + + 2 + + + + + False + False + 1 + + + + + True + 5 + True + + + True + True + True + Add.. + 0 + + + + + + True + True + True + Remove + 0 + + + + 1 + + + + + False + False + 2 + + + + + True + + + True + 0 + global volume: + + + + + True + True + 100 0 100 1 10 0 + False + + + + 1 + + + + + False + False + 3 + + + + + + + + + True + Stream + True + + + label_item + + + + + + + True + 0 + GTK_SHADOW_OUT + + + True + 5 + 5 + 5 + + + True + 5 + + + 200 + True + True + False + True + + + + + True + 5 + True + + + True + True + True + Play + 0 + + + + + + True + True + True + Stop + 0 + + + + 1 + + + + + True + True + True + Restart + 0 + + + + 2 + + + + + False + False + 1 + + + + + True + 5 + True + + + True + True + True + Add.. + 0 + + + + + + True + True + True + Remove + 0 + + + + 1 + + + + + False + False + 2 + + + + + True + + + True + 0 + global volume: + + + + + True + True + 100 0 100 1 10 0 + False + + + + 1 + + + + + False + False + 3 + + + + + + + + + True + MOD Music + True + + + label_item + + + + + 1 + + + + + True + 0 + GTK_SHADOW_OUT + + + True + 5 + 5 + 5 + + + True + 5 + + + 200 + True + True + False + True + + + + + True + 5 + True + + + True + True + True + Play + 0 + + + + + + False + False + 1 + + + + + True + 5 + True + + + True + True + True + Add.. + 0 + + + + + + True + True + True + Remove + 0 + + + + 1 + + + + + False + False + 2 + + + + + True + + + True + 0 + global volume: + + + + + True + True + 100 0 100 1 10 0 + False + + + + 1 + + + + + False + False + 3 + + + + + + + + + True + Sample + True + + + label_item + + + + + 2 + + + + + + + True + 10 + + + True + 10 + True + + + True + True + True + Stop Output + 0 + + + + False + + + + + True + True + True + Resume + 0 + + + + False + 1 + + + + + False + False + + + + + True + + + True + 0 + volume: + + + False + False + + + + + True + True + 0 0 100 1 10 0 + False + + + + False + False + 1 + + + + + 1 + + + + + True + 5 + + + True + True + 2 update threads + 0 + True + + + + False + False + + + + + True + PANGO_WRAP_WORD_CHAR + PANGO_ELLIPSIZE_END + + + False + False + 1 + + + + + False + False + 2 + + + + + False + False + 1 + + + + + + diff --git a/bass-sys/linux/bass24/basstest/makefile b/bass-sys/linux/bass24/basstest/makefile new file mode 100644 index 0000000..996bde7 --- /dev/null +++ b/bass-sys/linux/bass24/basstest/makefile @@ -0,0 +1,9 @@ +TARGET = basstest +PACKAGES = gtk+-2.0 libglade-2.0 + +include ../makefile.in + +all: $(TARGET) + +clean: + $(RM) $(TARGET) diff --git a/bass-sys/bass24/c/contest/contest.c b/bass-sys/linux/bass24/contest/contest.c similarity index 100% rename from bass-sys/bass24/c/contest/contest.c rename to bass-sys/linux/bass24/contest/contest.c diff --git a/bass-sys/linux/bass24/contest/makefile b/bass-sys/linux/bass24/contest/makefile new file mode 100644 index 0000000..72ed37c --- /dev/null +++ b/bass-sys/linux/bass24/contest/makefile @@ -0,0 +1,8 @@ +TARGET = contest + +include ../makefile.in + +all: $(TARGET) + +clean: + $(RM) $(TARGET) diff --git a/bass-sys/linux/bass24/custloop/custloop.c b/bass-sys/linux/bass24/custloop/custloop.c new file mode 100644 index 0000000..0069917 --- /dev/null +++ b/bass-sys/linux/bass24/custloop/custloop.c @@ -0,0 +1,271 @@ +/* + BASS custom looping example + Copyright (c) 2004-2014 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include +#include +#include "bass.h" + +#define WIDTH 600 // display width +#define HEIGHT 201 // height (odd number for centre line) + +#pragma pack(1) +typedef struct { + BYTE rgbRed, rgbGreen, rgbBlue; +} RGB; +#pragma pack() + +GtkWidget *win = 0; +GThread *scanthread = 0; +BOOL killscan = FALSE; + +DWORD chan; +DWORD bpp; // bytes per pixel +QWORD loop[2] = { 0 }; // loop start & end +HSYNC lsync; // looping sync + +GtkWidget *waveda; +GdkPixbuf *wavepb; +RGB palette[HEIGHT / 2 + 1]; + +// display error messages +void Error(const char *es) +{ + GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); +} + +void WindowDestroy(GtkObject *obj, gpointer data) +{ + gtk_main_quit(); +} + +void CALLBACK LoopSyncProc(HSYNC handle, DWORD channel, DWORD data, void *user) +{ + if (!BASS_ChannelSetPosition(channel, loop[0], BASS_POS_BYTE)) // try seeking to loop start + BASS_ChannelSetPosition(channel, 0, BASS_POS_BYTE); // failed, go to start of file instead +} + +void SetLoopStart(QWORD pos) +{ + loop[0] = pos; +} + +void SetLoopEnd(QWORD pos) +{ + loop[1] = pos; + BASS_ChannelRemoveSync(chan, lsync); // remove old sync + lsync = BASS_ChannelSetSync(chan, BASS_SYNC_POS | BASS_SYNC_MIXTIME, loop[1], LoopSyncProc, 0); // set new sync +} + +// scan the peaks +void *ScanPeaks(void *p) +{ + DWORD decoder = (uintptr_t)p; + RGB *wavebuf = (RGB*)gdk_pixbuf_get_pixels(wavepb); + DWORD pos = 0; + float spp = BASS_ChannelBytes2Seconds(decoder, bpp); // seconds per pixel + while (!killscan) { + float peak[2]; + if (spp > 1) { // more than 1 second per pixel, break it down... + float todo = spp; + peak[1] = peak[0] = 0; + do { + float level[2], step = (todo < 1 ? todo : 1); + BASS_ChannelGetLevelEx(decoder, level, step, BASS_LEVEL_STEREO); // scan peaks + if (peak[0] < level[0]) peak[0] = level[0]; + if (peak[1] < level[1]) peak[1] = level[1]; + todo -= step; + } while (todo > 0); + } else + BASS_ChannelGetLevelEx(decoder, peak, spp, BASS_LEVEL_STEREO); // scan peaks + { + DWORD a; + for (a = 0; a < peak[0] * (HEIGHT / 2); a++) + wavebuf[(HEIGHT / 2 - 1 - a) * WIDTH + pos] = palette[1 + a]; // draw left peak + for (a = 0; a < peak[1] * (HEIGHT / 2); a++) + wavebuf[(HEIGHT / 2 + 1 + a) * WIDTH + pos] = palette[1 + a]; // draw right peak + } + pos++; + if (pos >= WIDTH) break; // reached end of display + if (!BASS_ChannelIsActive(decoder)) break; // reached end of channel + } + if (!killscan) { + DWORD size; + BASS_ChannelSetPosition(decoder, (QWORD)-1, BASS_POS_BYTE | BASS_POS_SCAN); // build seek table (scan to end) + size = BASS_ChannelGetAttributeEx(decoder, BASS_ATTRIB_SCANINFO, 0, 0); // get seek table size + if (size) { // got it + void *info = malloc(size); // allocate a buffer + BASS_ChannelGetAttributeEx(decoder, BASS_ATTRIB_SCANINFO, info, size); // get the seek table + BASS_ChannelSetAttributeEx(chan, BASS_ATTRIB_SCANINFO, info, size); // apply it to the playback channel + free(info); + } + } + BASS_StreamFree(decoder); // free the decoder + return NULL; +} + +gboolean FileExtensionFilter(const GtkFileFilterInfo *info, gpointer data) +{ + return !regexec((regex_t*)data, info->filename, 0, NULL, 0); +} + +// select a file to play, and start scanning it +BOOL PlayFile() +{ + BOOL ret = FALSE; + regex_t fregex; + GtkWidget *filesel; // file selector + GtkFileFilter *filter; + filesel = gtk_file_chooser_dialog_new("Open File", GTK_WINDOW(win), GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "Playable files"); + regcomp(&fregex, "\\.(mo3|xm|mod|s3m|it|umx|mp[1-3]|ogg|wav|aif)$", REG_ICASE | REG_NOSUB | REG_EXTENDED); + gtk_file_filter_add_custom(filter, GTK_FILE_FILTER_FILENAME, FileExtensionFilter, &fregex, NULL); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "All files"); + gtk_file_filter_add_pattern(filter, "*"); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + if (gtk_dialog_run(GTK_DIALOG(filesel)) == GTK_RESPONSE_ACCEPT) { + char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filesel)); + gtk_widget_hide(filesel); + if (!(chan = BASS_StreamCreateFile(FALSE, file, 0, 0, 0)) + && !(chan = BASS_MusicLoad(FALSE, file, 0, 0, BASS_MUSIC_RAMP | BASS_MUSIC_POSRESET | BASS_MUSIC_PRESCAN, 1))) { + Error("Can't play file"); + } else { + // create the bitmap + wavepb = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, WIDTH, HEIGHT); + { // setup palette + RGB *pal = (RGB*)palette; + int a; + memset(palette, 0, sizeof(palette)); + for (a = 1; a <= HEIGHT / 2; a++) { + pal[a].rgbRed = (255 * a) / (HEIGHT / 2); + pal[a].rgbGreen = 255 - pal[a].rgbRed; + } + } + bpp = BASS_ChannelGetLength(chan, BASS_POS_BYTE) / WIDTH; // bytes per pixel + { + DWORD bpp1 = BASS_ChannelSeconds2Bytes(chan, 0.001); // minimum 1ms per pixel + if (bpp < bpp1) bpp = bpp1; + } + BASS_ChannelSetSync(chan, BASS_SYNC_END | BASS_SYNC_MIXTIME, 0, LoopSyncProc, 0); // set sync to loop at end + BASS_ChannelPlay(chan, FALSE); // start playing + { // create another channel to scan + DWORD chan2 = BASS_StreamCreateFile(FALSE, file, 0, 0, BASS_STREAM_DECODE); + if (!chan2) chan2 = BASS_MusicLoad(FALSE, file, 0, 0, BASS_MUSIC_DECODE, 1); +#if GLIB_CHECK_VERSION(2,32,0) + scanthread = g_thread_new(NULL, ScanPeaks, (void*)(uintptr_t)chan2); // start scanning in a new thread +#else + scanthread = g_thread_create(ScanPeaks, (void*)(uintptr_t)chan2, TRUE, NULL); // start scanning in a new thread +#endif + } + ret = TRUE; + } + g_free(file); + } + gtk_widget_destroy(filesel); + return ret; +} + +void WindowButtonRelease(GtkWidget *obj, GdkEventButton *event, gpointer data) +{ + if (event->type == GDK_BUTTON_RELEASE) { + if (event->button == 1) // set loop start + SetLoopStart(event->x * bpp); + else if (event->button == 3) // set loop end + SetLoopEnd(event->x * bpp); + } +} + +void DrawTimeLine(QWORD pos, DWORD col, DWORD y) +{ + GdkGC *gc = waveda->style->fg_gc[GTK_WIDGET_STATE(waveda)]; + DWORD wpos = pos / bpp; + GdkColor c = { 0,(col & 0xff) << 8,col & 0xff00,(col >> 8) & 0xff00 }; + gdk_gc_set_rgb_fg_color(gc, &c); + gdk_draw_line(waveda->window, gc, wpos, 0, wpos, HEIGHT); +} + +gboolean AreaExpose(GtkWidget *widget, GdkEventExpose *event, gpointer user) +{ + GdkGC *gc = widget->style->fg_gc[GTK_WIDGET_STATE(waveda)]; + GdkGCValues gcsave; + gdk_gc_get_values(gc, &gcsave); + gdk_draw_pixbuf(widget->window, gc, wavepb, 0, 0, 0, 0, -1, -1, GDK_RGB_DITHER_NONE, 0, 0); + DrawTimeLine(loop[0], 0xffff00, 12); // loop start + DrawTimeLine(loop[1], 0x00ffff, 24); // loop end + DrawTimeLine(BASS_ChannelGetPosition(chan, BASS_POS_BYTE), 0xffffff, 0); // current pos + gdk_gc_set_values(gc, &gcsave, GDK_GC_FOREGROUND); + return FALSE; +} + +gboolean TimerProc(gpointer data) +{ + // refresh window + gtk_widget_queue_draw(waveda); + return TRUE; +} + +int main(int argc, char* argv[]) +{ +#if !GLIB_CHECK_VERSION(2,32,0) + g_thread_init(NULL); +#endif + gtk_init(&argc, &argv); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + Error("An incorrect version of BASS was loaded"); + return 0; + } + + // initialize BASS + if (!BASS_Init(-1, 44100, 0, win, NULL)) { + Error("Can't initialize device"); + return 0; + } + if (!PlayFile()) { // start a file playing + BASS_Free(); + return 0; + } + + // create the window + win = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_CENTER); + gtk_window_set_resizable(GTK_WINDOW(win), FALSE); + gtk_window_set_title(GTK_WINDOW(win), "BASS custom looping example (left-click to set loop start, right-click to set end)"); + g_signal_connect(win, "destroy", GTK_SIGNAL_FUNC(WindowDestroy), NULL); + + GtkWidget *ebox = gtk_event_box_new(); + gtk_container_add(GTK_CONTAINER(win), ebox); + g_signal_connect(ebox, "button-release-event", GTK_SIGNAL_FUNC(WindowButtonRelease), NULL); + + waveda = gtk_drawing_area_new(); + gtk_widget_set_size_request(waveda, WIDTH, HEIGHT); + gtk_container_add(GTK_CONTAINER(ebox), waveda); + g_signal_connect(waveda, "expose-event", GTK_SIGNAL_FUNC(AreaExpose), NULL); + + // setup update timer (10hz) + g_timeout_add(100, TimerProc, NULL); + + gtk_widget_show_all(win); + gtk_main(); + + killscan = TRUE; + g_thread_join(scanthread); // wait for the scan thread + + g_object_unref(wavepb); + + BASS_Free(); + return 0; +} diff --git a/bass-sys/linux/bass24/custloop/makefile b/bass-sys/linux/bass24/custloop/makefile new file mode 100644 index 0000000..afbd218 --- /dev/null +++ b/bass-sys/linux/bass24/custloop/makefile @@ -0,0 +1,9 @@ +TARGET = custloop +PACKAGES = gtk+-2.0 gthread-2.0 + +include ../makefile.in + +all: $(TARGET) + +clean: + $(RM) $(TARGET) diff --git a/bass-sys/bass24/c/devlist/devlist.c b/bass-sys/linux/bass24/devlist/devlist.c similarity index 100% rename from bass-sys/bass24/c/devlist/devlist.c rename to bass-sys/linux/bass24/devlist/devlist.c diff --git a/bass-sys/linux/bass24/devlist/makefile b/bass-sys/linux/bass24/devlist/makefile new file mode 100644 index 0000000..a2a5cb7 --- /dev/null +++ b/bass-sys/linux/bass24/devlist/makefile @@ -0,0 +1,8 @@ +TARGET = devlist + +include ../makefile.in + +all: $(TARGET) + +clean: + $(RM) $(TARGET) diff --git a/bass-sys/linux/bass24/dsptest/dsptest.c b/bass-sys/linux/bass24/dsptest/dsptest.c new file mode 100644 index 0000000..7c006e0 --- /dev/null +++ b/bass-sys/linux/bass24/dsptest/dsptest.c @@ -0,0 +1,250 @@ +/* + BASS simple DSP test + Copyright (c) 2000-2017 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include +#include "bass.h" + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + +// path to glade file +#ifndef GLADE_PATH +#define GLADE_PATH "" +#endif + +GladeXML *glade; +GtkWidget *win = 0; +GtkWidget *filesel; + +DWORD chan; // the channel... HMUSIC or HSTREAM + +// display error messages +void Error(const char *es) +{ + GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); +} + +// "rotate" +HDSP rotdsp = 0; // DSP handle +float rotpos; // cur.pos +void CALLBACK Rotate(HDSP handle, DWORD channel, void *buffer, DWORD length, void *user) +{ + float *d = (float*)buffer; + DWORD a; + + for (a = 0; a < length / 4; a += 2) { + d[a] *= fabs(sin(rotpos)); + d[a + 1] *= fabs(cos(rotpos)); + rotpos += 0.00003; + } + rotpos = fmod(rotpos, 2 * M_PI); +} + +// "echo" +HDSP echdsp = 0; // DSP handle +#define ECHBUFLEN 1200 // buffer length +float echbuf[ECHBUFLEN][2]; // buffer +int echpos; // cur.pos +void CALLBACK Echo(HDSP handle, DWORD channel, void *buffer, DWORD length, void *user) +{ + float *d = (float*)buffer; + DWORD a; + + for (a = 0; a < length / 4; a += 2) { + float l = d[a] + (echbuf[echpos][1] / 2); + float r = d[a + 1] + (echbuf[echpos][0] / 2); +#if 1 // 0=echo, 1=basic "bathroom" reverb + echbuf[echpos][0] = d[a] = l; + echbuf[echpos][1] = d[a + 1] = r; +#else + echbuf[echpos][0] = d[a]; + echbuf[echpos][1] = d[a + 1]; + d[a] = l; + d[a + 1] = r; +#endif + echpos++; + if (echpos == ECHBUFLEN) echpos = 0; + } +} + +// "flanger" +HDSP fladsp = 0; // DSP handle +#define FLABUFLEN 350 // buffer length +float flabuf[FLABUFLEN][2]; // buffer +int flapos; // cur.pos +float flas, flasinc; // sweep pos/increment +void CALLBACK Flange(HDSP handle, DWORD channel, void *buffer, DWORD length, void *user) +{ + float *d = (float*)buffer; + DWORD a; + + for (a = 0; a < length / 4; a += 2) { + int p1 = (flapos + (int)flas) % FLABUFLEN; + int p2 = (p1 + 1) % FLABUFLEN; + float f = flas - (int)flas; + float s; + + s = (d[a] + ((flabuf[p1][0] * (1 - f)) + (flabuf[p2][0] * f))) * 0.7; + flabuf[flapos][0] = d[a]; + d[a] = s; + + s = (d[a + 1] + ((flabuf[p1][1] * (1 - f)) + (flabuf[p2][1] * f))) * 0.7; + flabuf[flapos][1] = d[a + 1]; + d[a + 1] = s; + + flapos++; + if (flapos == FLABUFLEN) flapos = 0; + flas += flasinc; + if (flas<0 || flas>FLABUFLEN - 1) { + flasinc = -flasinc; + flas += flasinc; + } + } +} + +#define GetWidget(id) glade_xml_get_widget(glade,id) + +void WindowDestroy(GtkObject *obj, gpointer data) +{ + gtk_main_quit(); +} + +void RotateToggled(GtkToggleButton *obj, gpointer data) +{ // toggle "rotate" + if (obj->active) { + rotpos = M_PI / 4; + rotdsp = BASS_ChannelSetDSP(chan, &Rotate, 0, 2); + } else + BASS_ChannelRemoveDSP(chan, rotdsp); +} + +void EchoToggled(GtkToggleButton *obj, gpointer data) +{ // toggle "echo" + if (obj->active) { + memset(echbuf, 0, sizeof(echbuf)); + echpos = 0; + echdsp = BASS_ChannelSetDSP(chan, &Echo, 0, 1); + } else + BASS_ChannelRemoveDSP(chan, echdsp); +} + +void FlangerToggled(GtkToggleButton *obj, gpointer data) +{ // toggle "flanger" + if (obj->active) { + memset(flabuf, 0, sizeof(flabuf)); + flapos = 0; + flas = FLABUFLEN / 2; + flasinc = 0.002f; + fladsp = BASS_ChannelSetDSP(chan, &Flange, 0, 0); + } else + BASS_ChannelRemoveDSP(chan, fladsp); +} + +gboolean FileExtensionFilter(const GtkFileFilterInfo *info, gpointer data) +{ + return !regexec((regex_t*)data, info->filename, 0, NULL, 0); +} + +void OpenClicked(GtkButton *obj, gpointer data) +{ + int resp = gtk_dialog_run(GTK_DIALOG(filesel)); + gtk_widget_hide(filesel); + if (resp == GTK_RESPONSE_ACCEPT) { + char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filesel)); + // free both MOD and stream, it must be one of them! :) + BASS_MusicFree(chan); + BASS_StreamFree(chan); + if (!(chan = BASS_StreamCreateFile(FALSE, file, 0, 0, BASS_SAMPLE_LOOP | BASS_SAMPLE_FLOAT)) + && !(chan = BASS_MusicLoad(FALSE, file, 0, 0, BASS_MUSIC_RAMPS | BASS_SAMPLE_LOOP | BASS_SAMPLE_FLOAT, 1))) { + // whatever it is, it ain't playable + gtk_button_set_label(obj, "click here to open a file..."); + Error("Can't play the file"); + } else { + BASS_CHANNELINFO info; + BASS_ChannelGetInfo(chan, &info); + if (info.chans != 2) { // the DSP expects stereo + gtk_button_set_label(obj, "click here to open a file..."); + BASS_MusicFree(chan); + BASS_StreamFree(chan); + Error("only stereo sources are supported"); + } else { + gtk_button_set_label(obj, file); + // setup DSPs on new channel and play it + RotateToggled(GTK_TOGGLE_BUTTON(GetWidget("rotate")), 0); + EchoToggled(GTK_TOGGLE_BUTTON(GetWidget("echo")), 0); + FlangerToggled(GTK_TOGGLE_BUTTON(GetWidget("flanger")), 0); + BASS_ChannelPlay(chan, FALSE); + } + } + g_free(file); + } +} + +int main(int argc, char* argv[]) +{ + regex_t fregex; + + gtk_init(&argc, &argv); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + Error("An incorrect version of BASS was loaded"); + return 0; + } + + // check for floating-point capability + if (!BASS_GetConfig(BASS_CONFIG_FLOAT)) { + Error("This example requires floating-point support"); + return 0; + } + + // enable floating-point DSP (not really necessary as the channels will be floating-point anyway) + BASS_SetConfig(BASS_CONFIG_FLOATDSP, TRUE); + + // initialize default device + if (!BASS_Init(-1, 44100, 0, NULL, NULL)) { + Error("Can't initialize device"); + return 0; + } + + // initialize GUI + glade = glade_xml_new(GLADE_PATH"dsptest.glade", NULL, NULL); + if (!glade) return 0; + win = GetWidget("window1"); + if (!win) return 0; + glade_xml_signal_autoconnect(glade); + + { // initialize file selector + GtkFileFilter *filter; + filesel = gtk_file_chooser_dialog_new("Open File", GTK_WINDOW(win), GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "Playable files"); + regcomp(&fregex, "\\.(mo3|xm|mod|s3m|it|umx|mp[1-3]|ogg|wav|aif)$", REG_ICASE | REG_NOSUB | REG_EXTENDED); + gtk_file_filter_add_custom(filter, GTK_FILE_FILTER_FILENAME, FileExtensionFilter, &fregex, NULL); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "All files"); + gtk_file_filter_add_pattern(filter, "*"); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + } + + gtk_main(); + + gtk_widget_destroy(filesel); + regfree(&fregex); + + BASS_Free(); + + return 0; +} diff --git a/bass-sys/linux/bass24/dsptest/dsptest.glade b/bass-sys/linux/bass24/dsptest/dsptest.glade new file mode 100644 index 0000000..5df81b1 --- /dev/null +++ b/bass-sys/linux/bass24/dsptest/dsptest.glade @@ -0,0 +1,82 @@ + + + + + 400 + True + 5 + BASS simple DSP test + False + GTK_WIN_POS_CENTER + + + + True + 10 + + + True + True + True + click here to open a file... + 0 + + + + False + + + + + True + + + True + True + rotate + 0 + True + + + + False + + + + + True + True + echo + 0 + True + + + + False + 1 + + + + + True + True + flanger + 0 + True + + + + False + 2 + + + + + False + 1 + + + + + + diff --git a/bass-sys/linux/bass24/dsptest/makefile b/bass-sys/linux/bass24/dsptest/makefile new file mode 100644 index 0000000..6a27a69 --- /dev/null +++ b/bass-sys/linux/bass24/dsptest/makefile @@ -0,0 +1,9 @@ +TARGET = dsptest +PACKAGES = gtk+-2.0 libglade-2.0 + +include ../makefile.in + +all: $(TARGET) + +clean: + $(RM) $(TARGET) diff --git a/bass-sys/linux/bass24/fxtest/fxtest.c b/bass-sys/linux/bass24/fxtest/fxtest.c new file mode 100644 index 0000000..a1bbb68 --- /dev/null +++ b/bass-sys/linux/bass24/fxtest/fxtest.c @@ -0,0 +1,191 @@ +/* + BASS DX8 effects test + Copyright (c) 2001-2017 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include +#include +#include "bass.h" + +// path to glade file +#ifndef GLADE_PATH +#define GLADE_PATH "" +#endif + +GladeXML *glade; +GtkWidget *win = 0; +GtkWidget *filesel; + +DWORD floatable = BASS_SAMPLE_FLOAT; // floating-point channel support? + +DWORD chan; // channel handle +DWORD fxchan = 0; // output stream handle +HFX fx[4]; // 3 eq bands + reverb + +// display error messages +void Error(const char *es) +{ + GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); +} + +#define GetWidget(id) glade_xml_get_widget(glade,id) + +void WindowDestroy(GtkObject *obj, gpointer data) +{ + gtk_main_quit(); +} + +void UpdateFX(const char *id) +{ + GtkRange *obj = GTK_RANGE(GetWidget(id)); + double v = gtk_range_get_value(obj); + int b = atoi(id + 2) - 1; + if (b < 3) { + BASS_DX8_PARAMEQ p; + BASS_FXGetParameters(fx[b], &p); + p.fGain = v; + BASS_FXSetParameters(fx[b], &p); + } else { + BASS_DX8_REVERB p; + BASS_FXGetParameters(fx[3], &p); + p.fReverbMix = (v ? log(v / 20.0) * 20 : -96); + BASS_FXSetParameters(fx[3], &p); + } +} + +void SetupFX() +{ + // setup the effects + BASS_DX8_PARAMEQ p; + DWORD ch = fxchan ? fxchan : chan; // set on output stream if enabled, else file stream + fx[0] = BASS_ChannelSetFX(ch, BASS_FX_DX8_PARAMEQ, 0); + fx[1] = BASS_ChannelSetFX(ch, BASS_FX_DX8_PARAMEQ, 0); + fx[2] = BASS_ChannelSetFX(ch, BASS_FX_DX8_PARAMEQ, 0); + fx[3] = BASS_ChannelSetFX(ch, BASS_FX_DX8_REVERB, 0); + p.fGain = 0; + p.fBandwidth = 18; + p.fCenter = 125; + BASS_FXSetParameters(fx[0], &p); + p.fCenter = 1000; + BASS_FXSetParameters(fx[1], &p); + p.fCenter = 8000; + BASS_FXSetParameters(fx[2], &p); + UpdateFX("fx1"); + UpdateFX("fx2"); + UpdateFX("fx3"); + UpdateFX("fx4"); +} + +gboolean FileExtensionFilter(const GtkFileFilterInfo *info, gpointer data) +{ + return !regexec((regex_t*)data, info->filename, 0, NULL, 0); +} + +void OpenClicked(GtkButton *obj, gpointer data) +{ + int resp = gtk_dialog_run(GTK_DIALOG(filesel)); + gtk_widget_hide(filesel); + if (resp == GTK_RESPONSE_ACCEPT) { + char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filesel)); + // free both MOD and stream, it must be one of them! :) + BASS_MusicFree(chan); + BASS_StreamFree(chan); + if (!(chan = BASS_StreamCreateFile(FALSE, file, 0, 0, BASS_SAMPLE_LOOP | floatable)) + && !(chan = BASS_MusicLoad(FALSE, file, 0, 0, BASS_MUSIC_RAMPS | BASS_SAMPLE_LOOP | floatable, 1))) { + // whatever it is, it ain't playable + gtk_button_set_label(obj, "click here to open a file..."); + Error("Can't play the file"); + } else { + gtk_button_set_label(obj, file); + if (!fxchan) SetupFX(); // set effects on file if not using output stream + BASS_ChannelPlay(chan, FALSE); + } + g_free(file); + } +} + +gboolean FXChange(GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data) +{ + UpdateFX(gtk_widget_get_name(GTK_WIDGET(range))); + return FALSE; +} + +void OutputToggled(GtkToggleButton *obj, gpointer data) +{ + // remove current effects + DWORD ch = fxchan ? fxchan : chan; + BASS_ChannelRemoveFX(ch, fx[0]); + BASS_ChannelRemoveFX(ch, fx[1]); + BASS_ChannelRemoveFX(ch, fx[2]); + BASS_ChannelRemoveFX(ch, fx[3]); + if (obj->active) + fxchan = BASS_StreamCreate(0, 0, 0, STREAMPROC_DEVICE, 0); // get device output stream + else + fxchan = 0; // stop using device output stream + SetupFX(); +} + +int main(int argc, char* argv[]) +{ + regex_t fregex; + + gtk_init(&argc, &argv); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + Error("An incorrect version of BASS was loaded"); + return 0; + } + + // check for floating-point capability + if (!BASS_GetConfig(BASS_CONFIG_FLOAT)) { + // no floating-point channel support + floatable = 0; + // enable floating-point (8.24 fixed-point in this case) DSP instead + BASS_SetConfig(BASS_CONFIG_FLOATDSP, TRUE); + } + + // initialize default device + if (!BASS_Init(-1, 44100, 0, NULL, NULL)) { + Error("Can't initialize device"); + return 0; + } + + // initialize GUI + glade = glade_xml_new(GLADE_PATH"fxtest.glade", NULL, NULL); + if (!glade) return 0; + win = GetWidget("window1"); + if (!win) return 0; + glade_xml_signal_autoconnect(glade); + + { // initialize file selector + GtkFileFilter *filter; + filesel = gtk_file_chooser_dialog_new("Open File", GTK_WINDOW(win), GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "Playable files"); + regcomp(&fregex, "\\.(mo3|xm|mod|s3m|it|umx|mp[1-3]|ogg|wav|aif)$", REG_ICASE | REG_NOSUB | REG_EXTENDED); + gtk_file_filter_add_custom(filter, GTK_FILE_FILTER_FILENAME, FileExtensionFilter, &fregex, NULL); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "All files"); + gtk_file_filter_add_pattern(filter, "*"); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + } + + gtk_main(); + + gtk_widget_destroy(filesel); + regfree(&fregex); + + BASS_Free(); + + return 0; +} diff --git a/bass-sys/linux/bass24/fxtest/fxtest.glade b/bass-sys/linux/bass24/fxtest/fxtest.glade new file mode 100644 index 0000000..6b76234 --- /dev/null +++ b/bass-sys/linux/bass24/fxtest/fxtest.glade @@ -0,0 +1,194 @@ + + + + + + 400 + True + 5 + BASS "DX8" effects test + False + center + + + + True + vertical + 10 + + + click here to open a file... + True + True + True + + + + False + 0 + + + + + True + + + True + vertical + + + 100 + True + True + vertical + 0 -10 10 1 10 0 + True + False + 0 + False + + + + 0 + + + + + True + 125 hz + + + 1 + + + + + 0 + + + + + True + vertical + + + 100 + True + True + vertical + 0 -10 10 1 10 0 + True + False + 0 + False + + + + 0 + + + + + True + 1 khz + + + 1 + + + + + 1 + + + + + True + vertical + + + 100 + True + True + vertical + 0 -10 10 1 10 0 + True + False + False + + + + 0 + + + + + True + 8 khz + + + 1 + + + + + 2 + + + + + True + vertical + + + 100 + True + True + vertical + 0 0 20 1 10 0 + True + False + False + + + + 0 + + + + + True + reverb + + + 1 + + + + + 3 + + + + + False + 1 + + + + + Apply effects to final output instead of file + True + True + False + True + + + + 2 + + + + + + diff --git a/bass-sys/linux/bass24/fxtest/makefile b/bass-sys/linux/bass24/fxtest/makefile new file mode 100644 index 0000000..e0459a6 --- /dev/null +++ b/bass-sys/linux/bass24/fxtest/makefile @@ -0,0 +1,9 @@ +TARGET = fxtest +PACKAGES = gtk+-2.0 libglade-2.0 + +include ../makefile.in + +all: $(TARGET) + +clean: + $(RM) $(TARGET) diff --git a/bass-sys/linux/bass24/libbass.so b/bass-sys/linux/bass24/libbass.so new file mode 100644 index 0000000..bf516e9 Binary files /dev/null and b/bass-sys/linux/bass24/libbass.so differ diff --git a/bass-sys/linux/bass24/livespec/livespec.c b/bass-sys/linux/bass24/livespec/livespec.c new file mode 100644 index 0000000..8e108ab --- /dev/null +++ b/bass-sys/linux/bass24/livespec/livespec.c @@ -0,0 +1,229 @@ +/* + BASS spectrum analyser example + Copyright (c) 2002-2010 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include "bass.h" + +#define SPECWIDTH 368 // display width (should be multiple of 4) +#define SPECHEIGHT 127 // height (changing requires palette adjustments too) + +#pragma pack(1) +typedef struct { + BYTE rgbRed, rgbGreen, rgbBlue; +} RGB; +#pragma pack() + +GtkWidget *win = 0; + +HRECORD chan; + +GtkWidget *speci, *textarea; +GdkPixbuf *specpb; +RGB palette[256]; + +int specmode = 0, specpos = 0; // spectrum mode (and marker pos for 2nd mode) + +// display error messages +void Error(const char *es) +{ + GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); +} + +void WindowDestroy(GtkObject *obj, gpointer data) +{ + gtk_main_quit(); +} + +void WindowButtonRelease(GtkWidget *obj, GdkEventButton *event, gpointer data) +{ + if (event->type == GDK_BUTTON_RELEASE) { + RGB *specbuf = (RGB*)gdk_pixbuf_get_pixels(specpb); + specmode = (specmode + 1) % 4; // next spectrum mode + memset(specbuf, 0, SPECWIDTH * SPECHEIGHT * sizeof(*specbuf)); // clear display + } +} + +gboolean FileExtensionFilter(const GtkFileFilterInfo *info, gpointer data) +{ + return !regexec((regex_t*)data, info->filename, 0, NULL, 0); +} + +// update the spectrum display - the interesting bit :) +gboolean UpdateSpectrum(gpointer data) +{ + static DWORD quietcount = 0; + int x, y, y1; + RGB *specbuf = (RGB*)gdk_pixbuf_get_pixels(specpb); + + if (specmode == 3) { // waveform + int c; + float *buf; + BASS_CHANNELINFO ci; + memset(specbuf, 0, SPECWIDTH * SPECHEIGHT * sizeof(*specbuf)); + BASS_ChannelGetInfo(chan, &ci); // get number of channels + buf = alloca(ci.chans * SPECWIDTH * sizeof(float)); // allocate buffer for data + BASS_ChannelGetData(chan, buf, (ci.chans * SPECWIDTH * sizeof(float)) | BASS_DATA_FLOAT); // get the sample data (floating-point to avoid 8 & 16 bit processing) + for (c = 0; c < ci.chans; c++) { + for (x = 0; x < SPECWIDTH; x++) { + int v = (1 - buf[x * ci.chans + c]) * SPECHEIGHT / 2; // invert and scale to fit display + if (v < 0) v = 0; + else if (v >= SPECHEIGHT) v = SPECHEIGHT - 1; + if (!x) y = v; + do { // draw line from previous sample... + if (y < v) y++; + else if (y > v) y--; + specbuf[y * SPECWIDTH + x] = palette[c & 1 ? 127 : 1]; // left=green, right=red (could add more colours to palette for more chans) + } while (y != v); + } + } + } else { + float fft[1024]; + BASS_ChannelGetData(chan, fft, BASS_DATA_FFT2048); // get the FFT data + + if (!specmode) { // "normal" FFT + memset(specbuf, 0, SPECWIDTH * SPECHEIGHT * sizeof(*specbuf)); + for (x = 0; x < SPECWIDTH / 2; x++) { +#if 1 + y = sqrt(fft[x + 1]) * 3 * SPECHEIGHT - 4; // scale it (sqrt to make low values more visible) +#else + y = fft[x + 1] * 10 * SPECHEIGHT; // scale it (linearly) +#endif + if (y > SPECHEIGHT) y = SPECHEIGHT; // cap it + if (x && (y1 = (y + y1) / 2)) // interpolate from previous to make the display smoother + while (--y1 >= 0) specbuf[(SPECHEIGHT - 1 - y1) * SPECWIDTH + x * 2 - 1] = palette[y1 + 1]; + y1 = y; + while (--y >= 0) specbuf[(SPECHEIGHT - 1 - y) * SPECWIDTH + x * 2] = palette[y + 1]; // draw level + } + } else if (specmode == 1) { // logarithmic, acumulate & average bins + int b0 = 0; + memset(specbuf, 0, SPECWIDTH * SPECHEIGHT * sizeof(*specbuf)); +#define BANDS 28 + for (x = 0; x < BANDS; x++) { + float peak = 0; + int b1 = pow(2, x * 10.0 / (BANDS - 1)); + if (b1 > 1023) b1 = 1023; + if (b1 <= b0) b1 = b0 + 1; // make sure it uses at least 1 FFT bin + for (; b0 < b1; b0++) + if (peak < fft[1 + b0]) peak = fft[1 + b0]; + y = sqrt(peak) * 3 * SPECHEIGHT - 4; // scale it (sqrt to make low values more visible) + if (y > SPECHEIGHT) y = SPECHEIGHT; // cap it + while (--y >= 0) + for (y1 = 0; y1 < SPECWIDTH / BANDS - 2; y1++) + specbuf[(SPECHEIGHT - 1 - y) * SPECWIDTH + x * (SPECWIDTH / BANDS) + y1] = palette[y + 1]; // draw bar + } + } else { // "3D" + for (x = 0; x < SPECHEIGHT; x++) { + y = sqrt(fft[x + 1]) * 3 * 127; // scale it (sqrt to make low values more visible) + if (y > 127) y = 127; // cap it + specbuf[(SPECHEIGHT - 1 - x) * SPECWIDTH + specpos] = palette[128 + y]; // plot it + } + // move marker onto next position + specpos = (specpos + 1) % SPECWIDTH; + for (x = 0; x < SPECHEIGHT; x++) specbuf[x * SPECWIDTH + specpos] = palette[255]; + } + } + + if (LOWORD(BASS_ChannelGetLevel(chan)) < 500) { // check if it's quiet + quietcount++; + if (quietcount > 40) // it's been quiet for over a second + gtk_label_set(GTK_LABEL(textarea), quietcount & 16 ? "make some noise!" : ""); + } else { // not quiet + quietcount = 0; + gtk_label_set(GTK_LABEL(textarea), "click to toggle mode"); + } + + gtk_image_set_from_pixbuf(GTK_IMAGE(speci), specpb); // update the display + + return TRUE; +} + +// Recording callback - not doing anything with the data +BOOL CALLBACK DuffRecording(HRECORD handle, const void *buffer, DWORD length, void *user) +{ + return TRUE; // continue recording +} + +int main(int argc, char* argv[]) +{ + gtk_init(&argc, &argv); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + Error("An incorrect version of BASS was loaded"); + return 0; + } + + // initialize BASS recording (default device) + if (!BASS_RecordInit(-1)) { + Error("Can't initialize device"); + return -1; + } + // start recording (44100hz mono 16-bit) + if (!(chan = BASS_RecordStart(44100, 1, 0, &DuffRecording, 0))) { + Error("Can't start recording"); + return -1; + } + + // create the window + win = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_CENTER); + gtk_window_set_resizable(GTK_WINDOW(win), FALSE); + gtk_window_set_title(GTK_WINDOW(win), "BASS \"live\" spectrum"); + g_signal_connect(GTK_WINDOW(win), "destroy", GTK_SIGNAL_FUNC(WindowDestroy), NULL); + + GtkWidget *ebox = gtk_event_box_new(); + gtk_container_add(GTK_CONTAINER(win), ebox); + g_signal_connect(ebox, "button-release-event", GTK_SIGNAL_FUNC(WindowButtonRelease), NULL); + + GtkWidget *box = gtk_vbox_new(FALSE, 2); + gtk_container_add(GTK_CONTAINER(ebox), box); + + // create the bitmap + specpb = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, SPECWIDTH, SPECHEIGHT); + speci = gtk_image_new_from_pixbuf(specpb); + gtk_container_add(GTK_CONTAINER(box), speci); + + textarea = gtk_label_new("click to toggle mode"); + gtk_container_add(GTK_CONTAINER(box), textarea); + + { // setup palette + RGB *pal = palette; + int a; + memset(palette, 0, sizeof(palette)); + for (a = 1; a < 128; a++) { + pal[a].rgbGreen = 256 - 2 * a; + pal[a].rgbRed = 2 * a; + } + for (a = 0; a < 32; a++) { + pal[128 + a].rgbBlue = 8 * a; + pal[128 + 32 + a].rgbBlue = 255; + pal[128 + 32 + a].rgbRed = 8 * a; + pal[128 + 64 + a].rgbRed = 255; + pal[128 + 64 + a].rgbBlue = 8 * (31 - a); + pal[128 + 64 + a].rgbGreen = 8 * a; + pal[128 + 96 + a].rgbRed = 255; + pal[128 + 96 + a].rgbGreen = 255; + pal[128 + 96 + a].rgbBlue = 8 * a; + } + } + + // setup update timer (40hz) + g_timeout_add(25, UpdateSpectrum, NULL); + + gtk_widget_show_all(win); + gtk_main(); + + g_object_unref(specpb); + + BASS_RecordFree(); + + return 0; +} diff --git a/bass-sys/linux/bass24/livespec/makefile b/bass-sys/linux/bass24/livespec/makefile new file mode 100644 index 0000000..e599ed4 --- /dev/null +++ b/bass-sys/linux/bass24/livespec/makefile @@ -0,0 +1,9 @@ +TARGET = livespec +PACKAGES = gtk+-2.0 + +include ../makefile.in + +all: $(TARGET) + +clean: + $(RM) $(TARGET) diff --git a/bass-sys/linux/bass24/makefile b/bass-sys/linux/bass24/makefile new file mode 100644 index 0000000..2d569ec --- /dev/null +++ b/bass-sys/linux/bass24/makefile @@ -0,0 +1,11 @@ +EXAMPLES = 3dtest basstest contest custloop devlist dsptest fxtest livespec modtest multi netradio plugins rectest speakers spectrum synth writewav + +.PHONY: all clean $(EXAMPLES) + +all: $(EXAMPLES) + +clean: + @$(foreach x,$(EXAMPLES),$(MAKE) -C $(x) clean;) + +$(EXAMPLES): + $(MAKE) -C $@ diff --git a/bass-sys/linux/bass24/makefile.in b/bass-sys/linux/bass24/makefile.in new file mode 100644 index 0000000..440fe5d --- /dev/null +++ b/bass-sys/linux/bass24/makefile.in @@ -0,0 +1,12 @@ +FLAGS = -Os -I.. -L.. -L../x64 -lbass -lm -Wl,--no-warn-search-mismatch,-rpath,'$$ORIGIN/..:$$ORIGIN/../x64' +FLAGS += $(foreach pkg,$(PACKAGES),`pkg-config $(pkg) --cflags --libs`) +ifneq (,$(findstring libglade,$(PACKAGES))) +FLAGS += -export-dynamic +# path to glade file +FLAGS += -D'GLADE_PATH="$(shell pwd)/"' +endif + +.PHONY: all clean + +%: %.c + $(CC) $*.c $(FLAGS) -o $@ diff --git a/bass-sys/linux/bass24/modtest/makefile b/bass-sys/linux/bass24/modtest/makefile new file mode 100644 index 0000000..450b9c7 --- /dev/null +++ b/bass-sys/linux/bass24/modtest/makefile @@ -0,0 +1,9 @@ +TARGET = modtest +PACKAGES = gtk+-2.0 libglade-2.0 + +include ../makefile.in + +all: $(TARGET) + +clean: + $(RM) $(TARGET) diff --git a/bass-sys/linux/bass24/modtest/modtest.c b/bass-sys/linux/bass24/modtest/modtest.c new file mode 100644 index 0000000..99c8f18 --- /dev/null +++ b/bass-sys/linux/bass24/modtest/modtest.c @@ -0,0 +1,208 @@ +/* + BASS MOD music test + Copyright (c) 1999-2014 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include "bass.h" + +// path to glade file +#ifndef GLADE_PATH +#define GLADE_PATH "" +#endif + +GladeXML *glade; +GtkWidget *win = 0; +GtkWidget *filesel; + +DWORD music; // the HMUSIC channel + +// display error messages +void Error(const char *es) +{ + GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); +} + +#define GetWidget(id) glade_xml_get_widget(glade,id) + +void WindowDestroy(GtkObject *obj, gpointer data) +{ + gtk_main_quit(); +} + +gboolean FileExtensionFilter(const GtkFileFilterInfo *info, gpointer data) +{ + return !regexec((regex_t*)data, info->filename, 0, NULL, 0); +} + +DWORD GetFlags() +{ + DWORD flags = BASS_MUSIC_POSRESET; // stop notes when seeking + switch (gtk_combo_box_get_active(GTK_COMBO_BOX(GetWidget("interpolation")))) { + case 0: + flags |= BASS_MUSIC_NONINTER; // no interpolation + break; + case 2: + flags |= BASS_MUSIC_SINCINTER; // sinc interpolation + break; + } + switch (gtk_combo_box_get_active(GTK_COMBO_BOX(GetWidget("ramping")))) { + case 1: + flags |= BASS_MUSIC_RAMP; // ramping + break; + case 2: + flags |= BASS_MUSIC_RAMPS; // "sensitive" ramping + break; + } + switch (gtk_combo_box_get_active(GTK_COMBO_BOX(GetWidget("surround")))) { + case 1: + flags |= BASS_MUSIC_SURROUND; // surround + break; + case 2: + flags |= BASS_MUSIC_SURROUND2; // "mode2" + break; + } + return flags; +} + +void OpenClicked(GtkButton *obj, gpointer data) +{ + int resp = gtk_dialog_run(GTK_DIALOG(filesel)); + gtk_widget_hide(filesel); + if (resp == GTK_RESPONSE_ACCEPT) { + char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filesel)); + BASS_MusicFree(music); // free the current music + music = BASS_MusicLoad(FALSE, file, 0, 0, GetFlags(), 1); // load the new music + if (music) { // success + DWORD length = BASS_ChannelGetLength(music, BASS_POS_MUSIC_ORDER); // get the order length + gtk_button_set_label(obj, file); + { + char text[100], *ctype = ""; + BASS_CHANNELINFO info; + int channels = 0; + while (BASS_ChannelGetAttributeEx(music, BASS_ATTRIB_MUSIC_VOL_CHAN + channels, 0, 0)) channels++; // count channels + BASS_ChannelGetInfo(music, &info); + switch (info.ctype & ~BASS_CTYPE_MUSIC_MO3) { + case BASS_CTYPE_MUSIC_MOD: + ctype = "MOD"; + break; + case BASS_CTYPE_MUSIC_MTM: + ctype = "MTM"; + break; + case BASS_CTYPE_MUSIC_S3M: + ctype = "S3M"; + break; + case BASS_CTYPE_MUSIC_XM: + ctype = "XM"; + break; + case BASS_CTYPE_MUSIC_IT: + ctype = "IT"; + break; + } + snprintf(text, sizeof(text), "name: %s, format: %dch %s%s", BASS_ChannelGetTags(music, BASS_TAG_MUSIC_NAME), channels, ctype, info.ctype & BASS_CTYPE_MUSIC_MO3 ? " (MO3)" : ""); + gtk_label_set_text(GTK_LABEL(GetWidget("info")), text); + } + gtk_range_set_range(GTK_RANGE(GetWidget("position")), 0, length - 1); // update scroller range + BASS_ChannelPlay(music, FALSE); // start it + } else { // failed + gtk_button_set_label(obj, "click here to open a file..."); + gtk_label_set_text(GTK_LABEL(GetWidget("info")), ""); + gtk_label_set_text(GTK_LABEL(GetWidget("posdisplay")), ""); + Error("Can't play the file"); + } + g_free(file); + } +} + +void PlayClicked(GtkButton *obj, gpointer data) +{ + if (BASS_ChannelIsActive(music) == BASS_ACTIVE_PLAYING) + BASS_ChannelPause(music); + else + BASS_ChannelPlay(music, FALSE); +} + +gboolean PositionChange(GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data) +{ + BASS_ChannelSetPosition(music, value, BASS_POS_MUSIC_ORDER); // set the position + return FALSE; +} + +void FlagChanged(GtkComboBox *obj, gpointer data) +{ + BASS_ChannelFlags(music, GetFlags(), -1); // update flags +} + +gboolean TimerProc(gpointer data) +{ + char text[16]; + QWORD pos = BASS_ChannelGetPosition(music, BASS_POS_MUSIC_ORDER); + if (pos != (QWORD)-1) { + gtk_range_set_value(GTK_RANGE(GetWidget("position")), LOWORD(pos)); + sprintf(text, "%03d.%03d", LOWORD(pos), HIWORD(pos)); + gtk_label_set_text(GTK_LABEL(GetWidget("posdisplay")), text); + } + return TRUE; +} + +int main(int argc, char* argv[]) +{ + regex_t fregex; + + gtk_init(&argc, &argv); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + Error("An incorrect version of BASS was loaded"); + return 0; + } + + // initialize default output device + if (!BASS_Init(-1, 44100, 0, NULL, NULL)) { + Error("Can't initialize device"); + return 0; + } + + // initialize GUI + glade = glade_xml_new(GLADE_PATH"modtest.glade", NULL, NULL); + if (!glade) return 0; + win = GetWidget("window1"); + if (!win) return 0; + glade_xml_signal_autoconnect(glade); + + gtk_combo_box_set_active(GTK_COMBO_BOX(GetWidget("interpolation")), 1); + gtk_combo_box_set_active(GTK_COMBO_BOX(GetWidget("ramping")), 2); + gtk_combo_box_set_active(GTK_COMBO_BOX(GetWidget("surround")), 0); + + { // initialize file selector + GtkFileFilter *filter; + filesel = gtk_file_chooser_dialog_new("Open File", GTK_WINDOW(win), GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "mo3/it/xm/s3m/mtm/mod/umx"); + regcomp(&fregex, "\\.(mo3|it|xm|s3m|mtm|mod|umx)$", REG_ICASE | REG_NOSUB | REG_EXTENDED); + gtk_file_filter_add_custom(filter, GTK_FILE_FILTER_FILENAME, FileExtensionFilter, &fregex, NULL); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "All files"); + gtk_file_filter_add_pattern(filter, "*"); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + } + + g_timeout_add(100, TimerProc, NULL); + + gtk_main(); + + gtk_widget_destroy(filesel); + regfree(&fregex); + + BASS_Free(); + + return 0; +} diff --git a/bass-sys/linux/bass24/modtest/modtest.glade b/bass-sys/linux/bass24/modtest/modtest.glade new file mode 100644 index 0000000..f087954 --- /dev/null +++ b/bass-sys/linux/bass24/modtest/modtest.glade @@ -0,0 +1,183 @@ + + + + + + 400 + True + 5 + BASS MOD music test + False + center + + + + True + vertical + 10 + + + click here to open a file... + True + True + True + + + + False + 0 + + + + + True + + + 1 + + + + + True + 100 + True + + + True + + + 0 + + + + + Play / Pause + True + True + True + + + + 1 + + + + + 2 + + + + + True + True + 0 0 0 1 10 0 + False + + + + 3 + + + + + True + 10 + True + + + True + vertical + + + True + Interpolation + + + 0 + + + + + True + off +linear +sinc + + + + 1 + + + + + 0 + + + + + True + vertical + + + True + Ramping + + + 0 + + + + + True + off +normal +sensitive + + + 1 + + + + + 1 + + + + + True + vertical + + + True + Surround + + + 0 + + + + + True + off +mode 1 +mode 2 + + + + 1 + + + + + 2 + + + + + 4 + + + + + + diff --git a/bass-sys/linux/bass24/mp3-free/libbass.so b/bass-sys/linux/bass24/mp3-free/libbass.so new file mode 100644 index 0000000..1befde8 Binary files /dev/null and b/bass-sys/linux/bass24/mp3-free/libbass.so differ diff --git a/bass-sys/linux/bass24/multi/makefile b/bass-sys/linux/bass24/multi/makefile new file mode 100644 index 0000000..2ca73e7 --- /dev/null +++ b/bass-sys/linux/bass24/multi/makefile @@ -0,0 +1,9 @@ +TARGET = multi +PACKAGES = gtk+-2.0 libglade-2.0 + +include ../makefile.in + +all: $(TARGET) + +clean: + $(RM) $(TARGET) diff --git a/bass-sys/linux/bass24/multi/multi.c b/bass-sys/linux/bass24/multi/multi.c new file mode 100644 index 0000000..47d9a56 --- /dev/null +++ b/bass-sys/linux/bass24/multi/multi.c @@ -0,0 +1,255 @@ +/* + BASS multiple output example + Copyright (c) 2001-2008 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include +#include +#include "bass.h" + +// path to glade file +#ifndef GLADE_PATH +#define GLADE_PATH "" +#endif + +GladeXML *glade; +GtkWidget *win = 0; +GtkWidget *filesel; + +DWORD outdev[2]; // output devices +DWORD latency[2]; // latencies +HSTREAM chan[2]; // the streams + +// display error messages +void Error(const char *es) +{ + GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); +} + +#define GetWidget(id) glade_xml_get_widget(glade,id) + +void WindowDestroy(GtkObject *obj, gpointer data) +{ + gtk_main_quit(); +} + +gboolean FileExtensionFilter(const GtkFileFilterInfo *info, gpointer data) +{ + return !regexec((regex_t*)data, info->filename, 0, NULL, 0); +} + +void OpenClicked(GtkButton *obj, gpointer data) +{ + int resp = gtk_dialog_run(GTK_DIALOG(filesel)); + gtk_widget_hide(filesel); + if (resp == GTK_RESPONSE_ACCEPT) { + char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filesel)); + const gchar *objname = gtk_widget_get_name(GTK_WIDGET(obj)); + int devn = atoi(objname + 4) - 1; // get device number from button name ("openX") + BASS_StreamFree(chan[devn]); // free old stream before opening new + BASS_SetDevice(outdev[devn]); // set the device to create stream on + if (!(chan[devn] = BASS_StreamCreateFile(FALSE, file, 0, 0, BASS_SAMPLE_LOOP))) { + gtk_button_set_label(obj, "click here to open a file..."); + Error("Can't play the file"); + } else { + gtk_button_set_label(obj, file); + BASS_ChannelPlay(chan[devn], FALSE); + } + g_free(file); + } +} + +// Cloning DSP function +void CALLBACK CloneDSP(HDSP handle, DWORD channel, void *buffer, DWORD length, void *user) +{ + BASS_StreamPutData((uintptr_t)user, buffer, length); // user = clone +} + +void CloneClicked(GtkButton *obj, gpointer data) +{ + const gchar *objname = gtk_widget_get_name(GTK_WIDGET(obj)); + int devn = atoi(objname + 5) - 1; // get device number from button name ("cloneX") + BASS_CHANNELINFO i; + if (!BASS_ChannelGetInfo(chan[devn ^ 1], &i)) { + Error("Nothing to clone"); + } else { + BASS_StreamFree(chan[devn]); // free old stream + BASS_SetDevice(outdev[devn]); // set the device to create stream on + if (!(chan[devn] = BASS_StreamCreate(i.freq, i.chans, i.flags, STREAMPROC_PUSH, 0))) { // create a "push" stream + char oname[10]; + sprintf(oname, "open%d", devn + 1); + gtk_button_set_label(GTK_BUTTON(GetWidget(oname)), "click here to open a file..."); + Error("Can't create clone"); + } else { + BASS_ChannelLock(chan[devn ^ 1], TRUE); // lock source stream to synchonise buffer contents + BASS_ChannelSetDSP(chan[devn ^ 1], CloneDSP, (void*)(uintptr_t)chan[devn], 0); // set DSP to feed data to clone + { // copy buffered data to clone + DWORD d = BASS_ChannelSeconds2Bytes(chan[devn], latency[devn] / 1000.f); // playback delay + DWORD c = BASS_ChannelGetData(chan[devn ^ 1], 0, BASS_DATA_AVAILABLE); + BYTE *buf = (BYTE*)malloc(c); + c = BASS_ChannelGetData(chan[devn ^ 1], buf, c); + if (c > d) BASS_StreamPutData(chan[devn], buf + d, c - d); + free(buf); + } + BASS_ChannelLock(chan[devn ^ 1], FALSE); // unlock source stream + BASS_ChannelPlay(chan[devn], FALSE); // play clone + { + char oname[10]; + sprintf(oname, "open%d", devn + 1); + gtk_button_set_label(GTK_BUTTON(GetWidget(oname)), "clone"); + } + } + } +} + +void SwapClicked(GtkButton *obj, gpointer data) +{ + { // swap handles + HSTREAM temp = chan[0]; + chan[0] = chan[1]; + chan[1] = temp; + } + { // swap text + GtkButton *open1 = GTK_BUTTON(GetWidget("open1")), *open2 = GTK_BUTTON(GetWidget("open2")); + char *temp = strdup(gtk_button_get_label(open1)); + gtk_button_set_label(open1, gtk_button_get_label(open2)); + gtk_button_set_label(open2, temp); + free(temp); + } + // update the channel devices + BASS_ChannelSetDevice(chan[0], outdev[0]); + BASS_ChannelSetDevice(chan[1], outdev[1]); +} + +// Simple device selector dialog stuff begins here +void ListRowActivated(GtkTreeView *obj, GtkTreePath *path, GtkTreeViewColumn *column, gpointer data) +{ + int sel = 1 + *gtk_tree_path_get_indices(path); // get selection + gtk_dialog_response(GTK_DIALOG(GetWidget("dialog1")), sel); +} + +int SelectDevice(const char *title) +{ + int sel = 0; + GtkWidget *win = GetWidget("dialog1"); + gtk_window_set_title(GTK_WINDOW(win), title); + + GtkTreeView *list = GTK_TREE_VIEW(GetWidget("list")); + if (!gtk_tree_view_get_column(list, 0)) { // no column yet, so add one... + GtkTreeViewColumn *col = gtk_tree_view_column_new(); + gtk_tree_view_append_column(list, col); + GtkCellRenderer *renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_column_pack_start(col, renderer, TRUE); + gtk_tree_view_column_add_attribute(col, renderer, "text", 0); + } + + GtkListStore *liststore = gtk_list_store_new(1, G_TYPE_STRING); + { + BASS_DEVICEINFO i; + int c; + for (c = 1; BASS_GetDeviceInfo(c, &i); c++) { // device 1 = 1st real device + if (i.flags & BASS_DEVICE_ENABLED) { // enabled, so add it... + GtkTreeIter it; + gtk_list_store_append(liststore, &it); + gtk_list_store_set(liststore, &it, 0, i.name, -1); + } + } + } + gtk_tree_view_set_model(list, GTK_TREE_MODEL(liststore)); + g_object_unref(liststore); + { // pre-select 1st entry + GtkTreeSelection *tsel = gtk_tree_view_get_selection(list); + GtkTreePath *tpath = gtk_tree_path_new_first(); + gtk_tree_selection_select_path(tsel, tpath); + gtk_tree_path_free(tpath); + } + + sel = gtk_dialog_run(GTK_DIALOG(win)); + gtk_widget_hide(win); + + return sel; +} +// Simple device selector dialog stuff ends here + +int main(int argc, char* argv[]) +{ + regex_t fregex; + + gtk_init(&argc, &argv); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + Error("An incorrect version of BASS was loaded"); + return 0; + } + + // initialize GUI + glade = glade_xml_new(GLADE_PATH"multi.glade", NULL, NULL); + if (!glade) return 0; + win = GetWidget("window1"); + if (!win) return 0; + glade_xml_signal_autoconnect(glade); + + // Let the user choose the output devices + outdev[0] = SelectDevice("Select output device #1"); + outdev[1] = SelectDevice("Select output device #2"); + + { // setup output devices + BASS_INFO info; + if (!BASS_Init(outdev[0], 44100, 0, NULL, NULL)) { + Error("Can't initialize device 1"); + return 0; + } + BASS_GetInfo(&info); + latency[0] = info.latency; + if (!BASS_Init(outdev[1], 44100, 0, NULL, NULL)) { + Error("Can't initialize device 2"); + return 0; + } + BASS_GetInfo(&info); + latency[1] = info.latency; + } + { + BASS_DEVICEINFO i; + BASS_GetDeviceInfo(outdev[0], &i); + gtk_frame_set_label(GTK_FRAME(GetWidget("device1")), i.name); + BASS_GetDeviceInfo(outdev[1], &i); + gtk_frame_set_label(GTK_FRAME(GetWidget("device2")), i.name); + } + + { // initialize file selector + GtkFileFilter *filter; + filesel = gtk_file_chooser_dialog_new("Open File", GTK_WINDOW(win), GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "Playable files"); + regcomp(&fregex, "\\.(mo3|xm|mod|s3m|it|umx|mp[1-3]|ogg|wav|aif)$", REG_ICASE | REG_NOSUB | REG_EXTENDED); + gtk_file_filter_add_custom(filter, GTK_FILE_FILTER_FILENAME, FileExtensionFilter, &fregex, NULL); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "All files"); + gtk_file_filter_add_pattern(filter, "*"); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + } + + gtk_widget_show(win); + gtk_main(); + + gtk_widget_destroy(filesel); + regfree(&fregex); + + // release both devices + BASS_SetDevice(outdev[0]); + BASS_Free(); + BASS_SetDevice(outdev[1]); + BASS_Free(); + + return 0; +} diff --git a/bass-sys/linux/bass24/multi/multi.glade b/bass-sys/linux/bass24/multi/multi.glade new file mode 100644 index 0000000..45cc71d --- /dev/null +++ b/bass-sys/linux/bass24/multi/multi.glade @@ -0,0 +1,203 @@ + + + + + 450 + 5 + BASS multiple output example + False + GTK_WIN_POS_CENTER + + + + True + 5 + + + True + 0 + GTK_SHADOW_OUT + + + True + 6 + 10 + 10 + 10 + + + True + 5 + + + True + True + True + click here to open a file... + 0 + + + + + + True + True + True + clone #2 + 0 + + + + False + 1 + + + + + + + + + True + True + + + label_item + + + + + False + + + + + True + + + + + + True + True + True + swap + 0 + + + + False + 10 + GTK_PACK_END + 1 + + + + + 1 + + + + + True + 0 + GTK_SHADOW_OUT + + + True + 6 + 10 + 10 + 10 + + + True + 5 + + + True + True + True + click here to open a file... + 0 + + + + + + True + True + True + clone #1 + 0 + + + + False + 1 + + + + + + + + + True + True + + + label_item + + + + + False + 2 + + + + + + + 300 + 5 + GTK_WIN_POS_CENTER_ON_PARENT + GDK_WINDOW_TYPE_HINT_DIALOG + False + + + True + 2 + + + True + True + False + True + + + + 1 + + + + + True + GTK_BUTTONBOX_END + + + + + + + + + False + GTK_PACK_END + + + + + + diff --git a/bass-sys/linux/bass24/netradio/makefile b/bass-sys/linux/bass24/netradio/makefile new file mode 100644 index 0000000..3380a85 --- /dev/null +++ b/bass-sys/linux/bass24/netradio/makefile @@ -0,0 +1,9 @@ +TARGET = netradio +PACKAGES = gtk+-2.0 libglade-2.0 gthread-2.0 + +include ../makefile.in + +all: $(TARGET) + +clean: + $(RM) $(TARGET) diff --git a/bass-sys/linux/bass24/netradio/netradio.c b/bass-sys/linux/bass24/netradio/netradio.c new file mode 100644 index 0000000..b670d52 --- /dev/null +++ b/bass-sys/linux/bass24/netradio/netradio.c @@ -0,0 +1,283 @@ +/* + BASS internet radio example + Copyright (c) 2002-2019 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include +#include "bass.h" + +// HLS definitions (copied from BASSHLS.H) +#define BASS_SYNC_HLS_SEGMENT 0x10300 +#define BASS_TAG_HLS_EXTINF 0x14000 + +// path to glade file +#ifndef GLADE_PATH +#define GLADE_PATH "" +#endif + +GladeXML *glade; +GtkWidget *win = 0; +DWORD req = 0; // request number/counter +HSTREAM chan; +guint buftimer = 0; + +const char *urls[10] = { // preset stream URLs + "http://stream-dc1.radioparadise.com/rp_192m.ogg", "http://www.radioparadise.com/m3u/mp3-32.m3u", + "http://network.absoluteradio.co.uk/core/audio/mp3/live.pls?service=a8bb", "http://network.absoluteradio.co.uk/core/audio/aacplus/live.pls?service=a8", + "http://somafm.com/secretagent.pls", "http://somafm.com/secretagent32.pls", + "http://somafm.com/suburbsofgoa.pls", "http://somafm.com/suburbsofgoa32.pls", + "http://ai-radio.org/256.ogg", "http://ai-radio.org/48.aacp" +}; + +// display error messages +void Error(const char *es) +{ + GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); +} + +#define GetWidget(id) glade_xml_get_widget(glade,id) + +void WindowDestroy(GtkObject *obj, gpointer data) +{ + gtk_main_quit(); +} + +void gtk_label_set_text_8859(GtkLabel *label, const gchar *text) +{ + gsize s; + char *utf = g_convert(text, -1, "UTF-8", "ISO-8859-1", NULL, &s, NULL); + if (utf) { + gtk_label_set_text(label, utf); + g_free(utf); + } else + gtk_label_set_text(label, text); +} + +// update stream title from metadata +void DoMeta() +{ + GtkLabel *label = GTK_LABEL(GetWidget("status1")); + const char *meta = BASS_ChannelGetTags(chan, BASS_TAG_META); + if (meta) { // got Shoutcast metadata + char *p = strstr(meta, "StreamTitle='"); + if (p) { + p = strdup(p + 13); + strchr(p, ';')[-1] = 0; + gtk_label_set_text_8859(label, p); + free(p); + } + } else { + meta = BASS_ChannelGetTags(chan, BASS_TAG_OGG); + if (meta) { // got Icecast/OGG tags + const char *artist = NULL, *title = NULL, *p = meta; + for (; *p; p += strlen(p) + 1) { + if (!strncasecmp(p, "artist=", 7)) // found the artist + artist = p + 7; + if (!strncasecmp(p, "title=", 6)) // found the title + title = p + 6; + } + if (title) { + if (artist) { + char text[100]; + snprintf(text, sizeof(text), "%s - %s", artist, title); + gtk_label_set_text(label, text); + } else + gtk_label_set_text(label, title); + } + } else { + meta = BASS_ChannelGetTags(chan, BASS_TAG_HLS_EXTINF); + if (meta) { // got HLS segment info + const char *p = strchr(meta, ','); + if (p) gtk_label_set_text(label, p + 1); + } + } + } +} + +void CALLBACK MetaSync(HSYNC handle, DWORD channel, DWORD data, void *user) +{ + gdk_threads_enter(); + DoMeta(); + gdk_threads_leave(); +} + +gboolean BufferTimerProc(gpointer data) +{ // monitor buffering progress + if (BASS_ChannelIsActive(chan) == BASS_ACTIVE_PLAYING) { + buftimer = 0; + gtk_label_set_text(GTK_LABEL(GetWidget("status2")), "playing"); + { // get the broadcast name and URL + const char *icy = BASS_ChannelGetTags(chan, BASS_TAG_ICY); + if (!icy) icy = BASS_ChannelGetTags(chan, BASS_TAG_HTTP); // no ICY tags, try HTTP + if (icy) { + for (; *icy; icy += strlen(icy) + 1) { + if (!strncasecmp(icy, "icy-name:", 9)) + gtk_label_set_text_8859(GTK_LABEL(GetWidget("status2")), icy + 9); + if (!strncasecmp(icy, "icy-url:", 8)) + gtk_label_set_text_8859(GTK_LABEL(GetWidget("status3")), icy + 8); + } + } + } + // get the stream title + DoMeta(); + return FALSE; // stop monitoring + } else { + char text[32]; + sprintf(text, "buffering... %d%%", 100 - (int)BASS_StreamGetFilePosition(chan, BASS_FILEPOS_BUFFERING)); + gtk_label_set_text(GTK_LABEL(GetWidget("status2")), text); + return TRUE; // continue monitoring + } +} + +void CALLBACK StallSync(HSYNC handle, DWORD channel, DWORD data, void *user) +{ + if (!data) { // stalled + if (!buftimer) buftimer = g_timeout_add(50, BufferTimerProc, NULL); // start buffer monitoring + } +} + +void CALLBACK EndSync(HSYNC handle, DWORD channel, DWORD data, void *user) +{ + if (buftimer) { + g_source_remove(buftimer); // stop buffer monitoring + buftimer = 0; + } + gdk_threads_enter(); + gtk_label_set_text(GTK_LABEL(GetWidget("status1")), ""); + gtk_label_set_text(GTK_LABEL(GetWidget("status2")), "not playing"); + gtk_label_set_text(GTK_LABEL(GetWidget("status3")), ""); + gdk_threads_leave(); +} + +void CALLBACK StatusProc(const void *buffer, DWORD length, void *user) +{ + if (buffer && !length && (uintptr_t)user == req) { // got HTTP/ICY tags, and this is still the current request + gdk_threads_enter(); + gtk_label_set_text(GTK_LABEL(GetWidget("status3")), buffer); // display connection status + gdk_threads_leave(); + } +} + +void *OpenURL(void *url) +{ + G_LOCK_DEFINE_STATIC(req); + DWORD c, r; + G_LOCK(req); // make sure only 1 thread at a time can do the following + r = ++req; // increment the request counter for this request + G_UNLOCK(req); + if (buftimer) { + g_source_remove(buftimer); // stop buffer monitoring + buftimer = 0; + } + BASS_StreamFree(chan); // close old stream + gdk_threads_enter(); + gtk_label_set_text(GTK_LABEL(GetWidget("status1")), ""); + gtk_label_set_text(GTK_LABEL(GetWidget("status2")), "connecting..."); + gtk_label_set_text(GTK_LABEL(GetWidget("status3")), ""); + gdk_threads_leave(); + c = BASS_StreamCreateURL(url, 0, BASS_STREAM_BLOCK | BASS_STREAM_STATUS | BASS_STREAM_AUTOFREE, StatusProc, (void*)(uintptr_t)r); + free(url); // free temp URL buffer + G_LOCK(req); + if (r != req) { // there is a newer request, discard this stream + G_UNLOCK(req); + if (c) BASS_StreamFree(c); + return NULL; + } + chan = c; // this is now the current stream + G_UNLOCK(req); + if (!chan) { + gdk_threads_enter(); + gtk_label_set_text(GTK_LABEL(GetWidget("status2")), "not playing"); + Error("Can't play the stream"); + gdk_threads_leave(); + } else { + // start buffer monitoring + buftimer = g_timeout_add(50, BufferTimerProc, NULL); + // set syncs for stream title updates + BASS_ChannelSetSync(chan, BASS_SYNC_META, 0, MetaSync, 0); // Shoutcast + BASS_ChannelSetSync(chan, BASS_SYNC_OGG_CHANGE, 0, MetaSync, 0); // Icecast/OGG + BASS_ChannelSetSync(chan, BASS_SYNC_HLS_SEGMENT, 0, MetaSync, 0); // HLS + // set sync for stalling/buffering + BASS_ChannelSetSync(chan, BASS_SYNC_STALL, 0, StallSync, 0); + // set sync for end of stream + BASS_ChannelSetSync(chan, BASS_SYNC_END, 0, EndSync, 0); + // play it! + BASS_ChannelPlay(chan, FALSE); + } + return NULL; +} + +void PresetClicked(GtkButton *obj, gpointer data) +{ + const char *url; + const gchar *objname = gtk_widget_get_name(GTK_WIDGET(obj)); + if (!strcmp(objname, "customopen")) { // play a custom URL + url = gtk_entry_get_text(GTK_ENTRY(GetWidget("customurl"))); // get the URL + } else { // play a preset + int preset = atoi(objname + 6) - 1; // get preset from button name ("presetX") + url = urls[preset]; + } + if (GTK_TOGGLE_BUTTON(GetWidget("proxydirect"))->active) + BASS_SetConfigPtr(BASS_CONFIG_NET_PROXY, NULL); // disable proxy + else + BASS_SetConfigPtr(BASS_CONFIG_NET_PROXY, gtk_entry_get_text(GTK_ENTRY(GetWidget("proxyurl")))); // set proxy server + // open URL in a new thread (so that main thread is free) +#if GLIB_CHECK_VERSION(2,32,0) + { + GThread *thread = g_thread_new(NULL, OpenURL, strdup(url)); + g_thread_unref(thread); + } +#else + g_thread_create(OpenURL, strdup(url), FALSE, NULL); +#endif +} + +int main(int argc, char* argv[]) +{ +#if !GLIB_CHECK_VERSION(2,32,0) + g_thread_init(NULL); +#endif + gdk_threads_init(); + gtk_init(&argc, &argv); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + Error("An incorrect version of BASS was loaded"); + return 0; + } + + // initialize default output device + if (!BASS_Init(-1, 44100, 0, NULL, NULL)) { + Error("Can't initialize device"); + return 0; + } + + BASS_SetConfig(BASS_CONFIG_NET_PLAYLIST, 1); // enable playlist processing + BASS_SetConfig(BASS_CONFIG_NET_PREBUF_WAIT, 0); // disable BASS_StreamCreateURL pre-buffering + + BASS_PluginLoad("libbass_aac.so", 0); // load BASS_AAC (if present) for AAC support + BASS_PluginLoad("libbassflac.so", 0); // load BASSFLAC (if present) for FLAC support + BASS_PluginLoad("libbasshls.so", 0); // load BASSHLS (if present) for HLS support + + // initialize GUI + glade = glade_xml_new(GLADE_PATH"netradio.glade", NULL, NULL); + if (!glade) return 0; + win = GetWidget("window1"); + if (!win) return 0; + glade_xml_signal_autoconnect(glade); + + gdk_threads_enter(); + gtk_main(); + gdk_threads_leave(); + + BASS_Free(); + + return 0; +} diff --git a/bass-sys/linux/bass24/netradio/netradio.glade b/bass-sys/linux/bass24/netradio/netradio.glade new file mode 100644 index 0000000..be5bcb9 --- /dev/null +++ b/bass-sys/linux/bass24/netradio/netradio.glade @@ -0,0 +1,432 @@ + + + + + + 450 + True + 5 + BASS internet radio tuner + False + center + + + + True + vertical + 5 + + + True + 0 + out + + + True + 6 + 10 + 10 + 10 + + + True + + + True + vertical + 5 + + + True + 0 + High bitrate + end + + + 0 + + + + + True + 0 + Low bitrate + + + 1 + + + + + 0 + + + + + True + vertical + 5 + + + True + 5 + + + 1 + True + True + True + + + + 0 + + + + + 2 + True + True + True + + + + 1 + + + + + 3 + True + True + True + + + + 2 + + + + + 4 + True + True + True + + + + 3 + + + + + 5 + True + True + True + + + + 4 + + + + + 0 + + + + + True + 5 + + + 1 + True + True + True + + + + 0 + + + + + 2 + True + True + True + + + + 1 + + + + + 3 + True + True + True + + + + 2 + + + + + 4 + True + True + True + + + + 3 + + + + + 5 + True + True + True + + + + 4 + + + + + 1 + + + + + 1 + + + + + + + + + True + Presets + True + + + label_item + + + + + False + 0 + + + + + True + 0 + out + + + True + 6 + 10 + 10 + 10 + + + True + 5 + + + True + True + http:// + + + 0 + + + + + Open + True + True + True + + + + False + False + 1 + + + + + + + + + True + Custom + True + + + label_item + + + + + 1 + + + + + 200 + True + 0 + out + + + True + 6 + 10 + 10 + 10 + + + True + + + True + True + + + 0 + + + + + True + not playing + True + + + 1 + + + + + True + True + + + 2 + + + + + + + + + True + Currently playing + True + + + label_item + + + + + 2 + + + + + True + 0 + out + + + True + 6 + 10 + 10 + 10 + + + True + vertical + + + True + True + + + 0 + + + + + True + + + Direct connection + True + True + False + True + + + 0 + + + + + True + 1 + 0 + [user:pass@]server:port + + + 1 + + + + + 1 + + + + + + + + + True + proxy + True + + + label_item + + + + + 3 + + + + + + diff --git a/bass-sys/linux/bass24/pascal/bass.pas b/bass-sys/linux/bass24/pascal/bass.pas new file mode 100644 index 0000000..6d96e4e --- /dev/null +++ b/bass-sys/linux/bass24/pascal/bass.pas @@ -0,0 +1,1043 @@ +{ + BASS 2.4 Delphi unit + Copyright (c) 1999-2019 Un4seen Developments Ltd. + + See the BASS.CHM file for more detailed documentation + + How to install + -------------- + Copy BASS.PAS to the \LIB subdirectory of your Delphi path or your project dir + + NOTE: Delphi users should use the BASS_UNICODE flag where possible +} + +unit BASS; + +interface + +{$IFDEF MSWINDOWS} +uses + Windows; +{$ENDIF} + +const + BASSVERSION = $204; // API version + BASSVERSIONTEXT = '2.4'; + + // Use these to test for error from functions that return a DWORD or QWORD + DW_ERROR = Cardinal(-1); // -1 (DWORD) + QW_ERROR = Int64(-1); // -1 (QWORD) + + // Error codes returned by BASS_ErrorGetCode() + BASS_OK = 0; // all is OK + BASS_ERROR_MEM = 1; // memory error + BASS_ERROR_FILEOPEN = 2; // can't open the file + BASS_ERROR_DRIVER = 3; // can't find a free sound driver + BASS_ERROR_BUFLOST = 4; // the sample buffer was lost + BASS_ERROR_HANDLE = 5; // invalid handle + BASS_ERROR_FORMAT = 6; // unsupported sample format + BASS_ERROR_POSITION = 7; // invalid position + BASS_ERROR_INIT = 8; // BASS_Init has not been successfully called + BASS_ERROR_START = 9; // BASS_Start has not been successfully called + BASS_ERROR_ALREADY = 14; // already initialized/paused/whatever + BASS_ERROR_NOTAUDIO = 17; // file does not contain audio + BASS_ERROR_NOCHAN = 18; // can't get a free channel + BASS_ERROR_ILLTYPE = 19; // an illegal type was specified + BASS_ERROR_ILLPARAM = 20; // an illegal parameter was specified + BASS_ERROR_NO3D = 21; // no 3D support + BASS_ERROR_NOEAX = 22; // no EAX support + BASS_ERROR_DEVICE = 23; // illegal device number + BASS_ERROR_NOPLAY = 24; // not playing + BASS_ERROR_FREQ = 25; // illegal sample rate + BASS_ERROR_NOTFILE = 27; // the stream is not a file stream + BASS_ERROR_NOHW = 29; // no hardware voices available + BASS_ERROR_EMPTY = 31; // the MOD music has no sequence data + BASS_ERROR_NONET = 32; // no internet connection could be opened + BASS_ERROR_CREATE = 33; // couldn't create the file + BASS_ERROR_NOFX = 34; // effects are not available + BASS_ERROR_NOTAVAIL = 37; // requested data/action is not available + BASS_ERROR_DECODE = 38; // the channel is/isn't a "decoding channel" + BASS_ERROR_DX = 39; // a sufficient DirectX version is not installed + BASS_ERROR_TIMEOUT = 40; // connection timedout + BASS_ERROR_FILEFORM = 41; // unsupported file format + BASS_ERROR_SPEAKER = 42; // unavailable speaker + BASS_ERROR_VERSION = 43; // invalid BASS version (used by add-ons) + BASS_ERROR_CODEC = 44; // codec is not available/supported + BASS_ERROR_ENDED = 45; // the channel/file has ended + BASS_ERROR_BUSY = 46; // the device is busy + BASS_ERROR_UNSTREAMABLE = 47; // unstreamable file + BASS_ERROR_UNKNOWN = -1; // some other mystery problem + + // BASS_SetConfig options + BASS_CONFIG_BUFFER = 0; + BASS_CONFIG_UPDATEPERIOD = 1; + BASS_CONFIG_GVOL_SAMPLE = 4; + BASS_CONFIG_GVOL_STREAM = 5; + BASS_CONFIG_GVOL_MUSIC = 6; + BASS_CONFIG_CURVE_VOL = 7; + BASS_CONFIG_CURVE_PAN = 8; + BASS_CONFIG_FLOATDSP = 9; + BASS_CONFIG_3DALGORITHM = 10; + BASS_CONFIG_NET_TIMEOUT = 11; + BASS_CONFIG_NET_BUFFER = 12; + BASS_CONFIG_PAUSE_NOPLAY = 13; + BASS_CONFIG_NET_PREBUF = 15; + BASS_CONFIG_NET_PASSIVE = 18; + BASS_CONFIG_REC_BUFFER = 19; + BASS_CONFIG_NET_PLAYLIST = 21; + BASS_CONFIG_MUSIC_VIRTUAL = 22; + BASS_CONFIG_VERIFY = 23; + BASS_CONFIG_UPDATETHREADS = 24; + BASS_CONFIG_DEV_BUFFER = 27; + BASS_CONFIG_REC_LOOPBACK = 28; + BASS_CONFIG_VISTA_TRUEPOS = 30; + BASS_CONFIG_IOS_SESSION = 34; + BASS_CONFIG_IOS_MIXAUDIO = 34; + BASS_CONFIG_DEV_DEFAULT = 36; + BASS_CONFIG_NET_READTIMEOUT = 37; + BASS_CONFIG_VISTA_SPEAKERS = 38; + BASS_CONFIG_IOS_SPEAKER = 39; + BASS_CONFIG_MF_DISABLE = 40; + BASS_CONFIG_HANDLES = 41; + BASS_CONFIG_UNICODE = 42; + BASS_CONFIG_SRC = 43; + BASS_CONFIG_SRC_SAMPLE = 44; + BASS_CONFIG_ASYNCFILE_BUFFER = 45; + BASS_CONFIG_OGG_PRESCAN = 47; + BASS_CONFIG_MF_VIDEO = 48; + BASS_CONFIG_AIRPLAY = 49; + BASS_CONFIG_DEV_NONSTOP = 50; + BASS_CONFIG_IOS_NOCATEGORY = 51; + BASS_CONFIG_VERIFY_NET = 52; + BASS_CONFIG_DEV_PERIOD = 53; + BASS_CONFIG_FLOAT = 54; + BASS_CONFIG_NET_SEEK = 56; + BASS_CONFIG_AM_DISABLE = 58; + BASS_CONFIG_NET_PLAYLIST_DEPTH = 59; + BASS_CONFIG_NET_PREBUF_WAIT = 60; + BASS_CONFIG_ANDROID_SESSIONID = 62; + BASS_CONFIG_WASAPI_PERSIST = 65; + BASS_CONFIG_REC_WASAPI = 66; + BASS_CONFIG_ANDROID_AAUDIO = 67; + + // BASS_SetConfigPtr options + BASS_CONFIG_NET_AGENT = 16; + BASS_CONFIG_NET_PROXY = 17; + BASS_CONFIG_LIBSSL = 64; + + // BASS_CONFIG_IOS_SESSION flags + BASS_IOS_SESSION_MIX = 1; + BASS_IOS_SESSION_DUCK = 2; + BASS_IOS_SESSION_AMBIENT = 4; + BASS_IOS_SESSION_SPEAKER = 8; + BASS_IOS_SESSION_DISABLE = 16; + + // BASS_Init flags + BASS_DEVICE_8BITS = 1; // 8 bit + BASS_DEVICE_MONO = 2; // mono + BASS_DEVICE_3D = 4; // enable 3D functionality + BASS_DEVICE_16BITS = 8; // limit output to 16 bit + BASS_DEVICE_LATENCY = $100; // calculate device latency (BASS_INFO struct) + BASS_DEVICE_CPSPEAKERS = $400; // detect speakers via Windows control panel + BASS_DEVICE_SPEAKERS = $800; // force enabling of speaker assignment + BASS_DEVICE_NOSPEAKER = $1000; // ignore speaker arrangement + BASS_DEVICE_DMIX = $2000; // use ALSA "dmix" plugin + BASS_DEVICE_FREQ = $4000; // set device sample rate + BASS_DEVICE_STEREO = $8000; // limit output to stereo + BASS_DEVICE_AUDIOTRACK = $20000; // use AudioTrack output + BASS_DEVICE_DSOUND = $40000; // use DirectSound output + + // DirectSound interfaces (for use with BASS_GetDSoundObject) + BASS_OBJECT_DS = 1; // IDirectSound + BASS_OBJECT_DS3DL = 2; // IDirectSound3DListener + + // BASS_DEVICEINFO flags + BASS_DEVICE_ENABLED = 1; + BASS_DEVICE_DEFAULT = 2; + BASS_DEVICE_INIT = 4; + BASS_DEVICE_LOOPBACK = 8; + + BASS_DEVICE_TYPE_MASK = $ff000000; + BASS_DEVICE_TYPE_NETWORK = $01000000; + BASS_DEVICE_TYPE_SPEAKERS = $02000000; + BASS_DEVICE_TYPE_LINE = $03000000; + BASS_DEVICE_TYPE_HEADPHONES = $04000000; + BASS_DEVICE_TYPE_MICROPHONE = $05000000; + BASS_DEVICE_TYPE_HEADSET = $06000000; + BASS_DEVICE_TYPE_HANDSET = $07000000; + BASS_DEVICE_TYPE_DIGITAL = $08000000; + BASS_DEVICE_TYPE_SPDIF = $09000000; + BASS_DEVICE_TYPE_HDMI = $0a000000; + BASS_DEVICE_TYPE_DISPLAYPORT = $40000000; + + // BASS_GetDeviceInfo flags + BASS_DEVICES_AIRPLAY = $1000000; + + // BASS_INFO flags (from DSOUND.H) + DSCAPS_CONTINUOUSRATE = $00000010; // supports all sample rates between min/maxrate + DSCAPS_EMULDRIVER = $00000020; // device does NOT have hardware DirectSound support + DSCAPS_CERTIFIED = $00000040; // device driver has been certified by Microsoft + DSCAPS_SECONDARYMONO = $00000100; // mono + DSCAPS_SECONDARYSTEREO = $00000200; // stereo + DSCAPS_SECONDARY8BIT = $00000400; // 8 bit + DSCAPS_SECONDARY16BIT = $00000800; // 16 bit + + // BASS_RECORDINFO flags (from DSOUND.H) + DSCCAPS_EMULDRIVER = DSCAPS_EMULDRIVER; // device does NOT have hardware DirectSound recording support + DSCCAPS_CERTIFIED = DSCAPS_CERTIFIED; // device driver has been certified by Microsoft + + // defines for formats field of BASS_RECORDINFO (from MMSYSTEM.H) + WAVE_FORMAT_1M08 = $00000001; // 11.025 kHz, Mono, 8-bit + WAVE_FORMAT_1S08 = $00000002; // 11.025 kHz, Stereo, 8-bit + WAVE_FORMAT_1M16 = $00000004; // 11.025 kHz, Mono, 16-bit + WAVE_FORMAT_1S16 = $00000008; // 11.025 kHz, Stereo, 16-bit + WAVE_FORMAT_2M08 = $00000010; // 22.05 kHz, Mono, 8-bit + WAVE_FORMAT_2S08 = $00000020; // 22.05 kHz, Stereo, 8-bit + WAVE_FORMAT_2M16 = $00000040; // 22.05 kHz, Mono, 16-bit + WAVE_FORMAT_2S16 = $00000080; // 22.05 kHz, Stereo, 16-bit + WAVE_FORMAT_4M08 = $00000100; // 44.1 kHz, Mono, 8-bit + WAVE_FORMAT_4S08 = $00000200; // 44.1 kHz, Stereo, 8-bit + WAVE_FORMAT_4M16 = $00000400; // 44.1 kHz, Mono, 16-bit + WAVE_FORMAT_4S16 = $00000800; // 44.1 kHz, Stereo, 16-bit + + BASS_SAMPLE_8BITS = 1; // 8 bit + BASS_SAMPLE_FLOAT = 256; // 32 bit floating-point + BASS_SAMPLE_MONO = 2; // mono + BASS_SAMPLE_LOOP = 4; // looped + BASS_SAMPLE_3D = 8; // 3D functionality + BASS_SAMPLE_SOFTWARE = 16; // not using hardware mixing + BASS_SAMPLE_MUTEMAX = 32; // mute at max distance (3D only) + BASS_SAMPLE_VAM = 64; // DX7 voice allocation & management + BASS_SAMPLE_FX = 128; // old implementation of DX8 effects + BASS_SAMPLE_OVER_VOL = $10000; // override lowest volume + BASS_SAMPLE_OVER_POS = $20000; // override longest playing + BASS_SAMPLE_OVER_DIST = $30000; // override furthest from listener (3D only) + + BASS_STREAM_PRESCAN = $20000; // enable pin-point seeking/length (MP3/MP2/MP1) + BASS_STREAM_AUTOFREE = $40000; // automatically free the stream when it stop/ends + BASS_STREAM_RESTRATE = $80000; // restrict the download rate of internet file streams + BASS_STREAM_BLOCK = $100000;// download/play internet file stream in small blocks + BASS_STREAM_DECODE = $200000;// don't play the stream, only decode (BASS_ChannelGetData) + BASS_STREAM_STATUS = $800000;// give server status info (HTTP/ICY tags) in DOWNLOADPROC + + BASS_MP3_IGNOREDELAY = $200; // ignore LAME/Xing/VBRI/iTunes delay & padding info + BASS_MP3_SETPOS = BASS_STREAM_PRESCAN; + + BASS_MUSIC_FLOAT = BASS_SAMPLE_FLOAT; + BASS_MUSIC_MONO = BASS_SAMPLE_MONO; + BASS_MUSIC_LOOP = BASS_SAMPLE_LOOP; + BASS_MUSIC_3D = BASS_SAMPLE_3D; + BASS_MUSIC_FX = BASS_SAMPLE_FX; + BASS_MUSIC_AUTOFREE = BASS_STREAM_AUTOFREE; + BASS_MUSIC_DECODE = BASS_STREAM_DECODE; + BASS_MUSIC_PRESCAN = BASS_STREAM_PRESCAN; // calculate playback length + BASS_MUSIC_CALCLEN = BASS_MUSIC_PRESCAN; + BASS_MUSIC_RAMP = $200; // normal ramping + BASS_MUSIC_RAMPS = $400; // sensitive ramping + BASS_MUSIC_SURROUND = $800; // surround sound + BASS_MUSIC_SURROUND2 = $1000; // surround sound (mode 2) + BASS_MUSIC_FT2PAN = $2000; // apply FastTracker 2 panning to XM files + BASS_MUSIC_FT2MOD = $2000; // play .MOD as FastTracker 2 does + BASS_MUSIC_PT1MOD = $4000; // play .MOD as ProTracker 1 does + BASS_MUSIC_NONINTER = $10000; // non-interpolated sample mixing + BASS_MUSIC_SINCINTER = $800000; // sinc interpolated sample mixing + BASS_MUSIC_POSRESET = $8000; // stop all notes when moving position + BASS_MUSIC_POSRESETEX = $400000; // stop all notes and reset bmp/etc when moving position + BASS_MUSIC_STOPBACK = $80000; // stop the music on a backwards jump effect + BASS_MUSIC_NOSAMPLE = $100000; // don't load the samples + + // Speaker assignment flags + BASS_SPEAKER_FRONT = $1000000; // front speakers + BASS_SPEAKER_REAR = $2000000; // rear/side speakers + BASS_SPEAKER_CENLFE = $3000000; // center & LFE speakers (5.1) + BASS_SPEAKER_REAR2 = $4000000; // rear center speakers (7.1) + BASS_SPEAKER_LEFT = $10000000; // modifier: left + BASS_SPEAKER_RIGHT = $20000000; // modifier: right + BASS_SPEAKER_FRONTLEFT = BASS_SPEAKER_FRONT or BASS_SPEAKER_LEFT; + BASS_SPEAKER_FRONTRIGHT = BASS_SPEAKER_FRONT or BASS_SPEAKER_RIGHT; + BASS_SPEAKER_REARLEFT = BASS_SPEAKER_REAR or BASS_SPEAKER_LEFT; + BASS_SPEAKER_REARRIGHT = BASS_SPEAKER_REAR or BASS_SPEAKER_RIGHT; + BASS_SPEAKER_CENTER = BASS_SPEAKER_CENLFE or BASS_SPEAKER_LEFT; + BASS_SPEAKER_LFE = BASS_SPEAKER_CENLFE or BASS_SPEAKER_RIGHT; + BASS_SPEAKER_REAR2LEFT = BASS_SPEAKER_REAR2 or BASS_SPEAKER_LEFT; + BASS_SPEAKER_REAR2RIGHT = BASS_SPEAKER_REAR2 or BASS_SPEAKER_RIGHT; + + BASS_ASYNCFILE = $40000000; + BASS_UNICODE = $80000000; + + BASS_RECORD_PAUSE = $8000; // start recording paused + + // DX7 voice allocation & management flags + BASS_VAM_HARDWARE = 1; + BASS_VAM_SOFTWARE = 2; + BASS_VAM_TERM_TIME = 4; + BASS_VAM_TERM_DIST = 8; + BASS_VAM_TERM_PRIO = 16; + + BASS_ORIGRES_FLOAT = $10000; + + // BASS_CHANNELINFO types + BASS_CTYPE_SAMPLE = 1; + BASS_CTYPE_RECORD = 2; + BASS_CTYPE_STREAM = $10000; + BASS_CTYPE_STREAM_VORBIS = $10002; + BASS_CTYPE_STREAM_OGG = $10002; + BASS_CTYPE_STREAM_MP1 = $10003; + BASS_CTYPE_STREAM_MP2 = $10004; + BASS_CTYPE_STREAM_MP3 = $10005; + BASS_CTYPE_STREAM_AIFF = $10006; + BASS_CTYPE_STREAM_CA = $10007; + BASS_CTYPE_STREAM_MF = $10008; + BASS_CTYPE_STREAM_AM = $10009; + BASS_CTYPE_STREAM_DUMMY = $18000; + BASS_CTYPE_STREAM_DEVICE = $18001; + BASS_CTYPE_STREAM_WAV = $40000; // WAVE flag, LOWORD=codec + BASS_CTYPE_STREAM_WAV_PCM = $50001; + BASS_CTYPE_STREAM_WAV_FLOAT = $50003; + BASS_CTYPE_MUSIC_MOD = $20000; + BASS_CTYPE_MUSIC_MTM = $20001; + BASS_CTYPE_MUSIC_S3M = $20002; + BASS_CTYPE_MUSIC_XM = $20003; + BASS_CTYPE_MUSIC_IT = $20004; + BASS_CTYPE_MUSIC_MO3 = $00100; // MO3 flag + + // 3D channel modes + BASS_3DMODE_NORMAL = 0; // normal 3D processing + BASS_3DMODE_RELATIVE = 1; // position is relative to the listener + BASS_3DMODE_OFF = 2; // no 3D processing + + // software 3D mixing algorithms (used with BASS_CONFIG_3DALGORITHM) + BASS_3DALG_DEFAULT = 0; + BASS_3DALG_OFF = 1; + BASS_3DALG_FULL = 2; + BASS_3DALG_LIGHT = 3; + + // EAX environments, use with BASS_SetEAXParameters + EAX_ENVIRONMENT_GENERIC = 0; + EAX_ENVIRONMENT_PADDEDCELL = 1; + EAX_ENVIRONMENT_ROOM = 2; + EAX_ENVIRONMENT_BATHROOM = 3; + EAX_ENVIRONMENT_LIVINGROOM = 4; + EAX_ENVIRONMENT_STONEROOM = 5; + EAX_ENVIRONMENT_AUDITORIUM = 6; + EAX_ENVIRONMENT_CONCERTHALL = 7; + EAX_ENVIRONMENT_CAVE = 8; + EAX_ENVIRONMENT_ARENA = 9; + EAX_ENVIRONMENT_HANGAR = 10; + EAX_ENVIRONMENT_CARPETEDHALLWAY = 11; + EAX_ENVIRONMENT_HALLWAY = 12; + EAX_ENVIRONMENT_STONECORRIDOR = 13; + EAX_ENVIRONMENT_ALLEY = 14; + EAX_ENVIRONMENT_FOREST = 15; + EAX_ENVIRONMENT_CITY = 16; + EAX_ENVIRONMENT_MOUNTAINS = 17; + EAX_ENVIRONMENT_QUARRY = 18; + EAX_ENVIRONMENT_PLAIN = 19; + EAX_ENVIRONMENT_PARKINGLOT = 20; + EAX_ENVIRONMENT_SEWERPIPE = 21; + EAX_ENVIRONMENT_UNDERWATER = 22; + EAX_ENVIRONMENT_DRUGGED = 23; + EAX_ENVIRONMENT_DIZZY = 24; + EAX_ENVIRONMENT_PSYCHOTIC = 25; + // total number of environments + EAX_ENVIRONMENT_COUNT = 26; + + BASS_STREAMPROC_END = $80000000; // end of user stream flag + + // BASS_StreamCreateFileUser file systems + STREAMFILE_NOBUFFER = 0; + STREAMFILE_BUFFER = 1; + STREAMFILE_BUFFERPUSH = 2; + + // BASS_StreamPutFileData options + BASS_FILEDATA_END = 0; // end & close the file + + // BASS_StreamGetFilePosition modes + BASS_FILEPOS_CURRENT = 0; + BASS_FILEPOS_DECODE = BASS_FILEPOS_CURRENT; + BASS_FILEPOS_DOWNLOAD = 1; + BASS_FILEPOS_END = 2; + BASS_FILEPOS_START = 3; + BASS_FILEPOS_CONNECTED = 4; + BASS_FILEPOS_BUFFER = 5; + BASS_FILEPOS_SOCKET = 6; + BASS_FILEPOS_ASYNCBUF = 7; + BASS_FILEPOS_SIZE = 8; + BASS_FILEPOS_BUFFERING = 9; + + // BASS_ChannelSetSync types + BASS_SYNC_POS = 0; + BASS_SYNC_END = 2; + BASS_SYNC_META = 4; + BASS_SYNC_SLIDE = 5; + BASS_SYNC_STALL = 6; + BASS_SYNC_DOWNLOAD = 7; + BASS_SYNC_FREE = 8; + BASS_SYNC_SETPOS = 11; + BASS_SYNC_MUSICPOS = 10; + BASS_SYNC_MUSICINST = 1; + BASS_SYNC_MUSICFX = 3; + BASS_SYNC_OGG_CHANGE = 12; + BASS_SYNC_DEV_FAIL = 14; + BASS_SYNC_DEV_FORMAT = 15; + BASS_SYNC_THREAD = $20000000; // flag: call sync in other thread + BASS_SYNC_MIXTIME = $40000000; // flag: sync at mixtime, else at playtime + BASS_SYNC_ONETIME = $80000000; // flag: sync only once, else continuously + + // BASS_ChannelIsActive return values + BASS_ACTIVE_STOPPED = 0; + BASS_ACTIVE_PLAYING = 1; + BASS_ACTIVE_STALLED = 2; + BASS_ACTIVE_PAUSED = 3; + BASS_ACTIVE_PAUSED_DEVICE = 4; + + // Channel attributes + BASS_ATTRIB_FREQ = 1; + BASS_ATTRIB_VOL = 2; + BASS_ATTRIB_PAN = 3; + BASS_ATTRIB_EAXMIX = 4; + BASS_ATTRIB_NOBUFFER = 5; + BASS_ATTRIB_VBR = 6; + BASS_ATTRIB_CPU = 7; + BASS_ATTRIB_SRC = 8; + BASS_ATTRIB_NET_RESUME = 9; + BASS_ATTRIB_SCANINFO = 10; + BASS_ATTRIB_NORAMP = 11; + BASS_ATTRIB_BITRATE = 12; + BASS_ATTRIB_BUFFER = 13; + BASS_ATTRIB_GRANULE = 14; + BASS_ATTRIB_MUSIC_AMPLIFY = $100; + BASS_ATTRIB_MUSIC_PANSEP = $101; + BASS_ATTRIB_MUSIC_PSCALER = $102; + BASS_ATTRIB_MUSIC_BPM = $103; + BASS_ATTRIB_MUSIC_SPEED = $104; + BASS_ATTRIB_MUSIC_VOL_GLOBAL = $105; + BASS_ATTRIB_MUSIC_ACTIVE = $106; + BASS_ATTRIB_MUSIC_VOL_CHAN = $200; // + channel # + BASS_ATTRIB_MUSIC_VOL_INST = $300; // + instrument # + + // BASS_ChannelSlideAttribute flags + BASS_SLIDE_LOG = $1000000; + + // BASS_ChannelGetData flags + BASS_DATA_AVAILABLE = 0; // query how much data is buffered + BASS_DATA_FIXED = $20000000; // flag: return 8.24 fixed-point data + BASS_DATA_FLOAT = $40000000; // flag: return floating-point sample data + BASS_DATA_FFT256 = $80000000; // 256 sample FFT + BASS_DATA_FFT512 = $80000001; // 512 FFT + BASS_DATA_FFT1024 = $80000002; // 1024 FFT + BASS_DATA_FFT2048 = $80000003; // 2048 FFT + BASS_DATA_FFT4096 = $80000004; // 4096 FFT + BASS_DATA_FFT8192 = $80000005; // 8192 FFT + BASS_DATA_FFT16384 = $80000006; // 16384 FFT + BASS_DATA_FFT32768 = $80000007; // 32768 FFT + BASS_DATA_FFT_INDIVIDUAL = $10; // FFT flag: FFT for each channel, else all combined + BASS_DATA_FFT_NOWINDOW = $20; // FFT flag: no Hanning window + BASS_DATA_FFT_REMOVEDC = $40; // FFT flag: pre-remove DC bias + BASS_DATA_FFT_COMPLEX = $80; // FFT flag: return complex data + BASS_DATA_FFT_NYQUIST = $100; // FFT flag: return extra Nyquist value + + // BASS_ChannelGetLevelEx flags + BASS_LEVEL_MONO = 1; + BASS_LEVEL_STEREO = 2; + BASS_LEVEL_RMS = 4; + BASS_LEVEL_VOLPAN = 8; + + // BASS_ChannelGetTags types : what's returned + BASS_TAG_ID3 = 0; // ID3v1 tags : TAG_ID3 structure + BASS_TAG_ID3V2 = 1; // ID3v2 tags : variable length block + BASS_TAG_OGG = 2; // OGG comments : series of null-terminated UTF-8 strings + BASS_TAG_HTTP = 3; // HTTP headers : series of null-terminated ANSI strings + BASS_TAG_ICY = 4; // ICY headers : series of null-terminated ANSI strings + BASS_TAG_META = 5; // ICY metadata : ANSI string + BASS_TAG_APE = 6; // APEv2 tags : series of null-terminated UTF-8 strings + BASS_TAG_MP4 = 7; // MP4/iTunes metadata : series of null-terminated UTF-8 strings + BASS_TAG_WMA = 8; // WMA tags : series of null-terminated UTF-8 strings + BASS_TAG_VENDOR = 9; // OGG encoder : UTF-8 string + BASS_TAG_LYRICS3 = 10; // Lyric3v2 tag : ASCII string + BASS_TAG_CA_CODEC = 11; // CoreAudio codec info : TAG_CA_CODEC structure + BASS_TAG_MF = 13; // Media Foundation tags : series of null-terminated UTF-8 strings + BASS_TAG_WAVEFORMAT = 14; // WAVE format : WAVEFORMATEEX structure + BASS_TAG_AM_MIME = 15; // Android Media MIME type : ASCII string + BASS_TAG_AM_NAME = 16; // Android Media codec name : ASCII string + BASS_TAG_RIFF_INFO = $100; // RIFF "INFO" tags : series of null-terminated ANSI strings + BASS_TAG_RIFF_BEXT = $101; // RIFF/BWF "bext" tags : TAG_BEXT structure + BASS_TAG_RIFF_CART = $102; // RIFF/BWF "cart" tags : TAG_CART structure + BASS_TAG_RIFF_DISP = $103; // RIFF "DISP" text tag : ANSI string + BASS_TAG_RIFF_CUE = $104; // RIFF "cue " chunk : TAG_CUE structure + BASS_TAG_RIFF_SMPL = $105; // RIFF "smpl" chunk : TAG_SMPL structure + BASS_TAG_APE_BINARY = $1000; // + index #, binary APEv2 tag : TAG_APE_BINARY structure + BASS_TAG_MUSIC_NAME = $10000; // MOD music name : ANSI string + BASS_TAG_MUSIC_MESSAGE = $10001; // MOD message : ANSI string + BASS_TAG_MUSIC_ORDERS = $10002; // MOD order list : BYTE array of pattern numbers + BASS_TAG_MUSIC_AUTH = $10003; // MOD author : UTF-8 string + BASS_TAG_MUSIC_INST = $10100; // + instrument #, MOD instrument name : ANSI string + BASS_TAG_MUSIC_SAMPLE = $10300; // + sample #, MOD sample name : ANSI string + + // BASS_ChannelGetLength/GetPosition/SetPosition modes + BASS_POS_BYTE = 0; // byte position + BASS_POS_MUSIC_ORDER = 1; // order.row position, MAKELONG(order,row) + BASS_POS_OGG = 3; // OGG bitstream number + BASS_POS_RESET = $2000000; // flag: reset user file buffers + BASS_POS_RELATIVE = $4000000; // flag: seek relative to the current position + BASS_POS_INEXACT = $8000000; // flag: allow seeking to inexact position + BASS_POS_DECODE = $10000000; // flag: get the decoding (not playing) position + BASS_POS_DECODETO = $20000000; // flag: decode to the position instead of seeking + BASS_POS_SCAN = $40000000; // flag: scan to the position + + // BASS_ChannelSetDevice/GetDevice option + BASS_NODEVICE = $20000; + + // BASS_RecordSetInput flags + BASS_INPUT_OFF = $10000; + BASS_INPUT_ON = $20000; + + BASS_INPUT_TYPE_MASK = $FF000000; + BASS_INPUT_TYPE_UNDEF = $00000000; + BASS_INPUT_TYPE_DIGITAL = $01000000; + BASS_INPUT_TYPE_LINE = $02000000; + BASS_INPUT_TYPE_MIC = $03000000; + BASS_INPUT_TYPE_SYNTH = $04000000; + BASS_INPUT_TYPE_CD = $05000000; + BASS_INPUT_TYPE_PHONE = $06000000; + BASS_INPUT_TYPE_SPEAKER = $07000000; + BASS_INPUT_TYPE_WAVE = $08000000; + BASS_INPUT_TYPE_AUX = $09000000; + BASS_INPUT_TYPE_ANALOG = $0A000000; + + // BASS_ChannelSetFX effect types + BASS_FX_DX8_CHORUS = 0; + BASS_FX_DX8_COMPRESSOR = 1; + BASS_FX_DX8_DISTORTION = 2; + BASS_FX_DX8_ECHO = 3; + BASS_FX_DX8_FLANGER = 4; + BASS_FX_DX8_GARGLE = 5; + BASS_FX_DX8_I3DL2REVERB = 6; + BASS_FX_DX8_PARAMEQ = 7; + BASS_FX_DX8_REVERB = 8; + BASS_FX_VOLUME = 9; + + BASS_DX8_PHASE_NEG_180 = 0; + BASS_DX8_PHASE_NEG_90 = 1; + BASS_DX8_PHASE_ZERO = 2; + BASS_DX8_PHASE_90 = 3; + BASS_DX8_PHASE_180 = 4; + +type + DWORD = Cardinal; + BOOL = LongBool; + QWORD = Int64; + + HMUSIC = DWORD; // MOD music handle + HSAMPLE = DWORD; // sample handle + HCHANNEL = DWORD; // playing sample's channel handle + HSTREAM = DWORD; // sample stream handle + HRECORD = DWORD; // recording handle + HSYNC = DWORD; // synchronizer handle + HDSP = DWORD; // DSP handle + HFX = DWORD; // DX8 effect handle + HPLUGIN = DWORD; // Plugin handle + + // Device info structure + BASS_DEVICEINFO = record + name: PAnsiChar; // description + driver: PAnsiChar; // driver + flags: DWORD; + end; + + BASS_INFO = record + flags: DWORD; // device capabilities (DSCAPS_xxx flags) + hwsize: DWORD; // size of total device hardware memory + hwfree: DWORD; // size of free device hardware memory + freesam: DWORD; // number of free sample slots in the hardware + free3d: DWORD; // number of free 3D sample slots in the hardware + minrate: DWORD; // min sample rate supported by the hardware + maxrate: DWORD; // max sample rate supported by the hardware + eax: BOOL; // device supports EAX? (always FALSE if BASS_DEVICE_3D was not used) + minbuf: DWORD; // recommended minimum buffer length in ms (requires BASS_DEVICE_LATENCY) + dsver: DWORD; // DirectSound version + latency: DWORD; // delay (in ms) before start of playback (requires BASS_DEVICE_LATENCY) + initflags: DWORD; // BASS_Init "flags" parameter + speakers: DWORD; // number of speakers available + freq: DWORD; // current output rate + end; + + // Recording device info structure + BASS_RECORDINFO = record + flags: DWORD; // device capabilities (DSCCAPS_xxx flags) + formats: DWORD; // supported standard formats (WAVE_FORMAT_xxx flags) + inputs: DWORD; // number of inputs + singlein: BOOL; // only 1 input can be set at a time + freq: DWORD; // current input rate + end; + + // Sample info structure + BASS_SAMPLE = record + freq: DWORD; // default playback rate + volume: Single; // default volume (0-100) + pan: Single; // default pan (-100=left, 0=middle, 100=right) + flags: DWORD; // BASS_SAMPLE_xxx flags + length: DWORD; // length (in samples, not bytes) + max: DWORD; // maximum simultaneous playbacks + origres: DWORD; // original resolution + chans: DWORD; // number of channels + mingap: DWORD; // minimum gap (ms) between creating channels + mode3d: DWORD; // BASS_3DMODE_xxx mode + mindist: Single; // minimum distance + maxdist: Single; // maximum distance + iangle: DWORD; // angle of inside projection cone + oangle: DWORD; // angle of outside projection cone + outvol: Single; // delta-volume outside the projection cone + vam: DWORD; // voice allocation/management flags (BASS_VAM_xxx) + priority: DWORD; // priority (0=lowest, $ffffffff=highest) + end; + + // Channel info structure + BASS_CHANNELINFO = record + freq: DWORD; // default playback rate + chans: DWORD; // channels + flags: DWORD; // BASS_SAMPLE/STREAM/MUSIC/SPEAKER flags + ctype: DWORD; // type of channel + origres: DWORD; // original resolution + plugin: HPLUGIN; // plugin + sample: HSAMPLE; // sample + {$IFDEF CPUX64} + padding: DWORD; + {$ENDIF} + filename: PChar; // filename + end; + + BASS_PLUGINFORM = record + ctype: DWORD; // channel type + {$IFDEF CPUX64} + padding: DWORD; + {$ENDIF} + name: PAnsiChar; // format description + exts: PAnsiChar; // file extension filter (*.ext1;*.ext2;etc...) + end; + PBASS_PLUGINFORMS = ^TBASS_PLUGINFORMS; + TBASS_PLUGINFORMS = array[0..maxInt div sizeOf(BASS_PLUGINFORM) - 1] of BASS_PLUGINFORM; + + PBASS_PLUGININFO = ^BASS_PLUGININFO; + BASS_PLUGININFO = record + version: DWORD; // version (same form as BASS_GetVersion) + formatc: DWORD; // number of formats + formats: PBASS_PLUGINFORMS; // the array of formats + end; + + // 3D vector (for 3D positions/velocities/orientations) + BASS_3DVECTOR = record + x: Single; // +=right, -=left + y: Single; // +=up, -=down + z: Single; // +=front, -=behind + end; + + // User file stream callback functions + FILECLOSEPROC = procedure(user: Pointer); {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; + FILELENPROC = function(user: Pointer): QWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; + FILEREADPROC = function(buffer: Pointer; length: DWORD; user: Pointer): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; + FILESEEKPROC = function(offset: QWORD; user: Pointer): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; + + BASS_FILEPROCS = record + close: FILECLOSEPROC; + length: FILELENPROC; + read: FILEREADPROC; + seek: FILESEEKPROC; + end; + + // ID3v1 tag structure + PTAG_ID3 = ^TAG_ID3; + TAG_ID3 = record + id: Array[0..2] of AnsiChar; + title: Array[0..29] of AnsiChar; + artist: Array[0..29] of AnsiChar; + album: Array[0..29] of AnsiChar; + year: Array[0..3] of AnsiChar; + comment: Array[0..29] of AnsiChar; + genre: Byte; + end; + + // Binary APEv2 tag structure + PTAG_APE_BINARY = ^TAG_APE_BINARY; + TAG_APE_BINARY = record + key: PAnsiChar; + data: PAnsiChar; + length: DWORD; + end; + + // BWF "bext" tag structure + PTAG_BEXT = ^TAG_BEXT; + TAG_BEXT = packed record + Description: Array[0..255] of AnsiChar; // description + Originator: Array[0..31] of AnsiChar; // name of the originator + OriginatorReference: Array[0..31] of AnsiChar; // reference of the originator + OriginationDate: Array[0..9] of AnsiChar; // date of creation (yyyy-mm-dd) + OriginationTime: Array[0..7] of AnsiChar; // time of creation (hh-mm-ss) + TimeReference: QWORD; // first sample count since midnight (little-endian) + Version: Word; // BWF version (little-endian) + UMID: Array[0..63] of Byte; // SMPTE UMID + Reserved: Array[0..189] of Byte; + CodingHistory: AnsiChar; // history + end; + + BASS_DX8_CHORUS = record + fWetDryMix: Single; + fDepth: Single; + fFeedback: Single; + fFrequency: Single; + lWaveform: DWORD; // 0=triangle, 1=sine + fDelay: Single; + lPhase: DWORD; // BASS_DX8_PHASE_xxx + end; + + BASS_DX8_COMPRESSOR = record + fGain: Single; + fAttack: Single; + fRelease: Single; + fThreshold: Single; + fRatio: Single; + fPredelay: Single; + end; + + BASS_DX8_DISTORTION = record + fGain: Single; + fEdge: Single; + fPostEQCenterFrequency: Single; + fPostEQBandwidth: Single; + fPreLowpassCutoff: Single; + end; + + BASS_DX8_ECHO = record + fWetDryMix: Single; + fFeedback: Single; + fLeftDelay: Single; + fRightDelay: Single; + lPanDelay: BOOL; + end; + + BASS_DX8_FLANGER = record + fWetDryMix: Single; + fDepth: Single; + fFeedback: Single; + fFrequency: Single; + lWaveform: DWORD; // 0=triangle, 1=sine + fDelay: Single; + lPhase: DWORD; // BASS_DX8_PHASE_xxx + end; + + BASS_DX8_GARGLE = record + dwRateHz: DWORD; // Rate of modulation in hz + dwWaveShape: DWORD; // 0=triangle, 1=square + end; + + BASS_DX8_I3DL2REVERB = record + lRoom: Integer; // [-10000, 0] default: -1000 mB + lRoomHF: Integer; // [-10000, 0] default: 0 mB + flRoomRolloffFactor: Single; // [0.0, 10.0] default: 0.0 + flDecayTime: Single; // [0.1, 20.0] default: 1.49s + flDecayHFRatio: Single; // [0.1, 2.0] default: 0.83 + lReflections: Integer; // [-10000, 1000] default: -2602 mB + flReflectionsDelay: Single; // [0.0, 0.3] default: 0.007 s + lReverb: Integer; // [-10000, 2000] default: 200 mB + flReverbDelay: Single; // [0.0, 0.1] default: 0.011 s + flDiffusion: Single; // [0.0, 100.0] default: 100.0 % + flDensity: Single; // [0.0, 100.0] default: 100.0 % + flHFReference: Single; // [20.0, 20000.0] default: 5000.0 Hz + end; + + BASS_DX8_PARAMEQ = record + fCenter: Single; + fBandwidth: Single; + fGain: Single; + end; + + BASS_DX8_REVERB = record + fInGain: Single; // [-96.0,0.0] default: 0.0 dB + fReverbMix: Single; // [-96.0,0.0] default: 0.0 db + fReverbTime: Single; // [0.001,3000.0] default: 1000.0 ms + fHighFreqRTRatio: Single; // [0.001,0.999] default: 0.001 + end; + + BASS_FX_VOLUME_PARAM = record + fTarget: Single; + fCurrent: Single; + fTime: Single; + lCurve: DWORD; + end; + + // callback function types + STREAMPROC = function(handle: HSTREAM; buffer: Pointer; length: DWORD; user: Pointer): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; + { + User stream callback function. + handle : The stream that needs writing + buffer : Buffer to write the samples in + length : Number of bytes to write + user : The 'user' parameter value given when calling BASS_StreamCreate + RETURN : Number of bytes written. Set the BASS_STREAMPROC_END flag to end + the stream. + } + +const + // special STREAMPROCs + STREAMPROC_DUMMY = Pointer(0); // "dummy" stream + STREAMPROC_PUSH = Pointer(-1); // push stream + STREAMPROC_DEVICE = Pointer(-2); // device mix stream + STREAMPROC_DEVICE_3D = Pointer(-3); // device 3D mix stream + +type + DOWNLOADPROC = procedure(buffer: Pointer; length: DWORD; user: Pointer); {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; + { + Internet stream download callback function. + buffer : Buffer containing the downloaded data... NULL=end of download + length : Number of bytes in the buffer + user : The 'user' parameter value given when calling BASS_StreamCreateURL + } + + SYNCPROC = procedure(handle: HSYNC; channel, data: DWORD; user: Pointer); {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; + { + Sync callback function. + handle : The sync that has occured + channel: Channel that the sync occured in + data : Additional data associated with the sync's occurance + user : The 'user' parameter given when calling BASS_ChannelSetSync + } + + DSPPROC = procedure(handle: HDSP; channel: DWORD; buffer: Pointer; length: DWORD; user: Pointer); {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; + { + DSP callback function. + handle : The DSP handle + channel: Channel that the DSP is being applied to + buffer : Buffer to apply the DSP to + length : Number of bytes in the buffer + user : The 'user' parameter given when calling BASS_ChannelSetDSP + } + + RECORDPROC = function(handle: HRECORD; buffer: Pointer; length: DWORD; user: Pointer): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; + { + Recording callback function. + handle : The recording handle + buffer : Buffer containing the recorded sample data + length : Number of bytes + user : The 'user' parameter value given when calling BASS_RecordStart + RETURN : TRUE = continue recording, FALSE = stop + } + + +// Functions +const +{$IFDEF MSWINDOWS} + bassdll = 'bass.dll'; +{$ENDIF} +{$IFDEF LINUX} + bassdll = 'libbass.so'; +{$ENDIF} +{$IFDEF MACOS} + bassdll = 'libbass.dylib'; +{$ENDIF} +{$IFDEF ANDROID} + bassdll = 'libbass.so'; +{$ENDIF} + +function BASS_SetConfig(option, value: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_GetConfig(option: DWORD): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SetConfigPtr(option: DWORD; value: Pointer): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_GetConfigPtr(option: DWORD): Pointer; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_GetVersion: DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ErrorGetCode: Integer; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_GetDeviceInfo(device: DWORD; var info: BASS_DEVICEINFO): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +{$IFDEF MSWINDOWS} +function BASS_Init(device: Integer; freq, flags: DWORD; win: HWND; clsid: PGUID): BOOL; stdcall; external bassdll; +{$ELSE} +function BASS_Init(device: Integer; freq, flags: DWORD; win: Pointer; clsid: Pointer): BOOL; cdecl; external bassdll; +{$ENDIF} +function BASS_SetDevice(device: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_GetDevice: DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_Free: BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +{$IFDEF MSWINDOWS} +function BASS_GetDSoundObject(obj: DWORD): Pointer; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +{$ENDIF} +function BASS_GetInfo(var info: BASS_INFO): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_Update(length: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_GetCPU: Single; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_Start: BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_Stop: BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_Pause: BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_IsStarted: BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SetVolume(volume: Single): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_GetVolume: Single; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; + +function BASS_PluginLoad(filename: PChar; flags: DWORD): HPLUGIN; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_PluginFree(handle: HPLUGIN): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_PluginGetInfo(handle: HPLUGIN): PBASS_PLUGININFO; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; + +function BASS_Set3DFactors(distf, rollf, doppf: Single): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_Get3DFactors(var distf, rollf, doppf: Single): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_Set3DPosition(var pos, vel, front, top: BASS_3DVECTOR): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_Get3DPosition(var pos, vel, front, top: BASS_3DVECTOR): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +procedure BASS_Apply3D; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +{$IFDEF MSWINDOWS} +function BASS_SetEAXParameters(env: Integer; vol, decay, damp: Single): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_GetEAXParameters(var env: DWORD; var vol, decay, damp: Single): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +{$ENDIF} + +function BASS_MusicLoad(mem: BOOL; f: Pointer; offset: QWORD; length, flags, freq: DWORD): HMUSIC; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_MusicFree(handle: HMUSIC): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; + +function BASS_SampleLoad(mem: BOOL; f: Pointer; offset: QWORD; length, max, flags: DWORD): HSAMPLE; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SampleCreate(length, freq, chans, max, flags: DWORD): HSAMPLE; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SampleFree(handle: HSAMPLE): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SampleSetData(handle: HSAMPLE; buffer: Pointer): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SampleGetData(handle: HSAMPLE; buffer: Pointer): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SampleGetInfo(handle: HSAMPLE; var info: BASS_SAMPLE): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SampleSetInfo(handle: HSAMPLE; var info: BASS_SAMPLE): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SampleGetChannel(handle: HSAMPLE; onlynew: BOOL): HCHANNEL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SampleGetChannels(handle: HSAMPLE; channels: Pointer): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SampleStop(handle: HSAMPLE): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; + +function BASS_StreamCreate(freq, chans, flags: DWORD; proc: STREAMPROC; user: Pointer): HSTREAM; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_StreamCreateFile(mem: BOOL; f: Pointer; offset, length: QWORD; flags: DWORD): HSTREAM; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_StreamCreateURL(url: PChar; offset: DWORD; flags: DWORD; proc: DOWNLOADPROC; user: Pointer):HSTREAM; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_StreamCreateFileUser(system, flags: DWORD; var procs: BASS_FILEPROCS; user: Pointer): HSTREAM; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_StreamFree(handle: HSTREAM): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_StreamGetFilePosition(handle: HSTREAM; mode: DWORD): QWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_StreamPutData(handle: HSTREAM; buffer: Pointer; length: DWORD): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_StreamPutFileData(handle: HSTREAM; buffer: Pointer; length: DWORD): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; + +function BASS_RecordGetDeviceInfo(device: DWORD; var info: BASS_DEVICEINFO): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_RecordInit(device: Integer):BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_RecordSetDevice(device: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_RecordGetDevice: DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_RecordFree: BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_RecordGetInfo(var info: BASS_RECORDINFO): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_RecordGetInputName(input: Integer): PAnsiChar; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_RecordSetInput(input: Integer; flags: DWORD; volume: Single): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_RecordGetInput(input: Integer; var volume: Single): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_RecordStart(freq, chans, flags: DWORD; proc: RECORDPROC; user: Pointer): HRECORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; + +function BASS_ChannelBytes2Seconds(handle: DWORD; pos: QWORD): Double; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};external bassdll; +function BASS_ChannelSeconds2Bytes(handle: DWORD; pos: Double): QWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};external bassdll; +function BASS_ChannelGetDevice(handle: DWORD): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelSetDevice(handle, device: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelIsActive(handle: DWORD): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};external bassdll; +function BASS_ChannelGetInfo(handle: DWORD; var info: BASS_CHANNELINFO):BOOL;{$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};external bassdll; +function BASS_ChannelGetTags(handle: HSTREAM; tags: DWORD): PAnsiChar; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelFlags(handle, flags, mask: DWORD): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelUpdate(handle, length: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelLock(handle: DWORD; lock: BOOL): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelPlay(handle: DWORD; restart: BOOL): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelStop(handle: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelPause(handle: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelSetAttribute(handle, attrib: DWORD; value: Single): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelGetAttribute(handle, attrib: DWORD; var value: Single): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelSlideAttribute(handle, attrib: DWORD; value: Single; time: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelIsSliding(handle, attrib: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};external bassdll; +function BASS_ChannelSetAttributeEx(handle, attrib: DWORD; value: Pointer; size: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};external bassdll; +function BASS_ChannelGetAttributeEx(handle, attrib: DWORD; value: Pointer; size: DWORD): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};external bassdll; +function BASS_ChannelSet3DAttributes(handle: DWORD; mode: Integer; min, max: Single; iangle, oangle, outvol: Integer): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelGet3DAttributes(handle: DWORD; var mode: DWORD; var min, max: Single; var iangle, oangle, outvol: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelSet3DPosition(handle: DWORD; var pos, orient, vel: BASS_3DVECTOR): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelGet3DPosition(handle: DWORD; var pos, orient, vel: BASS_3DVECTOR): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelGetLength(handle, mode: DWORD): QWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelSetPosition(handle: DWORD; pos: QWORD; mode: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelGetPosition(handle, mode: DWORD): QWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelGetLevel(handle: DWORD): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelGetLevelEx(handle: DWORD; levels: PSingle; length: Single; flags: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelGetData(handle: DWORD; buffer: Pointer; length: DWORD): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelSetSync(handle: DWORD; type_: DWORD; param: QWORD; proc: SYNCPROC; user: Pointer): HSYNC; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelRemoveSync(handle: DWORD; sync: HSYNC): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelSetDSP(handle: DWORD; proc: DSPPROC; user: Pointer; priority: Integer): HDSP; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelRemoveDSP(handle: DWORD; dsp: HDSP): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelSetLink(handle, chan: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelRemoveLink(handle, chan: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelSetFX(handle, type_: DWORD; priority: Integer): HFX; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelRemoveFX(handle: DWORD; fx: HFX): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; + +function BASS_FXSetParameters(handle: HFX; par: Pointer): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_FXGetParameters(handle: HFX; par: Pointer): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_FXReset(handle: HFX): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_FXSetPriority(handle: HFX; priority: Integer): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; + + +function BASS_SPEAKER_N(n: DWORD): DWORD; +{$IFDEF MSWINDOWS} +function BASS_SetEAXPreset(env: Integer): BOOL; +{ + This function is defined in the implementation part of this unit. + It is not part of BASS.DLL but an extra function which makes it easier + to set the predefined EAX environments. + env : a EAX_ENVIRONMENT_xxx constant +} +{$ENDIF} + + +implementation + +function BASS_SPEAKER_N(n: DWORD): DWORD; +begin + Result := n shl 24; +end; + +{$IFDEF MSWINDOWS} +function BASS_SetEAXPreset(env: Integer): BOOL; +begin + case (env) of + EAX_ENVIRONMENT_GENERIC: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_GENERIC, 0.5, 1.493, 0.5); + EAX_ENVIRONMENT_PADDEDCELL: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_PADDEDCELL, 0.25, 0.1, 0); + EAX_ENVIRONMENT_ROOM: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_ROOM, 0.417, 0.4, 0.666); + EAX_ENVIRONMENT_BATHROOM: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_BATHROOM, 0.653, 1.499, 0.166); + EAX_ENVIRONMENT_LIVINGROOM: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_LIVINGROOM, 0.208, 0.478, 0); + EAX_ENVIRONMENT_STONEROOM: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_STONEROOM, 0.5, 2.309, 0.888); + EAX_ENVIRONMENT_AUDITORIUM: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_AUDITORIUM, 0.403, 4.279, 0.5); + EAX_ENVIRONMENT_CONCERTHALL: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_CONCERTHALL, 0.5, 3.961, 0.5); + EAX_ENVIRONMENT_CAVE: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_CAVE, 0.5, 2.886, 1.304); + EAX_ENVIRONMENT_ARENA: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_ARENA, 0.361, 7.284, 0.332); + EAX_ENVIRONMENT_HANGAR: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_HANGAR, 0.5, 10.0, 0.3); + EAX_ENVIRONMENT_CARPETEDHALLWAY: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_CARPETEDHALLWAY, 0.153, 0.259, 2.0); + EAX_ENVIRONMENT_HALLWAY: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_HALLWAY, 0.361, 1.493, 0); + EAX_ENVIRONMENT_STONECORRIDOR: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_STONECORRIDOR, 0.444, 2.697, 0.638); + EAX_ENVIRONMENT_ALLEY: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_ALLEY, 0.25, 1.752, 0.776); + EAX_ENVIRONMENT_FOREST: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_FOREST, 0.111, 3.145, 0.472); + EAX_ENVIRONMENT_CITY: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_CITY, 0.111, 2.767, 0.224); + EAX_ENVIRONMENT_MOUNTAINS: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_MOUNTAINS, 0.194, 7.841, 0.472); + EAX_ENVIRONMENT_QUARRY: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_QUARRY, 1, 1.499, 0.5); + EAX_ENVIRONMENT_PLAIN: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_PLAIN, 0.097, 2.767, 0.224); + EAX_ENVIRONMENT_PARKINGLOT: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_PARKINGLOT, 0.208, 1.652, 1.5); + EAX_ENVIRONMENT_SEWERPIPE: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_SEWERPIPE, 0.652, 2.886, 0.25); + EAX_ENVIRONMENT_UNDERWATER: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_UNDERWATER, 1, 1.499, 0); + EAX_ENVIRONMENT_DRUGGED: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_DRUGGED, 0.875, 8.392, 1.388); + EAX_ENVIRONMENT_DIZZY: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_DIZZY, 0.139, 17.234, 0.666); + EAX_ENVIRONMENT_PSYCHOTIC: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_PSYCHOTIC, 0.486, 7.563, 0.806); + else + Result := FALSE; + end; +end; +{$ENDIF} + +end. + diff --git a/bass-sys/linux/bass24/plugins/makefile b/bass-sys/linux/bass24/plugins/makefile new file mode 100644 index 0000000..1197843 --- /dev/null +++ b/bass-sys/linux/bass24/plugins/makefile @@ -0,0 +1,9 @@ +TARGET = plugins +PACKAGES = gtk+-2.0 libglade-2.0 + +include ../makefile.in + +all: $(TARGET) + +clean: + $(RM) $(TARGET) diff --git a/bass-sys/linux/bass24/plugins/plugins.c b/bass-sys/linux/bass24/plugins/plugins.c new file mode 100644 index 0000000..35c1eda --- /dev/null +++ b/bass-sys/linux/bass24/plugins/plugins.c @@ -0,0 +1,225 @@ +/* + BASS plugin test + Copyright (c) 2005-2009 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include "bass.h" + +// path to glade file +#ifndef GLADE_PATH +#define GLADE_PATH "" +#endif + +GladeXML *glade; +GtkWidget *win = 0; +GtkWidget *filesel; + +DWORD chan; // the channel... HMUSIC or HSTREAM + +// display error messages +void Error(const char *es) +{ + GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); +} + +// translate a CTYPE value to text +const char *GetCTypeString(DWORD ctype, HPLUGIN plugin) +{ + if (plugin) { // using a plugin + const BASS_PLUGININFO *pinfo = BASS_PluginGetInfo(plugin); // get plugin info + int a; + for (a = 0; a < pinfo->formatc; a++) { + if (pinfo->formats[a].ctype == ctype) // found a "ctype" match... + return pinfo->formats[a].name; // return it's name + } + } + // check built-in stream formats... + if (ctype == BASS_CTYPE_STREAM_OGG) return "Ogg Vorbis"; + if (ctype == BASS_CTYPE_STREAM_MP1) return "MPEG layer 1"; + if (ctype == BASS_CTYPE_STREAM_MP2) return "MPEG layer 2"; + if (ctype == BASS_CTYPE_STREAM_MP3) return "MPEG layer 3"; + if (ctype == BASS_CTYPE_STREAM_AIFF) return "Audio IFF"; + if (ctype == BASS_CTYPE_STREAM_WAV_PCM) return "PCM WAVE"; + if (ctype == BASS_CTYPE_STREAM_WAV_FLOAT) return "Floating-point WAVE"; + if (ctype & BASS_CTYPE_STREAM_WAV) return "WAVE"; + return "?"; +} + +#define GetWidget(id) glade_xml_get_widget(glade,id) + +void WindowDestroy(GtkObject *obj, gpointer data) +{ + gtk_main_quit(); +} + +gboolean FileExtensionFilter(const GtkFileFilterInfo *info, gpointer data) +{ + return !regexec((regex_t*)data, info->filename, 0, NULL, 0); +} + +void OpenClicked(GtkButton *obj, gpointer data) +{ + int resp = gtk_dialog_run(GTK_DIALOG(filesel)); + gtk_widget_hide(filesel); + if (resp == GTK_RESPONSE_ACCEPT) { + char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filesel)); + BASS_StreamFree(chan); // free old stream before opening new + if (!(chan = BASS_StreamCreateFile(FALSE, file, 0, 0, BASS_SAMPLE_LOOP))) { + gtk_button_set_label(obj, "click here to open a file..."); + gtk_label_set_text(GTK_LABEL(GetWidget("info")), ""); + gtk_range_set_range(GTK_RANGE(GetWidget("position")), 0, 0); + Error("Can't play the file"); + } else { + gtk_button_set_label(obj, file); + { // display the file type and length + char text[100]; + QWORD bytes = BASS_ChannelGetLength(chan, BASS_POS_BYTE); + DWORD time = BASS_ChannelBytes2Seconds(chan, bytes); + BASS_CHANNELINFO info; + BASS_ChannelGetInfo(chan, &info); + sprintf(text, "channel type = %x (%s)\nlength = %llu (%u:%02u)", + info.ctype, GetCTypeString(info.ctype, info.plugin), bytes, time / 60, time % 60); + gtk_label_set_text(GTK_LABEL(GetWidget("info")), text); + gtk_range_set_range(GTK_RANGE(GetWidget("position")), 0, time); // update scroller range + } + BASS_ChannelPlay(chan, FALSE); + } + g_free(file); + } +} + +gboolean PositionChange(GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data) +{ + BASS_ChannelSetPosition(chan, BASS_ChannelSeconds2Bytes(chan, value), BASS_POS_BYTE); + return FALSE; +} + +gboolean TimerProc(gpointer data) +{ + gtk_range_set_value(GTK_RANGE(GetWidget("position")), BASS_ChannelBytes2Seconds(chan, BASS_ChannelGetPosition(chan, BASS_POS_BYTE))); // update position + return TRUE; +} + +int main(int argc, char* argv[]) +{ + gtk_init(&argc, &argv); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + Error("An incorrect version of BASS was loaded"); + return 0; + } + + // initialize default output device + if (!BASS_Init(-1, 44100, 0, NULL, NULL)) { + Error("Can't initialize device"); + return 0; + } + + // initialize GUI + glade = glade_xml_new(GLADE_PATH"plugins.glade", NULL, NULL); + if (!glade) return 0; + win = GetWidget("window1"); + if (!win) return 0; + glade_xml_signal_autoconnect(glade); + + { // setup plugin list and file selector + GtkTreeView *list = GTK_TREE_VIEW(GetWidget("plugins")); + GtkTreeViewColumn *col = gtk_tree_view_column_new(); + gtk_tree_view_append_column(list, col); + GtkCellRenderer *renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_column_pack_start(col, renderer, TRUE); + gtk_tree_view_column_add_attribute(col, renderer, "text", 0); + GtkListStore *liststore = gtk_list_store_new(1, G_TYPE_STRING); + gtk_tree_view_set_model(list, GTK_TREE_MODEL(liststore)); + g_object_unref(liststore); + gtk_tree_selection_set_mode(gtk_tree_view_get_selection(list), GTK_SELECTION_NONE); + + GtkFileFilter *filter; + regex_t *fregex; + filesel = gtk_file_chooser_dialog_new("Open File", GTK_WINDOW(win), GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "BASS built-in (*.wav;*.aif;*.mp3;*.mp2;*.mp1;*.ogg)"); + fregex = malloc(sizeof(*fregex)); + regcomp(fregex, "\\.(mp[1-3]|ogg|wav|aif)$", REG_ICASE | REG_NOSUB | REG_EXTENDED); + gtk_file_filter_add_custom(filter, GTK_FILE_FILTER_FILENAME, FileExtensionFilter, fregex, NULL); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + { // look for plugins (in the executable's directory) + glob_t g; + char path[300]; + if (readlink("/proc/self/exe", path, 300) <= 0) { + Error("Can't locate executable"); + return 0; + } + strcpy(strrchr(path, '/') + 1, "libbass*.so"); + if (!glob(path, 0, 0, &g)) { + int a; + for (a = 0; a < g.gl_pathc; a++) { + HPLUGIN plug; + if (plug = BASS_PluginLoad(g.gl_pathv[a], 0)) { // plugin loaded... + // add it to the list + char *file = strrchr(g.gl_pathv[a], '/') + 1; + GtkTreeIter it; + gtk_list_store_append(liststore, &it); + gtk_list_store_set(liststore, &it, 0, file, -1); + // get plugin info to add to the file selector filter + const BASS_PLUGININFO *pinfo = BASS_PluginGetInfo(plug); + int b; + for (b = 0; b < pinfo->formatc; b++) { + char buf[300], *p; + filter = gtk_file_filter_new(); + sprintf(buf, "%s (%s) - %s", pinfo->formats[b].name, pinfo->formats[b].exts, file); + gtk_file_filter_set_name(filter, buf); + // build filter regex + sprintf(buf, "\\.(%s)$", pinfo->formats[b].exts); + while (p = strchr(buf, '*')) { // find an extension + if (p[-1] == ';') // not the first... + p[-1] = '|'; // add an alternation + memmove(p, p + 2, strlen(p + 2) + 1); // remove the "*." + } + fregex = malloc(sizeof(*fregex)); + regcomp(fregex, buf, REG_ICASE | REG_NOSUB | REG_EXTENDED); + gtk_file_filter_add_custom(filter, GTK_FILE_FILTER_FILENAME, FileExtensionFilter, fregex, NULL); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + } + } + } + globfree(&g); + } + { + GtkTreeIter it; + if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(liststore), &it)) { // no plugins... + gtk_list_store_append(liststore, &it); + gtk_list_store_set(liststore, &it, 0, "no plugins - visit the BASS webpage to get some", -1); + } + } + } + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "All files"); + gtk_file_filter_add_pattern(filter, "*"); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + } + + g_timeout_add(500, TimerProc, NULL); + + gtk_main(); + + gtk_widget_destroy(filesel); + + // "free" the output device and all plugins + BASS_Free(); + BASS_PluginFree(0); + + return 0; +} diff --git a/bass-sys/linux/bass24/plugins/plugins.glade b/bass-sys/linux/bass24/plugins/plugins.glade new file mode 100644 index 0000000..8e7cac7 --- /dev/null +++ b/bass-sys/linux/bass24/plugins/plugins.glade @@ -0,0 +1,89 @@ + + + + + 400 + True + 5 + BASS plugin test + False + GTK_WIN_POS_CENTER + + + + True + 5 + + + True + 0 + GTK_SHADOW_OUT + + + True + 6 + 10 + 10 + 10 + + + 100 + True + True + False + True + + + + + + + True + Loaded plugins + True + + + label_item + + + + + + + True + True + True + click here to open a file... + 0 + + + + False + 10 + 1 + + + + + True + + + 2 + + + + + True + True + 0 0 0 1 10 0 + False + + + + 3 + + + + + + diff --git a/bass-sys/linux/bass24/rectest/makefile b/bass-sys/linux/bass24/rectest/makefile new file mode 100644 index 0000000..e7c1d2d --- /dev/null +++ b/bass-sys/linux/bass24/rectest/makefile @@ -0,0 +1,9 @@ +TARGET = rectest +PACKAGES = gtk+-2.0 libglade-2.0 + +include ../makefile.in + +all: $(TARGET) + +clean: + $(RM) $(TARGET) diff --git a/bass-sys/linux/bass24/rectest/rectest.c b/bass-sys/linux/bass24/rectest/rectest.c new file mode 100644 index 0000000..70145ee --- /dev/null +++ b/bass-sys/linux/bass24/rectest/rectest.c @@ -0,0 +1,276 @@ +/* + BASS recording example + Copyright (c) 2002-2019 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include +#include "bass.h" + +// path to glade file +#ifndef GLADE_PATH +#define GLADE_PATH "" +#endif + +GladeXML *glade; +GtkWidget *win = 0; +GtkWidget *filesel; // file selector + +#define FREQ 44100 +#define CHANS 2 +#define BUFSTEP 200000 // memory allocation unit + +int input; // current input source +char *recbuf = NULL; // recording buffer +DWORD reclen; // recording length + +HRECORD rchan = 0; // recording channel +HSTREAM chan = 0; // playback channel + +// display error messages +void Error(const char *es) +{ + GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); +} + +#define GetWidget(id) glade_xml_get_widget(glade,id) + +void WindowDestroy(GtkObject *obj, gpointer data) +{ + gtk_main_quit(); +} + +// buffer the recorded data +BOOL CALLBACK RecordingCallback(HRECORD handle, const void *buffer, DWORD length, void *user) +{ + // increase buffer size if needed + if ((reclen % BUFSTEP) + length >= BUFSTEP) { + recbuf = realloc(recbuf, ((reclen + length) / BUFSTEP + 1) * BUFSTEP); + if (!recbuf) { + rchan = 0; + Error("Out of memory!"); + gtk_button_set_label(GTK_BUTTON(GetWidget("record")), "Record"); + return FALSE; // stop recording + } + } + // buffer the data + memcpy(recbuf + reclen, buffer, length); + reclen += length; + return TRUE; // continue recording +} + +void StartRecording() +{ + WAVEFORMATEX *wf; + if (recbuf) { // free old recording + BASS_StreamFree(chan); + chan = 0; + free(recbuf); + recbuf = NULL; + gtk_widget_set_sensitive(GetWidget("play"), FALSE); + gtk_widget_set_sensitive(GetWidget("save"), FALSE); + } + // allocate initial buffer and make space for WAVE header + recbuf = malloc(BUFSTEP); + reclen = 44; + // fill the WAVE header + memcpy(recbuf, "RIFF\0\0\0\0WAVEfmt \20\0\0\0", 20); + memcpy(recbuf + 36, "data\0\0\0\0", 8); + wf = (WAVEFORMATEX*)(recbuf + 20); + wf->wFormatTag = 1; + wf->nChannels = CHANS; + wf->wBitsPerSample = 16; + wf->nSamplesPerSec = FREQ; + wf->nBlockAlign = wf->nChannels * wf->wBitsPerSample / 8; + wf->nAvgBytesPerSec = wf->nSamplesPerSec * wf->nBlockAlign; + // start recording + rchan = BASS_RecordStart(FREQ, CHANS, 0, RecordingCallback, 0); + if (!rchan) { + Error("Can't start recording"); + free(recbuf); + recbuf = 0; + return; + } + gtk_button_set_label(GTK_BUTTON(GetWidget("record")), "Stop"); +} + +void StopRecording() +{ + BASS_ChannelStop(rchan); + rchan = 0; + gtk_button_set_label(GTK_BUTTON(GetWidget("record")), "Record"); + // complete the WAVE header + *(DWORD*)(recbuf + 4) = reclen - 8; + *(DWORD*)(recbuf + 40) = reclen - 44; + // enable "save" button + gtk_widget_set_sensitive(GetWidget("save"), TRUE); + // create a stream from the recording + if (chan = BASS_StreamCreateFile(TRUE, recbuf, 0, reclen, 0)) + gtk_widget_set_sensitive(GetWidget("play"), TRUE); // enable "play" button +} + +gboolean FileExtensionFilter(const GtkFileFilterInfo *info, gpointer data) +{ + return !regexec((regex_t*)data, info->filename, 0, NULL, 0); +} + +// write the recorded data to disk +void WriteToDisk() +{ + int resp = gtk_dialog_run(GTK_DIALOG(filesel)); + gtk_widget_hide(filesel); + if (resp == GTK_RESPONSE_ACCEPT) { + char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filesel)); + FILE *fp = fopen(file, "wb"); + if (fp) { + fwrite(recbuf, reclen, 1, fp); + fclose(fp); + } else + Error("Can't create the file"); + g_free(file); + } +} + +void UpdateInputInfo() +{ + float level; + int r = BASS_RecordGetInput(input, &level); // get info on the input + if (r == -1 || level < 0) { // failed + r = BASS_RecordGetInput(-1, &level); // try master input instead + if (r == -1 || level < 0) level = 1; // that failed too, just display 100% + } + gtk_range_set_value(GTK_RANGE(GetWidget("level")), level * 100); // set the level slider +} + +void RecordClicked(GtkButton *obj, gpointer data) +{ + if (!rchan) + StartRecording(); + else + StopRecording(); +} + +void PlayClicked(GtkButton *obj, gpointer data) +{ + BASS_ChannelPlay(chan, TRUE); // play the recorded data +} + +void SaveClicked(GtkButton *obj, gpointer data) +{ + WriteToDisk(); +} + +void InputChanged(GtkComboBox *obj, gpointer data) +{ + int i; + input = gtk_combo_box_get_active(obj); // get the selection + // enable the selected input + for (i = 0; BASS_RecordSetInput(i, BASS_INPUT_OFF, -1); i++); // 1st disable all inputs, then... + BASS_RecordSetInput(input, BASS_INPUT_ON, -1); // enable the selected + UpdateInputInfo(); // update info +} + +void LevelChanged(GtkRange *range, gpointer data) +{ + double level = gtk_range_get_value(range) / 100; + if (!BASS_RecordSetInput(input, 0, level)) // failed to set input level + BASS_RecordSetInput(-1, 0, level); // try master level instead +} + +gboolean TimerProc(gpointer data) +{ // update the recording/playback counter + char text[30] = ""; + if (rchan) { // recording + if (!BASS_ChannelIsActive(rchan)) { // the recording has stopped, eg. unplugged device + StopRecording(); + Error("The recording stopped"); + return TRUE; + } + sprintf(text, "%d", reclen - 44); + } else if (chan) { + if (BASS_ChannelIsActive(chan)) // playing + sprintf(text, "%lld / %lld", BASS_ChannelGetPosition(chan, BASS_POS_BYTE), BASS_ChannelGetLength(chan, BASS_POS_BYTE)); + else + sprintf(text, "%lld", BASS_ChannelGetLength(chan, BASS_POS_BYTE)); + } + gtk_label_set(GTK_LABEL(GetWidget("status")), text); + return TRUE; +} + +int main(int argc, char* argv[]) +{ + regex_t fregex; + + gtk_init(&argc, &argv); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + Error("An incorrect version of BASS was loaded"); + return 0; + } + + // initalize default recording device + if (!BASS_RecordInit(-1)) { + Error("Can't initialize recording device"); + return 0; + } + // initialize default output device + if (!BASS_Init(-1, FREQ, 0, NULL, NULL)) + Error("Can't initialize output device"); + + // initialize GUI + glade = glade_xml_new(GLADE_PATH"rectest.glade", NULL, NULL); + if (!glade) return 0; + win = GetWidget("window1"); + if (!win) return 0; + glade_xml_signal_autoconnect(glade); + + { // get list of inputs + int c; + const char *i; + GtkComboBox *list = GTK_COMBO_BOX(GetWidget("input")); + for (c = 0; i = BASS_RecordGetInputName(c); c++) { + gtk_combo_box_append_text(list, i); + if (!(BASS_RecordGetInput(c, NULL) & BASS_INPUT_OFF)) { // this 1 is currently "on" + input = c; + gtk_combo_box_set_active(list, input); + UpdateInputInfo(); // display info + } + } + } + + { // initialize file selector + GtkFileFilter *filter; + filesel = gtk_file_chooser_dialog_new("Save File", GTK_WINDOW(win), GTK_FILE_CHOOSER_ACTION_SAVE, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL); + gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(filesel), TRUE); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "WAV files"); + regcomp(&fregex, "\\.wav$", REG_ICASE | REG_NOSUB | REG_EXTENDED); + gtk_file_filter_add_custom(filter, GTK_FILE_FILTER_FILENAME, FileExtensionFilter, &fregex, NULL); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "All files"); + gtk_file_filter_add_pattern(filter, "*"); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + } + + g_timeout_add(200, TimerProc, NULL); + + gtk_main(); + + gtk_widget_destroy(filesel); + regfree(&fregex); + + // release all BASS stuff + BASS_RecordFree(); + BASS_Free(); + + return 0; +} diff --git a/bass-sys/linux/bass24/rectest/rectest.glade b/bass-sys/linux/bass24/rectest/rectest.glade new file mode 100644 index 0000000..6d2de2a --- /dev/null +++ b/bass-sys/linux/bass24/rectest/rectest.glade @@ -0,0 +1,128 @@ + + + + + 400 + True + 5 + BASS recording test + False + GTK_WIN_POS_CENTER + + + + True + 5 + + + True + 5 + + + True + + + + + + + True + True + 0 0 100 1 10 0 + False + + + + 1 + + + + + + + True + 5 + + + True + 5 + + + True + True + True + Record + 0 + + + + + + True + False + True + True + Play + 0 + + + + 1 + + + + + True + False + True + True + Save + 0 + + + + 2 + + + + + False + + + + + True + 0 + 0 + GTK_SHADOW_OUT + + + True + + + 250 + True + + + + + + + + label_item + + + + + 1 + + + + + 1 + + + + + + diff --git a/bass-sys/linux/bass24/speakers/makefile b/bass-sys/linux/bass24/speakers/makefile new file mode 100644 index 0000000..2d077bc --- /dev/null +++ b/bass-sys/linux/bass24/speakers/makefile @@ -0,0 +1,9 @@ +TARGET = speakers +PACKAGES = gtk+-2.0 libglade-2.0 + +include ../makefile.in + +all: $(TARGET) + +clean: + $(RM) $(TARGET) diff --git a/bass-sys/linux/bass24/speakers/speakers.c b/bass-sys/linux/bass24/speakers/speakers.c new file mode 100644 index 0000000..43a9bf8 --- /dev/null +++ b/bass-sys/linux/bass24/speakers/speakers.c @@ -0,0 +1,158 @@ +/* + BASS multi-speaker example + Copyright (c) 2003-2009 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include +#include "bass.h" + +// path to glade file +#ifndef GLADE_PATH +#define GLADE_PATH "" +#endif + +GladeXML *glade; +GtkWidget *win = 0; +GtkWidget *filesel; + +DWORD flags[4] = { BASS_SPEAKER_FRONT,BASS_SPEAKER_REAR,BASS_SPEAKER_CENLFE,BASS_SPEAKER_REAR2 }; +HSTREAM chan[4]; + +// display error messages +void Error(const char *es) +{ + GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); +} + +#define GetWidget(id) glade_xml_get_widget(glade,id) + +void WindowDestroy(GtkObject *obj, gpointer data) +{ + gtk_main_quit(); +} + +gboolean FileExtensionFilter(const GtkFileFilterInfo *info, gpointer data) +{ + return !regexec((regex_t*)data, info->filename, 0, NULL, 0); +} + +void OpenClicked(GtkButton *obj, gpointer data) +{ + int resp = gtk_dialog_run(GTK_DIALOG(filesel)); + gtk_widget_hide(filesel); + if (resp == GTK_RESPONSE_ACCEPT) { + char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filesel)); + const gchar *objname = gtk_widget_get_name(GTK_WIDGET(obj)); + int speaker = atoi(objname + 4) - 1; // get speaker pair number from button name ("openX") + BASS_StreamFree(chan[speaker]); // free old stream before opening new + if (!(chan[speaker] = BASS_StreamCreateFile(FALSE, file, 0, 0, flags[speaker] | BASS_SAMPLE_LOOP))) { + gtk_button_set_label(obj, "click here to open a file..."); + Error("Can't play the file"); + } else { + gtk_button_set_label(obj, file); + BASS_ChannelPlay(chan[speaker], FALSE); + } + g_free(file); + } +} + +void SwapClicked(GtkButton *obj, gpointer data) +{ + const gchar *objname = gtk_widget_get_name(GTK_WIDGET(obj)); + int speaker = atoi(objname + 4) - 1; // get speaker pair number from button name ("swapX") + { // swap handles + HSTREAM temp = chan[speaker]; + chan[speaker] = chan[speaker + 1]; + chan[speaker + 1] = temp; + } + { // swap text + GtkButton *open1, *open2; + char bname[10], *temp; + sprintf(bname, "open%d", 1 + speaker); + open1 = GTK_BUTTON(GetWidget(bname)); + sprintf(bname, "open%d", 1 + speaker + 1); + open2 = GTK_BUTTON(GetWidget(bname)); + temp = strdup(gtk_button_get_label(open1)); + gtk_button_set_label(open1, gtk_button_get_label(open2)); + gtk_button_set_label(open2, temp); + free(temp); + } + // update the channel devices + BASS_ChannelFlags(chan[speaker], flags[speaker], BASS_SPEAKER_FRONT); + BASS_ChannelFlags(chan[speaker + 1], flags[speaker + 1], BASS_SPEAKER_FRONT); +} + +int main(int argc, char* argv[]) +{ + regex_t fregex; + + gtk_init(&argc, &argv); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + Error("An incorrect version of BASS was loaded"); + return 0; + } + + // initialize default device + if (!BASS_Init(-1, 44100, 0, NULL, NULL)) { + Error("Can't initialize device"); + return 0; + } + + // initialize GUI + glade = glade_xml_new(GLADE_PATH"speakers.glade", NULL, NULL); + if (!glade) return 0; + win = GetWidget("window1"); + if (!win) return 0; + glade_xml_signal_autoconnect(glade); + + { // check how many speakers the device supports + BASS_INFO i; + BASS_GetInfo(&i); + if (i.speakers < 8) { + gtk_widget_set_sensitive(GetWidget("open4"), FALSE); + gtk_widget_set_sensitive(GetWidget("swap3"), FALSE); + } + if (i.speakers < 6) { + gtk_widget_set_sensitive(GetWidget("open3"), FALSE); + gtk_widget_set_sensitive(GetWidget("swap2"), FALSE); + } + if (i.speakers < 4) { + gtk_widget_set_sensitive(GetWidget("open2"), FALSE); + gtk_widget_set_sensitive(GetWidget("swap1"), FALSE); + } + } + + { // initialize file selector + GtkFileFilter *filter; + filesel = gtk_file_chooser_dialog_new("Open File", GTK_WINDOW(win), GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "Playable files"); + regcomp(&fregex, "\\.(mo3|xm|mod|s3m|it|umx|mp[1-3]|ogg|wav|aif)$", REG_ICASE | REG_NOSUB | REG_EXTENDED); + gtk_file_filter_add_custom(filter, GTK_FILE_FILTER_FILENAME, FileExtensionFilter, &fregex, NULL); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "All files"); + gtk_file_filter_add_pattern(filter, "*"); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + } + + gtk_widget_show(win); + gtk_main(); + + gtk_widget_destroy(filesel); + regfree(&fregex); + + BASS_Free(); + + return 0; +} diff --git a/bass-sys/linux/bass24/speakers/speakers.glade b/bass-sys/linux/bass24/speakers/speakers.glade new file mode 100644 index 0000000..055c1a2 --- /dev/null +++ b/bass-sys/linux/bass24/speakers/speakers.glade @@ -0,0 +1,282 @@ + + + + + 450 + 5 + BASS multi-speaker example + False + GTK_WIN_POS_CENTER + + + + True + 5 + + + True + 0 + GTK_SHADOW_OUT + + + True + 6 + 10 + 10 + 10 + + + True + 5 + + + True + True + True + click here to open a file... + 0 + + + + + + + + + + True + 1 - front + True + + + label_item + + + + + False + + + + + True + + + + + + True + True + True + swap + 0 + + + + False + 10 + GTK_PACK_END + 1 + + + + + 1 + + + + + True + 0 + GTK_SHADOW_OUT + + + True + 6 + 10 + 10 + 10 + + + True + 5 + + + True + True + True + click here to open a file... + 0 + + + + + + + + + + True + 2 - rear + True + + + label_item + + + + + False + 2 + + + + + True + + + + + + True + True + True + swap + 0 + + + + False + 10 + GTK_PACK_END + 1 + + + + + 3 + + + + + True + 0 + GTK_SHADOW_OUT + + + True + 6 + 10 + 10 + 10 + + + True + 5 + + + True + True + True + click here to open a file... + 0 + + + + + + + + + + True + 3 - center/FLE + True + + + label_item + + + + + False + 4 + + + + + True + + + + + + True + True + True + swap + 0 + + + + False + 10 + GTK_PACK_END + 1 + + + + + 5 + + + + + True + 0 + GTK_SHADOW_OUT + + + True + 6 + 10 + 10 + 10 + + + True + 5 + + + True + True + True + click here to open a file... + 0 + + + + + + + + + + True + 4 - rear center + True + + + label_item + + + + + False + 6 + + + + + + diff --git a/bass-sys/linux/bass24/spectrum/makefile b/bass-sys/linux/bass24/spectrum/makefile new file mode 100644 index 0000000..847abdb --- /dev/null +++ b/bass-sys/linux/bass24/spectrum/makefile @@ -0,0 +1,9 @@ +TARGET = spectrum +PACKAGES = gtk+-2.0 + +include ../makefile.in + +all: $(TARGET) + +clean: + $(RM) $(TARGET) diff --git a/bass-sys/linux/bass24/spectrum/spectrum.c b/bass-sys/linux/bass24/spectrum/spectrum.c new file mode 100644 index 0000000..25d98de --- /dev/null +++ b/bass-sys/linux/bass24/spectrum/spectrum.c @@ -0,0 +1,241 @@ +/* + BASS spectrum analyser example + Copyright (c) 2002-2012 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include "bass.h" + +#define SPECWIDTH 368 // display width (should be multiple of 4) +#define SPECHEIGHT 127 // height (changing requires palette adjustments too) + +#pragma pack(1) +typedef struct { + BYTE rgbRed, rgbGreen, rgbBlue; +} RGB; +#pragma pack() + +GtkWidget *win = 0; + +DWORD chan; + +GtkWidget *speci; +GdkPixbuf *specpb; +RGB palette[256]; + +int specmode = 0, specpos = 0; // spectrum mode (and marker pos for 2nd mode) + +// display error messages +void Error(const char *es) +{ + GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); +} + +void WindowDestroy(GtkObject *obj, gpointer data) +{ + gtk_main_quit(); +} + +void WindowButtonRelease(GtkWidget *obj, GdkEventButton *event, gpointer data) +{ + if (event->type == GDK_BUTTON_RELEASE) { + RGB *specbuf = (RGB*)gdk_pixbuf_get_pixels(specpb); + specmode = (specmode + 1) % 4; // next spectrum mode + memset(specbuf, 0, SPECWIDTH * SPECHEIGHT * sizeof(*specbuf)); // clear display + } +} + +gboolean FileExtensionFilter(const GtkFileFilterInfo *info, gpointer data) +{ + return !regexec((regex_t*)data, info->filename, 0, NULL, 0); +} + +// select a file to play, and play it +BOOL PlayFile() +{ + BOOL ret = FALSE; + regex_t fregex; + GtkWidget *filesel; // file selector + GtkFileFilter *filter; + filesel = gtk_file_chooser_dialog_new("Open File", GTK_WINDOW(win), GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "Playable files"); + regcomp(&fregex, "\\.(mo3|xm|mod|s3m|it|umx|mp[1-3]|ogg|wav|aif)$", REG_ICASE | REG_NOSUB | REG_EXTENDED); + gtk_file_filter_add_custom(filter, GTK_FILE_FILTER_FILENAME, FileExtensionFilter, &fregex, NULL); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "All files"); + gtk_file_filter_add_pattern(filter, "*"); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filter); + if (gtk_dialog_run(GTK_DIALOG(filesel)) == GTK_RESPONSE_ACCEPT) { + char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filesel)); + gtk_widget_hide(filesel); + if (!(chan = BASS_StreamCreateFile(FALSE, file, 0, 0, BASS_SAMPLE_LOOP)) + && !(chan = BASS_MusicLoad(FALSE, file, 0, 0, BASS_MUSIC_RAMP | BASS_SAMPLE_LOOP, 1))) { + Error("Can't play file"); + } else { + BASS_ChannelPlay(chan, FALSE); + ret = TRUE; + } + g_free(file); + } + gtk_widget_destroy(filesel); + return ret; +} + +// update the spectrum display - the interesting bit :) +gboolean UpdateSpectrum(gpointer data) +{ + int x, y, y1; + RGB *specbuf = (RGB*)gdk_pixbuf_get_pixels(specpb); + + if (specmode == 3) { // waveform + int c; + float *buf; + BASS_CHANNELINFO ci; + memset(specbuf, 0, SPECWIDTH * SPECHEIGHT * sizeof(*specbuf)); + BASS_ChannelGetInfo(chan, &ci); // get number of channels + buf = alloca(ci.chans * SPECWIDTH * sizeof(float)); // allocate buffer for data + BASS_ChannelGetData(chan, buf, (ci.chans * SPECWIDTH * sizeof(float)) | BASS_DATA_FLOAT); // get the sample data (floating-point to avoid 8 & 16 bit processing) + for (c = 0; c < ci.chans; c++) { + for (x = 0; x < SPECWIDTH; x++) { + int v = (1 - buf[x * ci.chans + c]) * SPECHEIGHT / 2; // invert and scale to fit display + if (v < 0) v = 0; + else if (v >= SPECHEIGHT) v = SPECHEIGHT - 1; + if (!x) y = v; + do { // draw line from previous sample... + if (y < v) y++; + else if (y > v) y--; + specbuf[y * SPECWIDTH + x] = palette[c & 1 ? 127 : 1]; // left=green, right=red (could add more colours to palette for more chans) + } while (y != v); + } + } + } else { + float fft[1024]; + BASS_ChannelGetData(chan, fft, BASS_DATA_FFT2048); // get the FFT data + + if (!specmode) { // "normal" FFT + memset(specbuf, 0, SPECWIDTH * SPECHEIGHT * sizeof(*specbuf)); + for (x = 0; x < SPECWIDTH / 2; x++) { +#if 1 + y = sqrt(fft[x + 1]) * 3 * SPECHEIGHT - 4; // scale it (sqrt to make low values more visible) +#else + y = fft[x + 1] * 10 * SPECHEIGHT; // scale it (linearly) +#endif + if (y > SPECHEIGHT) y = SPECHEIGHT; // cap it + if (x && (y1 = (y + y1) / 2)) // interpolate from previous to make the display smoother + while (--y1 >= 0) specbuf[(SPECHEIGHT - 1 - y1) * SPECWIDTH + x * 2 - 1] = palette[y1 + 1]; + y1 = y; + while (--y >= 0) specbuf[(SPECHEIGHT - 1 - y) * SPECWIDTH + x * 2] = palette[y + 1]; // draw level + } + } else if (specmode == 1) { // logarithmic, acumulate & average bins + int b0 = 0; + memset(specbuf, 0, SPECWIDTH * SPECHEIGHT * sizeof(*specbuf)); +#define BANDS 28 + for (x = 0; x < BANDS; x++) { + float peak = 0; + int b1 = pow(2, x * 10.0 / (BANDS - 1)); + if (b1 > 1023) b1 = 1023; + if (b1 <= b0) b1 = b0 + 1; // make sure it uses at least 1 FFT bin + for (; b0 < b1; b0++) + if (peak < fft[1 + b0]) peak = fft[1 + b0]; + y = sqrt(peak) * 3 * SPECHEIGHT - 4; // scale it (sqrt to make low values more visible) + if (y > SPECHEIGHT) y = SPECHEIGHT; // cap it + while (--y >= 0) + for (y1 = 0; y1 < SPECWIDTH / BANDS - 2; y1++) + specbuf[(SPECHEIGHT - 1 - y) * SPECWIDTH + x * (SPECWIDTH / BANDS) + y1] = palette[y + 1]; // draw bar + } + } else { // "3D" + for (x = 0; x < SPECHEIGHT; x++) { + y = sqrt(fft[x + 1]) * 3 * 127; // scale it (sqrt to make low values more visible) + if (y > 127) y = 127; // cap it + specbuf[(SPECHEIGHT - 1 - x) * SPECWIDTH + specpos] = palette[128 + y]; // plot it + } + // move marker onto next position + specpos = (specpos + 1) % SPECWIDTH; + for (x = 0; x < SPECHEIGHT; x++) specbuf[x * SPECWIDTH + specpos] = palette[255]; + } + } + + gtk_image_set_from_pixbuf(GTK_IMAGE(speci), specpb); // update the display + + return TRUE; +} + +int main(int argc, char* argv[]) +{ + gtk_init(&argc, &argv); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + Error("An incorrect version of BASS was loaded"); + return 0; + } + + // initialize BASS + if (!BASS_Init(-1, 44100, 0, NULL, NULL)) { + Error("Can't initialize device"); + return 0; + } + + if (!PlayFile()) { // start a file playing + BASS_Free(); + return 0; + } + + // create the window + win = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_CENTER); + gtk_window_set_resizable(GTK_WINDOW(win), FALSE); + gtk_window_set_title(GTK_WINDOW(win), "BASS spectrum example (click to toggle mode)"); + g_signal_connect(win, "destroy", GTK_SIGNAL_FUNC(WindowDestroy), NULL); + + GtkWidget *ebox = gtk_event_box_new(); + gtk_container_add(GTK_CONTAINER(win), ebox); + g_signal_connect(ebox, "button-release-event", GTK_SIGNAL_FUNC(WindowButtonRelease), NULL); + + // create the bitmap + specpb = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, SPECWIDTH, SPECHEIGHT); + speci = gtk_image_new_from_pixbuf(specpb); + gtk_container_add(GTK_CONTAINER(ebox), speci); + + { // setup palette + RGB *pal = palette; + int a; + memset(palette, 0, sizeof(palette)); + for (a = 1; a < 128; a++) { + pal[a].rgbGreen = 256 - 2 * a; + pal[a].rgbRed = 2 * a; + } + for (a = 0; a < 32; a++) { + pal[128 + a].rgbBlue = 8 * a; + pal[128 + 32 + a].rgbBlue = 255; + pal[128 + 32 + a].rgbRed = 8 * a; + pal[128 + 64 + a].rgbRed = 255; + pal[128 + 64 + a].rgbBlue = 8 * (31 - a); + pal[128 + 64 + a].rgbGreen = 8 * a; + pal[128 + 96 + a].rgbRed = 255; + pal[128 + 96 + a].rgbGreen = 255; + pal[128 + 96 + a].rgbBlue = 8 * a; + } + } + + // setup update timer (40hz) + g_timeout_add(25, UpdateSpectrum, NULL); + + gtk_widget_show_all(win); + gtk_main(); + + g_object_unref(specpb); + + BASS_Free(); + + return 0; +} diff --git a/bass-sys/linux/bass24/synth/makefile b/bass-sys/linux/bass24/synth/makefile new file mode 100644 index 0000000..c904e38 --- /dev/null +++ b/bass-sys/linux/bass24/synth/makefile @@ -0,0 +1,9 @@ +TARGET = synth +PACKAGES = gtk+-2.0 libglade-2.0 + +include ../makefile.in + +all: $(TARGET) + +clean: + $(RM) $(TARGET) diff --git a/bass-sys/linux/bass24/synth/synth.c b/bass-sys/linux/bass24/synth/synth.c new file mode 100644 index 0000000..3a98f2a --- /dev/null +++ b/bass-sys/linux/bass24/synth/synth.c @@ -0,0 +1,146 @@ +/* + BASS simple synth + Copyright (c) 2001-2017 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include +#include +#include "bass.h" + +// path to glade file +#ifndef GLADE_PATH +#define GLADE_PATH "" +#endif + +GladeXML *glade; +GtkWidget *win = 0; + +BASS_INFO info; +HSTREAM stream; // the stream + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + +#define KEYS 20 +const guint keys[KEYS] = { + 'Q','2','W','3','E','R','5','T','6','Y','7','U', + 'I','9','O','0','P', GDK_bracketleft, GDK_equal, GDK_bracketright +}; +#define MAXVOL 0.22 +#define DECAY (MAXVOL/4000) +float vol[KEYS] = { 0 }, pos[KEYS]; // keys' volume and pos + +const DWORD fxtype[5] = { BASS_FX_DX8_CHORUS,BASS_FX_DX8_DISTORTION,BASS_FX_DX8_ECHO,BASS_FX_DX8_FLANGER,BASS_FX_DX8_REVERB }; +HFX fx[5] = { 0 }; // effect handles + +// display error messages +void Error(const char *es) +{ + GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); +} + +#define GetWidget(id) glade_xml_get_widget(glade,id) + +void WindowDestroy(GtkObject *obj, gpointer data) +{ + gtk_main_quit(); +} + +DWORD CALLBACK WriteStream(HSTREAM handle, float *buffer, DWORD length, void *user) +{ + int k, c; + float omega, s; + memset(buffer, 0, length); + for (k = 0; k < KEYS; k++) { + if (!vol[k]) continue; + omega = 2 * M_PI * pow(2.0, (k + 3) / 12.0) * 440.0 / info.freq; + for (c = 0; c < length / sizeof(float); c += 2) { + buffer[c] += sin(pos[k]) * vol[k]; + buffer[c + 1] = buffer[c]; // left and right channels are the same + pos[k] += omega; + if (vol[k] < MAXVOL) { + vol[k] -= DECAY; + if (vol[k] <= 0) { // faded-out + vol[k] = 0; + break; + } + } + } + pos[k] = fmod(pos[k], 2 * M_PI); + } + return length; +} + +void FXToggled(GtkToggleButton *obj, gpointer data) +{ // toggle effects + const gchar *objname = gtk_widget_get_name(GTK_WIDGET(obj)); + int n = atoi(objname + 2); + if (fx[n]) { + BASS_ChannelRemoveFX(stream, fx[n]); + fx[n] = 0; + } else + fx[n] = BASS_ChannelSetFX(stream, fxtype[n], 0); +} + +gboolean KeyHandler(GtkWidget *grab_widget, GdkEventKey *event, gpointer data) +{ + int key, kv = event->keyval; + if (kv >= 'a' && kv <= 'z') kv -= 0x20; + for (key = 0; key < KEYS; key++) { + if (kv == keys[key]) { + if (event->type == GDK_KEY_PRESS && vol[key] < MAXVOL) { + pos[key] = 0; + vol[key] = MAXVOL + DECAY / 2; // start key (setting "vol" slightly higher than MAXVOL to cover any rounding-down) + } else if (event->type == GDK_KEY_RELEASE && vol[key]) + vol[key] -= DECAY; // trigger key fadeout + break; + } + } + return FALSE; +} + +int main(int argc, char* argv[]) +{ + gtk_init(&argc, &argv); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + Error("An incorrect version of BASS was loaded"); + return 0; + } + + // initialize default output device + if (!BASS_Init(-1, 44100, 0, NULL, NULL)) { + Error("Can't initialize device"); + return 0; + } + + // initialize GUI + glade = glade_xml_new(GLADE_PATH"synth.glade", NULL, NULL); + if (!glade) return 0; + win = GetWidget("window1"); + if (!win) return 0; + glade_xml_signal_autoconnect(glade); + + BASS_GetInfo(&info); + stream = BASS_StreamCreate(info.freq, 2, BASS_SAMPLE_FLOAT, (STREAMPROC*)WriteStream, 0); // create a stream (stereo for effects) + BASS_ChannelSetAttribute(stream, BASS_ATTRIB_BUFFER, 0); // no buffering for minimum latency + BASS_ChannelPlay(stream, FALSE); // start it + + g_signal_connect(win, "key-press-event", G_CALLBACK(KeyHandler), NULL); + g_signal_connect(win, "key-release-event", G_CALLBACK(KeyHandler), NULL); + + gtk_main(); + + BASS_Free(); + + return 0; +} diff --git a/bass-sys/linux/bass24/synth/synth.glade b/bass-sys/linux/bass24/synth/synth.glade new file mode 100644 index 0000000..23f3dd8 --- /dev/null +++ b/bass-sys/linux/bass24/synth/synth.glade @@ -0,0 +1,174 @@ + + + + + + True + 5 + BASS simple sinewave synth + False + center + + + + True + vertical + 5 + + + True + 0 + out + + + True + 6 + 10 + 20 + 20 + + + True + <big><tt> 2 3 5 6 7 9 0 = +Q W ER T Y UI O P[ ]</tt></big> + True + center + + + + + + + True + Press these keys to play + True + + + label_item + + + + + 0 + + + + + True + 0 + out + + + True + 6 + 10 + 10 + 10 + + + True + vertical + + + True + + + reverb + True + True + False + True + + + + 0 + + + + + echo + True + True + False + True + + + + 1 + + + + + chorus + True + True + False + True + + + + 2 + + + + + 0 + + + + + True + + + flanger + True + True + False + True + + + + 0 + + + + + distortion + True + True + False + True + + + + 1 + + + + + 1 + + + + + + + + + True + Effects + True + + + label_item + + + + + 1 + + + + + + diff --git a/bass-sys/linux/bass24/writewav/makefile b/bass-sys/linux/bass24/writewav/makefile new file mode 100644 index 0000000..ae22394 --- /dev/null +++ b/bass-sys/linux/bass24/writewav/makefile @@ -0,0 +1,8 @@ +TARGET = writewav + +include ../makefile.in + +all: $(TARGET) + +clean: + $(RM) $(TARGET) diff --git a/bass-sys/bass24/c/writewav/writewav.c b/bass-sys/linux/bass24/writewav/writewav.c similarity index 100% rename from bass-sys/bass24/c/writewav/writewav.c rename to bass-sys/linux/bass24/writewav/writewav.c diff --git a/bass-sys/linux/bass24/x64/libbass.so b/bass-sys/linux/bass24/x64/libbass.so new file mode 100644 index 0000000..8839178 Binary files /dev/null and b/bass-sys/linux/bass24/x64/libbass.so differ diff --git a/bass-sys/linux/bass24/x64/mp3-free/libbass.so b/bass-sys/linux/bass24/x64/mp3-free/libbass.so new file mode 100644 index 0000000..2da283c Binary files /dev/null and b/bass-sys/linux/bass24/x64/mp3-free/libbass.so differ diff --git a/bass-sys/win/bass24/bass.chm b/bass-sys/win/bass24/bass.chm new file mode 100644 index 0000000..2d9ba09 Binary files /dev/null and b/bass-sys/win/bass24/bass.chm differ diff --git a/bass-sys/bass24/bass.dll b/bass-sys/win/bass24/bass.dll similarity index 100% rename from bass-sys/bass24/bass.dll rename to bass-sys/win/bass24/bass.dll diff --git a/bass-sys/win/bass24/bass.txt b/bass-sys/win/bass24/bass.txt new file mode 100644 index 0000000..c7d2da9 --- /dev/null +++ b/bass-sys/win/bass24/bass.txt @@ -0,0 +1,2127 @@ +BASS 2.4 +Copyright (c) 1999-2020 Un4seen Developments Ltd. All rights reserved. + +Files that you should have found in the BASS package +==================================================== +Win32 version +------------- +BASS.TXT This file +BASS.DLL BASS module +BASS.CHM BASS documentation +MP3-FREE\ + BASS.DLL BASS module using the OS's MP3 decoder +X64\ + BASS.DLL 64-bit BASS module + MP3-FREE + BASS.DLL 64-bit BASS module using the OS's MP3 decoder +C\ C/C++ API and examples... + BASS.H BASS C/C++ header file + BASS.LIB BASS import library + BASS.SLN Visual Studio solution for examples + MAKEFILE Makefile for examples + MAKEFILE.IN Makefile helper macros + X64\ + BASS.LIB 64-bit BASS import library + 3DTEST\ 3D/EAX example + ... + BASSTEST\ Simple playback example + ... + CONTEST\ Console example + ... + CUSTLOOP\ Custom looping example + ... + DEVLIST\ Device list example + ... + DSPTEST\ DSP example + ... + FXTEST\ DX8 effect example + ... + LIVEFX\ Full-duplex example + ... + LIVESPEC\ "Live" version of spectrum analyser example + ... + MODTEST\ MOD music example + ... + MULTI\ Multiple device example + ... + NETRADIO\ Internet streaming example + ... + PLUGINS\ Plugins example + ... + RECTEST\ Recording example + ... + SPEAKERS\ Multi-speaker example + ... + SPECTRUM\ Spectrum analyser example + ... + SYNTH\ Low latency custom streaming example + ... + WRITEWAV\ WAVE writer example + ... + BIN\ Precompiled examples + 3DTEST.EXE + BASSTEST.EXE + CONTEST.EXE + CUSTLOOP.EXE + DEVLIST.EXE + DSPTEST.EXE + FXTEST.EXE + LIVEFX.EXE + LIVESPEC.EXE + MODTEST.EXE + MULTI.EXE + NETRADIO.EXE + RECTEST.EXE + SPEAKERS.EXE + SPECTRUM.EXE + SYNTH.EXE + WRITEWAV.EXE +DELPHI\ Delphi API and examples... + BASS.PAS BASS Delphi unit + 3DTEST\ 3D/EAX example + ... + BASSTEST\ Simple playback example + ... + CONTEST\ Console example + ... + CUSTLOOP\ Custom looping example + ... + DSPTEST\ DSP example + ... + FXTEST\ DX8 effect example + ... + LIVEFX\ Full-duplex example + ... + LIVESPEC\ "Live" version of spectrum analyser example + ... + MULTI\ Multiple device example + ... + NETRADIO\ Internet streaming example + ... + PLUGINS\ Plugins example + ... + RECORDTEST\ Recording example + ... + SAMPLEVIS\ Visualisation example + ... + SPEAKERS\ Multi-speaker example + ... + SPECTRUM\ Spectrum analyser example + ... + STREAMTEST\ User stream example + ... + WRITEWAV\ WAVE writer example + ... +VB\ Visual Basic API and examples... + BASS.BAS BASS Visual Basic module + 3DTEST\ 3D/EAX example + ... + BASSTEST\ Simple playback example + ... + CUSTLOOP\ Custom looping example + ... + DSPTEST\ DSP example + ... + FXTEST\ DX8 effect example + ... + LIVEFX\ Full-duplex example + ... + LIVESPEC\ "Live" version of spectrum analyser example + ... + MULTI\ Multiple device example + ... + NETRADIO\ Internet streaming example + ... + PLUGINS\ Plugins example + ... + RECTEST\ Recording example + ... + SPEAKERS\ Multi-speaker example + ... + SPECTRUM\ Spectrum analyser example + ... + SYNTH\ Low latency custom streaming example + ... + WRITEWAV\ WAVE writer example + ... + MEMORY\ Playing from memory example by Jobnik + ... + +NOTE: You may need to "Unblock" the BASS.CHM file in its "Properties" to view + it on Windows 7. The documentation can also be viewed online at the BASS + website. + +NOTE: The Delphi and VB examples may not always be up to date with the C + examples, so the latter should be preferred as references if possible. + +NOTE: To run the example EXEs, first you will need to copy BASS.DLL into the + same directory as them. + +macOS version +------------- +BASS.TXT This file +LIBBASS.DYLIB BASS module +BASS.CHM BASS documentation +CHMOX.APP CHM file viewer +BASS.H BASS C/C++ header file +BASS.XCODEPROJ Xcode project for examples +MAKEFILE Makefile for specific architectures +MP3-FREE\ + LIBBASS.DYLIB BASS module using the OS's MP3 decoder +3DTEST\ 3D example + ... +BASSTEST\ Simple playback example + ... +CONTEST\ Console example + ... +CUSTLOOP\ Custom looping example + ... +DEVLIST\ Device list example + ... +DSPTEST\ DSP example + ... +FXTEST\ DX8 effect example + ... +LIVESPEC\ "Live" version of spectrum analyser example + ... +MODTEST\ MOD music example + ... +MULTI\ Multiple device example + ... +NETRADIO\ Internet streaming example + ... +PLUGINS\ Plugins example + ... +RECTEST\ Recording example + ... +SPEAKERS\ Multi-speaker example + ... +SPECTRUM\ Spectrum analyser example + ... +SYNTH\ Low latency custom streaming example + ... +WRITEWAV\ WAVE writer example + ... + +NOTE: To view the documentation, you will need a CHM viewer, such as the + included CHMOX. The documentation can also be viewed online at the BASS + website. + +NOTE: The GUI-based examples (not CONTEST/DEVLIST/WRITEWAV) use the old Carbon + APIs that are not supported by 64-bit macOS. They will be replaced in + future but are currently still included for reference (the BASS parts are + still relevant). + +Linux version +------------- +BASS.TXT This file +LIBBASS.SO BASS module +BASS.CHM BASS documentation +BASS.H BASS C/C++ header file +MAKEFILE Makefile for examples +MAKEFILE.IN Makefile helper macros +MP3-FREE\ + LIBBASS.SO BASS module using the OS's MP3 decoder +X64\ + LIBBASS.SO 64-bit BASS module + MP3-FREE + LIBBASS.SO 64-bit BASS module using the OS's MP3 decoder +PASCAL\ + BASS.PAS BASS Delphi/Pascal unit +3DTEST\ 3D example + ... +BASSTEST\ Simple playback example + ... +CONTEST\ Console example + ... +CUSTLOOP\ Custom looping example + ... +DEVLIST\ Device list example + ... +DSPTEST\ DSP example + ... +FXTEST\ DX8 effect example + ... +LIVESPEC\ "Live" version of spectrum analyser example + ... +MODTEST\ MOD music example + ... +MULTI\ Multiple device example + ... +NETRADIO\ Internet streaming example + ... +PLUGINS\ Plugins example + ... +RECTEST\ Recording example + ... +SPEAKERS\ Multi-speaker example + ... +SPECTRUM\ Spectrum analyser example + ... +SYNTH\ Low latency custom streaming example + ... +WRITEWAV\ WAVE writer example + ... + +NOTE: To view the documentation, you will need a CHM viewer. The documentation + can also be viewed online at the BASS website. + + +What's the point? +================= +BASS is an audio library for use in software on several platforms. Its +purpose is to provide the powerful and efficient sample, stream, MOD +music, and recording functions. All in a compact DLL that won't overly +bloat your software. + +See the documentation for descriptions of all the BASS functions. Also +check the included example source-codes for some examples of how to use +BASS in your own programs. + + +Requirements +============ +Win32 version +------------- +BASS requires WASAPI or DirectSound for playback and recording, but decoding +and silent playback on the "No sound" device is still possible without them. +DirectSound has been included with all Windows versions since Windows 98. On +Windows Vista and above, the default is to use WASAPI instead of DirectSound +for playback. 32-bit and 64-bit Windows are supported. + +macOS version +------------- +macOS 10.5 or above is required. BASS uses CoreAudio for playback and recording, +so there are no special library/driver requirements. x86_64 / arm64 / i386 +architectures are supported in a single universal library. + +Linux version +------------- +BASS requires ALSA for playback and recording, but decoding and silent playback +on the "No sound" device is still possible without it. 32-bit (i386) and 64-bit +(x86-64) architectures are supported. ARM support is also available as a +separate download from the website. + + +Main Features +============= +* Samples + supports WAV/AIFF/MP3/MP2/MP1/OGG and custom generated samples + +* Sample streams + stream any sample data in 8/16/32 bit, with both "push" and "pull" systems + +* File streams + MP3/MP2/MP1/OGG/WAV/AIFF file streaming + +* Internet file streaming + stream files from the internet, including Shout/Icecast + +* User file streaming + stream files from anywhere using any delivery method + +* OS codecs + ACM, Media Foundation and CoreAudio codec support for additional audio formats + +* Multi-channel streaming + support for more than plain stereo, including multi-channel OGG/WAV/AIFF files + +* MOD music + uses the same engine as XMPlay = best accuracy, speed, and quality + +* MO3 music + MP3/OGG compressed MOD music + +* Add-on system + support for more formats is available via add-ons (aka plugins) + +* Multiple outputs + simultaneously use multiple soundcards, and move channels between them + +* Recording + flexible recording system, with support for multiple devices + +* Decode without playback + streams and MOD musics can be outputted in any way you want + +* Speaker assignment + assign streams and MOD musics to specific speakers + +* High precision synchronization + synchronize events in your software to the streams and MOD musics + +* Effects + chorus/compressor/distortion/echo/flanger/gargle/parameq/reverb + +* User defined DSP functions + custom effects may be applied to individual streams or the final output mix + +* 32 bit floating-point decoding and processing + floating-point stream/music decoding, DSP/FX, and recording + +* 3D sound + play samples/streams/musics in any 3D position + + +Using BASS +========== +There is no guarantee that all future BASS versions will be compatible +with all previous versions, so your program should use BASS_GetVersion +to check the version that is loaded. This also means that you should +put the BASS module in the same directory as your executable (not just +somewhere in the path), to avoid the possibility of a wrong version being +loaded. + +If you are updating your software from a previous BASS version, then +you should check the "History" section (below), to see if any of the +functions that you are using have been affected by a change. + +Win32 version +------------- +C/C++, Delphi, and Visual Basic APIs and example projects are provided. To +use BASS with another language you will first have to convert the header +file. Or, as a last resort, you could use LoadLibrary and GetProcAddress. + +The downside is that you have to manually import each function that you +use, with the GetProcAddress function. But it has been made a lot simpler +to import BASS this way by the use of the BASSDEF #define. Here's a small +example: + +#define BASSDEF(f) (WINAPI *f) // define the functions as pointers +#include "bass.h" +... +HINSTANCE bass=LoadLibrary("BASS.DLL"); // load BASS +BASS_Init=GetProcAddress(bass,"BASS_Init"); // get BASS_Init +BASS_Init(-1,44100,0,hWnd,NULL); // call BASS_Init + +To use BASS with Borland C++ Builder, you will first have to create a +Borland C++ Builder import library for it. This is done by using the +IMPLIB tool that comes with Borland C++ Builder. Simply execute this: + + IMPLIB BASSBCB.LIB BASS.DLL + +... and then use BASSBCB.LIB in your projects to import BASS. + +To use BASS with LCC-Win32, you will first have to create a compatible +import library for it. This is done by using the PEDUMP and BUILDLIB +tools that come with LCC-Win32. Run these 2 commands: + + PEDUMP /EXP BASS.LIB > BASSLCC.EXP + BUILDLIB BASSLCC.EXP BASSLCC.LIB + +... and then use BASSLCC.LIB in your projects to import BASS. + +For the BASS functions that return strings (char*), VB users should use +the VBStrFromAnsiPtr function to convert the returned pointer into a VB +string. + +macOS version +------------- +See the example Xcode project. + +NOTE: The LIBBASS.DYLIB file must be put in the same directory as the + executable, it can't just be somewhere in the path. + +LIBBASS.DYLIB is a universal binary with support for the x86_64 / arm64 / i386 +architectures. If not all of those architectures are needed, the included +makefile can be used to extract the wanted one(s). Type "make x86_64" or +"make arm64" or "make i386" to extract a particular architecture. "make 64bit" +can be used to extract the x86_64 and arm64 architectures (exclude i386), and +"make intel" to extract the x86_64 and i386 architectures (exclude arm64). Any +BASS add-ons placed in the same directory will also be processed. + +Linux version +------------- +The LIBBASS.SO file needs to be in the OS's library search path for it to +be found; simply placing it in the same directory as the executable won't +necessarily work as it does on other platforms. The BASS libraries should +also not be placed in the standard library directories to avoid version +conflicts. To meet those competing requirements, a wrapper script could be +used to set the "LD_LIBRARY_PATH" environment variable before loading the +executable. Another option is to set the "rpath" in the executable, to tell +it where to look for libraries. That is what the example makefiles do. + +When building both 32-bit and 64-bit executables, it is possible to simply +try linking with both LIBBASS.SO versions, and the linker will use the +appropriate version and ignore the other. + + +Latest Version +============== +The latest version of BASS can always be found at the BASS website: + + www.un4seen.com + + +Licence +======= +BASS is free for non-commercial use. If you are a non-commercial entity +(eg. an individual) and you are not making any money from your product +(through sales/advertising/etc), then you can use BASS in it for free. +If you wish to use BASS in commercial products, then please also see the +next section. + +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, BASS IS PROVIDED +"AS IS", WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND/OR FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS SHALL NOT BE HELD +LIABLE FOR ANY DAMAGE THAT MAY RESULT FROM THE USE OF BASS. YOU USE +BASS ENTIRELY AT YOUR OWN RISK. + +Usage of BASS indicates that you agree to the above conditions. + +All trademarks and other registered names contained in the BASS +package are the property of their respective owners. + +Commercial licensing +-------------------- +BASS is available for use in your commercial products. The licence +types available are as follows: + +SHAREWARE: Allows the usage of BASS in an unlimited number of your +shareware ("try before you buy") products, which must sell for no more +than 40 Euros each. Non-shareware products are also permitted, but the +product price limit is 10 Euros in that case. The price limit can be +raised by purchasing duplicate licences, eg. 2 licences doubles it. If +you are an individual (not a corporation) making and selling your own +software, this is the licence for you. + +SINGLE COMMERCIAL: Allows the usage of BASS in one commercial product. + +UNLIMITED COMMERCIAL: Allows the usage of BASS in an unlimited number +of your commercial products. This licence is on a per-site basis, eg. +if you are creating products with BASS at 2 sites/locations, then 2 +licences are required. + +Please note the products must be end-user products, eg. not components +used by other products. + +These licences only cover your own software, not the publishing of +other's software. If you publish other's software, its developers (or +the software itself) will need to be licensed to use BASS. + +These licences are on a per-platform basis, with reductions available +when licensing for multiple platforms. In all cases there are no royalties +to pay, and you can use future BASS updates without further cost. + +These licences do not allow reselling/sublicensing of BASS. For example, +if a product is a development system, the users of said product are not +licensed to use BASS in their productions; they will need their own +licences. + +If the standard licences do not meet your requirements, or if you have +any questions, please get in touch (email: bass@un4seen.com). + +Visit the BASS website for the latest pricing: + + www.un4seen.com + +MP3 +--- +MP3 technology is patented, and Thomson license the use of their and +Fraunhofer's patents. The inclusion of an MP3 decoder (eg. BASS) in a +commercial product requires an MP3 patent licence. Contact Thomson for +details: + + www.mp3licensing.com + +Alternatively, the "MP3-FREE" BASS version does not include its own MP3 +decoder but instead makes use of the operating system's already licensed +decoder. If an MP3 decoder is not available, then MP3 playback will not +be possible, but everything else will function as normal. + +NOTE: When using the OS's MP3 decoder, BASS still does the file handling + so all the usual features are still supported, including streaming, + tag reading, pre-scanning, gapless playback, etc. + +NOTE: Linux does not include an MP3 decoder as standard. The "MP3-FREE" + BASS version will make use of the libmpg123 decoder, if installed. + + +Credits +======= +Ogg Vorbis decoding is based on libogg/vorbis, +Copyright (c) 2002-2020 Xiph.org Foundation + +CHMOX is (c) 2004 Stéphane Boisson, http://chmox.sourceforge.net/ + +API/Sample contributors +----------------------- +Delphi: Titus Miloi, Rogier Timmermans, Alessandro Cappellozza, + Jesse Naranjo, Chris Troesken, Evgeny Melnikov +Visual Basic: Adam Hoult, Hendrik Knaepen, Arthur Aminov, + Peter Hebels + + +History +======= +These are the major (and not so major) changes at each version stage. +There are of course bug fixes and other little improvements made along +the way too! To make upgrading simpler, all functions affected by a +change to the BASS interface are listed. + +2.4.15 - 17/12/2019 +------------------- +* Channel processing granularity option + BASS_ATTRIB_GRANULE (BASS_ChannelSetAttribute option) +* Asynchronous mixtime sync callbacks + BASS_SYNC_THREAD (BASS_ChannelSetSync flag) +* Output device update period can be set in samples + BASS_CONFIG_DEV_PERIOD (BASS_SetConfig option) +* Continuous output when nothing is playing is now optional on macOS/iOS too + BASS_CONFIG_DEV_NONSTOP (BASS_SetConfig option) +* AAudio output support on Android + BASS_Init + BASS_CONFIG_ANDROID_AAUDIO (BASS_SetConfig option) +* Support for audio session IDs on Android + BASS_CONFIG_ANDROID_SESSIONID (BASS_SetConfig option) +* ParcelFileDescriptor support on Android + BASS_StreamCreateFile + BASS_SampleLoad + BASS_MusicLoad +* FloatValue Java class added to receive floating-point values on Android 10 + BASS_Get3DFactors + BASS_RecordGetInput + BASS_ChannelGetAttribute + BASS_ChannelGet3DAttributes +* Audio session configuration option on iOS + BASS_CONFIG_IOS_SESSION (BASS_SetConfig option) +* OGG channel type constant renamed/duplicated to VORBIS + BASS_CTYPE_STREAM_VORBIS +* Error code for recognised file formats without audio + BASS_ERROR_NOTAUDIO (BASS_StreamCreateFile/User/URL error code) +* Error code for unstreamable MP4 files due to atom order + BASS_ERROR_UNSTREAMABLE (BASS_StreamCreateFileUser/URL error code) +* Fix for AAC streaming with BASS_STREAM_BLOCK on macOS 10.15 and iOS 13 + BASS_StreamCreateURL/FileUser +* Fix for playback rate changing bug when using DirectSound + BASS_ATTRIB_FREQ (BASS_ChannelSetAttribute option) +* armv6 architecture support dropped on iOS + +2.4.14 - 16/1/2019 +------------------ +* Support for playback on the "No sound" device + BASS_Init + BASS_StreamCreateFile/User/URL + BASS_SampleLoad/Create + BASS_ChannelPlay +* Improved sample rate conversion quality, including 64 point option + BASS_ATTRIB_SRC (BASS_ChannelSetAttribute option) + BASS_CONFIG_SRC/_SAMPLE (BASS_SetConfig options) +* Loopback (output device) recording on Windows Vista and above + BASS_RecordInit + BASS_RecordGetDeviceInfo + BASS_DEVICE_LOOPBACK (BASS_DEVICEINFO flag) + DEVLIST and RECTEST examples updated +* Native format recording option + BASS_RecordStart +* Access to the 3D output mix for applying DSP/FX + STREAMPROC_DEVICE_3D (BASS_StreamCreate option) +* Retrieval of a device's started/stopped status + BASS_IsStarted +* Sync for when a device stops unexpectedly + BASS_SYNC_DEV_FAIL (BASS_ChannelSetSync type) +* New channel playback state for a paused device + BASS_ACTIVE_PAUSED_DEVICE (BASS_ChannelIsActive) +* Sync for when a device's sample format changes + BASS_SYNC_DEV_FORMAT (BASS_ChannelSetSync type) +* Adjustable output device update period + BASS_CONFIG_DEV_PERIOD (BASS_SetConfig option) +* Nyquist FFT option + BASS_DATA_FFT_NYQUIST (BASS_ChannelGetData flag) +* Plugin-specific flags are ignored in standard stream creation functions + BASS_StreamCreateFile/User/URL +* Pre-buffering during stream creation is now disabled by default + BASS_CONFIG_NET_PREBUF_WAIT (BASS_SetConfig option) + BASS_StreamCreateURL/FileUser +* Existing internet streams are unaffected by read timeout config changes + BASS_CONFIG_NET_READTIMEOUT (BASS_SetConfig option) +* Retrieval of the number of existing handles + BASS_CONFIG_HANDLES (BASS_GetConfig option) +* Windows mixer settings are retained by default and optionally not + BASS_CONFIG_WASAPI_PERSIST (BASS_SetConfig option) +* Configurable OpenSSL library filename on Linux/Android + BASS_CONFIG_LIBSSL (BASS_SetConfigPtr option) +* Files can be deleted/renamed while streaming on Windows (already true on other platforms) + BASS_StreamCreateFile +* Fix for bug in playback buffering disabling option + BASS_ATTRIB_NOBUFFER (BASS_ChannelSetAttribute option) +* Fix to support long logarithmic curves in volume effects + BASS_FX_VOLUME (BASS_ChannelSetFX type) + +2.4.13.8 - 6/2/2018 +------------------- +* Indication of a file's original sample format being floating-point + BASS_ORIGRES_FLOAT (BASS_CHANNELINFO/SAMPLE flag) +* Some extra sample data is retained to account for device latency in data retrieval + BASS_ChannelGetData +* FFT window is shortened to match amount of available data when less than FFT size + BASS_ChannelGetData +* FFT level adjusted to be approx the same regardless of amount of available data + BASS_ChannelGetData +* Fix for crash when decoding channels are dissociated from a device + BASS_NODEVICE (BASS_ChannelSetDevice option) + +2.4.13 - 19/12/2017 +------------------- +* WASAPI output on Windows (DirectSound is fallback/optional) + BASS_DEVICE_DSOUND (BASS_Init flag) + BASS_CONFIG_DEV_BUFFER/NONSTOP (BASS_SetConfig options) + BASS_CONFIG_SRC/_SAMPLE (BASS_SetConfig options) + BASS_ATTRIB_SRC/NORAMP (BASS_ChannelSetAttribute options) +* Default output device following support extended to Windows Vista and macOS + BASS_CONFIG_DEV_DEFAULT (BASS_SetConfig option) +* Seamless playback buffer length changing + BASS_ATTRIB_BUFFER (BASS_ChannelSetAttribute option) + SYNTH example updated +* Access to the final output mix for applying DSP/FX + STREAMPROC_DEVICE (BASS_StreamCreate option) + BASS_CTYPE_STREAM_DEVICE + FXTEST example updated +* Dissociating of decoding channels from a device + BASS_NODEVICE (BASS_ChannelSetDevice option) +* Volume attribute levels above 1.0 for amplification + BASS_ATTRIB_VOL (BASS_ChannelSetAttribute option) +* Logarithmic attribute slides + BASS_SLIDE_LOG (BASS_ChannelSlideAttribute flag) +* Volume & panning attribute affected level retrieval + BASS_LEVEL_VOLPAN (BASS_ChannelGetLevelEx flag) +* Volume level adjustment effect + BASS_FX_VOLUME (BASS_ChannelSetFX type) + BASS_FX_VOLUME_PARAM structure +* Asynchronous pre-buffering + BASS_CONFIG_NET_PREBUF_WAIT (BASS_SetConfig option) + BASS_StreamCreateURL/FileUser + CONTEST and NETRADIO examples updated +* Decoding channels can be dissociated from a device + BASS_ChannelSetDevice +* Resetting of user file streams/decoders + BASS_POS_RESET (BASS_ChannelSetPosition flag) +* Relative seeking + BASS_POS_RELATIVE (BASS_ChannelSetPosition flag) +* RIFF cue points chunk retrieval + BASS_TAG_RIFF_CUE (BASS_ChannelGetTags type) + TAG_CUE structure +* RIFF sample chunk retrieval + BASS_TAG_RIFF_SMPL (BASS_ChannelGetTags type) + TAG_SMPL structure +* Support for Category/Description/Grouping/Keywords/Lyrics MP4 tags + BASS_TAG_MP4 (BASS_ChannelGetTags type) +* Separate channel type for dummy streams + BASS_CTYPE_STREAM_DUMMY +* Stalled internet stream buffering progress retrieval + BASS_FILEPOS_BUFFERING (BASS_StreamGetFilePosition mode) + CONTEST and NETRADIO examples updated +* Playlist recursion depth config option + BASS_CONFIG_NET_PLAYLIST_DEPTH (BASS_SetConfig options) +* Push file system read functions can now return 0 without ending the file + STREAMFILE_BUFFERPUSH (BASS_StreamCreateFileUser system) + FILEREADPROC +* 16 point SRC is used by default when SSE is available + BASS_CONFIG_SRC (BASS_SetConfig option) +* Mono downmixing for all file formats in sample loading + BASS_SAMPLE_MONO (BASS_SampleLoad flag) +* Mono OGG stream downmixing + BASS_SAMPLE_MONO (BASS_StreamCreateFile/User/URL flag) +* Media Foundation availability detection + BASS_CONFIG_MF_DISABLE (BASS_GetConfig option) + PLUGINS example updated +* AudioTrack output on Android + BASS_DEVICE_AUDIOTRACK (BASS_Init flag) +* Support for Android Media codecs + BASS_StreamCreateFile/User/URL + BASS_TAG_AM_MIME/NAME (BASS_ChannelGetTags type) + BASS_CONFIG_AM_DISABLE (BASS_SetConfig option) +* Panning fix for MOD files created with ScreamTracker 3 + BASS_MusicLoad +* Fix for compressor and distotion DX8 effects with floating-point data on Windows + BASS_FX_DX8_COMPRESSOR/DISTORTION (BASS_ChannelSetFX types) +* Fix for plugin freeing issue on 64-bit platforms (HPLUGIN is not library address any more) + BASS_PluginLoad + BASS_PluginFree + +2.4.12 - 10/3/2016 +------------------ +* DSP/FX chain order modification + BASS_FXSetPriority +* Average bitrate retrieval + BASS_ATTRIB_BITRATE +* Ramping-out when stopping/pausing playback + BASS_ChannelStop + BASS_ChannelPause +* Disabling of playback ramping + BASS_ATTRIB_NORAMP (BASS_ChannelSetAttribute option) +* Pre-buffering when playback buffering is disabled + BASS_ChannelUpdate + BASS_ATTRIB_NOBUFFER (BASS_ChannelSetAttribute option) +* Net agent and proxy config options now make a copy of the provided string + BASS_CONFIG_NET_AGENT/PROXY (BASS_SetConfigPtr options) + NETRADIO example updated +* Unicode net agent and proxy config options on Windows + BASS_CONFIG_NET_AGENT/PROXY (BASS_SetConfigPtr options) +* 32768 sample FFT + BASS_DATA_FFT32768 (BASS_ChannelGetData flag) +* Support for iTunes gapless info in MP3 files + BASS_StreamCreateFile/User +* 529 sample delay removed from start of MP3 files without delay info + BASS_StreamCreateFile/User/URL +* Support for numerical MP4 genre (gnre) tags + BASS_TAG_MP4 (BASS_ChannelGetTags type) +* Support for BASSWMA's tag option when using Media Foundation WMA codec + BASS_TAG_WMA (BASS_ChannelGetTags type) +* OpenMPT author tag retrieval + BASS_TAG_MUSIC_AUTH (BASS_ChannelGetTags type) +* FastTracker2 panning for XM files + BASS_MUSIC_FT2PAN (BASS_MusicLoad flag) +* Support for longer device names on Windows + BASS_DEVICEINFO (name member) +* Checking for floating-point support on platforms that might not have it + BASS_CONFIG_FLOAT (BASS_GetConfig option) +* Attribute size retrieval fix + BASS_ChannelGetAttributeEx +* Fix for missing LC_VERSION_MIN issue with Xcode 7 on OSX, ppc architecture (PowerPC) support dropped +* LIST example renamed to DEVLIST + +2.4.11 - 22/12/2014 +------------------- +* Support for custom HTTP request headers + BASS_StreamCreateURL +* HTTPS support on Linux/Android + BASS_StreamCreateURL +* Redirection HTTP headers provided during connection + BASS_STREAM_STATUS (BASS_StreamCreateURL flag) + DOWNLOADPROC +* Adjustable stalled internet stream resumption buffer level + BASS_ATTRIB_NET_RESUME (BASS_ChannelSetAttribute option) +* Extended level retrieval inc. multi-channel and RMS options + BASS_ChannelGetLevelEx +* Inexact/faster seeking + BASS_POS_INEXACT (BASS_ChannelSetPosition flag) +* Post-stream creation scanning (seek table building) + BASS_POS_SCAN (BASS_ChannelSetPosition flag) +* Extended attribute support + BASS_ChannelGet/SetAttributeEx +* Scanned info retrieval and setting + BASS_ATTRIB_SCANINFO (BASS_ChannelGet/SetAttributeEx option) +* Built-in ADPCM WAVE file support on Linux/Android/WinCE + BASS_StreamCreateFile/User/URL + BASS_SampleLoad +* Active MOD channel count retrieval + BASS_ATTRIB_MUSIC_ACTIVE (BASS_ChannelGetAttribute option) +* Fractional sample rates + BASS_ATTRIB_FREQ (BASS_ChannelSetAttribute option) +* Device type information + BASS_DEVICE_TYPE_xxx (BASS_DEVICEINFO flags) +* Unicode support for recording input names + BASS_CONFIG_UNICODE (BASS_SetConfig option) + BASS_RecordGetInputName +* File size retrieval + BASS_FILEPOS_SIZE (BASS_StreamGetFilePosition mode) +* Asynchronous file reading buffer level retrieval + BASS_FILEPOS_ASYNCBUF (BASS_StreamGetFilePosition mode) +* MPEG data search limit raised to 1MB + BASS_CONFIG_VERIFY (BASS_SetConfig option) +* Separate MPEG data search limit for internet/buffered streams + BASS_CONFIG_VERIFY_NET (BASS_SetConfig option) +* Support for iTunes gapless info with Media Foundation and CoreAudio codecs + BASS_StreamCreateFile/User +* Airplay receiver enumeration and selection on OSX + BASS_DEVICES_AIRPLAY (BASS_GetDeviceInfo flag) + BASS_CONFIG_AIRPLAY (BASS_SetConfig option) +* Media Foundation playback of audio from videos is now optional + BASS_CONFIG_MF_VIDEO (BASS_SetConfig option) +* Optional floating-point or fixed-point data retrieval on Android/WinCE + BASS_DATA_FLOAT/FIXED (BASS_ChannelGetData flags) +* Continuous output when nothing is playing on Linux/Android/WinCE + BASS_CONFIG_DEV_NONSTOP (BASS_SetConfig option) +* Fix for decoding channels being ended when stopping the output device + BASS_Stop +* Fix for Media Foundation internet/buffered streaming on Windows 8 + BASS_StreamCreateURL + BASS_StreamCreateFileUser +* Improved compatibility with recent PulseAudio versions on Linux +* LIST and MODTEST examples added +* MASM API and examples removed (available as separate download) + +2.4.10 - 16/2/2013 +------------------ +* Asynchronous file reading/buffering + BASS_ASYNCFILE (BASS_StreamCreateFile/User flag) + BASS_CONFIG_ASYNCFILE_BUFFER (BASS_SetConfig option) +* Support for chained OGG files (multiple logical bitstreams) + BASS_StreamCreateFile/User + BASS_CONFIG_OGG_PRESCAN (BASS_SetConfig option) + BASS_POS_OGG (BASS_ChannelSetPosition/ChannelGetLength mode) +* OGG logical bitstream syncs are no longer automatically "mixtime" + BASS_SYNC_OGG_CHANGE (BASS_ChannelSetSync type) +* Support for Soundtracker MOD files + BASS_MusicLoad +* Complex FFT data + BASS_DATA_FFT_COMPLEX (BASS_ChannelGetData flag) +* Volume levels above 1.0 for decoding channels + BASS_ATTRIB_VOL (BASS_ChannelSetAttribute option) +* Recording device channel count retrieval on Windows/OSX/iOS + BASS_RECORDINFO (formats member) +* Minimum recording period reduced to 5ms + BASS_RecordStart +* Recording device period adjustment on OSX + BASS_RecordStart +* Device UID retrieval on OSX + BASS_DEVICEINFO (driver member) +* The desktop window handle is used when none is provided + BASS_Init + +2.4.9 - 3/5/2012 +---------------- +* Improved and adjustable sample rate conversion quality + BASS_ATTRIB_SRC (BASS_ChannelSetAttribute option) + BASS_CONFIG_SRC/_SAMPLE (BASS_SetConfig options) +* Support for buffered file & internet streams with CoreAudio codecs on OSX/iOS + BASS_StreamCreateURL + BASS_StreamCreateUser +* Data and level retrieval from sample channels + BASS_ChannelGetData + BASS_ChannelGetLevel +* Oldest sample channel will be overridden when there are multiple candidates + BASS_SampleGetChannel +* Use of the device's output rate with MODs + BASS_MusicLoad +* Optional device output rate setting on OSX/iOS + BASS_DEVICE_FREQ (BASS_Init flag) +* UTF-8 device information on Windows + BASS_CONFIG_UNICODE (BASS_SetConfig option) +* Speaker assignment with panning/balance control on Windows Vista/7 + BASS_CONFIG_VISTA_SPEAKERS (BASS_SetConfig option) + BASS_ATTRIB_PAN (BASS_ChannelGet/Set/SlideAttribute option) +* Push stream queue level can be checked after using BASS_STREAMPROC_END + BASS_StreamPutData +* Support for ALSA subdevices on Linux + BASS_Init + BASS_GetDeviceInfo + BASS_RecordInit + BASS_RecordGetDeviceInfo +* Device list fix on 64-bit OSX + BASS_GetDeviceInfo + BASS_RecordGetDeviceInfo +* BASS_UNICODE support fix on Linux + BASS_PluginLoad +* Internet streaming tweaks/fixes on Windows +* SYNTH example updated to use device output rate +* RECTEST example updated (C version) for better Windows Vista/7 support +* Documentation updated with platform-specific info for Android + +2.4.8 - 29/8/2011 +----------------- +* Support for Media Foundation codecs on Windows 7 and updated Vista + BASS_StreamCreateFile/User/URL + BASS_TAG_MF (BASS_ChannelGetTags type) + PLUGINS example updated +* Built-in support for MP4 tags on Win32/OSX/iOS (for Media Foundation & CoreAudio AAC/ALAC codecs) + BASS_TAG_MP4 (BASS_ChannelGetTags type) +* WAVE format chunk retrieval + BASS_TAG_WAVEFORMAT (BASS_ChannelGetTags type) +* Adjustable sample channel limit + BASS_SampleSetInfo +* Per-channel CPU usage monitoring + BASS_ATTRIB_CPU (BASS_ChannelGetAttribute option) +* Pre-allocation of push stream queue space + BASS_StreamPutData +* Support for AIFF files with the data chunk before the format info chunk + BASS_StreamCreateFile/User/URL +* Ramping-in disabled for all but the XM format (and MODs in FT2 mode) in "normal" ramping mode + BASS_MUSIC_RAMP (BASS_MusicLoad flag) +* RIFF "INFO" tag reading fix + BASS_TAG_RIFF_INFO (BASS_ChannelGetTags type) +* OSX 10.7 compatibility fix +* x86_64 architecture support on OSX +* Delphi dynamic loading unit removed (now available as separate download) + +2.4.7 - 30/11/2010 +------------------ +* Decode-to-position seeking + BASS_POS_DECODETO (BASS_ChannelSetPosition flag) +* Support for RIFF "DISP" text tags + BASS_TAG_RIFF_DISP (BASS_ChannelGetTags type) +* Support for APEv1 tags + BASS_TAG_APE (BASS_ChannelGetTags type) + BASS_TAG_APE_BINARY (BASS_ChannelGetTags type) +* 16384 sample FFT + BASS_DATA_FFT16384 (BASS_ChannelGetData flag) +* Support for AIFF files larger than 4GB + BASS_StreamCreateFile/User/URL +* Acceptance of self-signed and invalid certificates + BASS_StreamCreateURL +* Internet stream reading timeout + BASS_CONFIG_NET_READTIMEOUT (BASS_SetConfig option) +* Support for removing a DSP within its DSPPROC + BASS_ChannelRemoveDSP +* Buffer bypassing for lower latency output (not available on Windows) + BASS_ATTRIB_NOBUFFER (BASS_ChannelSetAttribute option) + SYNTH example added (OSX) +* A "Default" device that follows default device changes on Windows 7 + BASS_CONFIG_DEV_DEFAULT (BASS_SetConfig option) +* Xcode examples project added for OSX +* Documentation updated with platform-specific info for iOS/Linux/WinCE + +2.4.6 - 17/6/2010 +----------------- +* Support for APEv2 tags, including binary + BASS_TAG_APE (BASS_ChannelGetTags type) + BASS_TAG_APE_BINARY (BASS_ChannelGetTags type) +* Unicode/IDN URL support + BASS_StreamCreateURL +* Decoding position retrieval + BASS_POS_DECODE (BASS_ChannelGetPosition flag) +* Support for OGG 6/7.1 channel configs + BASS_StreamCreateFile/User/URL +* Support for setting syncs within mixtime SYNCPROCs + BASS_ChannelSetSync +* Support for setting additional DSP/FX within DSPPROCs + BASS_ChannelSetDSP/FX +* DC bias removal in FFT processing + BASS_DATA_FFT_REMOVEDC (BASS_ChannelGetData flag) +* Fix for incorrect (2x) return value when getting FFT data from a 16-bit channel + BASS_ChannelGetData +* Fix for incorrect (STOPPED instead of PAUSED) channel status following BASS_Pause + BASS_ChannelIsActive + +2.4.5 - 18/12/2009 +------------------ +* Support for little-endian AIFF files + BASS_StreamCreateFile/User/URL + BASS_SampleLoad +* Support for 64-bit floating-point WAVE/AIFF files + BASS_StreamCreateFile/User/URL + BASS_SampleLoad +* Input volume retrieval failure results in a reading of -1 instead of 1 + BASS_RecordGetInput + RECTEST example updated +* Input volume support on OSX + BASS_RecordSetInput + BASS_RecordGetInput + RECTEST example updated +* Fix for deferred input settings on Vista + BASS_RecordSetInput +* Windows MP3 codec given preference over other installed MP3 codecs (MP3-FREE version) + BASS_StreamCreateFile/User/URL + BASS_SampleLoad + +2.4.4 - 13/10/2009 +------------------ +* RIFF/BWF "radio traffic" tag retrieval + BASS_TAG_RIFF_CART (BASS_ChannelGetTags type) + TAG_CART structure +* Support for ID3v2 tags in RIFF/WAVE/AIFF files ("ID3 " chunk) + BASS_TAG_ID3V2 (BASS_ChannelGetTags type) +* Pushed fractional samples are refused rather than discarded + BASS_StreamPutData +* DX8 effect emulation on OSX + BASS_FX_DX8_CHORUS/DISTORTION/ECHO/FLANGER/PARAMEQ/REVERB (BASS_ChannelSetFX types) + FXTEST example added +* UTF-16 support on OSX + BASS_UNICODE (BASS_StreamCreateFile/SampleLoad/MusicLoad/PluginLoad flag) + +2.4.3 - 8/5/2009 +---------------- +* MOD order list retrieval + BASS_TAG_MUSIC_ORDERS (BASS_ChannelGetTags type) +* Support for ID3v2 tags in RIFF/WAVE files ("id3 " chunk) + BASS_TAG_ID3V2 (BASS_ChannelGetTags type) +* Improved position reporting precision on Vista + BASS_ChannelGetPosition +* Length retrieval when streaming in blocks (BASS_STREAM_BLOCK) + BASS_ChannelGetLength +* Support for CoreAudio codecs on OSX + BASS_StreamCreateFile/User + BASS_SampleLoad + BASS_TAG_CA_CODEC (BASS_ChannelGetTags type) + TAG_CA_CODEC structure +* 3D algorithm option support on OSX + BASS_CONFIG_3DALGORITHM (BASS_SetConfig option) + +2.4.2 - 18/9/2008 +----------------- +* RF64 support + BASS_StreamCreateFile/User +* RIFF/BWF "Broadcast Audio Extension" tag retrieval + BASS_TAG_RIFF_BEXT (BASS_ChannelGetTags type) + TAG_BEXT structure +* ID3v1 tag structure + TAG_ID3 structure +* Multiple simultaneous recordings per device on Vista & OSX (as on XP) + BASS_RecordStart +* DX8 effect parameter defaults updated/corrected in documentation + +2.4 - 2/4/2008 +-------------- +* "Push" streaming + STREAMPROC_PUSH (BASS_StreamCreate option) + BASS_StreamPutData + LIVEFX and MULTI examples updated +* "Push" buffered file streaming + STREAMFILE_BUFFERPUSH (BASS_StreamCreateFileUser system) + BASS_StreamPutFileData +* STREAMFILEPROC replaced by table of callbacks for each file operation + BASS_FILEPROCS (FILECLOSEPROC/FILELENPROC/FILEREADPROC/FILESEEKPROC) + STREAMFILEPROC *removed* +* 64-bit file positioning + BASS_SampleLoad + BASS_MusicLoad + BASS_StreamCreateFile + BASS_StreamGetFilePosition +* File buffer level retrieval + BASS_FILEPOS_BUFFER (BASS_StreamGetFilePosition mode) +* Sinc interpolated MOD music mixing + BASS_MUSIC_SINCINTER (BASS_MusicLoad flag) +* MO3 2.4 support + BASS_MusicLoad +* MOD orders positioning incorporated into channel functions + BASS_ChannelGetLength + BASS_ChannelSetPosition + BASS_ChannelGetPosition + BASS_MusicGetOrderPosition *removed* + BASS_MusicGetOrders *removed* +* Channel attribute functions consolidated + BASS_ChannelSetAttribute + BASS_ChannelGetAttribute + BASS_ChannelSlideAttribute + BASS_ChannelIsSliding + BASS_ChannelSetAttributes *removed* + BASS_ChannelGetAttributes *removed* + BASS_ChannelSlideAttributes *removed* + BASS_ChannelSetEAXMix *removed* + BASS_ChannelGetEAXMix *removed* + BASS_MusicSetAttribute *removed* + BASS_MusicGetAttribute *removed* +* Floating-point volume and panning + BASS_SetVolume + BASS_GetVolume + BASS_RecordSetInput + BASS_RecordGetInput + BASS_ATTRIB_PAN/VOL (BASS_ChannelGet/Set/SlideAttribute options) + BASS_ATTRIB_MUSIC_VOL_CHAN/INST (BASS_ChannelGet/Set/SlideAttribute options) + BASS_SAMPLE (volume/pan/outvol members) + BASS_CONFIG_MAXVOL *removed* + BASSTEST and RECTEST examples updated +* Output device volume control on Vista (as on other OS) + BASS_SetVolume + BASS_GetVolume +* Multiple update threads + BASS_CONFIG_UPDATETHREADS (BASS_SetConfig option) + BASSTEST example updated +* Global volume range increased to 10000 + BASS_CONFIG_GVOL_SAMPLE/STREAM/MUSIC (BASS_SetConfig options) + BASSTEST example updated +* Setting and retrieving of a sample's data + BASS_SampleSetData + BASS_SampleGetData + BASS_SampleCreate + BASS_SampleCreateDone *removed* +* Channel flag setting mask + BASS_ChannelFlags + BASS_ChannelSetFlags *removed* + SPEAKERS example updated +* 256 sample FFT + BASS_DATA_FFT256 (BASS_ChannelGetData flag) +* Channel locking to prevent access by other threads + BASS_ChannelLock +* Manual channel buffer updating + BASS_ChannelUpdate + BASS_ChannelPreBuf *removed* +* Configurable manual update length + BASS_Update +* Extended device information retrieval and detection of new/removed devices + BASS_GetDeviceInfo + BASS_RecordGetDeviceInfo + BASS_DEVICEINFO structure + BASS_GetDeviceDescription *removed* + BASS_RecordGetDeviceDescription *removed* + BASS_INFO (driver member) *removed* + BASS_RECORDINFO (driver member) *removed* + MULTI example updated +* Default device change tracking on Windows (as on OSX) + BASS_Init + BASS_RecordInit +* Speaker detection from Windows control panel + BASS_DEVICE_CPSPEAKERS (BASS_Init flag) +* Channel automatically stopped & resumed for DX8 effects + BASS_ChannelSetFX + BASS_ChannelRemoveFX +* "double" precision position conversion + BASS_ChannelBytes2Seconds + BASS_ChannelSeconds2Bytes +* Separate config functions for pointers + BASS_SetConfigPtr + BASS_GetConfigPtr + BASS_CONFIG_NET_AGENT/PROXY (BASS_SetConfigPtr options) +* Configurable file format verification length + BASS_CONFIG_VERIFY (BASS_SetConfig option) +* Stream filename retrieval + BASS_CHANNELINFO (file member) +* Channel sample retrieval + BASS_CHANNELINFO (sample member) +* META syncs no longer receive metadata in the "data" parameter + BASS_SYNC_META (BASS_ChannelSetSync type) +* Separate sync for OGG logical bitstream changes (instead of BASS_SYNC_META) + BASS_SYNC_OGG_CHANGE (BASS_ChannelSetSync type) + NETRADIO example updated (C version) +* Message syncing removed (use PostMessage instead) + BASS_SYNC_MESSAGE (BASS_ChannelSetSync flag) *removed* +* Data retrieval from stopped/paused channels + BASS_ChannelGetData +* Callback "user" parameters changed to pointers + BASS_StreamCreate / STREAMPROC + BASS_StreamCreateFileUser + BASS_StreamCreateURL / DOWNLOADPROC + BASS_RecordStart / RECORDPROC + BASS_ChannelSetDSP / DSPPROC + BASS_ChannelSetSync / SYNCPROC + +2.3.0.3 - 30/7/2007 +------------------- +* FX state resetting + BASS_FXReset +* PLS/M3U playlist URL processing + BASS_CONFIG_NET_PLAYLIST (BASS_SetConfig option) + NETRADIO example updated +* Internet stream connection status retrieval + BASS_FILEPOS_CONNECTED (BASS_StreamGetFilePosition mode) +* Lyrics3v2 tags + BASS_TAG_LYRICS3 (BASS_ChannelGetTags type) +* IT virtual channel configuration + BASS_CONFIG_MUSIC_VIRTUAL (BASS_SetConfig option) +* Accurate speaker detection on Vista + BASS_INFO (speakers member) +* Device output/input rate retrieval on Vista + BASS_INFO (freq member) + BASS_RECORDINFO (freq member) +* Syncing upon position changes + BASS_SYNC_SETPOS (BASS_ChannelSetSync type) +* Improved stall handling + BASS_SYNC_STALL +* Invalid decoding channel flags produce an error instead of being ignored + BASS_StreamCreate/File/User/URL + BASS_MusicLoad + +2.3.0.2 - 22/1/2007 +------------------- +* Retrieval of a sample's existing channel handles + BASS_SampleGetChannels +* 8192 sample FFT + BASS_DATA_FFT8192 (BASS_ChannelGetData flag) +* Adjustable recording buffer + BASS_CONFIG_REC_BUFFER (BASS_SetConfig option) +* Stopping decoding channels before the end + BASS_ChannelStop +* Sample channels created paused to prevent overriding before playback + BASS_SampleGetChannel +* Separate "MP3-FREE" version using the OS's MP3 decoder + BASS_CONFIG_MP3_CODEC *removed* + +2.3.0.1 - 12/6/2006 +------------------- +* Ability to move a channel to another device + BASS_ChannelSetDevice + MULTI example updated +* Support for ID3v2.4 tags at end of file + BASS_TAG_ID3V2 (BASS_ChannelGetTags type) + +2.3 - 21/5/2006 +--------------- +* MOD message/instrument/sample text retrieval, merged with stream tag retrieval function + BASS_ChannelGetTags + BASS_TAG_MUSIC_NAME/MESSAGE/INST/SAMPLE (BASS_ChannelGetTags types) + BASS_MusicGetName *removed* + BASS_StreamGetTags *removed* +* Plugin information retrieval + BASS_PluginGetInfo + BASS_PLUGININFO/FORM structures + BASS_CHANNELINFO (plugin member) + PLUGINS example updated +* RIFF/WAVE "INFO" tag retrieval + BASS_TAG_RIFF_INFO (BASS_StreamGetTags type) +* More specific WAVE format information + BASS_CTYPE_STREAM_WAV_PCM/FLOAT (channel types) + BASS_CTYPE_STREAM_WAV (channel type flag) +* Proxy server configuration + BASS_CONFIG_NET_PROXY (BASS_SetConfig option) + BASS_CONFIG_NET_NOPROXY *removed* + NETRADIO example updated +* Passive FTP mode + BASS_CONFIG_NET_PASSIVE (BASS_SetConfig option) +* Agent changes take immediate effect + BASS_CONFIG_NET_AGENT (BASS_SetConfig option) +* Minimum time gap between creating new sample channels + BASS_SAMPLE (mingap member) + BASS_SampleGetChannel +* Support for Unicode plugin filenames + BASS_PluginLoad +* Device output/input rate retrieval (MacOSX only) + BASS_INFO (freq member) + BASS_RECORDINFO (freq member) +* Extended version info (minor revision) + BASS_GetVersion +* Unsupported codec error code + BASS_ERROR_CODEC +* Optional use of the Windows MP3 codec + BASS_CONFIG_MP3_CODEC (BASS_SetConfig option) +* 3D support for MacOSX + BASS_Set3DFactors + BASS_Get3DFactors + BASS_Set3DPosition + BASS_Get3DPosition + BASS_Apply3D + BASS_ChannelSet3DAttributes + BASS_ChannelGet3DAttributes + BASS_ChannelSet3DPosition + BASS_ChannelGet3DPosition + 3DTEST example added (Win32 example also updated) +* VB version of SYNTH example added + +2.2 - 2/10/2005 +--------------- +* Add-on plugin system + BASS_PluginLoad + BASS_PluginFree + BASS_StreamCreateFile/User/URL + BASS_SampleLoad + PLUGINS example added +* MOD position & syncing in bytes + BASS_ChannelSetPosition + BASS_ChannelGetPosition + BASS_MusicGetOrderPosition added for orders position + BASS_SYNC_MUSICPOS added for orders syncing + MAKEMUSICPOS macro/define + CUSTLOOP example updated +* Stream/MOD "length" functions combined (also works with samples), new MOD orders length function + BASS_ChannelGetLength + BASS_MusicGetOrders + BASS_StreamGetLength *removed* + BASS_MusicGetLength *removed* +* Support for AIFF files + BASS_StreamCreateFile/User/URL + BASS_SampleLoad +* Support for 24 and 32-bit (integer) WAV files + BASS_StreamCreateFile/User/URL + BASS_SampleLoad +* WAV files are no longer converted to the "device" resolution + BASS_StreamCreateFile/User/URL +* Recording master control + BASS_RecordGetInput + BASS_RecordSetInput +* Adjustable pre-buffering + BASS_ChannelPreBuf +* Floating-point data retrieval + BASS_DATA_FLOAT (BASS_ChannelGetData flag) +* Support for floating-point samples + BASS_SampleLoad + BASS_SampleCreate +* Multi-channel samples + BASS_SampleLoad/Create + BASS_SAMPLE (chans member) +* Sample lengths given in bytes + BASS_SampleCreate + BASS_SAMPLE (length member) +* MOD music 8-bit resolution option + BASS_MusicLoad +* OGG vendor tag retrieval + BASS_TAG_VENDOR (BASS_StreamGetTags type) +* Configurable "User-Agent" header for internet streams + BASS_CONFIG_NET_AGENT (BASS_SetConfig option) +* Shoutcast metadata is now requested automatically + BASS_STREAM_META flag *removed* +* Download callbacks receive all data from start of file/stream (including any non-audio data) + DOWNLOADPROC +* Length when streaming in blocks is unavailable (BASS_ERROR_NOTAVAIL, not just 0) + BASS_ChannelGetLength +* Support for growing custom file streams + BASS_FILE_LEN (STREAMFILEPROC action) +* Query file action removed + BASS_FILE_QUERY *removed* +* Recording channel syncing + BASS_ChannelSetSync +* Info structure "size" members removed + BASS_INFO structure + BASS_RECORDINFO structure +* Little bit of flag reshuffling + BASS_MP3_SETPOS renamed to BASS_STREAM_PRESCAN + BASS_MUSIC_CALCLEN value changed and renamed to BASS_MUSIC_PRESCAN + BASS_MUSIC_POSRESET value changed +* Add-on API enhancements +* MacOSX port introduced + +2.1 - 28/11/2004 +---------------- +* Improved "mixtime" sync system, allowing custom looping + SYNCPROC + CUSTLOOP example added +* FX can now be in the DSP chain, so can be prioritized and applied in floating-point + BASS_ChannelSetFX + BASS_CONFIG_FLOATDSP (BASS_SetConfig option) +* Ability to set channel flags (eg. looping) independent of playback + BASS_ChannelSetFlags + SPEAKERS example updated +* Stream/MOD "play" and channel "resume" functions combined + BASS_ChannelPlay + BASS_StreamPlay *removed* + BASS_MusicPlay *removed* + BASS_MusicPlayEx *removed* + BASS_ChannelResume *removed* +* Stream/MOD pre-buffering functions combined + BASS_ChannelPreBuf + BASS_StreamPreBuf *removed* + BASS_MusicPreBuf *removed* +* MOD attribute functions combined, with added BPM/speed/globalvolume options + BASS_MusicSetAttribute + BASS_MusicGetAttribute + BASS_MUSIC_ATTRIB_AMPLIFY + BASS_MUSIC_ATTRIB_PANSEP + BASS_MUSIC_ATTRIB_PSCALER + BASS_MUSIC_ATTRIB_BPM + BASS_MUSIC_ATTRIB_SPEED + BASS_MUSIC_ATTRIB_VOL_GLOBAL + BASS_MUSIC_ATTRIB_VOL_CHAN + BASS_MUSIC_ATTRIB_VOL_INST + BASS_MusicSetAmplify *removed* + BASS_MusicSetPanSep *removed* + BASS_MusicSetPositionScaler *removed* + BASS_MusicSetVolume *removed* + BASS_MusicGetVolume *removed* +* Flag to reset bpm/etc as well as notes when seeking in MOD musics + BASS_MUSIC_POSRESETEX (BASS_MusicLoad & BASS_ChannelSetFlags flag) +* More flexible and concise sample channel creation system + BASS_SampleGetChannel + BASS_SamplePlay *removed* + BASS_SamplePlayEx *removed* + BASS_SamplePlay3D *removed* + BASS_SamplePlay3DEx *removed* +* Support for up to 30 speakers + BASS_SPEAKER_N macro/define +* More precise level measurement + BASS_ChannelGetLevel +* Level can now be retrieved from decoding channels + BASS_ChannelGetLevel +* Retrieval of a sample/channel's original sample resolution + BASS_SAMPLE (origres member) + BASS_CHANNELINFO (origres member) +* Support for streaming WAV files in "blocks" + BASS_StreamCreateURL + BASS_StreamCreateFileUser +* Status info (HTTP/ICY tags) available during connection to server + BASS_STREAM_STATUS (BASS_StreamCreateURL flag) + DOWNLOADPROC + NETRADIO example updated (Delphi version also added) +* Adjustable internet stream pre-buffering + BASS_CONFIG_NET_PREBUF (BASS_SetConfig option) +* Option to bypass proxy server + BASS_CONFIG_NET_NOPROXY (BASS_SetConfig option) +* Option whether to allow channels to be played after BASS_Pause + BASS_CONFIG_PAUSE_NOPLAY (BASS_SetConfig option) +* Recording channel count now a separate parameter + BASS_RecordStart (chans parameter) +* Synchronizer for when a channel is freed + BASS_SYNC_FREE (BASS_ChannelSetSync type) +* Data start file position retrieval + BASS_FILEPOS_START (BASS_StreamGetFilePosition mode) +* Performance improvements + MP2 decoding ~20% faster + MP3/MP1 decoding & FFT processing all up to 10% faster + OGG decoding ~3% faster +* C/C++ examples reorganised, with makefiles & VC++ projects +* Add-on API enhancements +* More DLL shrinkage :) + +2.0 - 31/10/2003 +---------------- +* Multiple output device support + BASS_Init (device number changes) + BASS_SetDevice + BASS_GetDevice + BASS_ChannelGetDevice + MULTI example updated (VB version also added) +* Multiple recording device support + BASS_RecordSetDevice + BASS_RecordGetDevice + BASS_RecordStart + BASS_ChannelGetDevice + HRECORD handle + RECORDPROC (handle parameter) +* Recording with DSP/FX + BASS_ChannelSetDSP + BASS_ChannelSetFX +* Recording position retrieval + BASS_ChannelGetPosition +* Start recording paused + BASS_RECORD_PAUSE (BASS_RecordStart flag) +* Multi-channel streams, inc. support for multichannel OGG & WAV files + BASS_StreamCreate + BASS_StreamCreateFile/User/URL +* FFT for individual channels, inc. multi-channel streams + BASS_DATA_FFT_INDIVIDUAL (BASS_ChannelGetData flag) + BASS_DATA_FFT512S/1024S/2048S/4096S *removed* +* DSP prioritizing + BASS_ChannelSetDSP + DSPTEST example updated +* Seeking in internet streamed files + BASS_ChannelSetPosition +* Enhanced custom file stream systems + BASS_StreamCreateFileUser + BASS_FILE_SEEK (STREAMFILEPROC action) + BASS_STREAM_FILEPROC flag *removed* +* Enhanced custom stream system with automatic stalling/resuming + STREAMPROC + BASS_STREAMPROC_END (STREAMPROC flag) +* Synchronizer for stalled/resumed playback + BASS_SYNC_STALL (BASS_ChannelSetSync type) +* Synchronizer for completed download + BASS_SYNC_DOWNLOAD (BASS_ChannelSetSync type) +* End sync support for custom streams + BASS_SYNC_END (BASS_ChannelSetSync type) +* Synchronizer support for decoding channels + BASS_ChannelSetSync +* Unified configuration function + BASS_SetConfig + BASS_GetConfig + BASS_SetBufferLength *removed* + BASS_SetNetConfig *removed* + BASS_SetGlobalVolumes *removed* + BASS_GetGlobalVolumes *removed* + BASS_SetLogCurves *removed* + BASS_Set3DAlgorithm *removed* + BASS_DEVICE_FLOATDSP flag *removed* +* Internet stream saving to disk replaced by more flexible callback + BASS_StreamCreateURL + DOWNLOADPROC + VB NETRADIO example updated +* Buffer length retrieval when "streaming in blocks" + BASS_FILEPOS_END (BASS_StreamGetFilePosition mode) +* Individual sample rate setting for MOD musics + BASS_MusicLoad +* Channel type and default sample rate retrieval + BASS_ChannelGetInfo (replaces BASS_ChannelGetFlags) + BASS_CHANNELINFO +* MOD music flag retrieval + BASS_CHANNELINFO (flags member) +* Adjustable instrument volumes in MOD musics + BASS_MusicSetVolume (replaces BASS_MusicSetChannelVol) + BASS_MusicGetVolume (replaces BASS_MusicGetChannelVol) +* Automatically free a MOD music when it stops or ends + BASS_MUSIC_AUTOFREE (BASS_MusicLoad flag) +* Class GUID added to initialization parameters + BASS_Init + BASS_SetCLSID *removed* +* Update period adjustable at any time + BASS_CONFIG_UPDATEPERIOD (BASS_SetConfig option) + BASS_DEVICE_NOTHREAD flag *removed* +* Customizable maximum volume setting + BASS_CONFIG_MAXVOL (BASS_SetConfig option) + BASS_DEVICE_VOL1000 flag *removed* +* Device volume is now always left as it is during init/freeing + BASS_DEVICE_LEAVEVOL flag *removed* +* Device driver name retrieval + BASS_INFO (driver member) + BASS_RECORDINFO (driver member) +* Error codes are local to the current thread + BASS_ErrorGetCode +* Performance improvements + MP2 decoding 15-20% faster + MP3 decoding ~5% faster +* Built-in CD functions removed (replaced in BASSCD) + BASS_CDDoor *removed* + BASS_CDFree *removed* + BASS_CDGetID *removed* + BASS_CDGetTrackLength *removed* + BASS_CDGetTracks *removed* + BASS_CDInDrive *removed* + BASS_CDInit *removed* + BASS_CDPlay *removed* +* Force channels to use software mixing + BASS_SAMPLE_SOFTWARE (BASS_StreamCreate/File/User/URL & BASS_MusicLoad flag) +* Support for high-pass filter and forward/reverse (S9E/F) IT/MPT effects +* BASS_MUSIC flags rearranged to mirror BASS_SAMPLE/STREAM counterparts +* Output automatically started during initialization +* BASS_ChannelGetData once again accepts any "length" param +* All function comments have been removed from the API headers to avoid + outdated/incorrect information - the documentation should be used. +* TMT Pascal API removed from main distribution - now available on the website +* A few more 'K' knocked off the DLL size :) + +1.8a - 18/6/2003 +---------------- +* Tweaks 'n' fixes, including... + Fixed seeking bug on 32-bit OGG streams + Fixed seeking on a decoding channel after it has reached the end + Low FPU precision (eg. when using Direct3D) issue addressed + Improved speakers (BASS_INFO) detection + BASS_ChannelSeconds2Bytes return value is rounded down to nearest sample + BASS_ChannelGetData "length" param must equal a whole number of samples + Slide syncs are triggered by "-2" volume slides on "autofree" streams +* Support for Unicode filenames + BASS_UNICODE (BASS_SampleLoad/BASS_StreamCreateFile/BASS_MusicLoad flag) +* 4096 sample FFT + BASS_DATA_FFT4096/S (BASS_ChannelGetData flags) +* Another 'K' knocked off the DLL size + +1.8 - 9/3/2003 +-------------- +* 32-bit floating-point channels + BASS_SAMPLE_FLOAT (BASS_StreamCreate/File/URL flag) + BASS_MUSIC_FLOAT (BASS_MusicLoad flag) + BASS_SAMPLE_FLOAT (BASS_RecordStart flag) + BASS_DEVICE_FLOATDSP (BASS_Init flag) + DSPTEST example updated +* Support for 32-bit floating-point (type 3) WAV files + BASS_StreamCreateFile/URL + BASS_SampleLoad +* Channel speaker assignment + BASS_SPEAKER_FRONT (BASS_MusicLoad/BASS_StreamCreate/File/URL flag) + BASS_SPEAKER_REAR " + BASS_SPEAKER_CENLFE " + BASS_SPEAKER_REAR2 " + BASS_SPEAKER_FRONTLEFT " + BASS_SPEAKER_FRONTRIGHT " + BASS_SPEAKER_REARLEFT " + BASS_SPEAKER_REARRIGHT " + BASS_SPEAKER_CENTER " + BASS_SPEAKER_LFE " + BASS_SPEAKER_REAR2LEFT " + BASS_SPEAKER_REAR2RIGHT " + BASS_INFO (speakers member) + BASS_DEVICE_SPEAKERS (BASS_Init flag) + 4SPEAKER example replaced by SPEAKERS example +* Recording input type retrieval + BASS_INPUT_TYPE_xxx (BASS_RecordGetInput) + RECTEST example updated +* Non-interpolated MOD mixing + BASS_MUSIC_NONINTER (BASS_MusicLoad/PlayEx flag) +* Performance improvements + FFT up to 100% faster! + MP3(MPEG2/2.5) decoding up to 60% faster + MMX mixers 5-10% faster + MP3(MPEG1)/MP2/MP1/OGG decoding all ~5% faster +* Optional disabling of FFT windowing + BASS_DATA_FFT_NOWINDOW (BASS_ChannelGetData flag) +* BASS_ERROR_FILEFORM - error code to distinguish between file and sample format + BASS_MusicLoad + BASS_SampleLoad + BASS_StreamCreate/File/URL +* BASS_StreamGetFilePosition mode flags added + BASS_FILEPOS_DECODE/DOWNLOAD/END +* DirectSound 9 detection + BASS_INFO (dsver member) +* Initialization flags retrieval + BASS_INFO (initflags member) +* Half-rate MP3 playback option removed + BASS_MP3_HALFRATE flag *removed* +* New internal "plugin" system - BASSWMA is further integrated as a result +* Improved documentation - integrated with BASSWMA, search option added +* VB version of DSPTEST example added +* Delphi RECORDTEST example added +* Guess what... reduced DLL size again :) + +1.7 - 27/10/2002 +---------------- +* New alternative DX8 (DMO) effects implementation + BASS_StreamCreate/File/URL + BASS_MusicLoad + BASS_ChannelSetFX + SYNTH example updated +* User file streaming + BASS_STREAM_FILEPROC (BASS_StreamCreate flag) + STREAMFILEPROC +* DSP & FX support for decoding channels + BASS_ChannelSetDSP + BASS_ChannelSetFX +* Support for DX8 (DMO) effects in IT/XM/MO3 files + BASS_MusicLoad +* Support for chained OGG streaming (and syncing) + BASS_StreamCreateURL + BASS_SYNC_META (BASS_ChannelSetSync type) +* Attribute (volume/frequency/pan) sliding + BASS_ChannelSlideAttributes + BASS_ChannelIsSliding + BASS_SYNC_SLIDE (BASS_ChannelSetSync type) +* Recording without a callback function + BASS_RecordStart + LIVEFX example added +* Query a channel's buffered data + BASS_DATA_AVAILABLE (BASS_ChannelGetData flag) +* Discard data from the recording buffer + BASS_ChannelGetData +* Adjustable internet stream config (timeout/buffer lengths) + BASS_SetNetConfig +* Recommended minimum buffer length + BASS_INFO (minbuf member) +* MOD music flags adjustment without changing playback position + BASS_MusicPlayEx + PLAYER (MASM) example updated +* More functions are now useable in MOD music "mixtime" syncs + SYNCPROC + BASS_ChannelSetPosition + BASS_MusicPlayEx + BASS_MusicSetAmplify + BASS_MusicSetPanSep +* Maximum buffer length increased to 5 seconds + BASS_SetBufferLength +* Support for extended filter range in IT files + BASS_MusicLoad +* Speedier MOD music file verification + BASS_MusicLoad +* Delphi 3DTEST example fixed +* Magically reduced DLL size again :) + +1.6a - 25/8/2002 +---------------- +* OGG support updated to 1.0 +* Stereo FFT + BASS_DATA_FFT512S/1024S/2048S (BASS_ChannelGetData flags) +* Support for "Invert Loop" (EFx) MOD effect +* Reduced DLL size +* New Delphi examples + WRITEWAV - WAVE writer example + SAMPLEVIS - Visualisation example + +1.6 - 13/6/2002 +--------------- +* 64-bit stream lengths and positions + BASS_StreamGetLength + BASS_ChannelBytes2Seconds + BASS_ChannelSeconds2Bytes + BASS_ChannelGetPosition + BASS_ChannelSetPosition + BASS_ChannelSetSync +* Recording input selection + BASS_RECORDINFO (inputs & singlein members) + BASS_RecordGetInputName + BASS_RecordGetInput + BASS_RecordSetInput +* Adjustable recording update period + BASS_RecordStart +* Load OGG files as samples + BASS_SampleLoad +* CD drive door opening & closing + BASS_CDDoor +* CDDB2 ID retrieval + BASS_CDID_CDDB2 (BASS_CDGetID flag) +* Streaming beyond initial file length + BASS_StreamCreateFile +* Recording position bytes<->seconds translation + BASS_ChannelBytes2Seconds + BASS_ChannelSeconds2Bytes +* Improved multi-threaded support (play from any thread) + BASS_MusicPlay/Ex + BASS_SamplePlay/3D/Ex + BASS_StreamPlay + BASS_DEVICE_NOSYNC flag *removed* +* Paused channel status + BASS_ACTIVE_PAUSED (BASS_ChannelIsActive) +* Integrated WMA stream freeing + BASS_StreamFree + BASS_Free +* Pin-point accurate OGG seeking without BASS_MP3_SETPOS flag +* Win2k DS buffer bug fix + +1.5a - 14/4/2002 +---------------- +* NT4 fix (also enables "nosound" device without DX installed) + BASS_ERROR_DX error code +* MOD music loading without the samples + BASS_MUSIC_NOSAMPLE (BASS_MusicLoad flag) +* Custom decoding channels + BASS_STREAM_DECODE (BASS_StreamCreate flag) +* 5 second HTTP connection timeout + BASS_ERROR_TIMEOUT (BASS_StreamCreateURL error code) + +1.5 - 31/3/2002 +--------------- +* Improved performance + MMX mixers lot faster (over 50% faster in some cases!) + OGG decoding 15-20% faster + MP3 decoding 5-10% faster +* Recording + BASS_RecordGetDeviceDescription + BASS_RecordInit + BASS_RecordFree + BASS_RecordGetInfo + BASS_RecordStart +* OGG support built-in (OGG/VORBIS DLLs not required) + BASS_DEVICE_OGG flag *removed* +* MOD music seeking in seconds + BASS_MusicPlayEx + BASS_ChannelSetPosition +* Shoutcast metadata retrieval + BASS_STREAM_META (BASS_StreamCreateURL flag) + BASS_TAG_META (BASS_StreamGetTags type) + BASS_SYNC_META (BASS_ChannelSetSync type) +* 1000 volume levels + BASS_DEVICE_VOL1000 (BASS_Init/CDInit flag) +* CDDB ID retrieval + BASS_CDID_CDDB (BASS_CDGetID flag) +* Leave the CD volume as it is during init/closing + BASS_DEVICE_LEAVEVOL (BASS_CDInit flag) +* FFT enabled on decoding channels + BASS_ChannelGetData +* Left level duplicated on right for mono channels + BASS_ChannelGetLevel +* Improved MPEG length estimation without BASS_MP3_SETPOS flag + BASS_StreamGetLength +* Support for Modplug/ADPCM compressed files + BASS_MusicLoad +* Device description function parameter change + BASS_GetDeviceDescription +* MASM API + +1.4 - 30/1/2002 +--------------- +* Channel decoding without playback + BASS_MUSIC_DECODE (BASS_MusicLoad flag) + BASS_STREAM_DECODE (BASS_StreamCreateFile/URL flag) + BASS_ChannelGetData +* Windows message sync callbacks + BASS_SYNC_MESSAGE (BASS_ChannelSetSync flag) +* Adjustable channel volumes in MOD musics + BASS_MusicSetChannelVol + BASS_MusicGetChannelVol +* Customizable DirectSound initialization object + BASS_SetCLSID +* Retrieve HMUSIC/HSTREAM/HCHANNEL IDirectSoundBuffer interfaces + BASS_GetDSoundObject +* A3D functions removed (use BASS_SetCLSID/BASS_GetDSoundObject to access A3D) + BASS_DEVICE_A3D (BASS_Init flag) + BASS_SetA3DResManager + BASS_GetA3DResManager + BASS_SetA3DHFAbsorbtion + BASS_GetA3DHFAbsorbtion +* Callback functions now work in VB6 + DSPPROC + STREAMPROC + SYNCPROC +* Improved PCM WAVE streaming performance + BASS_StreamCreateFile + BASS_StreamCreateURL +* OGG modules updated to RC3 +* Stereo sample support in MO3 format +* MO3 encoder now distributed separately from BASS + +1.3 - 17/11/2001 +---------------- +* Manual buffer updating + BASS_DEVICE_NOTHREAD (BASS_Init flag) + BASS_Update +* Adjustable buffer update period (allows small buffer sizes) + BASS_Init +* Output device latency retrieval + BASS_INFO (latency member) +* MPEG/OGG seeking without BASS_MP3_SETPOS flag + BASS_ChannelSetPosition +* Internet file streaming from offsets + BASS_StreamCreateURL +* File stream tag/comment retrieval (ID3/ID3v2/OGG/HTTP/ICY tags) + BASS_StreamGetTags +* Byte<->time position translation + BASS_ChannelBytes2Seconds + BASS_ChannelSeconds2Bytes +* UMX (Unreal/Tournament music package) format support + BASS_MusicLoad +* S3M/IT sync fx changed to S2x (S0x conflicted with S00) + BASS_SYNC_MUSICFX +* Stereo sample support in IT/XM/S3M formats +* MO3: OGG compression supported + +1.2 - 25/9/2001 +--------------- +* OGG (Ogg Vorbis) stream support + BASS_DEVICE_OGG (BASS_Init flag) + BASS_StreamCreateFile + BASS_StreamCreateURL +* Channel linking (start/stop/pause/resume channels together) + BASS_ChannelSetLink + BASS_ChannelRemoveLink +* MOD music playback length calculation + BASS_MUSIC_CALCLEN (BASS_MusicLoad flag) + BASS_MusicGetLength +* Pre-buffering + BASS_MusicPreBuf + BASS_StreamPreBuf +* Samples with single simultaneous playbacks have same HSAMPLE/HCHANNEL handle + BASS_SamplePlay/Ex +* Stopping a custom stream flushes its buffer contents + BASS_ChannelStop + +1.1a - 31/8/2001 +---------------- +* NT4 bug fixed +* XM Wxx effect syncing + BASS_SYNC_MUSICFX +* MP3/2/1 rewinding without BASS_MP3_SETPOS + BASS_ChannelSetPosition + +1.1 - 11/8/2001 +--------------- +* DX8 (DMO) effects + BASS_SAMPLE_FX (BASS_StreamCreate/File/URL flag) + BASS_MUSIC_FX (BASS_MusicLoad flag) + BASS_ChannelSetFX + BASS_ChannelRemoveFX + BASS_FXSetParameters + BASS_FXGetParameters + BASS_FXCHORUS structure + BASS_FXCOMPRESSOR structure + BASS_FXDISTORTION structure + BASS_FXECHO structure + BASS_FXFLANGER structure + BASS_FXGARGLE structure + BASS_FXI3DL2REVERB structure + BASS_FXPARAMEQ structure + BASS_FXREVERB structure +* Internet file streaming in blocks (inc. Shoutcast/Icecast stream support) + BASS_STREAM_BLOCK (BASS_StreamCreateURL flag) +* 512/1024/2048 sample FFT + BASS_DATA_FFT512/1024/2048 (BASS_ChannelGetData flags) +* CD identification + BASS_CDGetID +* Improved DX version detection + BASS_INFO (dsver member) + +1.0 - 20/6/2001 +--------------- +* Load MP3/MP2/MP1 files as samples + BASS_SampleLoad +* Internet file streaming from FTP servers + BASS_StreamCreateURL +* Save a local copy of internet file streams + BASS_StreamCreateURL +* Sample accurate file stream seeking + BASS_ChannelSetPosition + BASS_StreamGetBlockLength *removed* +* Stream position synchronizer + BASS_SYNC_POS +* Increased synchronizer precision +* Improved MPEG file detection and error detection +* Stop MOD musics on a backwards jump effect + BASS_MUSIC_STOPBACK (BASS_MusicLoad/PlayEx flag) +* Leave the volume as it is during closing (as well as initialization) + BASS_DEVICE_LEAVEVOL (BASS_Init flag) +* Optional automatic use of foreground window handle during initialization + BASS_Init +* Reduced DLL size +* VB API fixes + +0.9 - 18/4/2001 +--------------- +* Internet file streaming + BASS_StreamCreateURL +* MP1 & MP2 (MPEG layer 1 & 2) support + BASS_StreamCreateFile/URL +* MPEG 2.5 support (12000/11025/8000hz sample rates) + BASS_StreamCreateFile/URL +* Decoding/download/end file stream position retrieval + BASS_StreamGetFilePosition +* XMPlay surround sound for MOD musics + BASS_MUSIC_SURROUND (BASS_MusicLoad/PlayEx flag) + BASS_MUSIC_SURROUND2 (BASS_MusicLoad/PlayEx flag) +* Restrict the download rate of internet file streams + BASS_STREAM_RESTRATE (BASS_StreamCreateURL flag) +* Check if an internet file stream is stalled + BASS_ChannelIsActive +* Automatically free a stream when it stops or ends + BASS_STREAM_AUTOFREE (BASS_StreamCreate/File/URL flag) +* Leave the volume as it is during initialization + BASS_DEVICE_LEAVEVOL (BASS_Init flag) +* Number of CD tracks retrieval + BASS_CDGetTracks +* CD track length retrieval + BASS_CDGetTrackLength +* Exact stream length set after whole file is streamed + BASS_StreamGetLength +* TMT Pascal API and samples +* Dynamic-loading Delphi API + +0.8a - 28/2/2000 +---------------- +* Updated Delphi API and samples + +0.8 - 24/1/2000 +--------------- +* Improved MP3 performance on P2/K6 and above CPUs +* User DSP functions on streams and MOD musics + BASS_ChannelSetDSP + BASS_ChannelRemoveDSP +* DX7 voice allocation & management + BASS_SAMPLE_VAM (BASS_SampleLoad/Create flag) + BASS_VAM_xxx flags + BASS_SAMPLE (vam & priority members) +* DX7 software 3D algorithm selection + BASS_Set3DAlgorithm +* DirectSound interface retrieval + BASS_GetDSoundObject +* Log/linear volume & panning curves + BASS_SetLogCurves +* User data passed to callback functions + STREAMPROC - BASS_StreamCreate + SYNCPROC - BASS_ChannelSetSync +* New synchronizer + BASS_SYNC_MUSICFX +* New synchronizer flag + BASS_SYNC_MIXTIME +* Disable synchronizers option - saves a little CPU time + BASS_DEVICE_NOSYNC (BASS_Init flag) +* Hi-res floating-point CPU usage monitoring + BASS_GetCPU +* Wait for playback to start when playing a CD + BASS_CDPlay +* DirectSound (dsound.dll) version retrieval + BASS_INFO (dsver member) +* Removed volume sliding functions (they were fairly pointless) + BASS_SlideVolume + BASS_IsSliding +* MO3: read/write encoder settings +* MO3: remove inst/samp/message texts now optional +* MO3: LAME encoder settings + +0.7 - 3/10/1999 +--------------- +* MO3 (MP3 compressed MODs) +* A3D functions + BASS_DEVICE_A3D (BASS_Init flag) + BASS_INFO (a3d member) + BASS_SetA3DResManager + BASS_GetA3DResManager + BASS_SetA3DHFAbsorbtion + BASS_GetA3DHFAbsorbtion +* Music/stream immediate sample data retrieval + BASS_ChannelGetData +* File stream (WAV/MP3) length retrieval + BASS_StreamGetLength + BASS_StreamGetBlockLength +* File stream seeking + BASS_ChannelSetPosition +* Mono MP3 option (lower CPU usage) + BASS_StreamCreateFile +* Music length retrieval + BASS_MusicGetLength +* Music name retrieval + BASS_MusicGetName +* Stop notes when moving MOD music position + BASS_MUSIC_POSRESET (BASS_MusicLoad/BASS_MusicPlayEx flag) +* BASS_ERROR_FREQ - invalid sample rate error code + BASS_SampleCreate + BASS_SamplePlayEx + BASS_SamplePlay3DEx + BASS_StreamCreate + BASS_ChannelSetAttributes +* Delphi and VB APIs + +0.6a - 26/7/1999 +---------------- +* Half rate MP3 option (lower CPU usage) + BASS_MP3_HALFRATE +* Loading/streaming from file offsets + BASS_MusicLoad + BASS_SampleLoad + BASS_StreamCreateFile +* Global music/sample/stream volume levels + BASS_SetGlobalVolumes + BASS_GetGlobalVolumes +* Other new function + BASS_SampleStop +* New synchronizer + BASS_SYNC_END +* New sample overrider + BASS_SAMPLE_OVER_DIST +* LoadLibrary/GetProcAddress instructions and example + +0.5 - 4/7/1999 +-------------- +* Documentation! +* File streaming (MP3 and WAV) + BASS_StreamCreateFile +* Custom generated samples + BASS_SampleCreate + BASS_SampleCreateDone +* Other new function + BASS_MusicSetPositionScaler +* Renamed function + BASS_ChannelClearSync -> BASS_ChannelRemoveSync +* Alterations made to + BASS_ChannelGetPosition + BASS_SampleLoad + BASS_StreamPlay + +0.4 - 30/3/1999 +--------------- +* Compressed WAV samples support (using audio CODECs) +* Updated CD volume handling - now works with SB Live +* More linear channel volume/pan scales (were slightly off before) +* "No sound" device option +* 3D sound functions + BASS_Set3DFactors + BASS_Get3DFactors + BASS_Set3DPosition + BASS_Get3DPosition + BASS_Apply3D + BASS_SamplePlay3D + BASS_SamplePlay3DEx + BASS_ChannelSet3DAttributes + BASS_ChannelGet3DAttributes + BASS_ChannelSet3DPosition + BASS_ChannelGet3DPosition +* EAX functions + BASS_SetEAXParameters + BASS_GetEAXParameters + BASS_ChannelSetEAXMix + BASS_ChannelGetEAXMix +* Other new functions + BASS_GetDeviceDescription + BASS_SetBufferLen + BASS_ChannelGetFlags + BASS_ChannelPause + BASS_ChannelResume + BASS_ChannelSetPosition +* Replaced function + BASS_CDResume -> BASS_ChannelResume +* Alterations made to + BASS_Init + BASS_CDInit + BASS_SampleLoad + BASS_StreamPlay + BASS_INFO structure + BASS_SAMPLE structure + BASS_DEVICE_xxx flags + BASS_SAMPLE_xxx flags + +0.3 - 8/3/1999 +-------------- +* Synchronization functions + BASS_ChannelSetSync + BASS_ChannelClearSync +* Other new functions + BASS_GetVersion + BASS_ChannelGetPosition + BASS_ChannelGetLevel + BASS_ChannelGetAttributes + BASS_ChannelSetAttributes +* Replaced functions + BASS_MusicStop -> BASS_ChannelStop + BASS_MusicSetVolume -> BASS_ChannelSetAttributes + BASS_CDStop -> BASS_ChannelStop + BASS_CDSetVolume -> BASS_ChannelSetAttributes + BASS_CDGetVolume -> BASS_ChannelGetAttributes + BASS_ChannelUpdate -> BASS_ChannelSetAttributes +* Alterations made to + BASS_MusicPlayEx + BASS_StreamPlay + BASS_INFO structure + +0.2 - 28/2/1999 +--------------- +* First public release + + +Bug reports, Suggestions, Comments, Enquiries, etc +================================================== +If you have any of the aforementioned please visit the BASS forum at the +website. If you can't find an answer there, you can also email: + + bass@un4seen.com + diff --git a/bass-sys/bass24/c/3dtest/3dtest.c b/bass-sys/win/bass24/c/3dtest/3dtest.c similarity index 100% rename from bass-sys/bass24/c/3dtest/3dtest.c rename to bass-sys/win/bass24/c/3dtest/3dtest.c diff --git a/bass-sys/bass24/c/3dtest/3dtest.dsp b/bass-sys/win/bass24/c/3dtest/3dtest.dsp similarity index 100% rename from bass-sys/bass24/c/3dtest/3dtest.dsp rename to bass-sys/win/bass24/c/3dtest/3dtest.dsp diff --git a/bass-sys/bass24/c/3dtest/3dtest.rc b/bass-sys/win/bass24/c/3dtest/3dtest.rc similarity index 100% rename from bass-sys/bass24/c/3dtest/3dtest.rc rename to bass-sys/win/bass24/c/3dtest/3dtest.rc diff --git a/bass-sys/bass24/c/3dtest/3dtest.vcproj b/bass-sys/win/bass24/c/3dtest/3dtest.vcproj similarity index 100% rename from bass-sys/bass24/c/3dtest/3dtest.vcproj rename to bass-sys/win/bass24/c/3dtest/3dtest.vcproj diff --git a/bass-sys/bass24/c/3dtest/3dtest.vcxproj b/bass-sys/win/bass24/c/3dtest/3dtest.vcxproj similarity index 100% rename from bass-sys/bass24/c/3dtest/3dtest.vcxproj rename to bass-sys/win/bass24/c/3dtest/3dtest.vcxproj diff --git a/bass-sys/bass24/c/3dtest/makefile b/bass-sys/win/bass24/c/3dtest/makefile similarity index 100% rename from bass-sys/bass24/c/3dtest/makefile rename to bass-sys/win/bass24/c/3dtest/makefile diff --git a/bass-sys/bass24/c/bass.dsw b/bass-sys/win/bass24/c/bass.dsw similarity index 100% rename from bass-sys/bass24/c/bass.dsw rename to bass-sys/win/bass24/c/bass.dsw diff --git a/bass-sys/win/bass24/c/bass.h b/bass-sys/win/bass24/c/bass.h new file mode 100644 index 0000000..901f9a2 --- /dev/null +++ b/bass-sys/win/bass24/c/bass.h @@ -0,0 +1,1160 @@ +/* + BASS 2.4 C/C++ header file + Copyright (c) 1999-2019 Un4seen Developments Ltd. + + See the BASS.CHM file for more detailed documentation +*/ + +#ifndef BASS_H +#define BASS_H + +#ifdef _WIN32 +#include +typedef unsigned __int64 QWORD; +#else +#include +#define WINAPI +#define CALLBACK +typedef uint8_t BYTE; +typedef uint16_t WORD; +typedef uint32_t DWORD; +typedef uint64_t QWORD; +#ifdef __OBJC__ +#include +#else +typedef int BOOL; +#endif +#ifndef TRUE +#define TRUE 1 +#define FALSE 0 +#endif +#define LOBYTE(a) (BYTE)(a) +#define HIBYTE(a) (BYTE)((a)>>8) +#define LOWORD(a) (WORD)(a) +#define HIWORD(a) (WORD)((a)>>16) +#define MAKEWORD(a,b) (WORD)(((a)&0xff)|((b)<<8)) +#define MAKELONG(a,b) (DWORD)(((a)&0xffff)|((b)<<16)) +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define BASSVERSION 0x204 // API version +#define BASSVERSIONTEXT "2.4" + +#ifndef BASSDEF +#define BASSDEF(f) WINAPI f +#else +#define NOBASSOVERLOADS +#endif + +typedef DWORD HMUSIC; // MOD music handle +typedef DWORD HSAMPLE; // sample handle +typedef DWORD HCHANNEL; // playing sample's channel handle +typedef DWORD HSTREAM; // sample stream handle +typedef DWORD HRECORD; // recording handle +typedef DWORD HSYNC; // synchronizer handle +typedef DWORD HDSP; // DSP handle +typedef DWORD HFX; // DX8 effect handle +typedef DWORD HPLUGIN; // Plugin handle + +// Error codes returned by BASS_ErrorGetCode +#define BASS_OK 0 // all is OK +#define BASS_ERROR_MEM 1 // memory error +#define BASS_ERROR_FILEOPEN 2 // can't open the file +#define BASS_ERROR_DRIVER 3 // can't find a free/valid driver +#define BASS_ERROR_BUFLOST 4 // the sample buffer was lost +#define BASS_ERROR_HANDLE 5 // invalid handle +#define BASS_ERROR_FORMAT 6 // unsupported sample format +#define BASS_ERROR_POSITION 7 // invalid position +#define BASS_ERROR_INIT 8 // BASS_Init has not been successfully called +#define BASS_ERROR_START 9 // BASS_Start has not been successfully called +#define BASS_ERROR_SSL 10 // SSL/HTTPS support isn't available +#define BASS_ERROR_ALREADY 14 // already initialized/paused/whatever +#define BASS_ERROR_NOTAUDIO 17 // file does not contain audio +#define BASS_ERROR_NOCHAN 18 // can't get a free channel +#define BASS_ERROR_ILLTYPE 19 // an illegal type was specified +#define BASS_ERROR_ILLPARAM 20 // an illegal parameter was specified +#define BASS_ERROR_NO3D 21 // no 3D support +#define BASS_ERROR_NOEAX 22 // no EAX support +#define BASS_ERROR_DEVICE 23 // illegal device number +#define BASS_ERROR_NOPLAY 24 // not playing +#define BASS_ERROR_FREQ 25 // illegal sample rate +#define BASS_ERROR_NOTFILE 27 // the stream is not a file stream +#define BASS_ERROR_NOHW 29 // no hardware voices available +#define BASS_ERROR_EMPTY 31 // the MOD music has no sequence data +#define BASS_ERROR_NONET 32 // no internet connection could be opened +#define BASS_ERROR_CREATE 33 // couldn't create the file +#define BASS_ERROR_NOFX 34 // effects are not available +#define BASS_ERROR_NOTAVAIL 37 // requested data/action is not available +#define BASS_ERROR_DECODE 38 // the channel is/isn't a "decoding channel" +#define BASS_ERROR_DX 39 // a sufficient DirectX version is not installed +#define BASS_ERROR_TIMEOUT 40 // connection timedout +#define BASS_ERROR_FILEFORM 41 // unsupported file format +#define BASS_ERROR_SPEAKER 42 // unavailable speaker +#define BASS_ERROR_VERSION 43 // invalid BASS version (used by add-ons) +#define BASS_ERROR_CODEC 44 // codec is not available/supported +#define BASS_ERROR_ENDED 45 // the channel/file has ended +#define BASS_ERROR_BUSY 46 // the device is busy +#define BASS_ERROR_UNSTREAMABLE 47 // unstreamable file +#define BASS_ERROR_UNKNOWN -1 // some other mystery problem + +// BASS_SetConfig options +#define BASS_CONFIG_BUFFER 0 +#define BASS_CONFIG_UPDATEPERIOD 1 +#define BASS_CONFIG_GVOL_SAMPLE 4 +#define BASS_CONFIG_GVOL_STREAM 5 +#define BASS_CONFIG_GVOL_MUSIC 6 +#define BASS_CONFIG_CURVE_VOL 7 +#define BASS_CONFIG_CURVE_PAN 8 +#define BASS_CONFIG_FLOATDSP 9 +#define BASS_CONFIG_3DALGORITHM 10 +#define BASS_CONFIG_NET_TIMEOUT 11 +#define BASS_CONFIG_NET_BUFFER 12 +#define BASS_CONFIG_PAUSE_NOPLAY 13 +#define BASS_CONFIG_NET_PREBUF 15 +#define BASS_CONFIG_NET_PASSIVE 18 +#define BASS_CONFIG_REC_BUFFER 19 +#define BASS_CONFIG_NET_PLAYLIST 21 +#define BASS_CONFIG_MUSIC_VIRTUAL 22 +#define BASS_CONFIG_VERIFY 23 +#define BASS_CONFIG_UPDATETHREADS 24 +#define BASS_CONFIG_DEV_BUFFER 27 +#define BASS_CONFIG_REC_LOOPBACK 28 +#define BASS_CONFIG_VISTA_TRUEPOS 30 +#define BASS_CONFIG_IOS_SESSION 34 +#define BASS_CONFIG_IOS_MIXAUDIO 34 +#define BASS_CONFIG_DEV_DEFAULT 36 +#define BASS_CONFIG_NET_READTIMEOUT 37 +#define BASS_CONFIG_VISTA_SPEAKERS 38 +#define BASS_CONFIG_IOS_SPEAKER 39 +#define BASS_CONFIG_MF_DISABLE 40 +#define BASS_CONFIG_HANDLES 41 +#define BASS_CONFIG_UNICODE 42 +#define BASS_CONFIG_SRC 43 +#define BASS_CONFIG_SRC_SAMPLE 44 +#define BASS_CONFIG_ASYNCFILE_BUFFER 45 +#define BASS_CONFIG_OGG_PRESCAN 47 +#define BASS_CONFIG_MF_VIDEO 48 +#define BASS_CONFIG_AIRPLAY 49 +#define BASS_CONFIG_DEV_NONSTOP 50 +#define BASS_CONFIG_IOS_NOCATEGORY 51 +#define BASS_CONFIG_VERIFY_NET 52 +#define BASS_CONFIG_DEV_PERIOD 53 +#define BASS_CONFIG_FLOAT 54 +#define BASS_CONFIG_NET_SEEK 56 +#define BASS_CONFIG_AM_DISABLE 58 +#define BASS_CONFIG_NET_PLAYLIST_DEPTH 59 +#define BASS_CONFIG_NET_PREBUF_WAIT 60 +#define BASS_CONFIG_ANDROID_SESSIONID 62 +#define BASS_CONFIG_WASAPI_PERSIST 65 +#define BASS_CONFIG_REC_WASAPI 66 +#define BASS_CONFIG_ANDROID_AAUDIO 67 + +// BASS_SetConfigPtr options +#define BASS_CONFIG_NET_AGENT 16 +#define BASS_CONFIG_NET_PROXY 17 +#define BASS_CONFIG_IOS_NOTIFY 46 +#define BASS_CONFIG_LIBSSL 64 + +// BASS_CONFIG_IOS_SESSION flags +#define BASS_IOS_SESSION_MIX 1 +#define BASS_IOS_SESSION_DUCK 2 +#define BASS_IOS_SESSION_AMBIENT 4 +#define BASS_IOS_SESSION_SPEAKER 8 +#define BASS_IOS_SESSION_DISABLE 16 + +// BASS_Init flags +#define BASS_DEVICE_8BITS 1 // 8 bit +#define BASS_DEVICE_MONO 2 // mono +#define BASS_DEVICE_3D 4 // enable 3D functionality +#define BASS_DEVICE_16BITS 8 // limit output to 16 bit +#define BASS_DEVICE_LATENCY 0x100 // calculate device latency (BASS_INFO struct) +#define BASS_DEVICE_CPSPEAKERS 0x400 // detect speakers via Windows control panel +#define BASS_DEVICE_SPEAKERS 0x800 // force enabling of speaker assignment +#define BASS_DEVICE_NOSPEAKER 0x1000 // ignore speaker arrangement +#define BASS_DEVICE_DMIX 0x2000 // use ALSA "dmix" plugin +#define BASS_DEVICE_FREQ 0x4000 // set device sample rate +#define BASS_DEVICE_STEREO 0x8000 // limit output to stereo +#define BASS_DEVICE_HOG 0x10000 // hog/exclusive mode +#define BASS_DEVICE_AUDIOTRACK 0x20000 // use AudioTrack output +#define BASS_DEVICE_DSOUND 0x40000 // use DirectSound output + +// DirectSound interfaces (for use with BASS_GetDSoundObject) +#define BASS_OBJECT_DS 1 // IDirectSound +#define BASS_OBJECT_DS3DL 2 // IDirectSound3DListener + +// Device info structure +typedef struct { +#if defined(_WIN32_WCE) || (WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP) + const wchar_t *name; // description + const wchar_t *driver; // driver +#else + const char *name; // description + const char *driver; // driver +#endif + DWORD flags; +} BASS_DEVICEINFO; + +// BASS_DEVICEINFO flags +#define BASS_DEVICE_ENABLED 1 +#define BASS_DEVICE_DEFAULT 2 +#define BASS_DEVICE_INIT 4 +#define BASS_DEVICE_LOOPBACK 8 + +#define BASS_DEVICE_TYPE_MASK 0xff000000 +#define BASS_DEVICE_TYPE_NETWORK 0x01000000 +#define BASS_DEVICE_TYPE_SPEAKERS 0x02000000 +#define BASS_DEVICE_TYPE_LINE 0x03000000 +#define BASS_DEVICE_TYPE_HEADPHONES 0x04000000 +#define BASS_DEVICE_TYPE_MICROPHONE 0x05000000 +#define BASS_DEVICE_TYPE_HEADSET 0x06000000 +#define BASS_DEVICE_TYPE_HANDSET 0x07000000 +#define BASS_DEVICE_TYPE_DIGITAL 0x08000000 +#define BASS_DEVICE_TYPE_SPDIF 0x09000000 +#define BASS_DEVICE_TYPE_HDMI 0x0a000000 +#define BASS_DEVICE_TYPE_DISPLAYPORT 0x40000000 + +// BASS_GetDeviceInfo flags +#define BASS_DEVICES_AIRPLAY 0x1000000 + +typedef struct { + DWORD flags; // device capabilities (DSCAPS_xxx flags) + DWORD hwsize; // size of total device hardware memory + DWORD hwfree; // size of free device hardware memory + DWORD freesam; // number of free sample slots in the hardware + DWORD free3d; // number of free 3D sample slots in the hardware + DWORD minrate; // min sample rate supported by the hardware + DWORD maxrate; // max sample rate supported by the hardware + BOOL eax; // device supports EAX? (always FALSE if BASS_DEVICE_3D was not used) + DWORD minbuf; // recommended minimum buffer length in ms (requires BASS_DEVICE_LATENCY) + DWORD dsver; // DirectSound version + DWORD latency; // delay (in ms) before start of playback (requires BASS_DEVICE_LATENCY) + DWORD initflags; // BASS_Init "flags" parameter + DWORD speakers; // number of speakers available + DWORD freq; // current output rate +} BASS_INFO; + +// BASS_INFO flags (from DSOUND.H) +#define DSCAPS_CONTINUOUSRATE 0x00000010 // supports all sample rates between min/maxrate +#define DSCAPS_EMULDRIVER 0x00000020 // device does NOT have hardware DirectSound support +#define DSCAPS_CERTIFIED 0x00000040 // device driver has been certified by Microsoft +#define DSCAPS_SECONDARYMONO 0x00000100 // mono +#define DSCAPS_SECONDARYSTEREO 0x00000200 // stereo +#define DSCAPS_SECONDARY8BIT 0x00000400 // 8 bit +#define DSCAPS_SECONDARY16BIT 0x00000800 // 16 bit + +// Recording device info structure +typedef struct { + DWORD flags; // device capabilities (DSCCAPS_xxx flags) + DWORD formats; // supported standard formats (WAVE_FORMAT_xxx flags) + DWORD inputs; // number of inputs + BOOL singlein; // TRUE = only 1 input can be set at a time + DWORD freq; // current input rate +} BASS_RECORDINFO; + +// BASS_RECORDINFO flags (from DSOUND.H) +#define DSCCAPS_EMULDRIVER DSCAPS_EMULDRIVER // device does NOT have hardware DirectSound recording support +#define DSCCAPS_CERTIFIED DSCAPS_CERTIFIED // device driver has been certified by Microsoft + +// defines for formats field of BASS_RECORDINFO (from MMSYSTEM.H) +#ifndef WAVE_FORMAT_1M08 +#define WAVE_FORMAT_1M08 0x00000001 /* 11.025 kHz, Mono, 8-bit */ +#define WAVE_FORMAT_1S08 0x00000002 /* 11.025 kHz, Stereo, 8-bit */ +#define WAVE_FORMAT_1M16 0x00000004 /* 11.025 kHz, Mono, 16-bit */ +#define WAVE_FORMAT_1S16 0x00000008 /* 11.025 kHz, Stereo, 16-bit */ +#define WAVE_FORMAT_2M08 0x00000010 /* 22.05 kHz, Mono, 8-bit */ +#define WAVE_FORMAT_2S08 0x00000020 /* 22.05 kHz, Stereo, 8-bit */ +#define WAVE_FORMAT_2M16 0x00000040 /* 22.05 kHz, Mono, 16-bit */ +#define WAVE_FORMAT_2S16 0x00000080 /* 22.05 kHz, Stereo, 16-bit */ +#define WAVE_FORMAT_4M08 0x00000100 /* 44.1 kHz, Mono, 8-bit */ +#define WAVE_FORMAT_4S08 0x00000200 /* 44.1 kHz, Stereo, 8-bit */ +#define WAVE_FORMAT_4M16 0x00000400 /* 44.1 kHz, Mono, 16-bit */ +#define WAVE_FORMAT_4S16 0x00000800 /* 44.1 kHz, Stereo, 16-bit */ +#endif + +// Sample info structure +typedef struct { + DWORD freq; // default playback rate + float volume; // default volume (0-1) + float pan; // default pan (-1=left, 0=middle, 1=right) + DWORD flags; // BASS_SAMPLE_xxx flags + DWORD length; // length (in bytes) + DWORD max; // maximum simultaneous playbacks + DWORD origres; // original resolution + DWORD chans; // number of channels + DWORD mingap; // minimum gap (ms) between creating channels + DWORD mode3d; // BASS_3DMODE_xxx mode + float mindist; // minimum distance + float maxdist; // maximum distance + DWORD iangle; // angle of inside projection cone + DWORD oangle; // angle of outside projection cone + float outvol; // delta-volume outside the projection cone + DWORD vam; // voice allocation/management flags (BASS_VAM_xxx) + DWORD priority; // priority (0=lowest, 0xffffffff=highest) +} BASS_SAMPLE; + +#define BASS_SAMPLE_8BITS 1 // 8 bit +#define BASS_SAMPLE_FLOAT 256 // 32 bit floating-point +#define BASS_SAMPLE_MONO 2 // mono +#define BASS_SAMPLE_LOOP 4 // looped +#define BASS_SAMPLE_3D 8 // 3D functionality +#define BASS_SAMPLE_SOFTWARE 16 // not using hardware mixing +#define BASS_SAMPLE_MUTEMAX 32 // mute at max distance (3D only) +#define BASS_SAMPLE_VAM 64 // DX7 voice allocation & management +#define BASS_SAMPLE_FX 128 // old implementation of DX8 effects +#define BASS_SAMPLE_OVER_VOL 0x10000 // override lowest volume +#define BASS_SAMPLE_OVER_POS 0x20000 // override longest playing +#define BASS_SAMPLE_OVER_DIST 0x30000 // override furthest from listener (3D only) + +#define BASS_STREAM_PRESCAN 0x20000 // enable pin-point seeking/length (MP3/MP2/MP1) +#define BASS_STREAM_AUTOFREE 0x40000 // automatically free the stream when it stop/ends +#define BASS_STREAM_RESTRATE 0x80000 // restrict the download rate of internet file streams +#define BASS_STREAM_BLOCK 0x100000 // download/play internet file stream in small blocks +#define BASS_STREAM_DECODE 0x200000 // don't play the stream, only decode (BASS_ChannelGetData) +#define BASS_STREAM_STATUS 0x800000 // give server status info (HTTP/ICY tags) in DOWNLOADPROC + +#define BASS_MP3_IGNOREDELAY 0x200 // ignore LAME/Xing/VBRI/iTunes delay & padding info +#define BASS_MP3_SETPOS BASS_STREAM_PRESCAN + +#define BASS_MUSIC_FLOAT BASS_SAMPLE_FLOAT +#define BASS_MUSIC_MONO BASS_SAMPLE_MONO +#define BASS_MUSIC_LOOP BASS_SAMPLE_LOOP +#define BASS_MUSIC_3D BASS_SAMPLE_3D +#define BASS_MUSIC_FX BASS_SAMPLE_FX +#define BASS_MUSIC_AUTOFREE BASS_STREAM_AUTOFREE +#define BASS_MUSIC_DECODE BASS_STREAM_DECODE +#define BASS_MUSIC_PRESCAN BASS_STREAM_PRESCAN // calculate playback length +#define BASS_MUSIC_CALCLEN BASS_MUSIC_PRESCAN +#define BASS_MUSIC_RAMP 0x200 // normal ramping +#define BASS_MUSIC_RAMPS 0x400 // sensitive ramping +#define BASS_MUSIC_SURROUND 0x800 // surround sound +#define BASS_MUSIC_SURROUND2 0x1000 // surround sound (mode 2) +#define BASS_MUSIC_FT2PAN 0x2000 // apply FastTracker 2 panning to XM files +#define BASS_MUSIC_FT2MOD 0x2000 // play .MOD as FastTracker 2 does +#define BASS_MUSIC_PT1MOD 0x4000 // play .MOD as ProTracker 1 does +#define BASS_MUSIC_NONINTER 0x10000 // non-interpolated sample mixing +#define BASS_MUSIC_SINCINTER 0x800000 // sinc interpolated sample mixing +#define BASS_MUSIC_POSRESET 0x8000 // stop all notes when moving position +#define BASS_MUSIC_POSRESETEX 0x400000 // stop all notes and reset bmp/etc when moving position +#define BASS_MUSIC_STOPBACK 0x80000 // stop the music on a backwards jump effect +#define BASS_MUSIC_NOSAMPLE 0x100000 // don't load the samples + +// Speaker assignment flags +#define BASS_SPEAKER_FRONT 0x1000000 // front speakers +#define BASS_SPEAKER_REAR 0x2000000 // rear/side speakers +#define BASS_SPEAKER_CENLFE 0x3000000 // center & LFE speakers (5.1) +#define BASS_SPEAKER_REAR2 0x4000000 // rear center speakers (7.1) +#define BASS_SPEAKER_N(n) ((n)<<24) // n'th pair of speakers (max 15) +#define BASS_SPEAKER_LEFT 0x10000000 // modifier: left +#define BASS_SPEAKER_RIGHT 0x20000000 // modifier: right +#define BASS_SPEAKER_FRONTLEFT BASS_SPEAKER_FRONT|BASS_SPEAKER_LEFT +#define BASS_SPEAKER_FRONTRIGHT BASS_SPEAKER_FRONT|BASS_SPEAKER_RIGHT +#define BASS_SPEAKER_REARLEFT BASS_SPEAKER_REAR|BASS_SPEAKER_LEFT +#define BASS_SPEAKER_REARRIGHT BASS_SPEAKER_REAR|BASS_SPEAKER_RIGHT +#define BASS_SPEAKER_CENTER BASS_SPEAKER_CENLFE|BASS_SPEAKER_LEFT +#define BASS_SPEAKER_LFE BASS_SPEAKER_CENLFE|BASS_SPEAKER_RIGHT +#define BASS_SPEAKER_REAR2LEFT BASS_SPEAKER_REAR2|BASS_SPEAKER_LEFT +#define BASS_SPEAKER_REAR2RIGHT BASS_SPEAKER_REAR2|BASS_SPEAKER_RIGHT + +#define BASS_ASYNCFILE 0x40000000 +#define BASS_UNICODE 0x80000000 + +#define BASS_RECORD_PAUSE 0x8000 // start recording paused +#define BASS_RECORD_ECHOCANCEL 0x2000 +#define BASS_RECORD_AGC 0x4000 + +// DX7 voice allocation & management flags +#define BASS_VAM_HARDWARE 1 +#define BASS_VAM_SOFTWARE 2 +#define BASS_VAM_TERM_TIME 4 +#define BASS_VAM_TERM_DIST 8 +#define BASS_VAM_TERM_PRIO 16 + +// Channel info structure +typedef struct { + DWORD freq; // default playback rate + DWORD chans; // channels + DWORD flags; // BASS_SAMPLE/STREAM/MUSIC/SPEAKER flags + DWORD ctype; // type of channel + DWORD origres; // original resolution + HPLUGIN plugin; // plugin + HSAMPLE sample; // sample + const char *filename; // filename +} BASS_CHANNELINFO; + +#define BASS_ORIGRES_FLOAT 0x10000 + +// BASS_CHANNELINFO types +#define BASS_CTYPE_SAMPLE 1 +#define BASS_CTYPE_RECORD 2 +#define BASS_CTYPE_STREAM 0x10000 +#define BASS_CTYPE_STREAM_VORBIS 0x10002 +#define BASS_CTYPE_STREAM_OGG 0x10002 +#define BASS_CTYPE_STREAM_MP1 0x10003 +#define BASS_CTYPE_STREAM_MP2 0x10004 +#define BASS_CTYPE_STREAM_MP3 0x10005 +#define BASS_CTYPE_STREAM_AIFF 0x10006 +#define BASS_CTYPE_STREAM_CA 0x10007 +#define BASS_CTYPE_STREAM_MF 0x10008 +#define BASS_CTYPE_STREAM_AM 0x10009 +#define BASS_CTYPE_STREAM_DUMMY 0x18000 +#define BASS_CTYPE_STREAM_DEVICE 0x18001 +#define BASS_CTYPE_STREAM_WAV 0x40000 // WAVE flag, LOWORD=codec +#define BASS_CTYPE_STREAM_WAV_PCM 0x50001 +#define BASS_CTYPE_STREAM_WAV_FLOAT 0x50003 +#define BASS_CTYPE_MUSIC_MOD 0x20000 +#define BASS_CTYPE_MUSIC_MTM 0x20001 +#define BASS_CTYPE_MUSIC_S3M 0x20002 +#define BASS_CTYPE_MUSIC_XM 0x20003 +#define BASS_CTYPE_MUSIC_IT 0x20004 +#define BASS_CTYPE_MUSIC_MO3 0x00100 // MO3 flag + +typedef struct { + DWORD ctype; // channel type +#if defined(_WIN32_WCE) || (WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP) + const wchar_t *name; // format description + const wchar_t *exts; // file extension filter (*.ext1;*.ext2;etc...) +#else + const char *name; // format description + const char *exts; // file extension filter (*.ext1;*.ext2;etc...) +#endif +} BASS_PLUGINFORM; + +typedef struct { + DWORD version; // version (same form as BASS_GetVersion) + DWORD formatc; // number of formats + const BASS_PLUGINFORM *formats; // the array of formats +} BASS_PLUGININFO; + +// 3D vector (for 3D positions/velocities/orientations) +typedef struct BASS_3DVECTOR { +#ifdef __cplusplus + BASS_3DVECTOR() {}; + BASS_3DVECTOR(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {}; +#endif + float x; // +=right, -=left + float y; // +=up, -=down + float z; // +=front, -=behind +} BASS_3DVECTOR; + +// 3D channel modes +#define BASS_3DMODE_NORMAL 0 // normal 3D processing +#define BASS_3DMODE_RELATIVE 1 // position is relative to the listener +#define BASS_3DMODE_OFF 2 // no 3D processing + +// software 3D mixing algorithms (used with BASS_CONFIG_3DALGORITHM) +#define BASS_3DALG_DEFAULT 0 +#define BASS_3DALG_OFF 1 +#define BASS_3DALG_FULL 2 +#define BASS_3DALG_LIGHT 3 + +// EAX environments, use with BASS_SetEAXParameters +enum +{ + EAX_ENVIRONMENT_GENERIC, + EAX_ENVIRONMENT_PADDEDCELL, + EAX_ENVIRONMENT_ROOM, + EAX_ENVIRONMENT_BATHROOM, + EAX_ENVIRONMENT_LIVINGROOM, + EAX_ENVIRONMENT_STONEROOM, + EAX_ENVIRONMENT_AUDITORIUM, + EAX_ENVIRONMENT_CONCERTHALL, + EAX_ENVIRONMENT_CAVE, + EAX_ENVIRONMENT_ARENA, + EAX_ENVIRONMENT_HANGAR, + EAX_ENVIRONMENT_CARPETEDHALLWAY, + EAX_ENVIRONMENT_HALLWAY, + EAX_ENVIRONMENT_STONECORRIDOR, + EAX_ENVIRONMENT_ALLEY, + EAX_ENVIRONMENT_FOREST, + EAX_ENVIRONMENT_CITY, + EAX_ENVIRONMENT_MOUNTAINS, + EAX_ENVIRONMENT_QUARRY, + EAX_ENVIRONMENT_PLAIN, + EAX_ENVIRONMENT_PARKINGLOT, + EAX_ENVIRONMENT_SEWERPIPE, + EAX_ENVIRONMENT_UNDERWATER, + EAX_ENVIRONMENT_DRUGGED, + EAX_ENVIRONMENT_DIZZY, + EAX_ENVIRONMENT_PSYCHOTIC, + + EAX_ENVIRONMENT_COUNT // total number of environments +}; + +// EAX presets, usage: BASS_SetEAXParameters(EAX_PRESET_xxx) +#define EAX_PRESET_GENERIC EAX_ENVIRONMENT_GENERIC,0.5F,1.493F,0.5F +#define EAX_PRESET_PADDEDCELL EAX_ENVIRONMENT_PADDEDCELL,0.25F,0.1F,0.0F +#define EAX_PRESET_ROOM EAX_ENVIRONMENT_ROOM,0.417F,0.4F,0.666F +#define EAX_PRESET_BATHROOM EAX_ENVIRONMENT_BATHROOM,0.653F,1.499F,0.166F +#define EAX_PRESET_LIVINGROOM EAX_ENVIRONMENT_LIVINGROOM,0.208F,0.478F,0.0F +#define EAX_PRESET_STONEROOM EAX_ENVIRONMENT_STONEROOM,0.5F,2.309F,0.888F +#define EAX_PRESET_AUDITORIUM EAX_ENVIRONMENT_AUDITORIUM,0.403F,4.279F,0.5F +#define EAX_PRESET_CONCERTHALL EAX_ENVIRONMENT_CONCERTHALL,0.5F,3.961F,0.5F +#define EAX_PRESET_CAVE EAX_ENVIRONMENT_CAVE,0.5F,2.886F,1.304F +#define EAX_PRESET_ARENA EAX_ENVIRONMENT_ARENA,0.361F,7.284F,0.332F +#define EAX_PRESET_HANGAR EAX_ENVIRONMENT_HANGAR,0.5F,10.0F,0.3F +#define EAX_PRESET_CARPETEDHALLWAY EAX_ENVIRONMENT_CARPETEDHALLWAY,0.153F,0.259F,2.0F +#define EAX_PRESET_HALLWAY EAX_ENVIRONMENT_HALLWAY,0.361F,1.493F,0.0F +#define EAX_PRESET_STONECORRIDOR EAX_ENVIRONMENT_STONECORRIDOR,0.444F,2.697F,0.638F +#define EAX_PRESET_ALLEY EAX_ENVIRONMENT_ALLEY,0.25F,1.752F,0.776F +#define EAX_PRESET_FOREST EAX_ENVIRONMENT_FOREST,0.111F,3.145F,0.472F +#define EAX_PRESET_CITY EAX_ENVIRONMENT_CITY,0.111F,2.767F,0.224F +#define EAX_PRESET_MOUNTAINS EAX_ENVIRONMENT_MOUNTAINS,0.194F,7.841F,0.472F +#define EAX_PRESET_QUARRY EAX_ENVIRONMENT_QUARRY,1.0F,1.499F,0.5F +#define EAX_PRESET_PLAIN EAX_ENVIRONMENT_PLAIN,0.097F,2.767F,0.224F +#define EAX_PRESET_PARKINGLOT EAX_ENVIRONMENT_PARKINGLOT,0.208F,1.652F,1.5F +#define EAX_PRESET_SEWERPIPE EAX_ENVIRONMENT_SEWERPIPE,0.652F,2.886F,0.25F +#define EAX_PRESET_UNDERWATER EAX_ENVIRONMENT_UNDERWATER,1.0F,1.499F,0.0F +#define EAX_PRESET_DRUGGED EAX_ENVIRONMENT_DRUGGED,0.875F,8.392F,1.388F +#define EAX_PRESET_DIZZY EAX_ENVIRONMENT_DIZZY,0.139F,17.234F,0.666F +#define EAX_PRESET_PSYCHOTIC EAX_ENVIRONMENT_PSYCHOTIC,0.486F,7.563F,0.806F + +typedef DWORD (CALLBACK STREAMPROC)(HSTREAM handle, void *buffer, DWORD length, void *user); +/* User stream callback function. +handle : The stream that needs writing +buffer : Buffer to write the samples in +length : Number of bytes to write +user : The 'user' parameter value given when calling BASS_StreamCreate +RETURN : Number of bytes written. Set the BASS_STREAMPROC_END flag to end the stream. */ + +#define BASS_STREAMPROC_END 0x80000000 // end of user stream flag + +// special STREAMPROCs +#define STREAMPROC_DUMMY (STREAMPROC*)0 // "dummy" stream +#define STREAMPROC_PUSH (STREAMPROC*)-1 // push stream +#define STREAMPROC_DEVICE (STREAMPROC*)-2 // device mix stream +#define STREAMPROC_DEVICE_3D (STREAMPROC*)-3 // device 3D mix stream + +// BASS_StreamCreateFileUser file systems +#define STREAMFILE_NOBUFFER 0 +#define STREAMFILE_BUFFER 1 +#define STREAMFILE_BUFFERPUSH 2 + +// User file stream callback functions +typedef void (CALLBACK FILECLOSEPROC)(void *user); +typedef QWORD (CALLBACK FILELENPROC)(void *user); +typedef DWORD (CALLBACK FILEREADPROC)(void *buffer, DWORD length, void *user); +typedef BOOL (CALLBACK FILESEEKPROC)(QWORD offset, void *user); + +typedef struct { + FILECLOSEPROC *close; + FILELENPROC *length; + FILEREADPROC *read; + FILESEEKPROC *seek; +} BASS_FILEPROCS; + +// BASS_StreamPutFileData options +#define BASS_FILEDATA_END 0 // end & close the file + +// BASS_StreamGetFilePosition modes +#define BASS_FILEPOS_CURRENT 0 +#define BASS_FILEPOS_DECODE BASS_FILEPOS_CURRENT +#define BASS_FILEPOS_DOWNLOAD 1 +#define BASS_FILEPOS_END 2 +#define BASS_FILEPOS_START 3 +#define BASS_FILEPOS_CONNECTED 4 +#define BASS_FILEPOS_BUFFER 5 +#define BASS_FILEPOS_SOCKET 6 +#define BASS_FILEPOS_ASYNCBUF 7 +#define BASS_FILEPOS_SIZE 8 +#define BASS_FILEPOS_BUFFERING 9 + +typedef void (CALLBACK DOWNLOADPROC)(const void *buffer, DWORD length, void *user); +/* Internet stream download callback function. +buffer : Buffer containing the downloaded data... NULL=end of download +length : Number of bytes in the buffer +user : The 'user' parameter value given when calling BASS_StreamCreateURL */ + +// BASS_ChannelSetSync types +#define BASS_SYNC_POS 0 +#define BASS_SYNC_END 2 +#define BASS_SYNC_META 4 +#define BASS_SYNC_SLIDE 5 +#define BASS_SYNC_STALL 6 +#define BASS_SYNC_DOWNLOAD 7 +#define BASS_SYNC_FREE 8 +#define BASS_SYNC_SETPOS 11 +#define BASS_SYNC_MUSICPOS 10 +#define BASS_SYNC_MUSICINST 1 +#define BASS_SYNC_MUSICFX 3 +#define BASS_SYNC_OGG_CHANGE 12 +#define BASS_SYNC_DEV_FAIL 14 +#define BASS_SYNC_DEV_FORMAT 15 +#define BASS_SYNC_THREAD 0x20000000 // flag: call sync in other thread +#define BASS_SYNC_MIXTIME 0x40000000 // flag: sync at mixtime, else at playtime +#define BASS_SYNC_ONETIME 0x80000000 // flag: sync only once, else continuously + +typedef void (CALLBACK SYNCPROC)(HSYNC handle, DWORD channel, DWORD data, void *user); +/* Sync callback function. +handle : The sync that has occured +channel: Channel that the sync occured in +data : Additional data associated with the sync's occurance +user : The 'user' parameter given when calling BASS_ChannelSetSync */ + +typedef void (CALLBACK DSPPROC)(HDSP handle, DWORD channel, void *buffer, DWORD length, void *user); +/* DSP callback function. +handle : The DSP handle +channel: Channel that the DSP is being applied to +buffer : Buffer to apply the DSP to +length : Number of bytes in the buffer +user : The 'user' parameter given when calling BASS_ChannelSetDSP */ + +typedef BOOL (CALLBACK RECORDPROC)(HRECORD handle, const void *buffer, DWORD length, void *user); +/* Recording callback function. +handle : The recording handle +buffer : Buffer containing the recorded sample data +length : Number of bytes +user : The 'user' parameter value given when calling BASS_RecordStart +RETURN : TRUE = continue recording, FALSE = stop */ + +// BASS_ChannelIsActive return values +#define BASS_ACTIVE_STOPPED 0 +#define BASS_ACTIVE_PLAYING 1 +#define BASS_ACTIVE_STALLED 2 +#define BASS_ACTIVE_PAUSED 3 +#define BASS_ACTIVE_PAUSED_DEVICE 4 + +// Channel attributes +#define BASS_ATTRIB_FREQ 1 +#define BASS_ATTRIB_VOL 2 +#define BASS_ATTRIB_PAN 3 +#define BASS_ATTRIB_EAXMIX 4 +#define BASS_ATTRIB_NOBUFFER 5 +#define BASS_ATTRIB_VBR 6 +#define BASS_ATTRIB_CPU 7 +#define BASS_ATTRIB_SRC 8 +#define BASS_ATTRIB_NET_RESUME 9 +#define BASS_ATTRIB_SCANINFO 10 +#define BASS_ATTRIB_NORAMP 11 +#define BASS_ATTRIB_BITRATE 12 +#define BASS_ATTRIB_BUFFER 13 +#define BASS_ATTRIB_GRANULE 14 +#define BASS_ATTRIB_MUSIC_AMPLIFY 0x100 +#define BASS_ATTRIB_MUSIC_PANSEP 0x101 +#define BASS_ATTRIB_MUSIC_PSCALER 0x102 +#define BASS_ATTRIB_MUSIC_BPM 0x103 +#define BASS_ATTRIB_MUSIC_SPEED 0x104 +#define BASS_ATTRIB_MUSIC_VOL_GLOBAL 0x105 +#define BASS_ATTRIB_MUSIC_ACTIVE 0x106 +#define BASS_ATTRIB_MUSIC_VOL_CHAN 0x200 // + channel # +#define BASS_ATTRIB_MUSIC_VOL_INST 0x300 // + instrument # + +// BASS_ChannelSlideAttribute flags +#define BASS_SLIDE_LOG 0x1000000 + +// BASS_ChannelGetData flags +#define BASS_DATA_AVAILABLE 0 // query how much data is buffered +#define BASS_DATA_FIXED 0x20000000 // flag: return 8.24 fixed-point data +#define BASS_DATA_FLOAT 0x40000000 // flag: return floating-point sample data +#define BASS_DATA_FFT256 0x80000000 // 256 sample FFT +#define BASS_DATA_FFT512 0x80000001 // 512 FFT +#define BASS_DATA_FFT1024 0x80000002 // 1024 FFT +#define BASS_DATA_FFT2048 0x80000003 // 2048 FFT +#define BASS_DATA_FFT4096 0x80000004 // 4096 FFT +#define BASS_DATA_FFT8192 0x80000005 // 8192 FFT +#define BASS_DATA_FFT16384 0x80000006 // 16384 FFT +#define BASS_DATA_FFT32768 0x80000007 // 32768 FFT +#define BASS_DATA_FFT_INDIVIDUAL 0x10 // FFT flag: FFT for each channel, else all combined +#define BASS_DATA_FFT_NOWINDOW 0x20 // FFT flag: no Hanning window +#define BASS_DATA_FFT_REMOVEDC 0x40 // FFT flag: pre-remove DC bias +#define BASS_DATA_FFT_COMPLEX 0x80 // FFT flag: return complex data +#define BASS_DATA_FFT_NYQUIST 0x100 // FFT flag: return extra Nyquist value + +// BASS_ChannelGetLevelEx flags +#define BASS_LEVEL_MONO 1 +#define BASS_LEVEL_STEREO 2 +#define BASS_LEVEL_RMS 4 +#define BASS_LEVEL_VOLPAN 8 + +// BASS_ChannelGetTags types : what's returned +#define BASS_TAG_ID3 0 // ID3v1 tags : TAG_ID3 structure +#define BASS_TAG_ID3V2 1 // ID3v2 tags : variable length block +#define BASS_TAG_OGG 2 // OGG comments : series of null-terminated UTF-8 strings +#define BASS_TAG_HTTP 3 // HTTP headers : series of null-terminated ANSI strings +#define BASS_TAG_ICY 4 // ICY headers : series of null-terminated ANSI strings +#define BASS_TAG_META 5 // ICY metadata : ANSI string +#define BASS_TAG_APE 6 // APE tags : series of null-terminated UTF-8 strings +#define BASS_TAG_MP4 7 // MP4/iTunes metadata : series of null-terminated UTF-8 strings +#define BASS_TAG_WMA 8 // WMA tags : series of null-terminated UTF-8 strings +#define BASS_TAG_VENDOR 9 // OGG encoder : UTF-8 string +#define BASS_TAG_LYRICS3 10 // Lyric3v2 tag : ASCII string +#define BASS_TAG_CA_CODEC 11 // CoreAudio codec info : TAG_CA_CODEC structure +#define BASS_TAG_MF 13 // Media Foundation tags : series of null-terminated UTF-8 strings +#define BASS_TAG_WAVEFORMAT 14 // WAVE format : WAVEFORMATEEX structure +#define BASS_TAG_AM_MIME 15 // Android Media MIME type : ASCII string +#define BASS_TAG_AM_NAME 16 // Android Media codec name : ASCII string +#define BASS_TAG_RIFF_INFO 0x100 // RIFF "INFO" tags : series of null-terminated ANSI strings +#define BASS_TAG_RIFF_BEXT 0x101 // RIFF/BWF "bext" tags : TAG_BEXT structure +#define BASS_TAG_RIFF_CART 0x102 // RIFF/BWF "cart" tags : TAG_CART structure +#define BASS_TAG_RIFF_DISP 0x103 // RIFF "DISP" text tag : ANSI string +#define BASS_TAG_RIFF_CUE 0x104 // RIFF "cue " chunk : TAG_CUE structure +#define BASS_TAG_RIFF_SMPL 0x105 // RIFF "smpl" chunk : TAG_SMPL structure +#define BASS_TAG_APE_BINARY 0x1000 // + index #, binary APE tag : TAG_APE_BINARY structure +#define BASS_TAG_MUSIC_NAME 0x10000 // MOD music name : ANSI string +#define BASS_TAG_MUSIC_MESSAGE 0x10001 // MOD message : ANSI string +#define BASS_TAG_MUSIC_ORDERS 0x10002 // MOD order list : BYTE array of pattern numbers +#define BASS_TAG_MUSIC_AUTH 0x10003 // MOD author : UTF-8 string +#define BASS_TAG_MUSIC_INST 0x10100 // + instrument #, MOD instrument name : ANSI string +#define BASS_TAG_MUSIC_SAMPLE 0x10300 // + sample #, MOD sample name : ANSI string + +// ID3v1 tag structure +typedef struct { + char id[3]; + char title[30]; + char artist[30]; + char album[30]; + char year[4]; + char comment[30]; + BYTE genre; +} TAG_ID3; + +// Binary APE tag structure +typedef struct { + const char *key; + const void *data; + DWORD length; +} TAG_APE_BINARY; + +// BWF "bext" tag structure +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4200) +#endif +#pragma pack(push,1) +typedef struct { + char Description[256]; // description + char Originator[32]; // name of the originator + char OriginatorReference[32]; // reference of the originator + char OriginationDate[10]; // date of creation (yyyy-mm-dd) + char OriginationTime[8]; // time of creation (hh-mm-ss) + QWORD TimeReference; // first sample count since midnight (little-endian) + WORD Version; // BWF version (little-endian) + BYTE UMID[64]; // SMPTE UMID + BYTE Reserved[190]; +#if defined(__GNUC__) && __GNUC__<3 + char CodingHistory[0]; // history +#elif 1 // change to 0 if compiler fails the following line + char CodingHistory[]; // history +#else + char CodingHistory[1]; // history +#endif +} TAG_BEXT; +#pragma pack(pop) + +// BWF "cart" tag structures +typedef struct +{ + DWORD dwUsage; // FOURCC timer usage ID + DWORD dwValue; // timer value in samples from head +} TAG_CART_TIMER; + +typedef struct +{ + char Version[4]; // version of the data structure + char Title[64]; // title of cart audio sequence + char Artist[64]; // artist or creator name + char CutID[64]; // cut number identification + char ClientID[64]; // client identification + char Category[64]; // category ID, PSA, NEWS, etc + char Classification[64]; // classification or auxiliary key + char OutCue[64]; // out cue text + char StartDate[10]; // yyyy-mm-dd + char StartTime[8]; // hh:mm:ss + char EndDate[10]; // yyyy-mm-dd + char EndTime[8]; // hh:mm:ss + char ProducerAppID[64]; // name of vendor or application + char ProducerAppVersion[64]; // version of producer application + char UserDef[64]; // user defined text + DWORD dwLevelReference; // sample value for 0 dB reference + TAG_CART_TIMER PostTimer[8]; // 8 time markers after head + char Reserved[276]; + char URL[1024]; // uniform resource locator +#if defined(__GNUC__) && __GNUC__<3 + char TagText[0]; // free form text for scripts or tags +#elif 1 // change to 0 if compiler fails the following line + char TagText[]; // free form text for scripts or tags +#else + char TagText[1]; // free form text for scripts or tags +#endif +} TAG_CART; + +// RIFF "cue " tag structures +typedef struct +{ + DWORD dwName; + DWORD dwPosition; + DWORD fccChunk; + DWORD dwChunkStart; + DWORD dwBlockStart; + DWORD dwSampleOffset; +} TAG_CUE_POINT; + +typedef struct +{ + DWORD dwCuePoints; +#if defined(__GNUC__) && __GNUC__<3 + TAG_CUE_POINT CuePoints[0]; +#elif 1 // change to 0 if compiler fails the following line + TAG_CUE_POINT CuePoints[]; +#else + TAG_CUE_POINT CuePoints[1]; +#endif +} TAG_CUE; + +// RIFF "smpl" tag structures +typedef struct +{ + DWORD dwIdentifier; + DWORD dwType; + DWORD dwStart; + DWORD dwEnd; + DWORD dwFraction; + DWORD dwPlayCount; +} TAG_SMPL_LOOP; + +typedef struct +{ + DWORD dwManufacturer; + DWORD dwProduct; + DWORD dwSamplePeriod; + DWORD dwMIDIUnityNote; + DWORD dwMIDIPitchFraction; + DWORD dwSMPTEFormat; + DWORD dwSMPTEOffset; + DWORD cSampleLoops; + DWORD cbSamplerData; +#if defined(__GNUC__) && __GNUC__<3 + TAG_SMPL_LOOP SampleLoops[0]; +#elif 1 // change to 0 if compiler fails the following line + TAG_SMPL_LOOP SampleLoops[]; +#else + TAG_SMPL_LOOP SampleLoops[1]; +#endif +} TAG_SMPL; +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +// CoreAudio codec info structure +typedef struct { + DWORD ftype; // file format + DWORD atype; // audio format + const char *name; // description +} TAG_CA_CODEC; + +#ifndef _WAVEFORMATEX_ +#define _WAVEFORMATEX_ +#pragma pack(push,1) +typedef struct tWAVEFORMATEX +{ + WORD wFormatTag; + WORD nChannels; + DWORD nSamplesPerSec; + DWORD nAvgBytesPerSec; + WORD nBlockAlign; + WORD wBitsPerSample; + WORD cbSize; +} WAVEFORMATEX, *PWAVEFORMATEX, *LPWAVEFORMATEX; +typedef const WAVEFORMATEX *LPCWAVEFORMATEX; +#pragma pack(pop) +#endif + +// BASS_ChannelGetLength/GetPosition/SetPosition modes +#define BASS_POS_BYTE 0 // byte position +#define BASS_POS_MUSIC_ORDER 1 // order.row position, MAKELONG(order,row) +#define BASS_POS_OGG 3 // OGG bitstream number +#define BASS_POS_RESET 0x2000000 // flag: reset user file buffers +#define BASS_POS_RELATIVE 0x4000000 // flag: seek relative to the current position +#define BASS_POS_INEXACT 0x8000000 // flag: allow seeking to inexact position +#define BASS_POS_DECODE 0x10000000 // flag: get the decoding (not playing) position +#define BASS_POS_DECODETO 0x20000000 // flag: decode to the position instead of seeking +#define BASS_POS_SCAN 0x40000000 // flag: scan to the position + +// BASS_ChannelSetDevice/GetDevice option +#define BASS_NODEVICE 0x20000 + +// BASS_RecordSetInput flags +#define BASS_INPUT_OFF 0x10000 +#define BASS_INPUT_ON 0x20000 + +#define BASS_INPUT_TYPE_MASK 0xff000000 +#define BASS_INPUT_TYPE_UNDEF 0x00000000 +#define BASS_INPUT_TYPE_DIGITAL 0x01000000 +#define BASS_INPUT_TYPE_LINE 0x02000000 +#define BASS_INPUT_TYPE_MIC 0x03000000 +#define BASS_INPUT_TYPE_SYNTH 0x04000000 +#define BASS_INPUT_TYPE_CD 0x05000000 +#define BASS_INPUT_TYPE_PHONE 0x06000000 +#define BASS_INPUT_TYPE_SPEAKER 0x07000000 +#define BASS_INPUT_TYPE_WAVE 0x08000000 +#define BASS_INPUT_TYPE_AUX 0x09000000 +#define BASS_INPUT_TYPE_ANALOG 0x0a000000 + +// BASS_ChannelSetFX effect types +#define BASS_FX_DX8_CHORUS 0 +#define BASS_FX_DX8_COMPRESSOR 1 +#define BASS_FX_DX8_DISTORTION 2 +#define BASS_FX_DX8_ECHO 3 +#define BASS_FX_DX8_FLANGER 4 +#define BASS_FX_DX8_GARGLE 5 +#define BASS_FX_DX8_I3DL2REVERB 6 +#define BASS_FX_DX8_PARAMEQ 7 +#define BASS_FX_DX8_REVERB 8 +#define BASS_FX_VOLUME 9 + +typedef struct { + float fWetDryMix; + float fDepth; + float fFeedback; + float fFrequency; + DWORD lWaveform; // 0=triangle, 1=sine + float fDelay; + DWORD lPhase; // BASS_DX8_PHASE_xxx +} BASS_DX8_CHORUS; + +typedef struct { + float fGain; + float fAttack; + float fRelease; + float fThreshold; + float fRatio; + float fPredelay; +} BASS_DX8_COMPRESSOR; + +typedef struct { + float fGain; + float fEdge; + float fPostEQCenterFrequency; + float fPostEQBandwidth; + float fPreLowpassCutoff; +} BASS_DX8_DISTORTION; + +typedef struct { + float fWetDryMix; + float fFeedback; + float fLeftDelay; + float fRightDelay; + BOOL lPanDelay; +} BASS_DX8_ECHO; + +typedef struct { + float fWetDryMix; + float fDepth; + float fFeedback; + float fFrequency; + DWORD lWaveform; // 0=triangle, 1=sine + float fDelay; + DWORD lPhase; // BASS_DX8_PHASE_xxx +} BASS_DX8_FLANGER; + +typedef struct { + DWORD dwRateHz; // Rate of modulation in hz + DWORD dwWaveShape; // 0=triangle, 1=square +} BASS_DX8_GARGLE; + +typedef struct { + int lRoom; // [-10000, 0] default: -1000 mB + int lRoomHF; // [-10000, 0] default: 0 mB + float flRoomRolloffFactor; // [0.0, 10.0] default: 0.0 + float flDecayTime; // [0.1, 20.0] default: 1.49s + float flDecayHFRatio; // [0.1, 2.0] default: 0.83 + int lReflections; // [-10000, 1000] default: -2602 mB + float flReflectionsDelay; // [0.0, 0.3] default: 0.007 s + int lReverb; // [-10000, 2000] default: 200 mB + float flReverbDelay; // [0.0, 0.1] default: 0.011 s + float flDiffusion; // [0.0, 100.0] default: 100.0 % + float flDensity; // [0.0, 100.0] default: 100.0 % + float flHFReference; // [20.0, 20000.0] default: 5000.0 Hz +} BASS_DX8_I3DL2REVERB; + +typedef struct { + float fCenter; + float fBandwidth; + float fGain; +} BASS_DX8_PARAMEQ; + +typedef struct { + float fInGain; // [-96.0,0.0] default: 0.0 dB + float fReverbMix; // [-96.0,0.0] default: 0.0 db + float fReverbTime; // [0.001,3000.0] default: 1000.0 ms + float fHighFreqRTRatio; // [0.001,0.999] default: 0.001 +} BASS_DX8_REVERB; + +#define BASS_DX8_PHASE_NEG_180 0 +#define BASS_DX8_PHASE_NEG_90 1 +#define BASS_DX8_PHASE_ZERO 2 +#define BASS_DX8_PHASE_90 3 +#define BASS_DX8_PHASE_180 4 + +typedef struct { + float fTarget; + float fCurrent; + float fTime; + DWORD lCurve; +} BASS_FX_VOLUME_PARAM; + +typedef void (CALLBACK IOSNOTIFYPROC)(DWORD status); +/* iOS notification callback function. +status : The notification (BASS_IOSNOTIFY_xxx) */ + +#define BASS_IOSNOTIFY_INTERRUPT 1 // interruption started +#define BASS_IOSNOTIFY_INTERRUPT_END 2 // interruption ended + +BOOL BASSDEF(BASS_SetConfig)(DWORD option, DWORD value); +DWORD BASSDEF(BASS_GetConfig)(DWORD option); +BOOL BASSDEF(BASS_SetConfigPtr)(DWORD option, const void *value); +void *BASSDEF(BASS_GetConfigPtr)(DWORD option); +DWORD BASSDEF(BASS_GetVersion)(); +int BASSDEF(BASS_ErrorGetCode)(); +BOOL BASSDEF(BASS_GetDeviceInfo)(DWORD device, BASS_DEVICEINFO *info); +#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP) +BOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, HWND win, const GUID *dsguid); +#else +BOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, void *win, void *dsguid); +#endif +BOOL BASSDEF(BASS_SetDevice)(DWORD device); +DWORD BASSDEF(BASS_GetDevice)(); +BOOL BASSDEF(BASS_Free)(); +#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP) +void *BASSDEF(BASS_GetDSoundObject)(DWORD object); +#endif +BOOL BASSDEF(BASS_GetInfo)(BASS_INFO *info); +BOOL BASSDEF(BASS_Update)(DWORD length); +float BASSDEF(BASS_GetCPU)(); +BOOL BASSDEF(BASS_Start)(); +BOOL BASSDEF(BASS_Stop)(); +BOOL BASSDEF(BASS_Pause)(); +BOOL BASSDEF(BASS_IsStarted)(); +BOOL BASSDEF(BASS_SetVolume)(float volume); +float BASSDEF(BASS_GetVolume)(); + +HPLUGIN BASSDEF(BASS_PluginLoad)(const char *file, DWORD flags); +BOOL BASSDEF(BASS_PluginFree)(HPLUGIN handle); +const BASS_PLUGININFO *BASSDEF(BASS_PluginGetInfo)(HPLUGIN handle); + +BOOL BASSDEF(BASS_Set3DFactors)(float distf, float rollf, float doppf); +BOOL BASSDEF(BASS_Get3DFactors)(float *distf, float *rollf, float *doppf); +BOOL BASSDEF(BASS_Set3DPosition)(const BASS_3DVECTOR *pos, const BASS_3DVECTOR *vel, const BASS_3DVECTOR *front, const BASS_3DVECTOR *top); +BOOL BASSDEF(BASS_Get3DPosition)(BASS_3DVECTOR *pos, BASS_3DVECTOR *vel, BASS_3DVECTOR *front, BASS_3DVECTOR *top); +void BASSDEF(BASS_Apply3D)(); +#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP) +BOOL BASSDEF(BASS_SetEAXParameters)(int env, float vol, float decay, float damp); +BOOL BASSDEF(BASS_GetEAXParameters)(DWORD *env, float *vol, float *decay, float *damp); +#endif + +HMUSIC BASSDEF(BASS_MusicLoad)(BOOL mem, const void *file, QWORD offset, DWORD length, DWORD flags, DWORD freq); +BOOL BASSDEF(BASS_MusicFree)(HMUSIC handle); + +HSAMPLE BASSDEF(BASS_SampleLoad)(BOOL mem, const void *file, QWORD offset, DWORD length, DWORD max, DWORD flags); +HSAMPLE BASSDEF(BASS_SampleCreate)(DWORD length, DWORD freq, DWORD chans, DWORD max, DWORD flags); +BOOL BASSDEF(BASS_SampleFree)(HSAMPLE handle); +BOOL BASSDEF(BASS_SampleSetData)(HSAMPLE handle, const void *buffer); +BOOL BASSDEF(BASS_SampleGetData)(HSAMPLE handle, void *buffer); +BOOL BASSDEF(BASS_SampleGetInfo)(HSAMPLE handle, BASS_SAMPLE *info); +BOOL BASSDEF(BASS_SampleSetInfo)(HSAMPLE handle, const BASS_SAMPLE *info); +HCHANNEL BASSDEF(BASS_SampleGetChannel)(HSAMPLE handle, BOOL onlynew); +DWORD BASSDEF(BASS_SampleGetChannels)(HSAMPLE handle, HCHANNEL *channels); +BOOL BASSDEF(BASS_SampleStop)(HSAMPLE handle); + +HSTREAM BASSDEF(BASS_StreamCreate)(DWORD freq, DWORD chans, DWORD flags, STREAMPROC *proc, void *user); +HSTREAM BASSDEF(BASS_StreamCreateFile)(BOOL mem, const void *file, QWORD offset, QWORD length, DWORD flags); +HSTREAM BASSDEF(BASS_StreamCreateURL)(const char *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user); +HSTREAM BASSDEF(BASS_StreamCreateFileUser)(DWORD system, DWORD flags, const BASS_FILEPROCS *proc, void *user); +BOOL BASSDEF(BASS_StreamFree)(HSTREAM handle); +QWORD BASSDEF(BASS_StreamGetFilePosition)(HSTREAM handle, DWORD mode); +DWORD BASSDEF(BASS_StreamPutData)(HSTREAM handle, const void *buffer, DWORD length); +DWORD BASSDEF(BASS_StreamPutFileData)(HSTREAM handle, const void *buffer, DWORD length); + +BOOL BASSDEF(BASS_RecordGetDeviceInfo)(DWORD device, BASS_DEVICEINFO *info); +BOOL BASSDEF(BASS_RecordInit)(int device); +BOOL BASSDEF(BASS_RecordSetDevice)(DWORD device); +DWORD BASSDEF(BASS_RecordGetDevice)(); +BOOL BASSDEF(BASS_RecordFree)(); +BOOL BASSDEF(BASS_RecordGetInfo)(BASS_RECORDINFO *info); +const char *BASSDEF(BASS_RecordGetInputName)(int input); +BOOL BASSDEF(BASS_RecordSetInput)(int input, DWORD flags, float volume); +DWORD BASSDEF(BASS_RecordGetInput)(int input, float *volume); +HRECORD BASSDEF(BASS_RecordStart)(DWORD freq, DWORD chans, DWORD flags, RECORDPROC *proc, void *user); + +double BASSDEF(BASS_ChannelBytes2Seconds)(DWORD handle, QWORD pos); +QWORD BASSDEF(BASS_ChannelSeconds2Bytes)(DWORD handle, double pos); +DWORD BASSDEF(BASS_ChannelGetDevice)(DWORD handle); +BOOL BASSDEF(BASS_ChannelSetDevice)(DWORD handle, DWORD device); +DWORD BASSDEF(BASS_ChannelIsActive)(DWORD handle); +BOOL BASSDEF(BASS_ChannelGetInfo)(DWORD handle, BASS_CHANNELINFO *info); +const char *BASSDEF(BASS_ChannelGetTags)(DWORD handle, DWORD tags); +DWORD BASSDEF(BASS_ChannelFlags)(DWORD handle, DWORD flags, DWORD mask); +BOOL BASSDEF(BASS_ChannelUpdate)(DWORD handle, DWORD length); +BOOL BASSDEF(BASS_ChannelLock)(DWORD handle, BOOL lock); +BOOL BASSDEF(BASS_ChannelPlay)(DWORD handle, BOOL restart); +BOOL BASSDEF(BASS_ChannelStop)(DWORD handle); +BOOL BASSDEF(BASS_ChannelPause)(DWORD handle); +BOOL BASSDEF(BASS_ChannelSetAttribute)(DWORD handle, DWORD attrib, float value); +BOOL BASSDEF(BASS_ChannelGetAttribute)(DWORD handle, DWORD attrib, float *value); +BOOL BASSDEF(BASS_ChannelSlideAttribute)(DWORD handle, DWORD attrib, float value, DWORD time); +BOOL BASSDEF(BASS_ChannelIsSliding)(DWORD handle, DWORD attrib); +BOOL BASSDEF(BASS_ChannelSetAttributeEx)(DWORD handle, DWORD attrib, void *value, DWORD size); +DWORD BASSDEF(BASS_ChannelGetAttributeEx)(DWORD handle, DWORD attrib, void *value, DWORD size); +BOOL BASSDEF(BASS_ChannelSet3DAttributes)(DWORD handle, int mode, float min, float max, int iangle, int oangle, float outvol); +BOOL BASSDEF(BASS_ChannelGet3DAttributes)(DWORD handle, DWORD *mode, float *min, float *max, DWORD *iangle, DWORD *oangle, float *outvol); +BOOL BASSDEF(BASS_ChannelSet3DPosition)(DWORD handle, const BASS_3DVECTOR *pos, const BASS_3DVECTOR *orient, const BASS_3DVECTOR *vel); +BOOL BASSDEF(BASS_ChannelGet3DPosition)(DWORD handle, BASS_3DVECTOR *pos, BASS_3DVECTOR *orient, BASS_3DVECTOR *vel); +QWORD BASSDEF(BASS_ChannelGetLength)(DWORD handle, DWORD mode); +BOOL BASSDEF(BASS_ChannelSetPosition)(DWORD handle, QWORD pos, DWORD mode); +QWORD BASSDEF(BASS_ChannelGetPosition)(DWORD handle, DWORD mode); +DWORD BASSDEF(BASS_ChannelGetLevel)(DWORD handle); +BOOL BASSDEF(BASS_ChannelGetLevelEx)(DWORD handle, float *levels, float length, DWORD flags); +DWORD BASSDEF(BASS_ChannelGetData)(DWORD handle, void *buffer, DWORD length); +HSYNC BASSDEF(BASS_ChannelSetSync)(DWORD handle, DWORD type, QWORD param, SYNCPROC *proc, void *user); +BOOL BASSDEF(BASS_ChannelRemoveSync)(DWORD handle, HSYNC sync); +HDSP BASSDEF(BASS_ChannelSetDSP)(DWORD handle, DSPPROC *proc, void *user, int priority); +BOOL BASSDEF(BASS_ChannelRemoveDSP)(DWORD handle, HDSP dsp); +BOOL BASSDEF(BASS_ChannelSetLink)(DWORD handle, DWORD chan); +BOOL BASSDEF(BASS_ChannelRemoveLink)(DWORD handle, DWORD chan); +HFX BASSDEF(BASS_ChannelSetFX)(DWORD handle, DWORD type, int priority); +BOOL BASSDEF(BASS_ChannelRemoveFX)(DWORD handle, HFX fx); + +BOOL BASSDEF(BASS_FXSetParameters)(HFX handle, const void *params); +BOOL BASSDEF(BASS_FXGetParameters)(HFX handle, void *params); +BOOL BASSDEF(BASS_FXReset)(HFX handle); +BOOL BASSDEF(BASS_FXSetPriority)(HFX handle, int priority); + +#ifdef __cplusplus +} + +#if defined(_WIN32) && !defined(NOBASSOVERLOADS) +static inline HPLUGIN BASS_PluginLoad(const WCHAR *file, DWORD flags) +{ + return BASS_PluginLoad((const char*)file, flags|BASS_UNICODE); +} + +static inline HMUSIC BASS_MusicLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD flags, DWORD freq) +{ + return BASS_MusicLoad(mem, (const void*)file, offset, length, flags|BASS_UNICODE, freq); +} + +static inline HSAMPLE BASS_SampleLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD max, DWORD flags) +{ + return BASS_SampleLoad(mem, (const void*)file, offset, length, max, flags|BASS_UNICODE); +} + +static inline HSTREAM BASS_StreamCreateFile(BOOL mem, const WCHAR *file, QWORD offset, QWORD length, DWORD flags) +{ + return BASS_StreamCreateFile(mem, (const void*)file, offset, length, flags|BASS_UNICODE); +} + +static inline HSTREAM BASS_StreamCreateURL(const WCHAR *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user) +{ + return BASS_StreamCreateURL((const char*)url, offset, flags|BASS_UNICODE, proc, user); +} + +static inline BOOL BASS_SetConfigPtr(DWORD option, const WCHAR *value) +{ + return BASS_SetConfigPtr(option|BASS_UNICODE, (const void*)value); +} +#endif +#endif + +#endif diff --git a/bass-sys/bass24/c/bass.lib b/bass-sys/win/bass24/c/bass.lib similarity index 100% rename from bass-sys/bass24/c/bass.lib rename to bass-sys/win/bass24/c/bass.lib diff --git a/bass-sys/bass24/c/bass.sln b/bass-sys/win/bass24/c/bass.sln similarity index 100% rename from bass-sys/bass24/c/bass.sln rename to bass-sys/win/bass24/c/bass.sln diff --git a/bass-sys/bass24/c/basstest/basstest.c b/bass-sys/win/bass24/c/basstest/basstest.c similarity index 100% rename from bass-sys/bass24/c/basstest/basstest.c rename to bass-sys/win/bass24/c/basstest/basstest.c diff --git a/bass-sys/bass24/c/basstest/basstest.dsp b/bass-sys/win/bass24/c/basstest/basstest.dsp similarity index 100% rename from bass-sys/bass24/c/basstest/basstest.dsp rename to bass-sys/win/bass24/c/basstest/basstest.dsp diff --git a/bass-sys/bass24/c/basstest/basstest.rc b/bass-sys/win/bass24/c/basstest/basstest.rc similarity index 100% rename from bass-sys/bass24/c/basstest/basstest.rc rename to bass-sys/win/bass24/c/basstest/basstest.rc diff --git a/bass-sys/bass24/c/basstest/basstest.vcproj b/bass-sys/win/bass24/c/basstest/basstest.vcproj similarity index 100% rename from bass-sys/bass24/c/basstest/basstest.vcproj rename to bass-sys/win/bass24/c/basstest/basstest.vcproj diff --git a/bass-sys/bass24/c/basstest/basstest.vcxproj b/bass-sys/win/bass24/c/basstest/basstest.vcxproj similarity index 100% rename from bass-sys/bass24/c/basstest/basstest.vcxproj rename to bass-sys/win/bass24/c/basstest/basstest.vcxproj diff --git a/bass-sys/bass24/c/basstest/makefile b/bass-sys/win/bass24/c/basstest/makefile similarity index 100% rename from bass-sys/bass24/c/basstest/makefile rename to bass-sys/win/bass24/c/basstest/makefile diff --git a/bass-sys/bass24/c/bin/3dtest.exe b/bass-sys/win/bass24/c/bin/3dtest.exe similarity index 100% rename from bass-sys/bass24/c/bin/3dtest.exe rename to bass-sys/win/bass24/c/bin/3dtest.exe diff --git a/bass-sys/bass24/c/bin/basstest.exe b/bass-sys/win/bass24/c/bin/basstest.exe similarity index 100% rename from bass-sys/bass24/c/bin/basstest.exe rename to bass-sys/win/bass24/c/bin/basstest.exe diff --git a/bass-sys/bass24/c/bin/contest.exe b/bass-sys/win/bass24/c/bin/contest.exe similarity index 100% rename from bass-sys/bass24/c/bin/contest.exe rename to bass-sys/win/bass24/c/bin/contest.exe diff --git a/bass-sys/bass24/c/bin/custloop.exe b/bass-sys/win/bass24/c/bin/custloop.exe similarity index 100% rename from bass-sys/bass24/c/bin/custloop.exe rename to bass-sys/win/bass24/c/bin/custloop.exe diff --git a/bass-sys/bass24/c/bin/devlist.exe b/bass-sys/win/bass24/c/bin/devlist.exe similarity index 100% rename from bass-sys/bass24/c/bin/devlist.exe rename to bass-sys/win/bass24/c/bin/devlist.exe diff --git a/bass-sys/bass24/c/bin/dsptest.exe b/bass-sys/win/bass24/c/bin/dsptest.exe similarity index 100% rename from bass-sys/bass24/c/bin/dsptest.exe rename to bass-sys/win/bass24/c/bin/dsptest.exe diff --git a/bass-sys/bass24/c/bin/fxtest.exe b/bass-sys/win/bass24/c/bin/fxtest.exe similarity index 100% rename from bass-sys/bass24/c/bin/fxtest.exe rename to bass-sys/win/bass24/c/bin/fxtest.exe diff --git a/bass-sys/bass24/c/bin/livefx.exe b/bass-sys/win/bass24/c/bin/livefx.exe similarity index 100% rename from bass-sys/bass24/c/bin/livefx.exe rename to bass-sys/win/bass24/c/bin/livefx.exe diff --git a/bass-sys/bass24/c/bin/livespec.exe b/bass-sys/win/bass24/c/bin/livespec.exe similarity index 100% rename from bass-sys/bass24/c/bin/livespec.exe rename to bass-sys/win/bass24/c/bin/livespec.exe diff --git a/bass-sys/bass24/c/bin/modtest.exe b/bass-sys/win/bass24/c/bin/modtest.exe similarity index 100% rename from bass-sys/bass24/c/bin/modtest.exe rename to bass-sys/win/bass24/c/bin/modtest.exe diff --git a/bass-sys/bass24/c/bin/multi.exe b/bass-sys/win/bass24/c/bin/multi.exe similarity index 100% rename from bass-sys/bass24/c/bin/multi.exe rename to bass-sys/win/bass24/c/bin/multi.exe diff --git a/bass-sys/bass24/c/bin/netradio.exe b/bass-sys/win/bass24/c/bin/netradio.exe similarity index 100% rename from bass-sys/bass24/c/bin/netradio.exe rename to bass-sys/win/bass24/c/bin/netradio.exe diff --git a/bass-sys/bass24/c/bin/plugins.exe b/bass-sys/win/bass24/c/bin/plugins.exe similarity index 100% rename from bass-sys/bass24/c/bin/plugins.exe rename to bass-sys/win/bass24/c/bin/plugins.exe diff --git a/bass-sys/bass24/c/bin/rectest.exe b/bass-sys/win/bass24/c/bin/rectest.exe similarity index 100% rename from bass-sys/bass24/c/bin/rectest.exe rename to bass-sys/win/bass24/c/bin/rectest.exe diff --git a/bass-sys/bass24/c/bin/speakers.exe b/bass-sys/win/bass24/c/bin/speakers.exe similarity index 100% rename from bass-sys/bass24/c/bin/speakers.exe rename to bass-sys/win/bass24/c/bin/speakers.exe diff --git a/bass-sys/bass24/c/bin/spectrum.exe b/bass-sys/win/bass24/c/bin/spectrum.exe similarity index 100% rename from bass-sys/bass24/c/bin/spectrum.exe rename to bass-sys/win/bass24/c/bin/spectrum.exe diff --git a/bass-sys/bass24/c/bin/synth.exe b/bass-sys/win/bass24/c/bin/synth.exe similarity index 100% rename from bass-sys/bass24/c/bin/synth.exe rename to bass-sys/win/bass24/c/bin/synth.exe diff --git a/bass-sys/bass24/c/bin/writewav.exe b/bass-sys/win/bass24/c/bin/writewav.exe similarity index 100% rename from bass-sys/bass24/c/bin/writewav.exe rename to bass-sys/win/bass24/c/bin/writewav.exe diff --git a/bass-sys/win/bass24/c/contest/contest.c b/bass-sys/win/bass24/c/contest/contest.c new file mode 100644 index 0000000..8052807 --- /dev/null +++ b/bass-sys/win/bass24/c/contest/contest.c @@ -0,0 +1,163 @@ +/* + BASS simple console player + Copyright (c) 1999-2019 Un4seen Developments Ltd. +*/ + +#include +#include +#include "bass.h" + +#ifdef _WIN32 // Windows +#include +#else // OSX/Linux +#include +#include +#include +#include + +#define Sleep(x) usleep(x*1000) + +int _kbhit() +{ + int r; + fd_set rfds; + struct timeval tv = { 0 }; + struct termios term, oterm; + tcgetattr(0, &oterm); + memcpy(&term, &oterm, sizeof(term)); + cfmakeraw(&term); + tcsetattr(0, TCSANOW, &term); + FD_ZERO(&rfds); + FD_SET(0, &rfds); + r = select(1, &rfds, NULL, NULL, &tv); + tcsetattr(0, TCSANOW, &oterm); + return r; +} +#endif + +// display error messages +void Error(const char *text) +{ + printf("Error(%d): %s\n", BASS_ErrorGetCode(), text); + BASS_Free(); + exit(0); +} + +void ListDevices() +{ + BASS_DEVICEINFO di; + int a; + for (a = 0; BASS_GetDeviceInfo(a, &di); a++) { + if (di.flags & BASS_DEVICE_ENABLED) // enabled output device + printf("dev %d: %s\n", a, di.name); + } +} + +void main(int argc, char **argv) +{ + DWORD chan, act, time, level; + BOOL ismod; + QWORD pos; + int a, filep, device = -1; + + printf("BASS simple console player\n" + "--------------------------\n"); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + printf("An incorrect version of BASS was loaded"); + return; + } + + for (filep = 1; filep < argc; filep++) { + if (!strcmp(argv[filep], "-l")) { + ListDevices(); + return; + } else if (!strcmp(argv[filep], "-d") && filep + 1 < argc) device = atoi(argv[++filep]); + else break; + } + if (filep == argc) { + printf("\tusage: contest [-l] [-d #] \n" + "\t-l = list devices\n" + "\t-d = device number\n"); + return; + } + + BASS_SetConfig(BASS_CONFIG_NET_PLAYLIST, 1); // enable playlist processing + BASS_SetConfig(BASS_CONFIG_NET_PREBUF_WAIT, 0); // disable BASS_StreamCreateURL pre-buffering + + // initialize output device + if (!BASS_Init(device, 44100, 0, 0, NULL)) + Error("Can't initialize device"); + + // try streaming the file/url + if ((chan = BASS_StreamCreateFile(FALSE, argv[filep], 0, 0, BASS_SAMPLE_LOOP)) + || (chan = BASS_StreamCreateURL(argv[filep], 0, BASS_SAMPLE_LOOP, 0, 0))) { + pos = BASS_ChannelGetLength(chan, BASS_POS_BYTE); + if (BASS_StreamGetFilePosition(chan, BASS_FILEPOS_DOWNLOAD) != -1) { + // streaming from the internet + if (pos != -1) + printf("streaming internet file [%lld bytes]", pos); + else + printf("streaming internet file"); + } else + printf("streaming file [%lld bytes]", pos); + ismod = FALSE; + } else { + // try loading the MOD (with looping, sensitive ramping, and calculate the duration) + if (!(chan = BASS_MusicLoad(FALSE, argv[filep], 0, 0, BASS_SAMPLE_LOOP | BASS_MUSIC_RAMPS | BASS_MUSIC_PRESCAN, 1))) + // not a MOD either + Error("Can't play the file"); + { // count channels + float dummy; + for (a = 0; BASS_ChannelGetAttribute(chan, BASS_ATTRIB_MUSIC_VOL_CHAN + a, &dummy); a++); + } + printf("playing MOD music \"%s\" [%u chans, %u orders]", + BASS_ChannelGetTags(chan, BASS_TAG_MUSIC_NAME), a, (DWORD)BASS_ChannelGetLength(chan, BASS_POS_MUSIC_ORDER)); + pos = BASS_ChannelGetLength(chan, BASS_POS_BYTE); + ismod = TRUE; + } + + // display the time length + if (pos != -1) { + time = (DWORD)BASS_ChannelBytes2Seconds(chan, pos); + printf(" %u:%02u\n", time / 60, time % 60); + } else // no time length available + printf("\n"); + + BASS_ChannelPlay(chan, FALSE); + + while (!_kbhit() && (act = BASS_ChannelIsActive(chan))) { + // display some stuff and wait a bit + level = BASS_ChannelGetLevel(chan); + pos = BASS_ChannelGetPosition(chan, BASS_POS_BYTE); + time = BASS_ChannelBytes2Seconds(chan, pos); + printf("pos %09llu", pos); + if (ismod) { + pos = BASS_ChannelGetPosition(chan, BASS_POS_MUSIC_ORDER); + printf(" (%03u:%03u)", LOWORD(pos), HIWORD(pos)); + } + printf(" - %u:%02u - L ", time / 60, time % 60); + if (act == BASS_ACTIVE_STALLED) { // playback has stalled + printf("- buffering: %3u%% -", 100 - (DWORD)BASS_StreamGetFilePosition(chan, BASS_FILEPOS_BUFFERING)); + } else { + for (a = 27204; a > 200; a = a * 2 / 3) putchar(LOWORD(level) >= a ? '*' : '-'); + putchar(' '); + for (a = 210; a < 32768; a = a * 3 / 2) putchar(HIWORD(level) >= a ? '*' : '-'); + } + printf(" R - cpu %.2f%% \r", BASS_GetCPU()); + fflush(stdout); + Sleep(50); + } + printf(" \r"); + + // wind the frequency down... + BASS_ChannelSlideAttribute(chan, BASS_ATTRIB_FREQ, 1000, 500); + Sleep(400); + // ...and fade-out to avoid a "click" + BASS_ChannelSlideAttribute(chan, BASS_ATTRIB_VOL | BASS_SLIDE_LOG, -1, 100); + // wait for slide to finish (could use BASS_SYNC_SLIDE instead) + while (BASS_ChannelIsSliding(chan, 0)) Sleep(1); + + BASS_Free(); +} diff --git a/bass-sys/bass24/c/contest/contest.dsp b/bass-sys/win/bass24/c/contest/contest.dsp similarity index 100% rename from bass-sys/bass24/c/contest/contest.dsp rename to bass-sys/win/bass24/c/contest/contest.dsp diff --git a/bass-sys/bass24/c/contest/contest.vcproj b/bass-sys/win/bass24/c/contest/contest.vcproj similarity index 100% rename from bass-sys/bass24/c/contest/contest.vcproj rename to bass-sys/win/bass24/c/contest/contest.vcproj diff --git a/bass-sys/bass24/c/contest/contest.vcxproj b/bass-sys/win/bass24/c/contest/contest.vcxproj similarity index 100% rename from bass-sys/bass24/c/contest/contest.vcxproj rename to bass-sys/win/bass24/c/contest/contest.vcxproj diff --git a/bass-sys/bass24/c/contest/makefile b/bass-sys/win/bass24/c/contest/makefile similarity index 100% rename from bass-sys/bass24/c/contest/makefile rename to bass-sys/win/bass24/c/contest/makefile diff --git a/bass-sys/bass24/c/custloop/custloop.c b/bass-sys/win/bass24/c/custloop/custloop.c similarity index 100% rename from bass-sys/bass24/c/custloop/custloop.c rename to bass-sys/win/bass24/c/custloop/custloop.c diff --git a/bass-sys/bass24/c/custloop/custloop.dsp b/bass-sys/win/bass24/c/custloop/custloop.dsp similarity index 100% rename from bass-sys/bass24/c/custloop/custloop.dsp rename to bass-sys/win/bass24/c/custloop/custloop.dsp diff --git a/bass-sys/bass24/c/custloop/custloop.vcproj b/bass-sys/win/bass24/c/custloop/custloop.vcproj similarity index 100% rename from bass-sys/bass24/c/custloop/custloop.vcproj rename to bass-sys/win/bass24/c/custloop/custloop.vcproj diff --git a/bass-sys/bass24/c/custloop/custloop.vcxproj b/bass-sys/win/bass24/c/custloop/custloop.vcxproj similarity index 100% rename from bass-sys/bass24/c/custloop/custloop.vcxproj rename to bass-sys/win/bass24/c/custloop/custloop.vcxproj diff --git a/bass-sys/bass24/c/custloop/makefile b/bass-sys/win/bass24/c/custloop/makefile similarity index 100% rename from bass-sys/bass24/c/custloop/makefile rename to bass-sys/win/bass24/c/custloop/makefile diff --git a/bass-sys/win/bass24/c/devlist/devlist.c b/bass-sys/win/bass24/c/devlist/devlist.c new file mode 100644 index 0000000..c09f8e8 --- /dev/null +++ b/bass-sys/win/bass24/c/devlist/devlist.c @@ -0,0 +1,76 @@ +/* + BASS device list example + Copyright (c) 2014-2019 Un4seen Developments Ltd. +*/ + +#include +#include "bass.h" + +void DisplayDeviceInfo(BASS_DEVICEINFO *di) +{ +#if 0//def _WIN32 + const char *path = di->driver + strlen(di->driver) + 1; + if (path[0]) + printf("%s\n\tdriver: %s\n\tpath: %s\n\ttype: ", di->name, di->driver, path); + else +#endif + printf("%s\n\tdriver: %s\n\ttype: ", di->name, di->driver); + switch (di->flags & BASS_DEVICE_TYPE_MASK) { + case BASS_DEVICE_TYPE_NETWORK: + printf("Remote Network"); + break; + case BASS_DEVICE_TYPE_SPEAKERS: + printf("Speakers"); + break; + case BASS_DEVICE_TYPE_LINE: + printf("Line"); + break; + case BASS_DEVICE_TYPE_HEADPHONES: + printf("Headphones"); + break; + case BASS_DEVICE_TYPE_MICROPHONE: + printf("Microphone"); + break; + case BASS_DEVICE_TYPE_HEADSET: + printf("Headset"); + break; + case BASS_DEVICE_TYPE_HANDSET: + printf("Handset"); + break; + case BASS_DEVICE_TYPE_DIGITAL: + printf("Digital"); + break; + case BASS_DEVICE_TYPE_SPDIF: + printf("SPDIF"); + break; + case BASS_DEVICE_TYPE_HDMI: + printf("HDMI"); + break; + case BASS_DEVICE_TYPE_DISPLAYPORT: + printf("DisplayPort"); + break; + default: + printf("Unknown"); + } + printf("\n\tflags:"); + if (di->flags & BASS_DEVICE_LOOPBACK) printf(" loopback"); + if (di->flags & BASS_DEVICE_ENABLED) printf(" enabled"); + if (di->flags & BASS_DEVICE_DEFAULT) printf(" default"); + printf(" (%x)\n", di->flags); +} + +void main() +{ + BASS_DEVICEINFO di; + int a; + printf("Output Devices\n"); + for (a = 1; BASS_GetDeviceInfo(a, &di); a++) { + printf("%d: ", a); + DisplayDeviceInfo(&di); + } + printf("\nInput Devices\n"); + for (a = 0; BASS_RecordGetDeviceInfo(a, &di); a++) { + printf("%d: ", a); + DisplayDeviceInfo(&di); + } +} diff --git a/bass-sys/bass24/c/devlist/devlist.dsp b/bass-sys/win/bass24/c/devlist/devlist.dsp similarity index 100% rename from bass-sys/bass24/c/devlist/devlist.dsp rename to bass-sys/win/bass24/c/devlist/devlist.dsp diff --git a/bass-sys/bass24/c/devlist/devlist.vcproj b/bass-sys/win/bass24/c/devlist/devlist.vcproj similarity index 100% rename from bass-sys/bass24/c/devlist/devlist.vcproj rename to bass-sys/win/bass24/c/devlist/devlist.vcproj diff --git a/bass-sys/bass24/c/devlist/devlist.vcxproj b/bass-sys/win/bass24/c/devlist/devlist.vcxproj similarity index 100% rename from bass-sys/bass24/c/devlist/devlist.vcxproj rename to bass-sys/win/bass24/c/devlist/devlist.vcxproj diff --git a/bass-sys/bass24/c/devlist/makefile b/bass-sys/win/bass24/c/devlist/makefile similarity index 100% rename from bass-sys/bass24/c/devlist/makefile rename to bass-sys/win/bass24/c/devlist/makefile diff --git a/bass-sys/bass24/c/dsptest/dsptest.c b/bass-sys/win/bass24/c/dsptest/dsptest.c similarity index 100% rename from bass-sys/bass24/c/dsptest/dsptest.c rename to bass-sys/win/bass24/c/dsptest/dsptest.c diff --git a/bass-sys/bass24/c/dsptest/dsptest.dsp b/bass-sys/win/bass24/c/dsptest/dsptest.dsp similarity index 100% rename from bass-sys/bass24/c/dsptest/dsptest.dsp rename to bass-sys/win/bass24/c/dsptest/dsptest.dsp diff --git a/bass-sys/bass24/c/dsptest/dsptest.rc b/bass-sys/win/bass24/c/dsptest/dsptest.rc similarity index 100% rename from bass-sys/bass24/c/dsptest/dsptest.rc rename to bass-sys/win/bass24/c/dsptest/dsptest.rc diff --git a/bass-sys/bass24/c/dsptest/dsptest.vcproj b/bass-sys/win/bass24/c/dsptest/dsptest.vcproj similarity index 100% rename from bass-sys/bass24/c/dsptest/dsptest.vcproj rename to bass-sys/win/bass24/c/dsptest/dsptest.vcproj diff --git a/bass-sys/bass24/c/dsptest/dsptest.vcxproj b/bass-sys/win/bass24/c/dsptest/dsptest.vcxproj similarity index 100% rename from bass-sys/bass24/c/dsptest/dsptest.vcxproj rename to bass-sys/win/bass24/c/dsptest/dsptest.vcxproj diff --git a/bass-sys/bass24/c/dsptest/makefile b/bass-sys/win/bass24/c/dsptest/makefile similarity index 100% rename from bass-sys/bass24/c/dsptest/makefile rename to bass-sys/win/bass24/c/dsptest/makefile diff --git a/bass-sys/bass24/c/fxtest/fxtest.c b/bass-sys/win/bass24/c/fxtest/fxtest.c similarity index 100% rename from bass-sys/bass24/c/fxtest/fxtest.c rename to bass-sys/win/bass24/c/fxtest/fxtest.c diff --git a/bass-sys/bass24/c/fxtest/fxtest.dsp b/bass-sys/win/bass24/c/fxtest/fxtest.dsp similarity index 100% rename from bass-sys/bass24/c/fxtest/fxtest.dsp rename to bass-sys/win/bass24/c/fxtest/fxtest.dsp diff --git a/bass-sys/bass24/c/fxtest/fxtest.rc b/bass-sys/win/bass24/c/fxtest/fxtest.rc similarity index 100% rename from bass-sys/bass24/c/fxtest/fxtest.rc rename to bass-sys/win/bass24/c/fxtest/fxtest.rc diff --git a/bass-sys/bass24/c/fxtest/fxtest.vcproj b/bass-sys/win/bass24/c/fxtest/fxtest.vcproj similarity index 100% rename from bass-sys/bass24/c/fxtest/fxtest.vcproj rename to bass-sys/win/bass24/c/fxtest/fxtest.vcproj diff --git a/bass-sys/bass24/c/fxtest/fxtest.vcxproj b/bass-sys/win/bass24/c/fxtest/fxtest.vcxproj similarity index 100% rename from bass-sys/bass24/c/fxtest/fxtest.vcxproj rename to bass-sys/win/bass24/c/fxtest/fxtest.vcxproj diff --git a/bass-sys/bass24/c/fxtest/makefile b/bass-sys/win/bass24/c/fxtest/makefile similarity index 100% rename from bass-sys/bass24/c/fxtest/makefile rename to bass-sys/win/bass24/c/fxtest/makefile diff --git a/bass-sys/bass24/c/livefx/livefx.c b/bass-sys/win/bass24/c/livefx/livefx.c similarity index 100% rename from bass-sys/bass24/c/livefx/livefx.c rename to bass-sys/win/bass24/c/livefx/livefx.c diff --git a/bass-sys/bass24/c/livefx/livefx.dsp b/bass-sys/win/bass24/c/livefx/livefx.dsp similarity index 100% rename from bass-sys/bass24/c/livefx/livefx.dsp rename to bass-sys/win/bass24/c/livefx/livefx.dsp diff --git a/bass-sys/bass24/c/livefx/livefx.rc b/bass-sys/win/bass24/c/livefx/livefx.rc similarity index 100% rename from bass-sys/bass24/c/livefx/livefx.rc rename to bass-sys/win/bass24/c/livefx/livefx.rc diff --git a/bass-sys/bass24/c/livefx/livefx.vcproj b/bass-sys/win/bass24/c/livefx/livefx.vcproj similarity index 100% rename from bass-sys/bass24/c/livefx/livefx.vcproj rename to bass-sys/win/bass24/c/livefx/livefx.vcproj diff --git a/bass-sys/bass24/c/livefx/livefx.vcxproj b/bass-sys/win/bass24/c/livefx/livefx.vcxproj similarity index 100% rename from bass-sys/bass24/c/livefx/livefx.vcxproj rename to bass-sys/win/bass24/c/livefx/livefx.vcxproj diff --git a/bass-sys/bass24/c/livefx/makefile b/bass-sys/win/bass24/c/livefx/makefile similarity index 100% rename from bass-sys/bass24/c/livefx/makefile rename to bass-sys/win/bass24/c/livefx/makefile diff --git a/bass-sys/bass24/c/livespec/livespec.c b/bass-sys/win/bass24/c/livespec/livespec.c similarity index 100% rename from bass-sys/bass24/c/livespec/livespec.c rename to bass-sys/win/bass24/c/livespec/livespec.c diff --git a/bass-sys/bass24/c/livespec/livespec.dsp b/bass-sys/win/bass24/c/livespec/livespec.dsp similarity index 100% rename from bass-sys/bass24/c/livespec/livespec.dsp rename to bass-sys/win/bass24/c/livespec/livespec.dsp diff --git a/bass-sys/bass24/c/livespec/livespec.vcproj b/bass-sys/win/bass24/c/livespec/livespec.vcproj similarity index 100% rename from bass-sys/bass24/c/livespec/livespec.vcproj rename to bass-sys/win/bass24/c/livespec/livespec.vcproj diff --git a/bass-sys/bass24/c/livespec/livespec.vcxproj b/bass-sys/win/bass24/c/livespec/livespec.vcxproj similarity index 100% rename from bass-sys/bass24/c/livespec/livespec.vcxproj rename to bass-sys/win/bass24/c/livespec/livespec.vcxproj diff --git a/bass-sys/bass24/c/livespec/makefile b/bass-sys/win/bass24/c/livespec/makefile similarity index 100% rename from bass-sys/bass24/c/livespec/makefile rename to bass-sys/win/bass24/c/livespec/makefile diff --git a/bass-sys/bass24/c/makefile b/bass-sys/win/bass24/c/makefile similarity index 100% rename from bass-sys/bass24/c/makefile rename to bass-sys/win/bass24/c/makefile diff --git a/bass-sys/bass24/c/makefile.in b/bass-sys/win/bass24/c/makefile.in similarity index 100% rename from bass-sys/bass24/c/makefile.in rename to bass-sys/win/bass24/c/makefile.in diff --git a/bass-sys/bass24/c/modtest/makefile b/bass-sys/win/bass24/c/modtest/makefile similarity index 100% rename from bass-sys/bass24/c/modtest/makefile rename to bass-sys/win/bass24/c/modtest/makefile diff --git a/bass-sys/bass24/c/modtest/modtest.c b/bass-sys/win/bass24/c/modtest/modtest.c similarity index 100% rename from bass-sys/bass24/c/modtest/modtest.c rename to bass-sys/win/bass24/c/modtest/modtest.c diff --git a/bass-sys/bass24/c/modtest/modtest.dsp b/bass-sys/win/bass24/c/modtest/modtest.dsp similarity index 100% rename from bass-sys/bass24/c/modtest/modtest.dsp rename to bass-sys/win/bass24/c/modtest/modtest.dsp diff --git a/bass-sys/bass24/c/modtest/modtest.rc b/bass-sys/win/bass24/c/modtest/modtest.rc similarity index 100% rename from bass-sys/bass24/c/modtest/modtest.rc rename to bass-sys/win/bass24/c/modtest/modtest.rc diff --git a/bass-sys/bass24/c/modtest/modtest.vcproj b/bass-sys/win/bass24/c/modtest/modtest.vcproj similarity index 100% rename from bass-sys/bass24/c/modtest/modtest.vcproj rename to bass-sys/win/bass24/c/modtest/modtest.vcproj diff --git a/bass-sys/bass24/c/modtest/modtest.vcxproj b/bass-sys/win/bass24/c/modtest/modtest.vcxproj similarity index 100% rename from bass-sys/bass24/c/modtest/modtest.vcxproj rename to bass-sys/win/bass24/c/modtest/modtest.vcxproj diff --git a/bass-sys/bass24/c/multi/makefile b/bass-sys/win/bass24/c/multi/makefile similarity index 100% rename from bass-sys/bass24/c/multi/makefile rename to bass-sys/win/bass24/c/multi/makefile diff --git a/bass-sys/bass24/c/multi/multi.c b/bass-sys/win/bass24/c/multi/multi.c similarity index 100% rename from bass-sys/bass24/c/multi/multi.c rename to bass-sys/win/bass24/c/multi/multi.c diff --git a/bass-sys/bass24/c/multi/multi.dsp b/bass-sys/win/bass24/c/multi/multi.dsp similarity index 100% rename from bass-sys/bass24/c/multi/multi.dsp rename to bass-sys/win/bass24/c/multi/multi.dsp diff --git a/bass-sys/bass24/c/multi/multi.rc b/bass-sys/win/bass24/c/multi/multi.rc similarity index 100% rename from bass-sys/bass24/c/multi/multi.rc rename to bass-sys/win/bass24/c/multi/multi.rc diff --git a/bass-sys/bass24/c/multi/multi.vcproj b/bass-sys/win/bass24/c/multi/multi.vcproj similarity index 100% rename from bass-sys/bass24/c/multi/multi.vcproj rename to bass-sys/win/bass24/c/multi/multi.vcproj diff --git a/bass-sys/bass24/c/multi/multi.vcxproj b/bass-sys/win/bass24/c/multi/multi.vcxproj similarity index 100% rename from bass-sys/bass24/c/multi/multi.vcxproj rename to bass-sys/win/bass24/c/multi/multi.vcxproj diff --git a/bass-sys/bass24/c/netradio/makefile b/bass-sys/win/bass24/c/netradio/makefile similarity index 100% rename from bass-sys/bass24/c/netradio/makefile rename to bass-sys/win/bass24/c/netradio/makefile diff --git a/bass-sys/bass24/c/netradio/netradio.c b/bass-sys/win/bass24/c/netradio/netradio.c similarity index 100% rename from bass-sys/bass24/c/netradio/netradio.c rename to bass-sys/win/bass24/c/netradio/netradio.c diff --git a/bass-sys/bass24/c/netradio/netradio.dsp b/bass-sys/win/bass24/c/netradio/netradio.dsp similarity index 100% rename from bass-sys/bass24/c/netradio/netradio.dsp rename to bass-sys/win/bass24/c/netradio/netradio.dsp diff --git a/bass-sys/bass24/c/netradio/netradio.rc b/bass-sys/win/bass24/c/netradio/netradio.rc similarity index 100% rename from bass-sys/bass24/c/netradio/netradio.rc rename to bass-sys/win/bass24/c/netradio/netradio.rc diff --git a/bass-sys/bass24/c/netradio/netradio.vcproj b/bass-sys/win/bass24/c/netradio/netradio.vcproj similarity index 100% rename from bass-sys/bass24/c/netradio/netradio.vcproj rename to bass-sys/win/bass24/c/netradio/netradio.vcproj diff --git a/bass-sys/bass24/c/netradio/netradio.vcxproj b/bass-sys/win/bass24/c/netradio/netradio.vcxproj similarity index 100% rename from bass-sys/bass24/c/netradio/netradio.vcxproj rename to bass-sys/win/bass24/c/netradio/netradio.vcxproj diff --git a/bass-sys/bass24/c/plugins/makefile b/bass-sys/win/bass24/c/plugins/makefile similarity index 100% rename from bass-sys/bass24/c/plugins/makefile rename to bass-sys/win/bass24/c/plugins/makefile diff --git a/bass-sys/bass24/c/plugins/plugins.c b/bass-sys/win/bass24/c/plugins/plugins.c similarity index 100% rename from bass-sys/bass24/c/plugins/plugins.c rename to bass-sys/win/bass24/c/plugins/plugins.c diff --git a/bass-sys/bass24/c/plugins/plugins.dsp b/bass-sys/win/bass24/c/plugins/plugins.dsp similarity index 100% rename from bass-sys/bass24/c/plugins/plugins.dsp rename to bass-sys/win/bass24/c/plugins/plugins.dsp diff --git a/bass-sys/bass24/c/plugins/plugins.rc b/bass-sys/win/bass24/c/plugins/plugins.rc similarity index 100% rename from bass-sys/bass24/c/plugins/plugins.rc rename to bass-sys/win/bass24/c/plugins/plugins.rc diff --git a/bass-sys/bass24/c/plugins/plugins.vcproj b/bass-sys/win/bass24/c/plugins/plugins.vcproj similarity index 100% rename from bass-sys/bass24/c/plugins/plugins.vcproj rename to bass-sys/win/bass24/c/plugins/plugins.vcproj diff --git a/bass-sys/bass24/c/plugins/plugins.vcxproj b/bass-sys/win/bass24/c/plugins/plugins.vcxproj similarity index 100% rename from bass-sys/bass24/c/plugins/plugins.vcxproj rename to bass-sys/win/bass24/c/plugins/plugins.vcxproj diff --git a/bass-sys/bass24/c/rectest/makefile b/bass-sys/win/bass24/c/rectest/makefile similarity index 100% rename from bass-sys/bass24/c/rectest/makefile rename to bass-sys/win/bass24/c/rectest/makefile diff --git a/bass-sys/bass24/c/rectest/rectest.c b/bass-sys/win/bass24/c/rectest/rectest.c similarity index 100% rename from bass-sys/bass24/c/rectest/rectest.c rename to bass-sys/win/bass24/c/rectest/rectest.c diff --git a/bass-sys/bass24/c/rectest/rectest.dsp b/bass-sys/win/bass24/c/rectest/rectest.dsp similarity index 100% rename from bass-sys/bass24/c/rectest/rectest.dsp rename to bass-sys/win/bass24/c/rectest/rectest.dsp diff --git a/bass-sys/bass24/c/rectest/rectest.rc b/bass-sys/win/bass24/c/rectest/rectest.rc similarity index 100% rename from bass-sys/bass24/c/rectest/rectest.rc rename to bass-sys/win/bass24/c/rectest/rectest.rc diff --git a/bass-sys/bass24/c/rectest/rectest.vcproj b/bass-sys/win/bass24/c/rectest/rectest.vcproj similarity index 100% rename from bass-sys/bass24/c/rectest/rectest.vcproj rename to bass-sys/win/bass24/c/rectest/rectest.vcproj diff --git a/bass-sys/bass24/c/rectest/rectest.vcxproj b/bass-sys/win/bass24/c/rectest/rectest.vcxproj similarity index 100% rename from bass-sys/bass24/c/rectest/rectest.vcxproj rename to bass-sys/win/bass24/c/rectest/rectest.vcxproj diff --git a/bass-sys/bass24/c/speakers/makefile b/bass-sys/win/bass24/c/speakers/makefile similarity index 100% rename from bass-sys/bass24/c/speakers/makefile rename to bass-sys/win/bass24/c/speakers/makefile diff --git a/bass-sys/bass24/c/speakers/speakers.c b/bass-sys/win/bass24/c/speakers/speakers.c similarity index 100% rename from bass-sys/bass24/c/speakers/speakers.c rename to bass-sys/win/bass24/c/speakers/speakers.c diff --git a/bass-sys/bass24/c/speakers/speakers.dsp b/bass-sys/win/bass24/c/speakers/speakers.dsp similarity index 100% rename from bass-sys/bass24/c/speakers/speakers.dsp rename to bass-sys/win/bass24/c/speakers/speakers.dsp diff --git a/bass-sys/bass24/c/speakers/speakers.rc b/bass-sys/win/bass24/c/speakers/speakers.rc similarity index 100% rename from bass-sys/bass24/c/speakers/speakers.rc rename to bass-sys/win/bass24/c/speakers/speakers.rc diff --git a/bass-sys/bass24/c/speakers/speakers.vcproj b/bass-sys/win/bass24/c/speakers/speakers.vcproj similarity index 100% rename from bass-sys/bass24/c/speakers/speakers.vcproj rename to bass-sys/win/bass24/c/speakers/speakers.vcproj diff --git a/bass-sys/bass24/c/speakers/speakers.vcxproj b/bass-sys/win/bass24/c/speakers/speakers.vcxproj similarity index 100% rename from bass-sys/bass24/c/speakers/speakers.vcxproj rename to bass-sys/win/bass24/c/speakers/speakers.vcxproj diff --git a/bass-sys/bass24/c/spectrum/makefile b/bass-sys/win/bass24/c/spectrum/makefile similarity index 100% rename from bass-sys/bass24/c/spectrum/makefile rename to bass-sys/win/bass24/c/spectrum/makefile diff --git a/bass-sys/bass24/c/spectrum/spectrum.c b/bass-sys/win/bass24/c/spectrum/spectrum.c similarity index 100% rename from bass-sys/bass24/c/spectrum/spectrum.c rename to bass-sys/win/bass24/c/spectrum/spectrum.c diff --git a/bass-sys/bass24/c/spectrum/spectrum.dsp b/bass-sys/win/bass24/c/spectrum/spectrum.dsp similarity index 100% rename from bass-sys/bass24/c/spectrum/spectrum.dsp rename to bass-sys/win/bass24/c/spectrum/spectrum.dsp diff --git a/bass-sys/bass24/c/spectrum/spectrum.vcproj b/bass-sys/win/bass24/c/spectrum/spectrum.vcproj similarity index 100% rename from bass-sys/bass24/c/spectrum/spectrum.vcproj rename to bass-sys/win/bass24/c/spectrum/spectrum.vcproj diff --git a/bass-sys/bass24/c/spectrum/spectrum.vcxproj b/bass-sys/win/bass24/c/spectrum/spectrum.vcxproj similarity index 100% rename from bass-sys/bass24/c/spectrum/spectrum.vcxproj rename to bass-sys/win/bass24/c/spectrum/spectrum.vcxproj diff --git a/bass-sys/bass24/c/synth/makefile b/bass-sys/win/bass24/c/synth/makefile similarity index 100% rename from bass-sys/bass24/c/synth/makefile rename to bass-sys/win/bass24/c/synth/makefile diff --git a/bass-sys/bass24/c/synth/synth.c b/bass-sys/win/bass24/c/synth/synth.c similarity index 100% rename from bass-sys/bass24/c/synth/synth.c rename to bass-sys/win/bass24/c/synth/synth.c diff --git a/bass-sys/bass24/c/synth/synth.dsp b/bass-sys/win/bass24/c/synth/synth.dsp similarity index 100% rename from bass-sys/bass24/c/synth/synth.dsp rename to bass-sys/win/bass24/c/synth/synth.dsp diff --git a/bass-sys/bass24/c/synth/synth.vcproj b/bass-sys/win/bass24/c/synth/synth.vcproj similarity index 100% rename from bass-sys/bass24/c/synth/synth.vcproj rename to bass-sys/win/bass24/c/synth/synth.vcproj diff --git a/bass-sys/bass24/c/synth/synth.vcxproj b/bass-sys/win/bass24/c/synth/synth.vcxproj similarity index 100% rename from bass-sys/bass24/c/synth/synth.vcxproj rename to bass-sys/win/bass24/c/synth/synth.vcxproj diff --git a/bass-sys/bass24/c/writewav/makefile b/bass-sys/win/bass24/c/writewav/makefile similarity index 100% rename from bass-sys/bass24/c/writewav/makefile rename to bass-sys/win/bass24/c/writewav/makefile diff --git a/bass-sys/win/bass24/c/writewav/writewav.c b/bass-sys/win/bass24/c/writewav/writewav.c new file mode 100644 index 0000000..b0e47f3 --- /dev/null +++ b/bass-sys/win/bass24/c/writewav/writewav.c @@ -0,0 +1,168 @@ +/* + BASS console WAV writer + Copyright (c) 2002-2008 Un4seen Developments Ltd. +*/ + +#include +#include +#include "bass.h" + +#ifdef _WIN32 // Windows +#include +#else // OSX +#include +#include +#include +#include + +int _kbhit() +{ + int r; + fd_set rfds; + struct timeval tv; + struct termios term, oterm; + tcgetattr(0, &oterm); + memcpy(&term, &oterm, sizeof(term)); + cfmakeraw(&term); + tcsetattr(0, TCSANOW, &term); + FD_ZERO(&rfds); + FD_SET(0, &rfds); + tv.tv_sec = tv.tv_usec = 0; + r = select(1, &rfds, NULL, NULL, &tv); + tcsetattr(0, TCSANOW, &oterm); + return r; +} +#endif + +#ifdef _BIG_ENDIAN +inline DWORD le_32(DWORD v) +{ + return (v >> 24) | ((v >> 8) & 0xff00) | ((v & 0xff00) << 8) | (v << 24); +} +inline WORD le_16(WORD v) +{ + return (v >> 8) | (v << 8); +} +#else +#define le_32(v) (v) +#define le_16(v) (v) +#endif + +// display error messages +void Error(const char *text) +{ + printf("Error(%d): %s\n", BASS_ErrorGetCode(), text); + BASS_Free(); + exit(0); +} + +void main(int argc, char **argv) +{ + BASS_CHANNELINFO info; + DWORD chan, p; + QWORD pos; + FILE *fp; + short buf[10000]; + WAVEFORMATEX wf; + + printf("BASS WAV writer example : MOD/MPx/OGG -> BASS.WAV\n" + "-------------------------------------------------\n"); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + printf("An incorrect version of BASS was loaded"); + return; + } + + if (argc != 2) { + printf("\tusage: writewav \n"); + return; + } + + // initalize "no sound" device + if (!BASS_Init(0, 44100, 0, 0, NULL)) + Error("Can't initialize device"); + + // try streaming the file/url + if ((chan = BASS_StreamCreateFile(FALSE, argv[1], 0, 0, BASS_STREAM_DECODE)) + || (chan = BASS_StreamCreateURL(argv[1], 0, BASS_STREAM_DECODE | BASS_STREAM_BLOCK, 0, 0))) { + pos = BASS_ChannelGetLength(chan, BASS_POS_BYTE); + if (pos == -1) // length not available + printf("streaming file"); + else +#ifdef _WIN32 + printf("streaming file [%I64u bytes]", pos); +#else + printf("streaming file [%llu bytes]", pos); +#endif + } else { + // try loading the MOD (with sensitive ramping, and calculate the duration) + if (!(chan = BASS_MusicLoad(FALSE, argv[1], 0, 0, BASS_MUSIC_DECODE | BASS_MUSIC_RAMP | BASS_MUSIC_PRESCAN, 0))) + // not a MOD either + Error("Can't play the file"); + { // count channels + float dummy; + for (p = 0; BASS_ChannelGetAttribute(chan, BASS_ATTRIB_MUSIC_VOL_CHAN + p, &dummy); p++); + } + printf("MOD music \"%s\" [%u chans, %u orders]", + BASS_ChannelGetTags(chan, BASS_TAG_MUSIC_NAME), p, (DWORD)BASS_ChannelGetLength(chan, BASS_POS_MUSIC_ORDER)); + pos = BASS_ChannelGetLength(chan, BASS_POS_BYTE); + } + + // display the time length + if (pos && pos != -1) { + p = (DWORD)BASS_ChannelBytes2Seconds(chan, pos); + printf(" %u:%02u\n", p / 60, p % 60); + } else // no time length available + printf("\n"); + + if (!(fp = fopen("bass.wav", "wb"))) Error("Can't create file"); + printf("writing to BASS.WAV file... press a key to stop\n"); + // write WAV header + BASS_ChannelGetInfo(chan, &info); + wf.wFormatTag = 1; + wf.nChannels = info.chans; + wf.wBitsPerSample = (info.flags & BASS_SAMPLE_8BITS ? 8 : 16); + wf.nBlockAlign = wf.nChannels * wf.wBitsPerSample / 8; + wf.nSamplesPerSec = info.freq; + wf.nAvgBytesPerSec = wf.nSamplesPerSec * wf.nBlockAlign; +#ifdef _BIG_ENDIAN // swap byte order + wf.wFormatTag = le_16(wf.wFormatTag); + wf.nChannels = le_16(wf.nChannels); + wf.wBitsPerSample = le_16(wf.wBitsPerSample); + wf.nBlockAlign = le_16(wf.nBlockAlign); + wf.nSamplesPerSec = le_32(wf.nSamplesPerSec); + wf.nAvgBytesPerSec = le_32(wf.nAvgBytesPerSec); +#endif + fwrite("RIFF\0\0\0\0WAVEfmt \20\0\0\0", 20, 1, fp); + fwrite(&wf, 16, 1, fp); + fwrite("data\0\0\0\0", 8, 1, fp); + + while (!_kbhit() && BASS_ChannelIsActive(chan)) { + int c = BASS_ChannelGetData(chan, buf, 20000); +#ifdef _BIG_ENDIAN + if (!(info.flags & BASS_SAMPLE_8BITS)) // swap 16-bit byte order + for (p = 0; p < c / 2; p++) buf[p] = le_16(buf[p]); +#endif + fwrite(buf, 1, c, fp); + pos = BASS_ChannelGetPosition(chan, BASS_POS_BYTE); +#ifdef _WIN32 + printf("pos %09I64u\r", pos); +#else + printf("pos %09llu\r", pos); +#endif + fflush(stdout); + } + // complete WAV header + fflush(fp); + p = ftell(fp); + fseek(fp, 4, SEEK_SET); + putw(le_32(p - 8), fp); + fflush(fp); + fseek(fp, 40, SEEK_SET); + putw(le_32(p - 44), fp); + fflush(fp); + fclose(fp); + + BASS_Free(); +} diff --git a/bass-sys/bass24/c/writewav/writewav.dsp b/bass-sys/win/bass24/c/writewav/writewav.dsp similarity index 100% rename from bass-sys/bass24/c/writewav/writewav.dsp rename to bass-sys/win/bass24/c/writewav/writewav.dsp diff --git a/bass-sys/bass24/c/writewav/writewav.vcproj b/bass-sys/win/bass24/c/writewav/writewav.vcproj similarity index 100% rename from bass-sys/bass24/c/writewav/writewav.vcproj rename to bass-sys/win/bass24/c/writewav/writewav.vcproj diff --git a/bass-sys/bass24/c/writewav/writewav.vcxproj b/bass-sys/win/bass24/c/writewav/writewav.vcxproj similarity index 100% rename from bass-sys/bass24/c/writewav/writewav.vcxproj rename to bass-sys/win/bass24/c/writewav/writewav.vcxproj diff --git a/bass-sys/bass24/c/x64/bass.lib b/bass-sys/win/bass24/c/x64/bass.lib similarity index 100% rename from bass-sys/bass24/c/x64/bass.lib rename to bass-sys/win/bass24/c/x64/bass.lib diff --git a/bass-sys/bass24/delphi/3dTest/D3Test.dpr b/bass-sys/win/bass24/delphi/3dTest/D3Test.dpr similarity index 100% rename from bass-sys/bass24/delphi/3dTest/D3Test.dpr rename to bass-sys/win/bass24/delphi/3dTest/D3Test.dpr diff --git a/bass-sys/bass24/delphi/3dTest/DTMain.dfm b/bass-sys/win/bass24/delphi/3dTest/DTMain.dfm similarity index 100% rename from bass-sys/bass24/delphi/3dTest/DTMain.dfm rename to bass-sys/win/bass24/delphi/3dTest/DTMain.dfm diff --git a/bass-sys/bass24/delphi/3dTest/DTMain.pas b/bass-sys/win/bass24/delphi/3dTest/DTMain.pas similarity index 100% rename from bass-sys/bass24/delphi/3dTest/DTMain.pas rename to bass-sys/win/bass24/delphi/3dTest/DTMain.pas diff --git a/bass-sys/bass24/delphi/BassTest/BTMain.dfm b/bass-sys/win/bass24/delphi/BassTest/BTMain.dfm similarity index 100% rename from bass-sys/bass24/delphi/BassTest/BTMain.dfm rename to bass-sys/win/bass24/delphi/BassTest/BTMain.dfm diff --git a/bass-sys/bass24/delphi/BassTest/BTMain.pas b/bass-sys/win/bass24/delphi/BassTest/BTMain.pas similarity index 100% rename from bass-sys/bass24/delphi/BassTest/BTMain.pas rename to bass-sys/win/bass24/delphi/BassTest/BTMain.pas diff --git a/bass-sys/bass24/delphi/BassTest/BassTest.dpr b/bass-sys/win/bass24/delphi/BassTest/BassTest.dpr similarity index 100% rename from bass-sys/bass24/delphi/BassTest/BassTest.dpr rename to bass-sys/win/bass24/delphi/BassTest/BassTest.dpr diff --git a/bass-sys/bass24/delphi/ConTest/ConTest.dpr b/bass-sys/win/bass24/delphi/ConTest/ConTest.dpr similarity index 100% rename from bass-sys/bass24/delphi/ConTest/ConTest.dpr rename to bass-sys/win/bass24/delphi/ConTest/ConTest.dpr diff --git a/bass-sys/bass24/delphi/DspTest/DTMain.dfm b/bass-sys/win/bass24/delphi/DspTest/DTMain.dfm similarity index 100% rename from bass-sys/bass24/delphi/DspTest/DTMain.dfm rename to bass-sys/win/bass24/delphi/DspTest/DTMain.dfm diff --git a/bass-sys/bass24/delphi/DspTest/DTMain.pas b/bass-sys/win/bass24/delphi/DspTest/DTMain.pas similarity index 100% rename from bass-sys/bass24/delphi/DspTest/DTMain.pas rename to bass-sys/win/bass24/delphi/DspTest/DTMain.pas diff --git a/bass-sys/bass24/delphi/DspTest/DspTest.dpr b/bass-sys/win/bass24/delphi/DspTest/DspTest.dpr similarity index 100% rename from bass-sys/bass24/delphi/DspTest/DspTest.dpr rename to bass-sys/win/bass24/delphi/DspTest/DspTest.dpr diff --git a/bass-sys/bass24/delphi/RecordTest/RecordTest.dpr b/bass-sys/win/bass24/delphi/RecordTest/RecordTest.dpr similarity index 100% rename from bass-sys/bass24/delphi/RecordTest/RecordTest.dpr rename to bass-sys/win/bass24/delphi/RecordTest/RecordTest.dpr diff --git a/bass-sys/bass24/delphi/RecordTest/Unit1.dfm b/bass-sys/win/bass24/delphi/RecordTest/Unit1.dfm similarity index 100% rename from bass-sys/bass24/delphi/RecordTest/Unit1.dfm rename to bass-sys/win/bass24/delphi/RecordTest/Unit1.dfm diff --git a/bass-sys/bass24/delphi/RecordTest/Unit1.pas b/bass-sys/win/bass24/delphi/RecordTest/Unit1.pas similarity index 100% rename from bass-sys/bass24/delphi/RecordTest/Unit1.pas rename to bass-sys/win/bass24/delphi/RecordTest/Unit1.pas diff --git a/bass-sys/bass24/delphi/SampleVis/CommonTypes.pas b/bass-sys/win/bass24/delphi/SampleVis/CommonTypes.pas similarity index 100% rename from bass-sys/bass24/delphi/SampleVis/CommonTypes.pas rename to bass-sys/win/bass24/delphi/SampleVis/CommonTypes.pas diff --git a/bass-sys/bass24/delphi/SampleVis/circle_vis.pas b/bass-sys/win/bass24/delphi/SampleVis/circle_vis.pas similarity index 100% rename from bass-sys/bass24/delphi/SampleVis/circle_vis.pas rename to bass-sys/win/bass24/delphi/SampleVis/circle_vis.pas diff --git a/bass-sys/bass24/delphi/SampleVis/main.dfm b/bass-sys/win/bass24/delphi/SampleVis/main.dfm similarity index 100% rename from bass-sys/bass24/delphi/SampleVis/main.dfm rename to bass-sys/win/bass24/delphi/SampleVis/main.dfm diff --git a/bass-sys/bass24/delphi/SampleVis/main.pas b/bass-sys/win/bass24/delphi/SampleVis/main.pas similarity index 100% rename from bass-sys/bass24/delphi/SampleVis/main.pas rename to bass-sys/win/bass24/delphi/SampleVis/main.pas diff --git a/bass-sys/bass24/delphi/SampleVis/osc_vis.pas b/bass-sys/win/bass24/delphi/SampleVis/osc_vis.pas similarity index 100% rename from bass-sys/bass24/delphi/SampleVis/osc_vis.pas rename to bass-sys/win/bass24/delphi/SampleVis/osc_vis.pas diff --git a/bass-sys/bass24/delphi/SampleVis/samplevis.dpr b/bass-sys/win/bass24/delphi/SampleVis/samplevis.dpr similarity index 100% rename from bass-sys/bass24/delphi/SampleVis/samplevis.dpr rename to bass-sys/win/bass24/delphi/SampleVis/samplevis.dpr diff --git a/bass-sys/bass24/delphi/SampleVis/spectrum_vis.pas b/bass-sys/win/bass24/delphi/SampleVis/spectrum_vis.pas similarity index 100% rename from bass-sys/bass24/delphi/SampleVis/spectrum_vis.pas rename to bass-sys/win/bass24/delphi/SampleVis/spectrum_vis.pas diff --git a/bass-sys/bass24/delphi/Speakers/Speakers.dpr b/bass-sys/win/bass24/delphi/Speakers/Speakers.dpr similarity index 100% rename from bass-sys/bass24/delphi/Speakers/Speakers.dpr rename to bass-sys/win/bass24/delphi/Speakers/Speakers.dpr diff --git a/bass-sys/bass24/delphi/Speakers/Unit1.dfm b/bass-sys/win/bass24/delphi/Speakers/Unit1.dfm similarity index 100% rename from bass-sys/bass24/delphi/Speakers/Unit1.dfm rename to bass-sys/win/bass24/delphi/Speakers/Unit1.dfm diff --git a/bass-sys/bass24/delphi/Speakers/Unit1.pas b/bass-sys/win/bass24/delphi/Speakers/Unit1.pas similarity index 100% rename from bass-sys/bass24/delphi/Speakers/Unit1.pas rename to bass-sys/win/bass24/delphi/Speakers/Unit1.pas diff --git a/bass-sys/bass24/delphi/StreamTest/STMain.dfm b/bass-sys/win/bass24/delphi/StreamTest/STMain.dfm similarity index 100% rename from bass-sys/bass24/delphi/StreamTest/STMain.dfm rename to bass-sys/win/bass24/delphi/StreamTest/STMain.dfm diff --git a/bass-sys/bass24/delphi/StreamTest/STMain.pas b/bass-sys/win/bass24/delphi/StreamTest/STMain.pas similarity index 100% rename from bass-sys/bass24/delphi/StreamTest/STMain.pas rename to bass-sys/win/bass24/delphi/StreamTest/STMain.pas diff --git a/bass-sys/bass24/delphi/StreamTest/StreamTest.dpr b/bass-sys/win/bass24/delphi/StreamTest/StreamTest.dpr similarity index 100% rename from bass-sys/bass24/delphi/StreamTest/StreamTest.dpr rename to bass-sys/win/bass24/delphi/StreamTest/StreamTest.dpr diff --git a/bass-sys/bass24/delphi/bass.bpg b/bass-sys/win/bass24/delphi/bass.bpg similarity index 100% rename from bass-sys/bass24/delphi/bass.bpg rename to bass-sys/win/bass24/delphi/bass.bpg diff --git a/bass-sys/bass24/delphi/bass.pas b/bass-sys/win/bass24/delphi/bass.pas similarity index 100% rename from bass-sys/bass24/delphi/bass.pas rename to bass-sys/win/bass24/delphi/bass.pas diff --git a/bass-sys/bass24/delphi/custloop/Unit1.dfm b/bass-sys/win/bass24/delphi/custloop/Unit1.dfm similarity index 100% rename from bass-sys/bass24/delphi/custloop/Unit1.dfm rename to bass-sys/win/bass24/delphi/custloop/Unit1.dfm diff --git a/bass-sys/bass24/delphi/custloop/Unit1.pas b/bass-sys/win/bass24/delphi/custloop/Unit1.pas similarity index 100% rename from bass-sys/bass24/delphi/custloop/Unit1.pas rename to bass-sys/win/bass24/delphi/custloop/Unit1.pas diff --git a/bass-sys/bass24/delphi/custloop/custloop.dpr b/bass-sys/win/bass24/delphi/custloop/custloop.dpr similarity index 100% rename from bass-sys/bass24/delphi/custloop/custloop.dpr rename to bass-sys/win/bass24/delphi/custloop/custloop.dpr diff --git a/bass-sys/bass24/delphi/devlist/devlist.dpr b/bass-sys/win/bass24/delphi/devlist/devlist.dpr similarity index 100% rename from bass-sys/bass24/delphi/devlist/devlist.dpr rename to bass-sys/win/bass24/delphi/devlist/devlist.dpr diff --git a/bass-sys/bass24/delphi/fxtest/FXtest.dpr b/bass-sys/win/bass24/delphi/fxtest/FXtest.dpr similarity index 100% rename from bass-sys/bass24/delphi/fxtest/FXtest.dpr rename to bass-sys/win/bass24/delphi/fxtest/FXtest.dpr diff --git a/bass-sys/bass24/delphi/fxtest/test.dfm b/bass-sys/win/bass24/delphi/fxtest/test.dfm similarity index 100% rename from bass-sys/bass24/delphi/fxtest/test.dfm rename to bass-sys/win/bass24/delphi/fxtest/test.dfm diff --git a/bass-sys/bass24/delphi/fxtest/test.pas b/bass-sys/win/bass24/delphi/fxtest/test.pas similarity index 100% rename from bass-sys/bass24/delphi/fxtest/test.pas rename to bass-sys/win/bass24/delphi/fxtest/test.pas diff --git a/bass-sys/bass24/delphi/livefx/Unit1.dfm b/bass-sys/win/bass24/delphi/livefx/Unit1.dfm similarity index 100% rename from bass-sys/bass24/delphi/livefx/Unit1.dfm rename to bass-sys/win/bass24/delphi/livefx/Unit1.dfm diff --git a/bass-sys/bass24/delphi/livefx/Unit1.pas b/bass-sys/win/bass24/delphi/livefx/Unit1.pas similarity index 100% rename from bass-sys/bass24/delphi/livefx/Unit1.pas rename to bass-sys/win/bass24/delphi/livefx/Unit1.pas diff --git a/bass-sys/bass24/delphi/livefx/livefx.dpr b/bass-sys/win/bass24/delphi/livefx/livefx.dpr similarity index 100% rename from bass-sys/bass24/delphi/livefx/livefx.dpr rename to bass-sys/win/bass24/delphi/livefx/livefx.dpr diff --git a/bass-sys/bass24/delphi/livespec/livespec.dpr b/bass-sys/win/bass24/delphi/livespec/livespec.dpr similarity index 100% rename from bass-sys/bass24/delphi/livespec/livespec.dpr rename to bass-sys/win/bass24/delphi/livespec/livespec.dpr diff --git a/bass-sys/bass24/delphi/modtest/modtest.dpr b/bass-sys/win/bass24/delphi/modtest/modtest.dpr similarity index 100% rename from bass-sys/bass24/delphi/modtest/modtest.dpr rename to bass-sys/win/bass24/delphi/modtest/modtest.dpr diff --git a/bass-sys/bass24/delphi/modtest/modtest.rc b/bass-sys/win/bass24/delphi/modtest/modtest.rc similarity index 100% rename from bass-sys/bass24/delphi/modtest/modtest.rc rename to bass-sys/win/bass24/delphi/modtest/modtest.rc diff --git a/bass-sys/bass24/delphi/multi/Multi.dpr b/bass-sys/win/bass24/delphi/multi/Multi.dpr similarity index 100% rename from bass-sys/bass24/delphi/multi/Multi.dpr rename to bass-sys/win/bass24/delphi/multi/Multi.dpr diff --git a/bass-sys/bass24/delphi/multi/multi.rc b/bass-sys/win/bass24/delphi/multi/multi.rc similarity index 100% rename from bass-sys/bass24/delphi/multi/multi.rc rename to bass-sys/win/bass24/delphi/multi/multi.rc diff --git a/bass-sys/bass24/delphi/netradio/Unit1.dfm b/bass-sys/win/bass24/delphi/netradio/Unit1.dfm similarity index 100% rename from bass-sys/bass24/delphi/netradio/Unit1.dfm rename to bass-sys/win/bass24/delphi/netradio/Unit1.dfm diff --git a/bass-sys/bass24/delphi/netradio/Unit1.pas b/bass-sys/win/bass24/delphi/netradio/Unit1.pas similarity index 100% rename from bass-sys/bass24/delphi/netradio/Unit1.pas rename to bass-sys/win/bass24/delphi/netradio/Unit1.pas diff --git a/bass-sys/bass24/delphi/netradio/netradio.dpr b/bass-sys/win/bass24/delphi/netradio/netradio.dpr similarity index 100% rename from bass-sys/bass24/delphi/netradio/netradio.dpr rename to bass-sys/win/bass24/delphi/netradio/netradio.dpr diff --git a/bass-sys/bass24/delphi/plugins/Unit1.dfm b/bass-sys/win/bass24/delphi/plugins/Unit1.dfm similarity index 100% rename from bass-sys/bass24/delphi/plugins/Unit1.dfm rename to bass-sys/win/bass24/delphi/plugins/Unit1.dfm diff --git a/bass-sys/bass24/delphi/plugins/Unit1.pas b/bass-sys/win/bass24/delphi/plugins/Unit1.pas similarity index 100% rename from bass-sys/bass24/delphi/plugins/Unit1.pas rename to bass-sys/win/bass24/delphi/plugins/Unit1.pas diff --git a/bass-sys/bass24/delphi/plugins/plugins.dpr b/bass-sys/win/bass24/delphi/plugins/plugins.dpr similarity index 100% rename from bass-sys/bass24/delphi/plugins/plugins.dpr rename to bass-sys/win/bass24/delphi/plugins/plugins.dpr diff --git a/bass-sys/bass24/delphi/spectrum/COMMON.INC b/bass-sys/win/bass24/delphi/spectrum/COMMON.INC similarity index 100% rename from bass-sys/bass24/delphi/spectrum/COMMON.INC rename to bass-sys/win/bass24/delphi/spectrum/COMMON.INC diff --git a/bass-sys/bass24/delphi/spectrum/Unit1.pas b/bass-sys/win/bass24/delphi/spectrum/Unit1.pas similarity index 100% rename from bass-sys/bass24/delphi/spectrum/Unit1.pas rename to bass-sys/win/bass24/delphi/spectrum/Unit1.pas diff --git a/bass-sys/bass24/delphi/spectrum/spectrum.dpr b/bass-sys/win/bass24/delphi/spectrum/spectrum.dpr similarity index 100% rename from bass-sys/bass24/delphi/spectrum/spectrum.dpr rename to bass-sys/win/bass24/delphi/spectrum/spectrum.dpr diff --git a/bass-sys/bass24/delphi/synth/synth.dpr b/bass-sys/win/bass24/delphi/synth/synth.dpr similarity index 100% rename from bass-sys/bass24/delphi/synth/synth.dpr rename to bass-sys/win/bass24/delphi/synth/synth.dpr diff --git a/bass-sys/bass24/delphi/writewav/UnitMain.dfm b/bass-sys/win/bass24/delphi/writewav/UnitMain.dfm similarity index 100% rename from bass-sys/bass24/delphi/writewav/UnitMain.dfm rename to bass-sys/win/bass24/delphi/writewav/UnitMain.dfm diff --git a/bass-sys/bass24/delphi/writewav/UnitMain.pas b/bass-sys/win/bass24/delphi/writewav/UnitMain.pas similarity index 100% rename from bass-sys/bass24/delphi/writewav/UnitMain.pas rename to bass-sys/win/bass24/delphi/writewav/UnitMain.pas diff --git a/bass-sys/bass24/delphi/writewav/writewav.dpr b/bass-sys/win/bass24/delphi/writewav/writewav.dpr similarity index 100% rename from bass-sys/bass24/delphi/writewav/writewav.dpr rename to bass-sys/win/bass24/delphi/writewav/writewav.dpr diff --git a/bass-sys/bass24/mp3-free/bass.dll b/bass-sys/win/bass24/mp3-free/bass.dll similarity index 100% rename from bass-sys/bass24/mp3-free/bass.dll rename to bass-sys/win/bass24/mp3-free/bass.dll diff --git a/bass-sys/bass24/vb/3Dtest/frm3Dtest.frm b/bass-sys/win/bass24/vb/3Dtest/frm3Dtest.frm similarity index 100% rename from bass-sys/bass24/vb/3Dtest/frm3Dtest.frm rename to bass-sys/win/bass24/vb/3Dtest/frm3Dtest.frm diff --git a/bass-sys/bass24/vb/3Dtest/prj3Dtest.vbp b/bass-sys/win/bass24/vb/3Dtest/prj3Dtest.vbp similarity index 100% rename from bass-sys/bass24/vb/3Dtest/prj3Dtest.vbp rename to bass-sys/win/bass24/vb/3Dtest/prj3Dtest.vbp diff --git a/bass-sys/bass24/vb/BASStest/frmBassTest.frm b/bass-sys/win/bass24/vb/BASStest/frmBassTest.frm similarity index 100% rename from bass-sys/bass24/vb/BASStest/frmBassTest.frm rename to bass-sys/win/bass24/vb/BASStest/frmBassTest.frm diff --git a/bass-sys/bass24/vb/BASStest/prjBassTest.vbp b/bass-sys/win/bass24/vb/BASStest/prjBassTest.vbp similarity index 100% rename from bass-sys/bass24/vb/BASStest/prjBassTest.vbp rename to bass-sys/win/bass24/vb/BASStest/prjBassTest.vbp diff --git a/bass-sys/bass24/vb/CustLoop/frmCustLoop.frm b/bass-sys/win/bass24/vb/CustLoop/frmCustLoop.frm similarity index 100% rename from bass-sys/bass24/vb/CustLoop/frmCustLoop.frm rename to bass-sys/win/bass24/vb/CustLoop/frmCustLoop.frm diff --git a/bass-sys/bass24/vb/CustLoop/modCustLoop.bas b/bass-sys/win/bass24/vb/CustLoop/modCustLoop.bas similarity index 100% rename from bass-sys/bass24/vb/CustLoop/modCustLoop.bas rename to bass-sys/win/bass24/vb/CustLoop/modCustLoop.bas diff --git a/bass-sys/bass24/vb/CustLoop/prjCustLoop.vbp b/bass-sys/win/bass24/vb/CustLoop/prjCustLoop.vbp similarity index 100% rename from bass-sys/bass24/vb/CustLoop/prjCustLoop.vbp rename to bass-sys/win/bass24/vb/CustLoop/prjCustLoop.vbp diff --git a/bass-sys/bass24/vb/DSPtest/frmDSPtest.frm b/bass-sys/win/bass24/vb/DSPtest/frmDSPtest.frm similarity index 100% rename from bass-sys/bass24/vb/DSPtest/frmDSPtest.frm rename to bass-sys/win/bass24/vb/DSPtest/frmDSPtest.frm diff --git a/bass-sys/bass24/vb/DSPtest/modDSPtest.bas b/bass-sys/win/bass24/vb/DSPtest/modDSPtest.bas similarity index 100% rename from bass-sys/bass24/vb/DSPtest/modDSPtest.bas rename to bass-sys/win/bass24/vb/DSPtest/modDSPtest.bas diff --git a/bass-sys/bass24/vb/DSPtest/prjDSPtest.vbp b/bass-sys/win/bass24/vb/DSPtest/prjDSPtest.vbp similarity index 100% rename from bass-sys/bass24/vb/DSPtest/prjDSPtest.vbp rename to bass-sys/win/bass24/vb/DSPtest/prjDSPtest.vbp diff --git a/bass-sys/bass24/vb/FXtest/frmFXtest.frm b/bass-sys/win/bass24/vb/FXtest/frmFXtest.frm similarity index 100% rename from bass-sys/bass24/vb/FXtest/frmFXtest.frm rename to bass-sys/win/bass24/vb/FXtest/frmFXtest.frm diff --git a/bass-sys/bass24/vb/FXtest/prjFXtest.vbp b/bass-sys/win/bass24/vb/FXtest/prjFXtest.vbp similarity index 100% rename from bass-sys/bass24/vb/FXtest/prjFXtest.vbp rename to bass-sys/win/bass24/vb/FXtest/prjFXtest.vbp diff --git a/bass-sys/bass24/vb/LiveFX/frmLiveFX.frm b/bass-sys/win/bass24/vb/LiveFX/frmLiveFX.frm similarity index 100% rename from bass-sys/bass24/vb/LiveFX/frmLiveFX.frm rename to bass-sys/win/bass24/vb/LiveFX/frmLiveFX.frm diff --git a/bass-sys/bass24/vb/LiveFX/modLiveFX.bas b/bass-sys/win/bass24/vb/LiveFX/modLiveFX.bas similarity index 100% rename from bass-sys/bass24/vb/LiveFX/modLiveFX.bas rename to bass-sys/win/bass24/vb/LiveFX/modLiveFX.bas diff --git a/bass-sys/bass24/vb/LiveFX/prjLiveFX.vbp b/bass-sys/win/bass24/vb/LiveFX/prjLiveFX.vbp similarity index 100% rename from bass-sys/bass24/vb/LiveFX/prjLiveFX.vbp rename to bass-sys/win/bass24/vb/LiveFX/prjLiveFX.vbp diff --git a/bass-sys/bass24/vb/LiveSpec/frmLiveSpec.frm b/bass-sys/win/bass24/vb/LiveSpec/frmLiveSpec.frm similarity index 100% rename from bass-sys/bass24/vb/LiveSpec/frmLiveSpec.frm rename to bass-sys/win/bass24/vb/LiveSpec/frmLiveSpec.frm diff --git a/bass-sys/bass24/vb/LiveSpec/modLiveSpec.bas b/bass-sys/win/bass24/vb/LiveSpec/modLiveSpec.bas similarity index 100% rename from bass-sys/bass24/vb/LiveSpec/modLiveSpec.bas rename to bass-sys/win/bass24/vb/LiveSpec/modLiveSpec.bas diff --git a/bass-sys/bass24/vb/LiveSpec/prjLiveSpec.vbp b/bass-sys/win/bass24/vb/LiveSpec/prjLiveSpec.vbp similarity index 100% rename from bass-sys/bass24/vb/LiveSpec/prjLiveSpec.vbp rename to bass-sys/win/bass24/vb/LiveSpec/prjLiveSpec.vbp diff --git a/bass-sys/bass24/vb/Memory/SYNCtest.bas b/bass-sys/win/bass24/vb/Memory/SYNCtest.bas similarity index 100% rename from bass-sys/bass24/vb/Memory/SYNCtest.bas rename to bass-sys/win/bass24/vb/Memory/SYNCtest.bas diff --git a/bass-sys/bass24/vb/Memory/cbass_time.cls b/bass-sys/win/bass24/vb/Memory/cbass_time.cls similarity index 100% rename from bass-sys/bass24/vb/Memory/cbass_time.cls rename to bass-sys/win/bass24/vb/Memory/cbass_time.cls diff --git a/bass-sys/bass24/vb/Memory/frmMemory.frm b/bass-sys/win/bass24/vb/Memory/frmMemory.frm similarity index 100% rename from bass-sys/bass24/vb/Memory/frmMemory.frm rename to bass-sys/win/bass24/vb/Memory/frmMemory.frm diff --git a/bass-sys/bass24/vb/Memory/prjMemory.vbp b/bass-sys/win/bass24/vb/Memory/prjMemory.vbp similarity index 100% rename from bass-sys/bass24/vb/Memory/prjMemory.vbp rename to bass-sys/win/bass24/vb/Memory/prjMemory.vbp diff --git a/bass-sys/bass24/vb/Multi/frmDevice.frm b/bass-sys/win/bass24/vb/Multi/frmDevice.frm similarity index 100% rename from bass-sys/bass24/vb/Multi/frmDevice.frm rename to bass-sys/win/bass24/vb/Multi/frmDevice.frm diff --git a/bass-sys/bass24/vb/Multi/frmMulti.frm b/bass-sys/win/bass24/vb/Multi/frmMulti.frm similarity index 100% rename from bass-sys/bass24/vb/Multi/frmMulti.frm rename to bass-sys/win/bass24/vb/Multi/frmMulti.frm diff --git a/bass-sys/bass24/vb/Multi/modMulti.bas b/bass-sys/win/bass24/vb/Multi/modMulti.bas similarity index 100% rename from bass-sys/bass24/vb/Multi/modMulti.bas rename to bass-sys/win/bass24/vb/Multi/modMulti.bas diff --git a/bass-sys/bass24/vb/Multi/prjMulti.vbp b/bass-sys/win/bass24/vb/Multi/prjMulti.vbp similarity index 100% rename from bass-sys/bass24/vb/Multi/prjMulti.vbp rename to bass-sys/win/bass24/vb/Multi/prjMulti.vbp diff --git a/bass-sys/bass24/vb/NetRadio/clsFileIo.cls b/bass-sys/win/bass24/vb/NetRadio/clsFileIo.cls similarity index 100% rename from bass-sys/bass24/vb/NetRadio/clsFileIo.cls rename to bass-sys/win/bass24/vb/NetRadio/clsFileIo.cls diff --git a/bass-sys/bass24/vb/NetRadio/frmNetRadio.frm b/bass-sys/win/bass24/vb/NetRadio/frmNetRadio.frm similarity index 100% rename from bass-sys/bass24/vb/NetRadio/frmNetRadio.frm rename to bass-sys/win/bass24/vb/NetRadio/frmNetRadio.frm diff --git a/bass-sys/bass24/vb/NetRadio/modNetRadio.bas b/bass-sys/win/bass24/vb/NetRadio/modNetRadio.bas similarity index 100% rename from bass-sys/bass24/vb/NetRadio/modNetRadio.bas rename to bass-sys/win/bass24/vb/NetRadio/modNetRadio.bas diff --git a/bass-sys/bass24/vb/NetRadio/prjNetRadio.vbp b/bass-sys/win/bass24/vb/NetRadio/prjNetRadio.vbp similarity index 100% rename from bass-sys/bass24/vb/NetRadio/prjNetRadio.vbp rename to bass-sys/win/bass24/vb/NetRadio/prjNetRadio.vbp diff --git a/bass-sys/bass24/vb/Plugins/frmPlugins.frm b/bass-sys/win/bass24/vb/Plugins/frmPlugins.frm similarity index 100% rename from bass-sys/bass24/vb/Plugins/frmPlugins.frm rename to bass-sys/win/bass24/vb/Plugins/frmPlugins.frm diff --git a/bass-sys/bass24/vb/Plugins/prjPlugins.vbp b/bass-sys/win/bass24/vb/Plugins/prjPlugins.vbp similarity index 100% rename from bass-sys/bass24/vb/Plugins/prjPlugins.vbp rename to bass-sys/win/bass24/vb/Plugins/prjPlugins.vbp diff --git a/bass-sys/bass24/vb/RecTest/frmRecTest.frm b/bass-sys/win/bass24/vb/RecTest/frmRecTest.frm similarity index 100% rename from bass-sys/bass24/vb/RecTest/frmRecTest.frm rename to bass-sys/win/bass24/vb/RecTest/frmRecTest.frm diff --git a/bass-sys/bass24/vb/RecTest/modRecTest.bas b/bass-sys/win/bass24/vb/RecTest/modRecTest.bas similarity index 100% rename from bass-sys/bass24/vb/RecTest/modRecTest.bas rename to bass-sys/win/bass24/vb/RecTest/modRecTest.bas diff --git a/bass-sys/bass24/vb/RecTest/prjRecTest.vbp b/bass-sys/win/bass24/vb/RecTest/prjRecTest.vbp similarity index 100% rename from bass-sys/bass24/vb/RecTest/prjRecTest.vbp rename to bass-sys/win/bass24/vb/RecTest/prjRecTest.vbp diff --git a/bass-sys/bass24/vb/Speakers/frmSpeakers.frm b/bass-sys/win/bass24/vb/Speakers/frmSpeakers.frm similarity index 100% rename from bass-sys/bass24/vb/Speakers/frmSpeakers.frm rename to bass-sys/win/bass24/vb/Speakers/frmSpeakers.frm diff --git a/bass-sys/bass24/vb/Speakers/prjSpeakers.vbp b/bass-sys/win/bass24/vb/Speakers/prjSpeakers.vbp similarity index 100% rename from bass-sys/bass24/vb/Speakers/prjSpeakers.vbp rename to bass-sys/win/bass24/vb/Speakers/prjSpeakers.vbp diff --git a/bass-sys/bass24/vb/Spectrum/frmSpectrum.frm b/bass-sys/win/bass24/vb/Spectrum/frmSpectrum.frm similarity index 100% rename from bass-sys/bass24/vb/Spectrum/frmSpectrum.frm rename to bass-sys/win/bass24/vb/Spectrum/frmSpectrum.frm diff --git a/bass-sys/bass24/vb/Spectrum/modSpectrum.bas b/bass-sys/win/bass24/vb/Spectrum/modSpectrum.bas similarity index 100% rename from bass-sys/bass24/vb/Spectrum/modSpectrum.bas rename to bass-sys/win/bass24/vb/Spectrum/modSpectrum.bas diff --git a/bass-sys/bass24/vb/Spectrum/prjSpectrum.vbp b/bass-sys/win/bass24/vb/Spectrum/prjSpectrum.vbp similarity index 100% rename from bass-sys/bass24/vb/Spectrum/prjSpectrum.vbp rename to bass-sys/win/bass24/vb/Spectrum/prjSpectrum.vbp diff --git a/bass-sys/bass24/vb/Synth/frmSynth.frm b/bass-sys/win/bass24/vb/Synth/frmSynth.frm similarity index 100% rename from bass-sys/bass24/vb/Synth/frmSynth.frm rename to bass-sys/win/bass24/vb/Synth/frmSynth.frm diff --git a/bass-sys/bass24/vb/Synth/modSynth.bas b/bass-sys/win/bass24/vb/Synth/modSynth.bas similarity index 100% rename from bass-sys/bass24/vb/Synth/modSynth.bas rename to bass-sys/win/bass24/vb/Synth/modSynth.bas diff --git a/bass-sys/bass24/vb/Synth/prjSynth.vbp b/bass-sys/win/bass24/vb/Synth/prjSynth.vbp similarity index 100% rename from bass-sys/bass24/vb/Synth/prjSynth.vbp rename to bass-sys/win/bass24/vb/Synth/prjSynth.vbp diff --git a/bass-sys/bass24/vb/WriteWav/frmWriteWave.frm b/bass-sys/win/bass24/vb/WriteWav/frmWriteWave.frm similarity index 100% rename from bass-sys/bass24/vb/WriteWav/frmWriteWave.frm rename to bass-sys/win/bass24/vb/WriteWav/frmWriteWave.frm diff --git a/bass-sys/bass24/vb/WriteWav/prjWriteWave.vbp b/bass-sys/win/bass24/vb/WriteWav/prjWriteWave.vbp similarity index 100% rename from bass-sys/bass24/vb/WriteWav/prjWriteWave.vbp rename to bass-sys/win/bass24/vb/WriteWav/prjWriteWave.vbp diff --git a/bass-sys/bass24/vb/bass.bas b/bass-sys/win/bass24/vb/bass.bas similarity index 100% rename from bass-sys/bass24/vb/bass.bas rename to bass-sys/win/bass24/vb/bass.bas diff --git a/bass-sys/bass24/x64/bass.dll b/bass-sys/win/bass24/x64/bass.dll similarity index 100% rename from bass-sys/bass24/x64/bass.dll rename to bass-sys/win/bass24/x64/bass.dll diff --git a/bass-sys/bass24/x64/mp3-free/bass.dll b/bass-sys/win/bass24/x64/mp3-free/bass.dll similarity index 100% rename from bass-sys/bass24/x64/mp3-free/bass.dll rename to bass-sys/win/bass24/x64/mp3-free/bass.dll