示例#1
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);
}
示例#2
0
void Block_Properties(
	struct Blocks *block,
	NInt num_tracks,
	int num_lines
){
	if(num_tracks!=block->num_tracks){
		struct Tracker_Windows *window=root->song->tracker_windows;
		while(window!=NULL){
			struct WBlocks *wblock=(struct WBlocks *)ListFindElement1(&window->wblocks->l,block->l.num);
			SetCursorPosConcrete(window,wblock,0,-1);
			window=NextWindow(window);
		}
		Block_Set_num_tracks(block,num_tracks);
	}

	if(num_lines!=block->num_lines){
		Block_Set_num_lines(block,num_lines);
	}

	struct Tracker_Windows *window=root->song->tracker_windows;
	while(window!=NULL){
		struct WBlocks *wblock=ListFindElement1(&window->wblocks->l,block->l.num);
		if(wblock->curr_realline>=wblock->num_reallines){
			wblock->curr_realline = wblock->num_reallines-1;
		}

		UpdateReallinesDependens(window,wblock);
		window=NextWindow(window);
	}
}
示例#3
0
void DLoadLocalZooms(
                     const struct Root *newroot,
                     struct Tracker_Windows *window,
                     struct WBlocks *wblock
){
	UpdateRealLines(window,wblock);
	UpdateReallinesDependens(window,wblock);

        //SetZoomLevelAreaWidth(window,wblock);
}
示例#4
0
void SelectEditFont(
	struct Tracker_Windows *window
){
	struct WBlocks *wblock=window->wblock;

        char *font = GFX_SelectEditFont(window);
	if(font==NULL)
          return;

	window->leftslider.width=window->fontwidth;

	UpdateAllWBlockWidths(window);

	UpdateReallinesDependens(window,wblock);

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

        printf("font: -%s-\n",font);
        // Saved last in case the font crashes radium
        SETTINGS_write_string("font",font);
}
示例#5
0
static void handleDirtyBlock(int blocknum){
  struct Tracker_Windows *window = root->song->tracker_windows;

  while(window!=NULL){
    struct WBlocks *wblock=ListFindElement1(&window->wblocks->l,blocknum);

    UpdateAllWTracksCoordinates(window,wblock);
    UpdateAndClearSomeTrackReallinesAndGfxWTracks(
                                                  window,
                                                  wblock,
                                                  0,
                                                  window->wblock->block->num_tracks-1
                                                  );


    if(wblock->curr_realline>=wblock->num_reallines){
      wblock->curr_realline=wblock->num_reallines-1;
    }

    UpdateReallinesDependens(window,wblock);
    window=NextWindow(window);
  }
}
示例#6
0
文件: lines.c 项目: onukore/radium
/* Argh. This one was difficult, I don`t think it works correctly
   in all situations yet either.
*/
void InsertLines(
	struct Blocks *block,
	int line,
	int toinsert
){
	int lokke;
	struct LocalZooms *localzoom;
	struct Tracker_Windows *window=root->song->tracker_windows;
	struct WBlocks *wblock;
	struct Tracks *track=block->tracks;

	int num_lines=block->num_lines;

	if(line>num_lines+toinsert){
		toinsert=line-num_lines;
	}

        if (line==num_lines-1) { // special case
          Block_Properties(block, block->num_tracks, block->num_lines + toinsert);
          return;
        }
        
	if( line<0 || line>=num_lines) return;

	if(toinsert==0 || num_lines+toinsert<2 || num_lines+toinsert>=MAX_UINT32) return;

        
        PC_Pause();{
        
          blocktobelongtoforinsertlines_notes_a_terrible_hack=block;
          
          block->num_lines=num_lines+toinsert;
          
          List_InsertLines3(&block->temponodes,block->temponodes->l.next,line,toinsert,NULL);
          LegalizeTempoNodes(block);
          List_InsertLines3(&block->signatures,&block->signatures->l,line,toinsert,NULL);
          List_InsertLines3(&block->lpbs,&block->lpbs->l,line,toinsert,NULL);
          List_InsertLines3(&block->tempos,&block->tempos->l,line,toinsert,NULL);
          
          UpdateSTimes(block);
          UpdateBeats(block);

          while(track!=NULL){
            List_InsertLines3(&track->notes,&track->notes->l,line,toinsert,InsertLines_notes);
            LegalizeNotes(block,track);
            List_InsertLines3(&track->stops,&track->stops->l,line,toinsert,NULL);
            VECTOR_FOR_EACH(struct FXs *fxs, &track->fxs){
              List_InsertLines3(&fxs->fxnodelines,&fxs->fxnodelines->l,line,toinsert,NULL);
            }END_VECTOR_FOR_EACH;
            LegalizeFXlines(block,track);
            track=NextTrack(track);
          }

          while(window!=NULL){
            wblock=ListFindElement1(&window->wblocks->l,block->l.num);
            List_InsertLines3(
                              &wblock->localzooms,
                              &wblock->localzooms->l,
                              line,
                              toinsert,
                              InsertLines_localzooms
                              //			NULL
                              );
            for(lokke=line;lokke<line+toinsert;lokke++){
              localzoom=talloc(sizeof(struct LocalZooms));
              localzoom->Tline=lokke;
              localzoom->Tdividor=1;
              localzoom->zoomline=lokke;
              ListAddElement3(&wblock->localzooms,&localzoom->l);
            }
            UpdateWBlockWidths(window,wblock);
            wblock->reallines = NULL; // We changed the localzooms, which is used to set new curr_realline. We don't need to set new curr_realline, so just set reallines to NULL.
            UpdateRealLines(window,wblock);
            UpdateReallinesDependens(window,wblock);
            if(wblock->curr_realline>=wblock->num_reallines){
              wblock->curr_realline=wblock->num_reallines-1;
            }
            window=NextWindow(window);
          }
          
          blocktobelongtoforinsertlines_notes_a_terrible_hack=NULL;

        }PC_StopPause(window);
}
void CB_PasteBlock(
	struct Tracker_Windows *window,
	struct WBlocks *wblock,
	struct WBlocks *towblock
){

  R_ASSERT(is_playing()==false);
  
	struct Blocks *block=wblock->block;
	struct Blocks *toblock=towblock->block;
	struct WTracks *towtrack=towblock->wtracks;
	struct WTracks *towtrack_wtrack=towblock->wtrack;
	struct Tracks *totrack=toblock->tracks;
	struct WTracks *wtrack;

	NInt wblocknum=towblock->l.num;
	struct ListHeader1 *nextwblock=towblock->l.next;

	NInt blocknum=toblock->l.num;
	struct ListHeader1 *nextblock=toblock->l.next;

        unsigned int org_color = toblock->color;
          
	NInt org_num_tracks=toblock->num_tracks;

	memcpy(towblock,wblock,sizeof(struct WBlocks));
	memcpy(toblock,block,sizeof(struct Blocks));

        toblock->color = org_color; // Don't want to paste color.
        
	towblock->l.next=nextwblock;
	towblock->l.num=wblocknum;

	towblock->block=toblock;
	towblock->wtracks=towtrack;
	towblock->wtrack=towtrack_wtrack;
	toblock->tracks=totrack;

	toblock->l.next=nextblock;
	toblock->l.num=blocknum;

        //printf("org num_tracks: %d, before: %d\n",org_num_tracks,toblock->num_tracks);

	toblock->num_tracks=org_num_tracks;

	Block_Set_num_tracks(toblock,block->num_tracks);
        TIME_everything_in_block_has_changed(towblock->block); // UpdateReallines requires updated time values (for whether to show swing type track or not).
        
	toblock->name=block->name;
        
	towblock->localzooms=NULL;
	CB_UnpackLocalZooms(&towblock->localzooms,wblock->localzooms,block->num_lines);
	//towblock->reallines=NULL;
        
	UpdateRealLines_dont_change_curr_realline(window, towblock);

	//towblock->wtempos=NULL;
	//towblock->wlpbs=NULL;

        toblock->swings=CB_CopySwings(block->swings, NULL);
        toblock->signatures=CB_CopySignatures(block->signatures);
	toblock->lpbs=CB_CopyLPBs(block->lpbs);

	toblock->tempos=CB_CopyTempos(block->tempos);
	toblock->temponodes=CB_CopyTempoNodes(block->temponodes);
	toblock->lasttemponode=(struct TempoNodes *)ListLast3(&toblock->temponodes->l);

	UpdateReallinesDependens(window,towblock);

	wtrack=wblock->wtracks;
	towtrack=towblock->wtracks;
	while(wtrack!=NULL){
		if(towtrack==NULL){
			RError("Error in funtion CB_PasteBlock in file clipboard_block_paste.c; towtrack=NULL\n");
			break;
		}
		if(towtrack->l.num!=wtrack->l.num){
			RError("Error in funtion CB_PasteBlock in file clipboard_block_paste.c; towtrack->l.num!=wtrack->l.num\n");
			break;
		}

		co_CB_PasteTrack(towblock,wtrack,towtrack);
		towtrack=NextWTrack(towtrack);
		wtrack=NextWTrack(wtrack);
	}

	if(towtrack!=NULL){
		RError("Error in funtion CB_PasteBlock in file clipboard_block_paste.c; towtrack!=NULL when wtrack==NULL\n");
	}

        g_editor_blocks_generation++;
	BS_UpdateBlockList();
	BS_UpdatePlayList();
}