2 terminatorX - realtime audio scratching software
3 Copyright (C) 1999 Alexander König
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 Description: This file contains the routines for handling the
22 "globals" block. Intializing, reading setup from
27 21 Jul 1999: introduced the lowpass globals.
33 #include "tX_global.h"
38 void get_rc_name(char *buffer)
44 strcpy(buffer, getenv("HOME"));
45 if (buffer[strlen(buffer)-1]!='/')
48 strcat(buffer, ".terminatorXrc.bin");
53 char rc_name[PATH_MAX]="";
56 strcpy(globals.scratch_name, "scratch.wav");
57 strcpy(globals.loop_name, "");
59 strcpy(globals.prefix, "tX_scratch");
60 strcpy(globals.audio_device, "/dev/dsp");
62 strcpy(globals.xinput_device, "");
63 globals.xinput_enable=0;
65 globals.update_idle=18;
70 globals.rec_size=1024000;
73 globals.scratch_vol=0.5;
75 globals.sense_cycles=12;
77 globals.mouse_speed=0.8;
82 globals.vtt_default_speed=1.0;
85 globals.time_update=15;
86 globals.time_enable=1;
89 globals.reset_filectr=1;
97 globals.lowpass_enable=0;
98 globals.lowpass_reso=0.9;
100 strcpy(globals.last_fn,"");
106 strcpy(globals.tables_filename, "");
107 strcpy(globals.record_filename, "");
110 get_rc_name(rc_name);
112 rc=fopen(rc_name, "r");
115 fread(&globals, sizeof(tx_global), 1, rc);
119 globals.scratch_size=0;
120 globals.scratch_len=0;
121 globals.scratch_data=NULL;
125 globals.loop_data=NULL;
127 globals.rec_buffer=NULL;
129 if (globals.reset_filectr) globals.filectr=0;
134 char rc_name[PATH_MAX]="";
137 get_rc_name(rc_name);
139 rc=fopen(rc_name, "w");
142 fwrite(&globals, sizeof(tx_global), 1, rc);