module xplay
	names = case_sensitive
	objects = {
		XmPushButton = gadget;
		XmToggleButton = gadget;
	}

procedure
	ChangeState();
	ProcessName();
	FileMenuSelect(integer);
	CancelPrompt();
	WidgetCreate(integer);
	UpdateFilePos();

value
	title_label_text : "Audio Play Control";
	file_label_text : "File";
	open_button_text : "Open";
	quit_button_text : "Quit";
	open_error_text : "Can't Open Specified File.";
	file_position_title : "File Position";

value
	menu_open : 1;
	menu_quit : 2;

value
	REW : 0;
	STOP : 1;
	PLAY : 2;
	PAUSE : 3;
	FF : 4;
	wcr_scale : 5;

!value topshadow : rgb(53000,57000,65000);
value topshadow : rgb(56680,27640,27640);
!value middle : rgb(45000,49000,65535);
value middle : rgb(45750,8740,8740);
!value botshadow : rgb(37000,41000,57000);
value botshadow : rgb(34690,6600,6600);
!value buttonbground : rgb(53000,53000,58000);
!value buttonbground : rgb(52600,50600,49100);
value buttonbground: color('wheat');

value cd_colors : color_table(
	topshadow='t',
	middle='m',
	botshadow='b',
	buttonbground=' '
	);

value selected_colors : color_table(
	topshadow='b',
	middle='m',
	botshadow='t',
	buttonbground=' '
	);

value
        play_icon: icon(color_table=cd_colors,
'        t                                                  ',
'        ttt                                                ',
'        ttttttt                                            ',
'        ttttttttttt                                        ',
'        tttmmmmtttttttt                                    ',
'        tttmmmmmmmmtttttttt                                ',
'        tttmmmmmmmmmmmmtttttttt                            ',
'        tttmmmmmmmmmmmmmmmmtttttttt                        ',
'        tttmmmmmmmmmmmmmmmmmmmmtttttttt                    ',
'        tttmmmmmmmmmmmmmmmmmmmmmmmmtttttttt                ',
'        tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmtttttttt            ',
'        tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmtttttttt        ',
'        tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbbbbbbb        ',
'        tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbbbbbbb            ',
'        tttmmmmmmmmmmmmmmmmmmmmmmmmbbbbbbbb                ',
'        tttmmmmmmmmmmmmmmmmmmmmbbbbbbbb                    ',
'        tttmmmmmmmmmmmmmmmmbbbbbbbb                        ',
'        tttmmmmmmmmmmmmbbbbbbbb                            ',
'        tttmmmmmmmmbbbbbbbb                                ',
'        tttmmmmbbbbbbbb                                    ',
'        tttbbbbbbbb                                        ',
'        ttbbbbb                                            ',
'        tbbb                                               ',
'        t                                                  ',
'                                                           '
);

value
        play_selected_icon: icon(color_table=selected_colors,
'        t                                                  ',
'        ttt                                                ',
'        ttttttt                                            ',
'        ttttttttttt                                        ',
'        tttmmmmtttttttt                                    ',
'        tttmmmmmmmmtttttttt                                ',
'        tttmmmmmmmmmmmmtttttttt                            ',
'        tttmmmmmmmmmmmmmmmmtttttttt                        ',
'        tttmmmmmmmmmmmmmmmmmmmmtttttttt                    ',
'        tttmmmmmmmmmmmmmmmmmmmmmmmmtttttttt                ',
'        tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmtttttttt            ',
'        tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmtttttttt        ',
'        tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbbbbbbb        ',
'        tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbbbbbbb            ',
'        tttmmmmmmmmmmmmmmmmmmmmmmmmbbbbbbbb                ',
'        tttmmmmmmmmmmmmmmmmmmmmbbbbbbbb                    ',
'        tttmmmmmmmmmmmmmmmmbbbbbbbb                        ',
'        tttmmmmmmmmmmmmbbbbbbbb                            ',
'        tttmmmmmmmmbbbbbbbb                                ',
'        tttmmmmbbbbbbbb                                    ',
'        tttbbbbbbbb                                        ',
'        ttbbbbb                                            ',
'        tbbb                                               ',
'        t                                                  ',
'                                                           '
);

