static float request_notenum(struct Tracker_Windows *window, const char *title, float old_notenum){ float notenum = -1; ReqType reqtype=GFX_OpenReq(window,30,12,"Set Pitch"); if (old_notenum>0.0f) GFX_SetString(reqtype, notetext_from_notenum(old_notenum)); char temp[1024]; sprintf(temp, "%s (for example: \"c4\" or \"c#5,50\") >", title); while(notenum <= 0.0f){ char *notetext = GFX_GetString( window, reqtype, temp ); if(notetext==NULL) break; notenum = notenum_from_notetext(notetext); } GFX_CloseReq(window,reqtype); printf("notenum: %f\n",notenum); return notenum; }
void Window_config( struct Tracker_Windows *window ){ ReqType reqtype=GFX_OpenReq(window,30,12,"Window Config"); vector_t v={0}; VECTOR_push_back(&v,"Left Slider width"); VECTOR_push_back(&v,"Bottom Slider height"); VECTOR_push_back(&v, "First Beat Line color opacity"); VECTOR_push_back(&v, "Beat Line color opacity"); VECTOR_push_back(&v, "Line separate color opacity"); //VECTOR_push_back(&v,"Minimum node-size"); int sel=GFX_Menu(window,reqtype,"Select operation",&v); switch(sel){ case -1: break; #if 0 case 0: SelectEditFont(window); break; #endif case 0: SelectLeftSliderWidth(window,reqtype); break; case 1: SelectBottomSliderHeight(window,reqtype); break; case 2: SetFirstBeatOpacity(window, reqtype); break; case 3: SetBeatOpacity(window, reqtype); break; case 4: SetLineOpacity(window, reqtype); break; #if 0 case 5: SelectMinNodeSize(window,reqtype); break; #endif } GFX_CloseReq(window,reqtype); if (sel != -1) Window_config(window); }
void Block_Properties_CurrPos( struct Tracker_Windows *window ){ NInt num_tracks; int num_lines; char seltext[500]; char *blockname; ReqType reqtype; struct WBlocks *wblock=window->wblock; struct Blocks *block=wblock->block; PlayStop(); reqtype=GFX_OpenReq(window,33,5,"Block Properties"); sprintf(seltext,"Number of tracks (now %d): ",wblock->block->num_tracks); num_tracks=GFX_GetInteger(window,reqtype,seltext,2,200); if(num_tracks==1) num_tracks=wblock->block->num_tracks; sprintf(seltext,"Number of lines (now %d): ",wblock->block->num_lines); num_lines=GFX_GetInteger(window,reqtype,seltext,2,2000); if(num_lines==1) num_lines=wblock->block->num_lines; sprintf(seltext,"Name (now: '%s'): ",wblock->block->name); blockname=GFX_GetString(window,reqtype,seltext); if(blockname!=NULL){ wblock->block->name=blockname; BS_UpdateBlockList(); BS_UpdatePlayList(); } GFX_CloseReq(window,reqtype); if(num_tracks==wblock->block->num_tracks && num_lines==wblock->block->num_lines){ return; } Undo_Block_CurrPos(window); Block_Properties(block,num_tracks,num_lines); window=root->song->tracker_windows; while(window!=NULL){ window->must_redraw = true; window=NextWindow(window); } }
void Window_config( struct Tracker_Windows *window ){ ReqType reqtype=GFX_OpenReq(window,30,12,"Select which variable to modify:"); vector_t v={}; int leftsliderwidth = VECTOR_push_back(&v,"Left Slider width"); int bottomsliderheight = VECTOR_push_back(&v,"Bottom Slider height"); int firstbeat = VECTOR_push_back(&v, "First Beat Line color opacity"); int beatlineopacity = VECTOR_push_back(&v, "Beat Line color opacity"); int linecoloropacity = VECTOR_push_back(&v, "Line separate color opacity"); //VECTOR_push_back(&v,"Minimum node-size"); int sel=GFX_Menu(window,reqtype,"",v,true); #if 0 // case 0: SelectEditFont(window); break; #endif if (sel==leftsliderwidth) SelectLeftSliderWidth(window,reqtype); else if (sel==bottomsliderheight) SelectBottomSliderHeight(window,reqtype); else if (sel==firstbeat) SetFirstBeatOpacity(window, reqtype); else if (sel==beatlineopacity) SetBeatOpacity(window, reqtype); else if (sel==linecoloropacity) SetLineOpacity(window, reqtype); #if 0 else if (sel==selminnodesize) SelectMinNodeSize(window,reqtype); #endif GFX_CloseReq(window,reqtype); if (sel != -1) Window_config(window); }
void openRequester(char *text, int width, int height){ struct Tracker_Windows *window=getWindowFromNum(-1);if(window==NULL) return; requester = GFX_OpenReq(window,width,height,text); }