Exemple #1
0
void pasteTrack(int tracknum, int blocknum, int windownum){
  if (tracknum==-1 && blocknum==-1){
    struct Tracker_Windows *window=getWindowFromNum(windownum);if(window==NULL) return;
    CB_PasteTrack_CurrPos(window);
    return;
  }

  struct Tracker_Windows *window=NULL;
  struct WTracks *wtrack;
  struct WBlocks *wblock;

  wtrack=getWTrackFromNumA(
	windownum,
	&window,
	blocknum,
	&wblock,
	tracknum
	);

  if(wtrack==NULL) return;

  if (cb_wtrack != NULL) {
    Undo_Open_rec();{
      ADD_UNDO(Track(window, wblock, wtrack, wblock->curr_realline));
      co_CB_PasteTrack(wblock, cb_wtrack, wtrack);
    }Undo_Close();
  }
    
  window->must_redraw = true;
}
Exemple #2
0
char* requestString(char *text){
  struct Tracker_Windows *window=getWindowFromNum(-1);if(window==NULL) return "";
  char *ret = GFX_GetString(window, requester, text);
  if(ret==NULL)
    ret="";
  return ret;
}
Exemple #3
0
void copyTrack(int tracknum, int blocknum, int windownum){
  struct Tracker_Windows *window=getWindowFromNum(windownum);if(window==NULL) return;
  
  if (tracknum==-1 && blocknum==-1){
    
    CB_CopyTrack_CurrPos(window);
    
  } else {
    
    struct Tracker_Windows *window=NULL;
    struct WTracks *wtrack;
    struct WBlocks *wblock;
    
    wtrack=getWTrackFromNumA(
                             windownum,
                             &window,
                             blocknum,
                             &wblock,
                             tracknum
                             );
    
    if(wtrack==NULL) return;
    
    cb_wtrack = CB_CopyTrack(wblock, wtrack);
    
  }
  
  window->must_redraw = true;
}
Exemple #4
0
char* requestMidiPort(void){
  struct Tracker_Windows *window=getWindowFromNum(-1);if(window==NULL) return "";
  char *ret = MIDIrequestPortName(window, requester, false);
  if(ret==NULL)
    ret="";
  return ret;
}
Exemple #5
0
const char *getSaveFilename(char *text, char *filetypes, char *dir){
  struct Tracker_Windows *window=getWindowFromNum(-1);if(window==NULL) return "";
  const wchar_t *ret = GFX_GetSaveFileName(window, NULL, text, STRING_create(dir), filetypes);
  if(ret==NULL)
    return "";
  else
    return STRING_get_chars(ret);
}
Exemple #6
0
void switchEditOnOff(void){
	struct Tracker_Windows *window=getWindowFromNum(-1);
	ATOMIC_SET(root->editonoff, ATOMIC_GET(root->editonoff)?false:true);
        char temp[1000];
        sprintf(temp,"Edit %s",ATOMIC_GET(root->editonoff)?"On":"Off");
        GFX_SetStatusBar(temp);
        window->must_redraw=true;
}
Exemple #7
0
void closeRequester(void){
  struct Tracker_Windows *window=getWindowFromNum(-1);if(window==NULL) return;

  if(requester!=NULL){
    GFX_CloseReq(window, requester);
    requester = NULL;
  }
}
Exemple #8
0
void setNoteEndPlace(int line,int counter,int dividor,int windownum,int blocknum,int tracknum,int notenum){
  struct Tracker_Windows *window=getWindowFromNum(windownum);
  struct Notes *note=getNoteFromNum(windownum,blocknum,tracknum,notenum);

  if(window==NULL) return;
  if(note==NULL) return;

  PlaceCopy(&note->end, PlaceCreate(line,counter,dividor));
}
Exemple #9
0
void keyUpPlay(int notenum,int windownum){
	struct Tracker_Windows *window=getWindowFromNum(windownum);

	notenum+=root->keyoct;

	if(notenum<=0 || notenum>127) return;
	if(window==NULL || window->curr_track<0) return;
        
        PATCH_stopNoteCurrPos(window,notenum,-1);
}
Exemple #10
0
void keyUpPlay(int notenum,int windownum){
  //printf("UP: doautorepeat: %d, autorepeat: %d\n", doAutoRepeat(), AutoRepeat(tevent.keyswitch));
	struct Tracker_Windows *window=getWindowFromNum(windownum);

	notenum+=root->keyoct;

	if(notenum<=0 || notenum>127) return;
	if(window==NULL || window->curr_track<0) return;
        
        PATCH_stopNoteCurrPos(window,notenum,-1);
}
Exemple #11
0
void polyKeyDownPlay(int notenum,int windownum){
	struct Tracker_Windows *window=getWindowFromNum(windownum);

	notenum+=root->keyoct;

	if(notenum<=0 || notenum>127) return;
	if(window==NULL || window->curr_track<0) return;

	PATCH_playNoteCurrPos(window,notenum,-1);
        if(ATOMIC_GET(root->editonoff))
          InsertNoteCurrPos(window,notenum,true,-1);
}
Exemple #12
0
void putNoteNote(int notenote,int windownum,int blocknum,int tracknum,int notenum){
  struct Tracker_Windows *window=getWindowFromNum(windownum);
  struct Notes *note=getNoteFromNum(windownum,blocknum,tracknum,notenum);

  if(window==NULL) return;
  if(note==NULL) return;

  note->note=notenote;

  UpdateAndClearSomeTrackReallinesAndGfxWTracks(
						window,
						window->wblock,
						0,
						window->wblock->block->num_tracks-1
						);
}
Exemple #13
0
void polyKeyDownPlay(int notenum,int windownum){
  //printf("POLY: doautorepeat: %d, autorepeat: %d\n", doAutoRepeat(), AutoRepeat(tevent.keyswitch));

        if (!doAutoRepeat() && tevent_autorepeat)
          return;

	struct Tracker_Windows *window=getWindowFromNum(windownum);

	notenum+=root->keyoct;

	if(notenum<=0 || notenum>127) return;
	if(window==NULL || window->curr_track<0) return;

	PATCH_playNoteCurrPos(window,notenum,-1);
        if(ATOMIC_GET(root->editonoff))
          InsertNoteCurrPos(window,notenum,true,-1);
}
Exemple #14
0
void playRangeFromCurrent(int windownum){
  struct Tracker_Windows *window=getWindowFromNum(windownum);
  if(window==NULL) return;

  PlayRangeCurrPos(window);
}
Exemple #15
0
void playSongFromStart(void){
 PlaySongFromStart(getWindowFromNum(-1));
}
Exemple #16
0
void playBlockFromStart(int windownum){
  struct Tracker_Windows *window=getWindowFromNum(windownum);
  if(window==NULL) return;

  PlayBlockFromStart(window,true); // true == do_loop
}
Exemple #17
0
void copyRange(int windownum){
  struct Tracker_Windows *window=getWindowFromNum(windownum);if(window==NULL) return;
  CopyRange_CurrPos(window);
}
Exemple #18
0
void configVST(int windownum){
  struct Tracker_Windows *window=getWindowFromNum(windownum);if(window==NULL) return;
  OS_VST_config(window);
}
Exemple #19
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);
}
Exemple #20
0
void setDefaultEditorFont(void){
  struct Tracker_Windows *window=getWindowFromNum(-1);if(window==NULL) return;
  GFX_SetDefaultFont(window);
}
Exemple #21
0
void configFonts(int windownum){
  struct Tracker_Windows *window=getWindowFromNum(windownum);if(window==NULL) return;
  GFX_ConfigFonts(window);
}
Exemple #22
0
void setDefaultColors2(void){
  GFX_SetDefaultColors2(getWindowFromNum(-1));
}
Exemple #23
0
void incNoteVolume(int incvolume,int windownum){
	struct Tracker_Windows *window=getWindowFromNum(windownum);
	if(window==NULL) return;

	IncreaseVelocityCurrPos(window,incvolume);
}
Exemple #24
0
int popupMenu2(const char *texts, func_t* callback){
  struct Tracker_Windows *window=getWindowFromNum(-1);
  vector_t *vec = GFX_MenuParser(texts, "%");
  return GFX_Menu2(window, NULL,"",vec, callback);
}
Exemple #25
0
float requestFloat(char *text, float min, float max){
  struct Tracker_Windows *window=getWindowFromNum(-1);if(window==NULL) return min-1.0f;
  return GFX_GetFloat(window, requester, text, min, max);
}
Exemple #26
0
void loadBlock(const char *filename_c){
  struct Tracker_Windows *window=getWindowFromNum(-1);if(window==NULL) return;
    
  bool success = false;
  bool have_made_undo = false;
  
  if (filename_c==NULL || !strcmp(filename_c, ""))
    filename_c = "/tmp/block.block";

  const wchar_t *filename = STRING_create(filename_c);
  
  int num_blocks = root->song->num_blocks;
    
  if (Load_Initialize(filename, "RADIUM BLOCK")==false) {
    goto exit;
    return;
  }
        
  if(strcmp(dc.ls,"WBLOCK")){
    handleError("Loading failed.\nExpected \"WBLOCK\", but found instead: '%s'.\nFile: '%s'\n",dc.ls,STRING_get_chars(filename));
    DISK_close_and_delete(dc.file);
    goto exit;
    return;
  }

  struct WBlocks *wblock = LoadWBlock();
  wblock->l.num = num_blocks;

  DC_Next();
  if(strcmp(dc.ls,"BLOCK")){
    handleError("Loading failed.\nExpected \"BLOCK\", but found instead: '%s'.\nFile: '%s'\n",dc.ls,STRING_get_chars(filename));
    DISK_close_and_delete(dc.file);
    goto exit;
  }

  struct Blocks *block = LoadBlock();
  block->l.num = num_blocks;
  
  DISK_close_and_delete(dc.file);

  if(!dc.success){
    handleError("Loading failed.\n");
    goto exit;
  }
  
  printf("Got it: %p / %p\n",wblock,block);


  ADD_UNDO(Block_Insert(num_blocks));
  have_made_undo = true;

  /*
  DC_ListAdd1(&root->song->blocks,block);
  DC_ListAdd1(&root->song->tracker_windows->wblocks, wblock);
  */

  wblock->block = block;
  window->curr_track = 0;

  DLoadBlocks(root, block);
  DLoadWBlocks(window, window, wblock);  

  CB_PasteBlock(window, wblock, window->wblock);

  success = true;
  
 exit:
  if (success==false)
    if (have_made_undo)
      Undo_CancelLastUndo();
}
Exemple #27
0
void switchSoundScrollOnOff(int windownum){
	struct Tracker_Windows *window=getWindowFromNum(windownum);
	if(window==NULL) return;

	window->playalong=window->playalong?false:true;
}
Exemple #28
0
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);
}
Exemple #29
0
void setDefaultSystemFont(void){
  struct Tracker_Windows *window=getWindowFromNum(-1);if(window==NULL) return;
  //RWarning("Warning! (?)"); // warning window test
  GFX_SetDefaultSystemFont(window);
}
Exemple #30
0
void configBlock(int windownum){
  struct Tracker_Windows *window=getWindowFromNum(windownum);if(window==NULL) return;
  Block_Properties_CurrPos(window);
}