static void make_backup(void){ if (Undo_num_undos() == 0) return; if (dc.filename==NULL) return; if (!editor_has_keyboard_focus()) // If showing popup menu, editing text widgets, etc. we don't want to disturb the user. return; if (g_undo_generation_for_last_backup == g_curr_undo_generation) return; // Set this immediately so we don't start several BackupTimers. g_undo_generation_for_last_backup = g_curr_undo_generation; root->song->tracker_windows->message = "Please wait. Saving backup"; GL_create(root->song->tracker_windows, root->song->tracker_windows->wblock); wchar_t *backup_filename = get_backup_filename(); Save_Backup(backup_filename, root); root->song->tracker_windows->message = NULL; GL_create(root->song->tracker_windows, root->song->tracker_windows->wblock); //printf(" BACKUP finished\n"); }
static void make_backup(void){ RETURN_IF_DATA_IS_INACCESSIBLE_SAFE2(); if (Undo_num_undos() == 0) return; if (dc.filename==NULL) return; if (g_undo_generation_for_last_backup == g_curr_undo_generation) return; // Set this immediately so we don't start several BackupTimers. g_undo_generation_for_last_backup = g_curr_undo_generation; root->song->tracker_windows->message = "Please wait. Saving backup"; GL_create(root->song->tracker_windows); wchar_t *backup_filename = get_backup_filename(); Save_Backup(backup_filename, root); root->song->tracker_windows->message = NULL; GL_create(root->song->tracker_windows); //printf(" BACKUP finished\n"); }
// Simpler version when using opengl void P2MUpdateSongPosCallBack(void){ bool setfirstpos=ATOMIC_GET(root->setfirstpos); NInt curr_block_num = ATOMIC_GET(root->curr_blocknum); struct Tracker_Windows *window=root->song->tracker_windows; struct WBlocks *wblock = ListFindElement1(&window->wblocks->l,curr_block_num); int old_curr_realline = wblock->curr_realline; int till_curr_realline = R_BOUNDARIES(0, ATOMIC_GET(wblock->till_curr_realline), wblock->num_reallines-1); // till_curr_realline can be set from any thread, at any time, to any value. if (!ATOMIC_GET(root->play_cursor_onoff)){ //printf("P2MUpdateSongPosCallBack: Setting to %d\n",till_curr_realline); wblock->curr_realline = till_curr_realline; wblock->top_realline += till_curr_realline - old_curr_realline; wblock->bot_realline += till_curr_realline - old_curr_realline; } if(pc->playtype==PLAYSONG) BS_SelectPlaylistPos(ATOMIC_GET2(root->curr_playlist)); if(window->curr_block!=curr_block_num){ //printf("Bef. w: %d, r: %d\n",window->curr_block,root->curr_block); if(setfirstpos){ wblock->curr_realline=0; SetWBlock_Top_And_Bot_Realline(window,wblock); GE_set_curr_realline(0); } SelectWBlock( window, wblock ); //printf("Aft. w: %d, r: %d\n",window->curr_block,root->curr_block); } // make sure "Rec" is updated { static struct Tracks *current_track = NULL; static bool current_track_recording = false; struct Tracks *track = wblock->wtrack->track; if (track != current_track || (current_track!=NULL && track->is_recording != current_track_recording)){ current_track = track; current_track_recording = current_track->is_recording; GL_create(window, wblock); } } //GE_set_curr_realline(wblock->curr_realline); // printf("till_curr_realline: %d\n",wblock->till_curr_realline); //ScrollEditorToRealLine(window,wblock,wblock->curr_realline); }
void EditorWidget::updateEditor(){ if(ATOMIC_GET(is_starting_up)==true) return; { struct Patch *patch = ATOMIC_GET(atomic_must_redraw_instrument); if (patch!=NULL){ ATOMIC_SET(atomic_must_redraw_instrument, NULL); GFX_update_instrument_widget(patch);//GFX_update_instrument_patch_gui(patch); } } transfer_atomic_must_redraws(window); #if 0 //!defined(RELEASE) { int queue_size = GFX_get_op_queue_size(this->window); if (queue_size > 0 || this->window->must_calculate_coordinates==true || this->window->must_redraw==true || this->window->must_redraw_editor) printf("..Updating. Queue: %d. Update coordinates: %d. Redraw editor: %d. Redraw: %d\n", queue_size, this->window->must_calculate_coordinates, this->window->must_redraw_editor, this->window->must_redraw ); } #endif if (GFX_get_op_queue_size(this->window)>0) this->window->must_redraw = true; if (this->window->must_calculate_coordinates==true){ this->window->must_redraw = true; this->window->must_calculate_coordinates=false; } if (this->window->must_redraw) { UpdateTrackerWindowCoordinates(window); UpdateWBlockCoordinates(this->window, this->window->wblock); GFX_UpdateUpperLeft(window, window->wblock); UpdateAllPianoRollHeaders(window, window->wblock); SEQUENCER_update(); update(); this->window->must_redraw_editor=true; this->window->must_redraw=false; } if (this->window->must_redraw_editor==true){ GL_create(this->window, this->window->wblock); if (!is_playing()) SEQUENCER_update(); this->window->must_redraw_editor=false; } }