Example #1
0
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);
	}

}
Example #2
0
static void SelectBottomSliderHeight(
	struct Tracker_Windows *window,
	ReqType reqtype
){
	char temp[100];
	int newwidth;

	sprintf(temp,"New Height (Now: %d. Use 0 to set automatic value) >",window->bottomslider_height);

	newwidth=GFX_GetInteger(
		window,
		reqtype,
		temp,
		0,
		window->height-(window->wblock->t.y1+(window->fontheight*6)),
                true
	);
	if(newwidth<0) return;

        GFX_set_bottom_widget_height(newwidth < 2 ? g_default_slider_height - 2 : newwidth);
        
	UpdateAllWBlockCoordinates(window);

        window->blt.clear_do=false;
	window->must_redraw = true;

        SETTINGS_write_int("bottom_slider_height",newwidth);
}
Example #3
0
static void SelectLeftSliderWidth(
	struct Tracker_Windows *window,
	ReqType reqtype
){
	char temp[100];
	int newwidth;

	sprintf(temp,"New Width (now %d) >",window->leftslider.width);

	newwidth=GFX_GetInteger(
		window,
		reqtype,
		temp,
		4,
		window->wblock->temponodearea.x2,
                true
                                );
	if(newwidth<4) return;

	window->leftslider.width=newwidth;

	UpdateAllWBlockCoordinates(window);

        window->blt.clear_do=false;
	window->must_redraw = true;

        SETTINGS_write_int("left_slider_width",newwidth);
}
Example #4
0
void SelectMinNodeSize(
	struct Tracker_Windows *window,
	ReqType reqtype
){
	struct WBlocks *wblock=window->wblock;

	char temp[100];
	int newwidth;

	sprintf(temp,"New Size (now %d) >",window->minnodesize);

	newwidth=GFX_GetInteger(
		window,
		reqtype,
		temp,
		1,
		40,
                true
	);
	if(newwidth<1) return;

	window->minnodesize=newwidth;

	UpdateReallinesDependens(window,wblock);

	window->must_redraw = true;

        SETTINGS_write_int("minimum_node_size",newwidth);
}
Example #5
0
static void SetLineOpacity(
	struct Tracker_Windows *window,
	ReqType reqtype
){
	char temp[1000];
	int new_opacity;

	sprintf(temp,"New Line Opacity (0-1000) (now %d) >",line_opacity);

        new_opacity = GFX_GetInteger(
		window,
		reqtype,
		temp,
		0,
		1000,
                true
	);
	if(new_opacity<0 || new_opacity>1000)
          return;

        line_opacity = new_opacity;
        SETTINGS_write_int("line_opacity", new_opacity);

        window->must_redraw = true;
}
Example #6
0
static void SetFirstBeatOpacity(
	struct Tracker_Windows *window,
	ReqType reqtype
){
	char temp[1000];
	int new_opacity;

	sprintf(temp,"New First Beat Opacity (0-1000) (now %d) >",first_beat_opacity);

        new_opacity = GFX_GetInteger(
		window,
		reqtype,
		temp,
		0,
		1000,
                true
	);
	if(new_opacity<0 || new_opacity>1000)
          return;

        first_beat_opacity = new_opacity;

        window->wblock->block->is_dirty = true;

        SETTINGS_write_int("first_beat_opacity", new_opacity);
}
Example #7
0
void SelectBottomSliderHeight(
	struct Tracker_Windows *window,
	ReqType reqtype
){
	char temp[100];
	int newwidth;

	sprintf(temp,"New Height (now %d) >",window->bottomslider.width);

	newwidth=GFX_GetInteger(
		window,
		reqtype,
		temp,
		2,
		window->height-(window->wblock->t.y1+(window->fontheight*6))
	);
	if(newwidth<2) return;

	window->bottomslider.width=newwidth;

	UpdateAllWBlockCoordinates(window);

        window->blt.clear_do=false;
	window->must_redraw = true;

        SETTINGS_write_int("bottom_slider_height",newwidth);
}
Example #8
0
int MIDIgetPatch(
	struct Tracker_Windows *window,
	ReqType reqtype,
	const struct Tracks *track,
	struct Patch *patch
){
        MIDI_InitPatch(patch);

	struct MidiPort *midi_port = MIDIgetPort(window,reqtype,NULL);

	struct PatchData *patchdata=getPatchData(patch);
        patchdata->midi_port = midi_port;

        patchdata->channel=GFX_GetInteger(window,reqtype,"Channel: (1-16) ",1,16);
        if(patchdata->channel>0)
          patchdata->channel--;

	patchdata->preset=GFX_GetInteger(window,reqtype,"Preset: (1-128) ",1,128);
        patchdata->preset--;

	return PATCH_SUCCESS;
}
Example #9
0
void InsertLines_CurrPos(
                         struct Tracker_Windows *window,
                         int toinsert
){
	struct WBlocks *wblock=window->wblock;
	int curr_realline=wblock->curr_realline;
	int curr_line=wblock->reallines[curr_realline]->Tline;
	int num_lines=wblock->block->num_lines;

        if(toinsert==0)
	  toinsert=GFX_GetInteger(window,NULL,"Number of lines to insert\n(number can be negative): ",-(num_lines-curr_line),10000);

	if(toinsert==-(num_lines-curr_line)-1) return;

	ADD_UNDO(Block_CurrPos(window));

	InsertLines(window->wblock->block,curr_line,toinsert);

	window=root->song->tracker_windows;
	while(window!=NULL){
		window->must_redraw = true;
		window=NextWindow(window);
	}
}
Example #10
0
int requestInteger(char *text, int min, int max){
  struct Tracker_Windows *window=getWindowFromNum(-1);if(window==NULL) return min-1;
  return GFX_GetInteger(window, requester, text, min, max);
}