value
        stop_icon: icon(color_table=cd_colors,
'                                                           ',
'                                                           ',
'            ttttttttttttttttttttttttttttttttttt            ',
'            ttttttttttttttttttttttttttttttttttb            ',
'            tttttttttttttttttttttttttttttttttbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            ttbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb            ',
'            tbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb            ',
'            bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb            ',
'                                                           ',
'                                                           '
);

value
        stop_selected_icon: icon(color_table=selected_colors,
'                                                           ',
'                                                           ',
'            ttttttttttttttttttttttttttttttttttt            ',
'            ttttttttttttttttttttttttttttttttttb            ',
'            tttttttttttttttttttttttttttttttttbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            tttmmmmmmmmmmmmmmmmmmmmmmmmmmmmmbbb            ',
'            ttbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb            ',
'            tbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb            ',
'            bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb            ',
'                                                           ',
'                                                           '
);

value
        pause_icon: icon(color_table=cd_colors,
'                                                           ',
'                                                           ',
'                 tttttttttb      tttttttttb                ',
'                 ttttttttbb      ttttttttbb                ',
'                 tttttttbbb      tttttttbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttbbbbbbb      tttbbbbbbb                ',
'                 ttbbbbbbbb      ttbbbbbbbb                ',
'                 tbbbbbbbbb      tbbbbbbbbb                ',
'                                                           ',
'                                                           '
);

value
        pause_selected_icon: icon(color_table=selected_colors,
'                                                           ',
'                                                           ',
'                 tttttttttb      tttttttttb                ',
'                 ttttttttbb      ttttttttbb                ',
'                 tttttttbbb      tttttttbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttmmmmbbb      tttmmmmbbb                ',
'                 tttbbbbbbb      tttbbbbbbb                ',
'                 ttbbbbbbbb      ttbbbbbbbb                ',
'                 tbbbbbbbbb      tbbbbbbbbb                ',
'                                                           ',
'                                                           '
);

value
        fast_icon: icon(color_table=cd_colors,
'                                                           ',
'                                                           ',
'          t                  t                             ',
'          ttt                ttt                           ',
'          ttttt              ttttt                         ',
'          ttttttt            ttttttt                       ',
'          tttmttttt          tttmttttt                     ',
'          tttmmtttttt        tttmmtttttt                   ',
'          tttmmmmtttttt      tttmmmmtttttt                 ',
'          tttmmmmmmtttttt    tttmmmmmmtttttt               ',
'          tttmmmmmmmmtttttt  tttmmmmmmmmtttttt             ',
'          tttmmmmmmmmmmtttttttttmmmmmmmmmmtttttt           ',
'          tttmmmmmmmmmmbbbbbbtttmmmmmmmmmmbbbbbb           ',
'          tttmmmmmmmmbbbbbb  tttmmmmmmmmbbbbbb             ',
'          tttmmmmmmbbbbbb    tttmmmmmmbbbbbb               ',
'          tttmmmmbbbbbb      tttmmmmbbbbbb                 ',
'          tttmmbbbbbb        tttmmbbbbbb                   ',
'          tttmbbbbb          tttmbbbbb                     ',
'          tttbbbb            tttbbbb                       ',
'          ttbbb              ttbbb                         ',
'          tbb                tbb                           ',
'          t                  t                             ',
'                                                           ',
'                                                           ',
'                                                           '
);

value
        fast_selected_icon: icon(color_table=selected_colors,
'                                                           ',
'                                                           ',
'          t                  t                             ',
'          ttt                ttt                           ',
'          ttttt              ttttt                         ',
'          ttttttt            ttttttt                       ',
'          tttmttttt          tttmttttt                     ',
'          tttmmtttttt        tttmmtttttt                   ',
'          tttmmmmtttttt      tttmmmmtttttt                 ',
'          tttmmmmmmtttttt    tttmmmmmmtttttt               ',
'          tttmmmmmmmmtttttt  tttmmmmmmmmtttttt             ',
'          tttmmmmmmmmmmtttttttttmmmmmmmmmmtttttt           ',
'          tttmmmmmmmmmmbbbbbbtttmmmmmmmmmmbbbbbb           ',
'          tttmmmmmmmmbbbbbb  tttmmmmmmmmbbbbbb             ',
'          tttmmmmmmbbbbbb    tttmmmmmmbbbbbb               ',
'          tttmmmmbbbbbb      tttmmmmbbbbbb                 ',
'          tttmmbbbbbb        tttmmbbbbbb                   ',
'          tttmbbbbb          tttmbbbbb                     ',
'          tttbbbb            tttbbbb                       ',
'          ttbbb              ttbbb                         ',
'          tbb                tbb                           ',
'          t                  t                             ',
'                                                           ',
'                                                           ',
'                                                           '
);

