strcpy(globals.xinput_device, gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(lookup_widget(dialog, "xinput_device"))->entry)));
globals.mouse_speed=gtk_range_get_value(GTK_RANGE(lookup_widget(dialog, "mouse_speed")));
globals.sense_cycles=(int) gtk_range_get_value(GTK_RANGE(lookup_widget(dialog, "stop_sense_cycles")));
+ globals.vtt_inertia=gtk_range_get_value(GTK_RANGE(lookup_widget(dialog, "vtt_inertia")));
/* User Interface */
globals.show_nag=(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(dialog, "startup_nagbox")))==TRUE);
globals.update_delay=(int) gtk_range_get_value(GTK_RANGE(lookup_widget(dialog, "update_delay")));
globals.update_idle=(int) gtk_range_get_value(GTK_RANGE(lookup_widget(dialog, "update_idle")));
globals.flash_response=gtk_range_get_value(GTK_RANGE(lookup_widget(dialog, "vumeter_decay")));
-
+
/* Misc */
strcpy(globals.file_editor, gtk_entry_get_text(GTK_ENTRY(lookup_widget(dialog, "soundfile_editor"))));
strcpy(globals.lrdf_path, gtk_entry_get_text(GTK_ENTRY(lookup_widget(dialog, "ladspa_rdf_path"))));
if (oss_devices) {
return oss_devices;
}
-
-
+
struct dirent **namelist;
int n,i;
n = scandir("/dev", &namelist, oss_select_dsp_only, alphasort);
#endif
/* Audio: OSS */
- gtk_combo_set_popdown_strings(GTK_COMBO(lookup_widget(dialog, "oss_audio_device")), get_oss_device_list());
+ GList *oss_list=get_oss_device_list();
+ if (oss_list) {
+ gtk_combo_set_popdown_strings(GTK_COMBO(lookup_widget(dialog, "oss_audio_device")), oss_list);
+ }
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(lookup_widget(dialog, "oss_audio_device"))->entry), globals.oss_device);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(lookup_widget(dialog, "oss_buffers")), globals.oss_buff_no);
/* Audio: ALSA */
- gtk_combo_set_popdown_strings(GTK_COMBO(lookup_widget(dialog, "alsa_audio_device")), get_alsa_device_list());
+ GList *alsa_list=get_alsa_device_list();
+ if (alsa_list) {
+ gtk_combo_set_popdown_strings(GTK_COMBO(lookup_widget(dialog, "alsa_audio_device")), get_alsa_device_list());
+ }
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(lookup_widget(dialog, "alsa_audio_device"))->entry), globals.alsa_device);
gtk_range_set_value(GTK_RANGE(lookup_widget(dialog, "alsa_buffer_time")), globals.alsa_buffer_time/1000);
gtk_range_set_value(GTK_RANGE(lookup_widget(dialog, "stop_sense_cycles")), globals.sense_cycles);
gtk_tooltips_set_tip(tooltips, lookup_widget(dialog, "stop_sense_cycles"),"If there is no \"motion-event\" for x cycles, where x is the number of cycles you select here, terminatorX assumes mouse motion has stopped. For smaller buffer sizes (=> shorter cycle times) you might have to increase this value", NULL);
-
+
+ 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);
+
/* 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 *stop_sense_cycles;
GtkWidget *label25;
GtkWidget *xinput_enable;
+ GtkWidget *label37;
+ GtkWidget *vtt_inertia;
GtkWidget *label4;
GtkWidget *table2;
GtkWidget *label8;
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 2), label16);
gtk_label_set_justify (GTK_LABEL (label16), GTK_JUSTIFY_LEFT);
- table1 = gtk_table_new (4, 2, FALSE);
+ table1 = gtk_table_new (5, 2, FALSE);
gtk_widget_show (table1);
gtk_container_add (GTK_CONTAINER (notebook1), table1);
gtk_container_set_border_width (GTK_CONTAINER (table1), 4);
(GtkAttachOptions) (0), 0, 0);
gtk_tooltips_set_tip (tooltips, xinput_enable, "CAREFUL! Enable this *only* if you want to use an input device than your default X-Pointer (yes, your mouse ;). You have to select your desired device as well. Selecting the default mouse pointer will crash terminatorX so if you want to use that keep this option disabled.", NULL);
+ label37 = gtk_label_new ("Turntable Inertia:");
+ gtk_widget_show (label37);
+ gtk_table_attach (GTK_TABLE (table1), label37, 0, 1, 4, 5,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_label_set_justify (GTK_LABEL (label37), GTK_JUSTIFY_LEFT);
+ gtk_misc_set_alignment (GTK_MISC (label37), 0, 0.5);
+
+ vtt_inertia = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (10, 1, 310, 0.01, 1, 10)));
+ gtk_widget_show (vtt_inertia);
+ gtk_table_attach (GTK_TABLE (table1), vtt_inertia, 1, 2, 4, 5,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (GTK_FILL), 0, 0);
+
label4 = gtk_label_new ("Input");
gtk_widget_show (label4);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 3), label4);
GLADE_HOOKUP_OBJECT (tx_options, stop_sense_cycles, "stop_sense_cycles");
GLADE_HOOKUP_OBJECT (tx_options, label25, "label25");
GLADE_HOOKUP_OBJECT (tx_options, xinput_enable, "xinput_enable");
+ GLADE_HOOKUP_OBJECT (tx_options, label37, "label37");
+ GLADE_HOOKUP_OBJECT (tx_options, vtt_inertia, "vtt_inertia");
GLADE_HOOKUP_OBJECT (tx_options, label4, "label4");
GLADE_HOOKUP_OBJECT (tx_options, table2, "table2");
GLADE_HOOKUP_OBJECT (tx_options, label8, "label8");
globals.fullscreen_enabled=0;
globals.confirm_events=0;
globals.compress_set_files=0;
+
+ globals.vtt_inertia=10.0;
}
int load_globals_xml() {
restore_int("compress_set_files", globals.compress_set_files);
restore_int("fullscreen_enabled", globals.fullscreen_enabled);
restore_int("confirm_events", globals.confirm_events);
+ restore_float("vtt_inertia", globals.vtt_inertia);
if (!elementFound) {
fprintf(stderr, "tX: Unhandled XML element: \"%s\"\n", cur->name);
store_int("compress_set_files", globals.compress_set_files);
store_int("fullscreen_enabled", globals.fullscreen_enabled);
store_int("confirm_events", globals.confirm_events);
-
+ store_float("vtt_inertia", globals.vtt_inertia);
+
fprintf(rc,"</terminatorXrc>\n");
}
}
int fullscreen_enabled;
int confirm_events;
+
+ double vtt_inertia;
+
} tx_global;
extern tx_global globals;
tX_midiin *midi=(tX_midiin *) data;
midi->check_event();
- return false;
+ return TRUE;
}
tX_midiin::tX_midiin()
return 0.0;
}
-void tX_seqpar :: do_exec(const float value)
-{
- fprintf(stderr, "oops: called do_exec() of tX_seqpar.\n");
-}
-
-void tX_seqpar :: exec_value(const float value)
-{
- fprintf(stderr, "oops: called exec_value() of tX_seqpar.\n");
-}
-
-void tX_seqpar :: do_update_graphics()
-{
- fprintf(stderr, "oops: called do_update_graphics() of tX_seqpar.\n");
-}
-
void tX_seqpar :: update_graphics()
{
gui_active=0;
static tX_seqpar *get_sp_by_persistence_id(unsigned int pid);
void record_value (const float value);
- virtual void do_exec(const float value);
- virtual void exec_value(const float value);
- virtual void do_update_graphics();
+ virtual void do_exec(const float value)=NULL;
+ virtual void exec_value(const float value)=NULL;
+ virtual void do_update_graphics()=NULL;
void update_graphics();
static void update_all_graphics();
static void init_all_graphics();
{
f_prec *ptr;
- for (ptr=ec_buffer; ptr<=ec_delay; ptr++)
- {
+ for (ptr=ec_buffer; ptr<=ec_delay; ptr++) {
*ptr=0.0;
}
ec_ptr=ec_buffer;
{
list <vtt_fx *> :: iterator effect;
- if (do_scratch)
- {
- if (sense_cycles>0)
- {
+ if (do_scratch) {
+ if (sense_cycles>0) {
sense_cycles--;
if (sense_cycles==0) sp_speed.receive_input_value(0);
}
}
render_scratch();
- for (effect=fx_list.begin(); effect != fx_list.end(); effect++)
- {
+ for (effect=fx_list.begin(); effect != fx_list.end(); effect++) {
if ((*effect)->isEnabled()) (*effect)->run();
}
}
fade_out=0;
fade_in=0;
- if (speed != speed_target)
- {
+ if (speed != speed_target) {
speed_target=speed;
speed_step=speed_target-speed_real;
- speed_step/=10.0;
+ speed_step/=globals.vtt_inertia;
+ tX_error("dingens - step: %lf", speed_step);
}
- if (speed_target != speed_real)
- {
+ if (speed_target != speed_real) {
speed_real+=speed_step;
if ((speed_step<0) && (speed_real<speed_target)) speed_real=speed_target;
- else
- if ((speed_step>0) && (speed_real>speed_target)) speed_real=speed_target;
+ else if ((speed_step>0) && (speed_real>speed_target)) speed_real=speed_target;
}
- if (fade)
- {
- if ((speed_last==0) && (speed_real !=0))
- {
+ if (fade) {
+ if ((speed_last==0) && (speed_real !=0)) {
fade_in=1;
fade=NEED_FADE_OUT;
}
- }
- else
- {
- if ((speed_last!=0) && (speed_real==0))
- {
+ } else {
+ if ((speed_last!=0) && (speed_real==0)) {
fade_out=1;
fade=NEED_FADE_IN;
}
speed_last = speed_real;
- if (res_mute != res_mute_old)
- {
- if (res_mute)
- {
+ if (res_mute != res_mute_old) {
+ if (res_mute) {
fade_out=1; fade_in=0;
fade=NEED_FADE_IN;
- }
- else
- {
+ } else {
fade_in=1; fade_out=0;
fade=NEED_FADE_OUT;
}
res_mute_old=res_mute;
- }
- else
- {
+ } else {
if (res_mute) do_mute=1;
}
}
calc_speed();
- for (sample =0,out=output_buffer, fade_vol=0.0; sample < samples_in_outputbuffer;sample++, out++, fade_vol+=inv_samples_in_outputbuffer)
- {
- if ((speed_real!=0) || (fade_out))
- {
+ for (sample =0,out=output_buffer, fade_vol=0.0; sample < samples_in_outputbuffer;sample++, out++, fade_vol+=inv_samples_in_outputbuffer) {
+ if ((speed_real!=0) || (fade_out)) {
pos_f+=speed_real;
- if (pos_f>maxpos)
- {
+ if (pos_f>maxpos) {
pos_f-=maxpos;
- if (res_pitch>0)
- {
- if (loop)
- {
- if (is_sync_master)
- {
- master_triggered=1;
- master_triggered_at=sample;
- }
- }
- else
- {
+ if (res_pitch>0) {
+ if (loop) {
+ if (is_sync_master)
+ {
+ master_triggered=1;
+ master_triggered_at=sample;
+ }
+ } else {
want_stop=1;
}
-
}
- }
- else if (pos_f<0)
- {
+ } else if (pos_f<0) {
pos_f+=maxpos;
- if (res_pitch<0)
- {
- if (loop)
- {
- if (is_sync_master)
- {
- master_triggered=1;
- master_triggered_at=sample;
- }
- }
- else
- {
+ if (res_pitch<0) {
+ if (loop) {
+ if (is_sync_master)
+ {
+ master_triggered=1;
+ master_triggered_at=sample;
+ }
+ } else {
want_stop=1;
}
}
amount_b=pos_f-pos_a_f;
amount_a=1.0-amount_b;
- if (do_mute)
- {
+ if (do_mute) {
*out=0.0;
- }
- else
- {
+ } else {
ptr=&buffer[pos_i];
sample_a=(f_prec) *ptr;
- if (pos_i == pos_i_max)
- {
+ if (pos_i == pos_i_max) {
sample_b=*buffer;
- }
- else
- {
+ } else {
ptr++;
sample_b=(f_prec) *ptr;
}
sample_res=(sample_a*amount_a)+(sample_b*amount_b);
- if (fade_in)
- {
+ if (fade_in) {
sample_res*=fade_vol;
- }
- else
- if (fade_out)
- {
+ } else if (fade_out) {
sample_res*=1.0-fade_vol;
}
*out=sample_res;
}
- }
- else
- {
+ } else {
*out=0;
}
}
pos_f_tmp=pos_f+speed_real*samples_in_outputbuffer;
- if ((pos_f_tmp > 0) && (pos_f_tmp < maxpos))
- {
+ if ((pos_f_tmp > 0) && (pos_f_tmp < maxpos)) {
#ifdef pos_f_test
show=1;
#else
/* now the slow way ;) */
- for (sample =0; sample < samples_in_outputbuffer; sample++)
- {
- pos_f+=speed_real;
+ for (sample =0; sample < samples_in_outputbuffer; sample++) {
+ pos_f+=speed_real;
- if (pos_f>maxpos)
- {
- pos_f-=maxpos;
- if (res_pitch>0)
- {
- if (loop)
- {
- if (is_sync_master)
- {
+ if (pos_f>maxpos) {
+ pos_f-=maxpos;
+ if (res_pitch>0) {
+ if (loop) {
+ if (is_sync_master) {
master_triggered=1;
master_triggered_at=sample;
}
- }
- else
- {
- want_stop=1;
- }
-
+ } else {
+ want_stop=1;
}
}
- else if (pos_f<0)
- {
- pos_f+=maxpos;
- if (res_pitch<0)
- {
- if (loop)
- {
- if (is_sync_master)
- {
+ } else if (pos_f<0) {
+ pos_f+=maxpos;
+ if (res_pitch<0) {
+ if (loop) {
+ if (is_sync_master) {
master_triggered=1;
master_triggered_at=sample;
}
- }
- else
- {
- want_stop=1;
- }
+ } else {
+ want_stop=1;
}
}
-
+ }
}
#ifdef pos_f_test
- if (show)
- {
+ if (show) {
diff=pos_f_tmp-pos_f;
if (diff!=0) printf("fast: %f, slow: %f, diff: %f, tt: %s\n", pos_f_tmp, pos_f, diff, name);
}
{
f_prec *sample;
- for (sample = output_buffer; sample<end_of_outputbuffer; sample++)
- {
+ for (sample = output_buffer; sample<end_of_outputbuffer; sample++) {
lp_buf0 = lp_a * lp_buf0 + lp_freq * ((*sample)*lp_resgain + lp_b * (lp_buf0 - lp_buf1));
lp_buf1 = lp_a * lp_buf1 + lp_freq * lp_buf0;
f_prec *ec_sample;
int i;
- for (i=0, sample = output_buffer, ec_sample=ec_output_buffer; i<samples_in_outputbuffer; i++, ec_sample++,sample++, ec_ptr++)
- {
+ for (i=0, sample = output_buffer, ec_sample=ec_output_buffer; i<samples_in_outputbuffer; i++, ec_sample++,sample++, ec_ptr++) {
if (ec_ptr>ec_delay) ec_ptr=ec_buffer;
*ec_sample=(*ec_ptr) *ec_feedback;
*ec_ptr=*sample+*ec_sample;
{
list <vtt_fx *> :: iterator effect;
- if ((!is_playing) && do_unlock)
- {
+ if ((!is_playing) && do_unlock) {
pthread_mutex_unlock(&render_lock);
return(1);
}
max_value=0;
cleanup_vtt(this);
- sync_countdown=0;
+ //sync_countdown=0;
/* deactivating plugins */
- for (effect=fx_list.begin(); effect != fx_list.end(); effect++)
- {
+ for (effect=fx_list.begin(); effect != fx_list.end(); effect++) {
(*effect)->deactivate();
}
float ladspa_dummy_output_port;
-void vtt_fx :: activate ()
-{
- fprintf(stderr, "tX: Oops: activate() abstract vtt_fx?");
-}
-
-void vtt_fx :: deactivate ()
-{
- fprintf(stderr, "tX: Oops: deactivate() abstract vtt_fx?");
-}
-
-void vtt_fx :: run ()
-{
- fprintf(stderr, "tX: Oops: run() abstract vtt_fx?");
-}
-
-void vtt_fx :: save(FILE *rc, gzFile rz, char *indent) {
- fprintf(stderr, "tX: Oops: run() abstract vtt_fx?");
-}
-
void vtt_fx :: reconnect_buffer()
{
-}
-
-int vtt_fx :: isEnabled ()
-{
- fprintf(stderr, "tX: Oops: isEnabled() abstract vtt_fx?");
- return 0;
-}
-
-const char * vtt_fx :: get_info_string()
-{
- return "tX: Oops: Why do you see this info string?";
+ /* NOP */
}
vtt_fx :: ~vtt_fx() {}
void set_vtt(void *v) { vtt=v;}
void *get_vtt() { return vtt; }
- virtual void activate();
- virtual void deactivate();
- virtual void run();
- virtual int isEnabled();
+ virtual void activate()=NULL;
+ virtual void deactivate()=NULL;
+ virtual void run()=NULL;
+ virtual int isEnabled()=NULL;
virtual void reconnect_buffer();
- virtual const char *get_info_string();
+ virtual const char *get_info_string()=NULL;
- virtual void save(FILE *rc, gzFile rz, char *indent);
+ virtual void save(FILE *rc, gzFile rz, char *indent)=NULL;
GtkWidget* get_panel_widget() { return panel_widget; }
void set_panel_widget(GtkWidget *widget) { panel_widget=widget; }
<widget class="GtkTable" id="table1">
<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"></property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkLabel" id="label37">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Turntable Inertia:</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="GtkHScale" id="vtt_inertia">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="draw_value">True</property>
+ <property name="value_pos">GTK_POS_TOP</property>
+ <property name="digits">1</property>
+ <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
+ <property name="inverted">False</property>
+ <property name="adjustment">10 1 310 0.01 1 10</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">fill</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="tab_expand">False</property>