- Pre-listen support for mpg321
- Added a new auto-hiding "panel-bar" to which turntable control and audio
panels can be minimized to.
-- Cleaning up the audio panel
+- Cleaned up the turntables' audio panel for better looks and easier usage
+- Rewrote the engine thread completely - unlike before the engine thread
+ is created on startup and kept alive until termination.
+- terminatorX can now be run suid root - and it might even be safe. After
+ creating the engine thread both terminatorX threads drop root privileges
+ before evaluating any parameters or reading/writing files, etc. The problem
+ is the pthread "manager thread" is out of control of terminatorX code - so
+ I cannot tell that thread to drop privileges.
+- Fixed Drag'n'Drop for GNOME 2
+- Deleted tons of old outdated code in tX_engine.cc and tX_mastergui.cc
[v3.72]
- Applied a patch from Matthew Evans <activesx@hotmail.com> that introduces
store_globals();
+ delete engine;
+
fprintf(stderr, "Have a nice life.\n");
#else
gtk_widget_hide(main_window);
/* setting buffer size */
buff_cfg=(globals.buff_no<<16) | globals.buff_size;
-#ifdef ENABLE_DEBUG_OUTPUT
- fprintf(stderr, "[tX_adudiodevice_oss::open()] buff_no: %i, buff_size: %i, buff_cfg: %08x\n", globals.buff_no, globals.buff_size, buff_cfg);
-#endif
+ tX_debug("tX_adudiodevice_oss::open() - buff_no: %i, buff_size: %i, buff_cfg: %08x", globals.buff_no, globals.buff_size, buff_cfg);
p=buff_cfg;
i += ioctl(fd, SNDCTL_DSP_GETBLKSIZE, &blocksize);
-#ifdef ENABLE_DEBUG_OUTPUT
- fprintf(stderr, "[tX_adudiodevice_oss::open()] blocksize: %i\n", blocksize);
-#endif
+ tX_debug("tX_adudiodevice_oss::open() - blocksize: %i", blocksize);
samples_per_buffer=blocksize/sizeof(int16_t);
globals.true_block_size=samples_per_buffer/2;
{
bytes = fread(p, 1, min(1024, wav_in.len-allbytes), wav_in.handle);
+ if (bytes<=0) {
+ free(data);
+ return (TX_AUDIO_ERR_WAV_READ);
+ }
+
#ifdef BIG_ENDIAN_MACHINE
swapbuffer(p, bytes/sizeof(int16_t));
#endif
- if (bytes<=0)
- {
- free(data);
- //wav_progress_update(0);
- return (TX_AUDIO_ERR_WAV_READ);
- }
allbytes+=bytes;
ld_set_progress((float) allbytes/(float)wav_in.len);
mem=data;
no_samples=memsize/sizeof(int16_t);
-// printf("WAV: data: %08x, size %i, len: %i\n", data, memsize, no_samples);
-
return (TX_AUDIO_SUCCESS);
}
#endif
mouse-speed (should be changed to maybe) but now
depends on sample size -> you can warp through all
samples with the same mouse-distance.
+
+ 12 Aug 2002: Complete rewrite - tX_engine is now a class and the thread
+ is created on startup and kept alive until termination
*/
#include "tX_types.h"
tX_engine *engine=NULL;
-tx_mouse *mouse=new tx_mouse();
-tX_audiodevice *device=NULL;
-tx_tapedeck *tape=new tx_tapedeck();
-
void tX_engine :: set_grab_request() {
grab_request=true;
}
pthread_mutex_unlock(&start);
/* Render first block */
- sequencer.step();
- temp=vtt_class::render_all_turntables();
+ if (!stop_flag) {
+ sequencer.step();
+ temp=vtt_class::render_all_turntables();
+ }
while (!stop_flag) {
/* Checking whether to grab or not */
grab_active=false;
/* Reseting grab_request, too - doesn't help keeping it, does it ? ;) */
grab_request=false;
- // mouse->ungrab() // do we need this?
+ mouse->ungrab();
+ grab_off();
} else {
grab_active=true;
}
}
engine->loop();
+
+ tX_debug("engine_thread_entry() - Engine thread terminating.");
+
+ pthread_exit(NULL);
}
tX_engine :: tX_engine() {
if (recording_request) {
if (tape->start_record(globals.record_filename, device->get_buffersize()*sizeof(int16_t))) {
- recording=true;
device->close();
delete device;
device=NULL;
return ERROR_TAPE;
- }
+ } else {
+ recording=true;
+ }
}
for (vtt=vtt_class::main_list.begin(); vtt!=vtt_class::main_list.end(); vtt++) {
}
tX_engine :: ~tX_engine() {
+ void *dummy;
+ thread_terminate=true;
+ stop_flag=true;
+ pthread_mutex_unlock(&start);
+ tX_debug("~tX_engine() - Waiting for engine thread to terminate.");
+ pthread_join(thread, &dummy);
}
#define WID_DYN TRUE, TRUE, 0
#define WID_FIX FALSE, FALSE, 0
extern void add_vtt(GtkWidget *ctrl, GtkWidget *audio, char *fn);
-extern void recreate_gui(vtt_class *vtt, GtkWidget *daddy);
extern void destroy_gui(vtt_class *vtt);
extern void gui_show_frame(vtt_class *vtt, int show);
int stop_update=0;
int update_delay;
-int mg_hide_gui=0;
vtt_class *old_focus=NULL;
int grab_status=0;
}
-#ifdef USE_SCHEDULER
-int mg_oldprio;
-#endif
-
GtkSignalFunc seq_stop(GtkWidget *w, void *);
GtkSignalFunc audio_on(GtkWidget *w, void *d)
grab_status=0;
}
-void hide_clicked(GtkWidget *w, void *d)
-{
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)))
- {
- mg_hide_gui=1;
- }
- else
- {
- mg_hide_gui=0;
- }
-}
-
void quit()
{
turn_audio_off();
dummy=gtk_entry_new_with_max_length(12);
seq_entry=dummy;
- gtk_widget_set_usize(dummy, 55, 20);
+ gtk_widget_set_usize(dummy, 65, 20);
gtk_entry_set_text(GTK_ENTRY(dummy), "00:00.00");
gtk_box_pack_start(GTK_BOX(sequencer_box), dummy, WID_FIX);
gtk_widget_show(dummy);
panel_bar=gtk_hbox_new(TRUE,2);
gtk_box_pack_start(GTK_BOX(left_hbox), panel_bar, WID_FIX);
- //gtk_widget_show(panel_bar);
control_parent=gtk_hbox_new(FALSE,0);
gtk_box_pack_start(GTK_BOX(tt_parent), control_parent, WID_FIX);
gtk_container_remove(GTK_CONTAINER(panel_bar), button);
if (buttons_on_panel_bar==0) gtk_widget_hide(panel_bar);
}
-
sync_cycles=0,
sync_countdown=0;
- x_control=CONTROL_SCRATCH;
- y_control=CONTROL_CUTOFF;
-
lp_enable=0;
lp_reso=0.8;
lp_freq=0.3;
loop=newstate;
}
-void vtt_class :: set_controls (int x, int y)
-{
- x_control=x;
- y_control=y;
-}
-
void vtt_class :: set_mute(int newstate)
{
mute=newstate;
}
}
-#define MAGIC 0.05
-
-void vtt_class :: handle_input(int control, f_prec value)
-{
- f_prec temp;
-
- switch (control)
- {
- case CONTROL_SCRATCH:
- if (do_scratch) sp_speed.receive_input_value(value*globals.mouse_speed);
- sense_cycles=globals.sense_cycles;
- break;
-
- case CONTROL_VOLUME:
- temp=rel_volume+MAGIC*value*globals.mouse_speed;
- if (temp>2.0) temp=2.0;
- else if (temp<0) temp=0;
- sp_volume.receive_input_value(temp);
- break;
-
- case CONTROL_CUTOFF:
- temp=lp_freq+MAGIC*value*globals.mouse_speed;
- if (temp>0.99) temp=0.99;
- else if (temp<0) temp=0;
- sp_lp_freq.receive_input_value(temp);
- break;
-
- case CONTROL_FEEDBACK:
- temp=ec_feedback+MAGIC*value*globals.mouse_speed;
- if (temp>1.0) temp=1.0;
- else if (temp<0) temp=0;
- sp_ec_feedback.receive_input_value(temp);
- break;
- }
-}
void vtt_class :: unfocus()
{
int vtt_class :: load_10(FILE * input)
{
int res=0;
+ int obsolete_int;
atload(name);
atload(filename);
atload(loop);
atload(mute);
- atload(x_control);
- atload(y_control);
+ atload(obsolete_int); //x_control
+ atload(obsolete_int); //y_control
atload(lp_enable);
atload(lp_gain);
int res=0;
guint32 pid;
int32_t gui_page;
+ int obsolete_int;
atload(name);
atload(filename);
atload(loop);
atload(mute);
- atload(x_control);
- atload(y_control);
+ atload(obsolete_int); //x_control
+ atload(obsolete_int); //y_control
atload(lp_enable);
atload(lp_gain);
#define EC_MAX_BUFFER 256000
-#define CONTROL_NOTHING 0
-#define CONTROL_SCRATCH 1
-#define CONTROL_VOLUME 2
-#define CONTROL_CUTOFF 3
-#define CONTROL_FEEDBACK 4
-
#define NEED_FADE_OUT 0
#define NEED_FADE_IN 1
int mix_solo;
int fade;
- /* input control vars */
- int x_control;
- int y_control;
-
/* seq par mapping for x/y axis */
tX_seqpar *x_par;
tX_seqpar *y_par;
void set_mute(int);
- void set_controls(int, int);
void set_y_input_parameter(tX_seqpar *);
void set_x_input_parameter(tX_seqpar *);
void set_scratch(int);
void xy_input(f_prec, f_prec);
- void handle_input(int, f_prec);
vtt_fx_ladspa * add_effect(LADSPA_Plugin *);
int quit_load_file(GtkWidget *wid, vtt_class *vtt)
{
- //vtt->gui.file_dialog=NULL;
- //prelis_stop();
return 1;
}
gui_set_tooltip(g->del, "Click here to annihilate this turntable. All events recorded for this turntable will be erased, too.");
p->add_client_widget(g->del);
-// g->show_audio=gtk_toggle_button_new_with_label("Show Audio");
-// p->add_client_widget(g->show_audio);
-
gtk_box_pack_start(GTK_BOX(g->control_subbox), p->get_widget(), WID_FIX);
p=new tX_panel("Trigger", g->control_subbox);
GtkWidget *widget;
GdkWindow *window;
GdkGC *gc;
-// GdkColor *fg;
-// GdkColor *bg;
int current_x, x, y, yc, ymax;