i hope you can help me get the largest function to print
[via fprintf() --to a voiceconfile file-- the
1) gender [M or F]
2) pitch
3) speed [of speech in words/minute]
4) volume [0 -- 200%]
5) delay [in 10th of a sec between words
originalyy, i thought coding this would be trivial. it may
well be, but if so, i haven't figured it out!
this code will be on my options dropdown. please see
http://www.thought.org/vbc for my latest pix. --this is
entirely raw and unpolished; there are no links besides my
.signature.
the reason i am asking help is that my shoulder is giving
out and i don't want to press my luck. also because i am
still hard in Learn mode with gtk ... so this is one for you
gurus.
thanks for insights..
appended: dDemo.
===
/* from here:: Options callback */
#include gtk/gtk.h
#include string.h
enum
{
MALE,
FEMALE
};
/* globals */
GtkWidget *gender_radio_male;
GtkWidget *gender_radio_female;
GtkWidget *pitch_scale1;
GtkWidget *speedWPM_scale2;
GtkWidget *volume_scale3;
GtkWidget *delay_scale4;
int valueGender, tgen = 0, tpit = 0, tspe = 0, tvol = 0, tdel =0;;
double valuePitch, valueSpeed, valueVolume, valueDelay;
/* end globals */
static void
cb_gender_toggled (GtkToggleButton *button, gpointer userdata)
{
puts(within callback);
int malefemale = (int)userdata;
if (gtk_toggle_button_get_active (button))
{
if (malefemale == MALE)
{
fprintf(stdout, MALE [7]\n);
}
else if (malefemale == FEMALE)
{
fprintf(stdout, FEMALE [13]\n);
}
}
valueGender = malefemale;
}
static void hscale_value_changed_pitch (GtkRange *hscale, GtkWindow
*parentWindow)
{
//fprintf(stderr,hscale pitch value: %g\n,value);
}
static void hscale_value_changed_speed (GtkRange *hscale, GtkWindow
*parentWindow)
{
valueSpeed = gtk_range_get_value(hscale);
//fprintf(stderr,hscale speed value: %g\n,value);
}
static void hscale_value_changed_volume (GtkRange *hscale, GtkWindow
*parentWindow)
{
valueVolume = gtk_range_get_value(hscale);
//fprintf(stderr,hscale volume value: %g\n,value);
}
static void hscale_value_changed_delay (GtkRange *hscale, GtkWindow
*parentWindow)
{
valueDelay = gtk_range_get_value(hscale);
//fprintf(stderr,hscale delay value: %g\n,value);
}
int
main (int argc, char *argv[])
{
/*
* Declare the GTK Widgets used in the program
*/
GtkWidget *dialog;
GtkWidget *main_hbox; //hbox1
GtkWidget *gender_frame;
GtkWidget *gender_align;
GtkWidget *gender_hbox; // hbox2
/*
GtkWidget *gender_radio_male;
GtkWidget *gender_radio_female;
*/
GtkWidget *params_frame;
GtkWidget *params_align;
GtkWidget *params_table;
GtkWidget *temp_widget;
GtkWidget *parent_window;
/*
Initialize GTK
*/
gtk_init (argc, argv);
parent_window = NULL; //Set to parent window if you want the dialog box
//to block access to the other windows in the app
//while it is open and running.
dialog = gtk_dialog_new_with_buttons (Voice Settings, GTK_WINDOW
(parent_window),
0,
GTK_STOCK_REVERT_TO_SAVED, //revert button which
GTK_RESPONSE_CANCEL,// returns a cancel response
GTK_STOCK_CLOSE,//close button which
GTK_RESPONSE_ACCEPT,// returns an accept response
NULL// mark the end of our buttons (we could have
more)
);
gtk_window_set_title ( GTK_WINDOW ( dialog ) , VBC Espeak Options);
gtk_widget_set_usize( GTK_WIDGET ( dialog ) , 600 , 400 );
/*
* dialog boxes have a vbox built in we can use
*/
main_hbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
/*
* Create the first frame
*/
gender_frame = gtk_frame_new (bVoice Gender/b);
gtk_frame_set_shadow_type (GTK_FRAME (gender_frame), GTK_SHADOW_NONE);
g_object_set (gtk_frame_get_label_widget (GTK_FRAME (gender_frame)),
use-markup, TRUE, NULL);
gtk_widget_show (gender_frame);
/*
* ADD FRAME to the hbox
*/
gtk_box_pack_start (GTK_BOX (main_hbox), gender_frame, FALSE, FALSE, 0);//HBOX
/*
* Create an alignment widget to indent our child objects
*/
/*
* left aligned, top-aligned, children should fill the box
*/
gender_align = gtk_alignment_new (0, 0, 0, 1);
/*
* set a left margin of 12 pixels :: Padding
*/
gtk_alignment_set_padding (GTK_ALIGNMENT (gender_align), 0, 0, 12, 0);
gtk_widget_show (gender_align);
/*
* add alignmnet widget to frame
*/
gtk_container_add (GTK_CONTAINER (gender_frame), gender_align);
/*
* Create a [vh]box for the radio buttons and add it to the
* alignment widget inside the frame
*/
gender_hbox = gtk_hbox_new (FALSE, 2);//2