return -1;
}
- //snd_pcm_hw_params_free (hw_params);
+ if (globals.alsa_free_hwstats) {
+ snd_pcm_hw_params_free (hw_params);
+ }
+
return 0; //snd_pcm_prepare(pcm_handle);
}
globals.alsa_period_time=(int) gtk_range_get_value(GTK_RANGE(lookup_widget(dialog, "alsa_period_time")));
globals.alsa_period_time*=1000;
globals.alsa_samplerate=atoi(gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(lookup_widget(dialog, "alsa_samplerate"))->entry)));
+ globals.alsa_free_hwstats=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(dialog, "alsa_free_hwstats")));
/* TODO: JACK
*/
/* User Interface */
globals.show_nag=(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(dialog, "startup_nagbox")))==TRUE);
globals.tooltips=(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(dialog, "mainwin_tooltips")))==TRUE);
+ globals.filename_length=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(lookup_widget(dialog, "filename_length")));
if (globals.tooltips) gtk_tooltips_enable(gui_tooltips);
else gtk_tooltips_disable(gui_tooltips);
add_widget_dyn(label);
#ifdef USE_ALSA
-static GList *alsa_devices;
+static GList *alsa_devices=NULL;
GList *get_alsa_device_list() {
if (alsa_devices) {
FILE *file;
char buffer[PATH_MAX+1];
+ alsa_devices=NULL;
if ((file = fopen("/proc/asound/pcm", "r"))) {
while(fgets(buffer, PATH_MAX, file)) {
int n,i;
n = scandir("/dev", &namelist, oss_select_dsp_only, alphasort);
+ oss_devices=NULL;
+
if (n>0) {
for (i=0; i<n; i++) {
char buffer[256];
sprintf(tmp, "%i", globals.alsa_samplerate);
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(lookup_widget(dialog, "alsa_samplerate"))->entry), tmp);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lookup_widget(dialog, "alsa_free_hwstats")), globals.alsa_free_hwstats);
/* TODO: Samplerate!
ALSA
gtk_range_set_value(GTK_RANGE(lookup_widget(dialog, "vtt_inertia")), globals.vtt_inertia);
gtk_tooltips_set_tip(tooltips, lookup_widget(dialog, "vtt_inertia"),"This value defines how fast the turntables will adapt to the speed input - the higher this value, the longer it will take the turntable to actually reach the target speed.", NULL);
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(lookup_widget(dialog, "filename_length")), globals.filename_length);
/* User Interface */
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lookup_widget(dialog, "startup_nagbox")), globals.show_nag);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lookup_widget(dialog, "mainwin_tooltips")), globals.tooltips);
GtkWidget *alsa_period_time;
GtkWidget *label32;
GtkWidget *alsa_buffer_time;
+ GtkWidget *label39;
+ GtkWidget *alsa_free_hwstats;
GtkWidget *label16;
GtkWidget *table1;
GtkWidget *label5;
GSList *buttons_text_and_icon_group = NULL;
GtkWidget *buttons_icon_only;
GtkWidget *buttons_text_only;
+ GtkWidget *label38;
+ GtkObject *filename_length_adj;
+ GtkWidget *filename_length;
GtkWidget *label2;
GtkWidget *table3;
GtkWidget *label13;
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label15);
gtk_label_set_justify (GTK_LABEL (label15), GTK_JUSTIFY_LEFT);
- table6 = gtk_table_new (4, 2, FALSE);
+ table6 = gtk_table_new (5, 2, FALSE);
gtk_widget_show (table6);
gtk_container_add (GTK_CONTAINER (notebook1), table6);
gtk_container_set_border_width (GTK_CONTAINER (table6), 4);
(GtkAttachOptions) (GTK_FILL), 0, 0);
gtk_scale_set_digits (GTK_SCALE (alsa_buffer_time), 0);
+ label39 = gtk_label_new ("Free HWstats:");
+ gtk_widget_show (label39);
+ gtk_table_attach (GTK_TABLE (table6), label39, 0, 1, 4, 5,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_label_set_justify (GTK_LABEL (label39), GTK_JUSTIFY_LEFT);
+ gtk_misc_set_alignment (GTK_MISC (label39), 0, 0.5);
+
+ alsa_free_hwstats = gtk_check_button_new_with_mnemonic ("Enabled");
+ gtk_widget_show (alsa_free_hwstats);
+ gtk_table_attach (GTK_TABLE (table6), alsa_free_hwstats, 1, 2, 4, 5,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (alsa_free_hwstats), TRUE);
+
label16 = gtk_label_new ("Audio: ALSA");
gtk_widget_show (label16);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 2), label16);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 3), label4);
gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_LEFT);
- table2 = gtk_table_new (6, 2, FALSE);
+ table2 = gtk_table_new (7, 2, FALSE);
gtk_widget_show (table2);
gtk_container_add (GTK_CONTAINER (notebook1), table2);
gtk_container_set_border_width (GTK_CONTAINER (table2), 4);
gtk_radio_button_set_group (GTK_RADIO_BUTTON (buttons_text_only), buttons_text_and_icon_group);
buttons_text_and_icon_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (buttons_text_only));
+ label38 = gtk_label_new ("Filename Length:");
+ gtk_widget_show (label38);
+ gtk_table_attach (GTK_TABLE (table2), label38, 0, 1, 6, 7,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_label_set_justify (GTK_LABEL (label38), GTK_JUSTIFY_LEFT);
+ gtk_misc_set_alignment (GTK_MISC (label38), 0, 0.5);
+
+ filename_length_adj = gtk_adjustment_new (8, 3, 255, 1, 10, 10);
+ filename_length = gtk_spin_button_new (GTK_ADJUSTMENT (filename_length_adj), 1, 0);
+ gtk_widget_show (filename_length);
+ gtk_table_attach (GTK_TABLE (table2), filename_length, 1, 2, 6, 7,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
label2 = gtk_label_new ("User Interface");
gtk_widget_show (label2);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 4), label2);
GLADE_HOOKUP_OBJECT (tx_options, alsa_period_time, "alsa_period_time");
GLADE_HOOKUP_OBJECT (tx_options, label32, "label32");
GLADE_HOOKUP_OBJECT (tx_options, alsa_buffer_time, "alsa_buffer_time");
+ GLADE_HOOKUP_OBJECT (tx_options, label39, "label39");
+ GLADE_HOOKUP_OBJECT (tx_options, alsa_free_hwstats, "alsa_free_hwstats");
GLADE_HOOKUP_OBJECT (tx_options, label16, "label16");
GLADE_HOOKUP_OBJECT (tx_options, table1, "table1");
GLADE_HOOKUP_OBJECT (tx_options, label5, "label5");
GLADE_HOOKUP_OBJECT (tx_options, buttons_text_and_icon, "buttons_text_and_icon");
GLADE_HOOKUP_OBJECT (tx_options, buttons_icon_only, "buttons_icon_only");
GLADE_HOOKUP_OBJECT (tx_options, buttons_text_only, "buttons_text_only");
+ GLADE_HOOKUP_OBJECT (tx_options, label38, "label38");
+ GLADE_HOOKUP_OBJECT (tx_options, filename_length, "filename_length");
GLADE_HOOKUP_OBJECT (tx_options, label2, "label2");
GLADE_HOOKUP_OBJECT (tx_options, table3, "table3");
GLADE_HOOKUP_OBJECT (tx_options, label13, "label13");
globals.compress_set_files=0;
globals.vtt_inertia=10.0;
+
+ globals.alsa_free_hwstats=1;
+ globals.filename_length=20;
}
int load_globals_xml() {
restore_int("alsa_buffer_time", globals.alsa_buffer_time);
restore_int("alsa_period_time", globals.alsa_period_time);
restore_int("alsa_samplerate", globals.alsa_samplerate);
-
+ restore_int("alsa_free_hwstats", globals.alsa_free_hwstats);
+
restore_string("xinput_device", globals.xinput_device);
restore_int("xinput_enable", globals.xinput_enable);
restore_int("update_idle", globals.update_idle);
restore_float("mouse_speed", globals.mouse_speed);
restore_int("width", globals.width);
restore_int("height", globals.height);
+ restore_int("filename_length", globals.filename_length);
restore_int("tooltips", globals.tooltips);
restore_int("use_stdout", globals.use_stdout);
restore_int("show_nag", globals.show_nag);
store_int("alsa_buffer_time", globals.alsa_buffer_time);
store_int("alsa_period_time", globals.alsa_period_time);
store_int("alsa_samplerate", globals.alsa_samplerate);
+ store_int("alsa_free_hwstats", globals.alsa_free_hwstats);
store_string("xinput_device", globals.xinput_device);
store_int("xinput_enable", globals.xinput_enable);
store_float("mouse_speed", globals.mouse_speed);
store_int("width", globals.width);
store_int("height", globals.height);
+ store_int("filename_length", globals.filename_length);
store_int("tooltips", globals.tooltips);
store_int("use_stdout", globals.use_stdout);
// globals.use_stdout_from_conf_file=0; What the heck is this?
double vtt_inertia;
+ int alsa_free_hwstats;
+ int filename_length;
+
} tx_global;
extern tx_global globals;
#define WID_DYN TRUE, TRUE, 0
#define WID_FIX FALSE, FALSE, 0
-#define FILENAME_BUTTON_MAX 20
-
void nicer_filename(char *dest, char *source)
{
char *fn;
fn=strrchr(temp, '.');
if (fn) *fn=0;
- if (strlen(temp) > FILENAME_BUTTON_MAX)
+ if (strlen(temp) > globals.filename_length)
{
- temp[FILENAME_BUTTON_MAX-3]='.';
- temp[FILENAME_BUTTON_MAX-2]='.';
- temp[FILENAME_BUTTON_MAX-1]='.';
- temp[FILENAME_BUTTON_MAX]=0;
+ temp[globals.filename_length-3]='.';
+ temp[globals.filename_length-2]='.';
+ temp[globals.filename_length-1]='.';
+ temp[globals.filename_length]=0;
}
strcpy (dest, temp);
}
GtkWidget *tempbox2;
GtkWidget *tempbox3;
GtkWidget *dummy;
- char nice_name[FILENAME_BUTTON_MAX];
+ char nice_name[256];
vtt_gui *g;
gui_set_tooltip(g->file, "Click to Load/Edit/Reload a sample for this turntable. To load you can also drag a file and drop it over this button or the sound data display below.");
gtk_box_pack_start(GTK_BOX(tempbox), g->file, WID_DYN);
- g->mouse_mapping=gtk_button_new_with_label("Mouse Mapping");
+ g->mouse_mapping=gtk_button_new_with_label("Mouse");
gtk_widget_show(g->mouse_mapping);
gui_set_tooltip(g->mouse_mapping, "Determines what parameters should be affected on mouse moition in mouse grab mode.");
gtk_box_pack_start(GTK_BOX(tempbox2), g->mouse_mapping, WID_FIX);
#ifdef USE_ALSA_MIDI_IN
- g->midi_mapping=gtk_button_new_with_label("MIDI Mapping");
+ g->midi_mapping=gtk_button_new_with_label("MIDI");
gtk_widget_show(g->midi_mapping);
gui_set_tooltip(g->midi_mapping, "Determines what parameters should be bound to what MIDI events.");
gtk_box_pack_start(GTK_BOX(tempbox2), g->midi_mapping, WID_FIX);
<widget class="GtkTable" id="table6">
<property name="border_width">4</property>
<property name="visible">True</property>
- <property name="n_rows">4</property>
+ <property name="n_rows">5</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">2</property>
<property name="y_options">fill</property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkLabel" id="label39">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Free HWstats:</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="alsa_free_hwstats">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Enabled</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="active">True</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="tab_expand">False</property>
<widget class="GtkTable" id="table2">
<property name="border_width">4</property>
<property name="visible">True</property>
- <property name="n_rows">6</property>
+ <property name="n_rows">7</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">2</property>
<property name="y_options">fill</property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkLabel" id="label38">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Filename Length:</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkSpinButton" id="filename_length">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">0</property>
+ <property name="numeric">False</property>
+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+ <property name="snap_to_ticks">False</property>
+ <property name="wrap">False</property>
+ <property name="adjustment">8 3 255 1 10 10</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="tab_expand">False</property>