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; }
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; }
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; }
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; }
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); }
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; }
void closeRequester(void){ struct Tracker_Windows *window=getWindowFromNum(-1);if(window==NULL) return; if(requester!=NULL){ GFX_CloseReq(window, requester); requester = NULL; } }
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(¬e->end, PlaceCreate(line,counter,dividor)); }
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); }
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); }
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); }
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 ); }
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); }
void playRangeFromCurrent(int windownum){ struct Tracker_Windows *window=getWindowFromNum(windownum); if(window==NULL) return; PlayRangeCurrPos(window); }
void playSongFromStart(void){ PlaySongFromStart(getWindowFromNum(-1)); }
void playBlockFromStart(int windownum){ struct Tracker_Windows *window=getWindowFromNum(windownum); if(window==NULL) return; PlayBlockFromStart(window,true); // true == do_loop }
void copyRange(int windownum){ struct Tracker_Windows *window=getWindowFromNum(windownum);if(window==NULL) return; CopyRange_CurrPos(window); }
void configVST(int windownum){ struct Tracker_Windows *window=getWindowFromNum(windownum);if(window==NULL) return; OS_VST_config(window); }
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); }
void setDefaultEditorFont(void){ struct Tracker_Windows *window=getWindowFromNum(-1);if(window==NULL) return; GFX_SetDefaultFont(window); }
void configFonts(int windownum){ struct Tracker_Windows *window=getWindowFromNum(windownum);if(window==NULL) return; GFX_ConfigFonts(window); }
void setDefaultColors2(void){ GFX_SetDefaultColors2(getWindowFromNum(-1)); }
void incNoteVolume(int incvolume,int windownum){ struct Tracker_Windows *window=getWindowFromNum(windownum); if(window==NULL) return; IncreaseVelocityCurrPos(window,incvolume); }
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); }
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); }
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(); }
void switchSoundScrollOnOff(int windownum){ struct Tracker_Windows *window=getWindowFromNum(windownum); if(window==NULL) return; window->playalong=window->playalong?false:true; }
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); }
void setDefaultSystemFont(void){ struct Tracker_Windows *window=getWindowFromNum(-1);if(window==NULL) return; //RWarning("Warning! (?)"); // warning window test GFX_SetDefaultSystemFont(window); }
void configBlock(int windownum){ struct Tracker_Windows *window=getWindowFromNum(windownum);if(window==NULL) return; Block_Properties_CurrPos(window); }