value
        rew_icon: icon(color_table=cd_colors,
'                                                           ',
'                                                           ',
'                            t                  t           ',
'                          ttb                ttb           ',
'                        tttbb              tttbb           ',
'                      ttttbbb            ttttbbb           ',
'                    tttttmbbb          tttttmbbb           ',
'                  ttttttmmbbb        ttttttmmbbb           ',
'                ttttttmmmmbbb      ttttttmmmmbbb           ',
'              ttttttmmmmmmbbb    ttttttmmmmmmbbb           ',
'            ttttttmmmmmmmmbbb  ttttttmmmmmmmmbbb           ',
'          ttttttmmmmmmmmmmbbbttttttmmmmmmmmmmbbb           ',
'          bbbbbbmmmmmmmmmmbbbbbbbbbmmmmmmmmmmbbb           ',
'            bbbbbbmmmmmmmmbbb  bbbbbbmmmmmmmmbbb           ',
'              bbbbbbmmmmmmbbb    bbbbbbmmmmmmbbb           ',
'                bbbbbbmmmmbbb      bbbbbbmmmmbbb           ',
'                  bbbbbbmmbbb        bbbbbbmmbbb           ',
'                    bbbbbbbbb          bbbbbbbbb           ',
'                      bbbbbbb            bbbbbbb           ',
'                        bbbbb              bbbbb           ',
'                          bbb                bbb           ',
'                            b                  b           ',
'                                                           ',
'                                                           ',
'                                                           '
);

value
        rew_selected_icon: icon(color_table=selected_colors,
'                                                           ',
'                                                           ',
'                            t                  t           ',
'                          ttb                ttb           ',
'                        tttbb              tttbb           ',
'                      ttttbbb            ttttbbb           ',
'                    tttttmbbb          tttttmbbb           ',
'                  ttttttmmbbb        ttttttmmbbb           ',
'                ttttttmmmmbbb      ttttttmmmmbbb           ',
'              ttttttmmmmmmbbb    ttttttmmmmmmbbb           ',
'            ttttttmmmmmmmmbbb  ttttttmmmmmmmmbbb           ',
'          ttttttmmmmmmmmmmbbbttttttmmmmmmmmmmbbb           ',
'          bbbbbbmmmmmmmmmmbbbbbbbbbmmmmmmmmmmbbb           ',
'            bbbbbbmmmmmmmmbbb  bbbbbbmmmmmmmmbbb           ',
'              bbbbbbmmmmmmbbb    bbbbbbmmmmmmbbb           ',
'                bbbbbbmmmmbbb      bbbbbbmmmmbbb           ',
'                  bbbbbbmmbbb        bbbbbbmmbbb           ',
'                    bbbbbbbbb          bbbbbbbbb           ',
'                      bbbbbbb            bbbbbbb           ',
'                        bbbbb              bbbbb           ',
'                          bbb                bbb           ',
'                            b                  b           ',
'                                                           ',
'                                                           ',
'                                                           '
);

object play_main : XmPanedWindow {
	controls {
		XmLabel	title_label;
		XmForm form;
	};
};

object title_label : XmLabel {
	arguments {
		XmNlabelString = title_label_text;
	};
};

object form : XmForm {
	controls {
		XmMenuBar menu_bar;
		XmRadioBox control_box;
		XmScale file_position;
	};
};

object menu_bar : XmMenuBar {
	arguments {
		XmNleftAttachment = XmATTACH_FORM;
		XmNrightAttachment = XmATTACH_FORM;
		XmNtopAttachment = XmATTACH_FORM;
	};
	controls {
		XmCascadeButton file_button;
	};
};

object file_button : XmCascadeButton {
	arguments {
		XmNlabelString = file_label_text;
	};
	controls {
		XmPulldownMenu file_menu;
	};
};

object file_menu : XmPulldownMenu {
	controls {
		XmPushButton open_button;
		XmPushButton quit_button;
	};
};

object open_button : XmPushButton {
	arguments {
		XmNlabelString = open_button_text;
	};
	callbacks {
		XmNactivateCallback = procedure FileMenuSelect(menu_open);
	};
};

object quit_button : XmPushButton {
	arguments {
		XmNlabelString = quit_button_text;
	};
	callbacks {
		XmNactivateCallback = procedure FileMenuSelect(menu_quit);
	};
};

object control_box : XmRadioBox {
	arguments {
		XmNleftAttachment = XmATTACH_FORM;
		XmNrightAttachment = XmATTACH_FORM;
		XmNtopAttachment = XmATTACH_WIDGET;
		XmNtopWidget = menu_bar;
		XmNorientation = XmHORIZONTAL;
	};
	controls {
		XmToggleButton rew_button;
		XmToggleButton stop_button;
		XmToggleButton play_button;
		XmToggleButton pause_button;
		XmToggleButton fast_button;
	};
};

object rew_button : XmToggleButton {
	arguments {
		XmNlabelType = XmPIXMAP;
		XmNlabelPixmap = rew_icon;
		XmNselectPixmap = rew_selected_icon;
		XmNindicatorOn = false;
		XmNhighlightThickness = 0;
	};
	callbacks {
		MrmNcreateCallback = procedure WidgetCreate(REW);
		XmNvalueChangedCallback = procedure ChangeState();
	};
};

object stop_button : XmToggleButton {
	arguments {
		XmNlabelType = XmPIXMAP;
		XmNlabelPixmap = stop_icon;
		XmNselectPixmap = stop_selected_icon;
		XmNindicatorOn = false;
		XmNhighlightThickness = 0;
	};
	callbacks {
		MrmNcreateCallback = procedure WidgetCreate(STOP);
		XmNvalueChangedCallback = procedure ChangeState();
	};
};

object play_button : XmToggleButton {
	arguments {
		XmNlabelType = XmPIXMAP;
		XmNlabelPixmap = play_icon;
		XmNselectPixmap = play_selected_icon;
		XmNindicatorOn = false;
		XmNhighlightThickness = 0;
	};
	callbacks {
		MrmNcreateCallback = procedure WidgetCreate(PLAY);
		XmNvalueChangedCallback = procedure ChangeState();
	};
};

object pause_button : XmToggleButton {
	arguments {
		XmNlabelType = XmPIXMAP;
		XmNlabelPixmap = pause_icon;
		XmNselectPixmap = pause_selected_icon;
		XmNindicatorOn = false;
		XmNhighlightThickness = 0;
	};
	callbacks {
		MrmNcreateCallback = procedure WidgetCreate(PAUSE);
		XmNvalueChangedCallback = procedure ChangeState();
	};
};

object fast_button : XmToggleButton {
	arguments {
		XmNlabelType = XmPIXMAP;
		XmNlabelPixmap = fast_icon;
		XmNselectPixmap = fast_selected_icon;
		XmNindicatorOn = false;
		XmNhighlightThickness = 0;
	};
	callbacks {
		MrmNcreateCallback = procedure WidgetCreate(FF);
		XmNvalueChangedCallback = procedure ChangeState();
	};
};

object file_position : XmScale {
	arguments {
		XmNleftAttachment = XmATTACH_FORM;
		XmNrightAttachment = XmATTACH_FORM;
		XmNtopAttachment = XmATTACH_WIDGET;
		XmNtopWidget = control_box;
		XmNorientation = XmHORIZONTAL;
		XmNtitleString = file_position_title;
		XmNhighlightThickness = 0;
	};
	callbacks {
		XmNdragCallback = procedure UpdateFilePos();
		MrmNcreateCallback = procedure WidgetCreate(wcr_scale);
	};
};

/* Popups */

object fs_box : XmFileSelectionDialog {
	callbacks {
		XmNcancelCallback = procedure CancelPrompt();
		XmNokCallback = procedure ProcessName();
	};
};

object open_error : XmErrorDialog {
	arguments {
		XmNmessageString = open_error_text;
	};
};

end module;

