void PIANOROLLHEADER_show(const struct WBlocks *wblock, void *pianorollheader, int x, int y, int x2, int y2){ Pianorollheader *widget=static_cast<Pianorollheader*>(pianorollheader); //if (widget->parent()==NULL) // widget->setParent(g_editor); GL_lock();{ widget->move(x,y); widget->resize(x2-x, y2-y); if (x < wblock->t.x1){ int x1 = wblock->t.x1 - x; int w = x2-x1; widget->setMask(QRegion(x1, 0, w, widget->height())); }else widget->clearMask(); //widget->move(0,widget->tracknum*20); //widget->resize(100,100); //printf("A: x: %d, y: %d, width: %d, height: %d. Visible: %d\n", widget->pos().x(), widget->pos().y(), widget->size().width(), widget->size().height(),widget->isVisible()); if (g_is_starting_up==false) widget->updateWidgets(); widget->show(); //widget->raise(); //widget->update(); } GL_unlock(); //printf("B: x: %d, y: %d, width: %d, height: %d. Visible: %d\n", widget->pos().x(), widget->pos().y(), widget->size().width(), widget->size().height(),widget->isVisible()); }
void GFX_InstrumentWindowToFront(void){ g_instruments_widget->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum); // might not be needed set_widget_height(120); if (!instrumentWidgetIsInMixer()){ //EditorWidget *editor = static_cast<EditorWidget*>(root->song->tracker_windows->os_visual.widget); //g_instruments_widget->setParent(editor->ysplitter); //editor->ysplitter->handle(2)->setEnabled(false); //editor->ysplitter->setStretchFactor(2,0); API_showInstrumentGui(); GFX_update_current_instrument_widget(); } else { GL_lock(); { g_instruments_widget->show(); }GL_unlock(); GFX_update_current_instrument_widget(); if(instrumentWidgetIsInMixer() && GFX_MixerIsVisible()==false){ GFX_ShowMixer(); } } set_editor_focus(); }
void GFX_showHideEditor(void){ GL_lock();{ if(g_editor->isHidden()) g_editor->show(); else g_editor->hide(); }GL_unlock(); }
void grabKeyboard(void){ //g_embed_container->grabKeyboard(); //g_editor->main_window->grabKeyboard(); //abort(); // This function should not be used. // GL_lock is needed when using intel gfx driver to avoid crash caused by opening two opengl contexts simultaneously from two threads. GL_lock();{ g_editor->setFocus(); }GL_unlock(); }
void set_editor_focus(void){ if(root==NULL) return; EditorWidget *editor = static_cast<EditorWidget*>(root->song->tracker_windows->os_visual.widget); // GL_lock is needed when using intel gfx driver to avoid crash caused by opening two opengl contexts simultaneously from two threads. GL_lock();{ editor->editor_layout_widget->setFocus(); }GL_unlock(); #if USE_GTK_VISUAL //GTK_SetFocus(); #endif }
static void setColor(enum ColorNums num, const QRgb &rgb){ R_ASSERT_RETURN_IF_FALSE(num<END_CONFIG_COLOR_NUM); GL_lock();{ #if USE_GTK_VISUAL GTK_SetColor(num,qRed(rgb),qGreen(rgb),qBlue(rgb)); #endif if (g_config_colors[num]==NULL) get_config_qcolor(num); g_config_colors[num]->setRgb(rgb); if(num==LOW_BACKGROUND_COLOR_NUM) system_color->setRgb(rgb); else if(num==HIGH_BACKGROUND_COLOR_NUM) button_color->setRgb(rgb); }GL_unlock(); }
void GFX_ShowEditor(void){ GL_lock();{ g_editor->show(); }GL_unlock(); }
static bool Load(const wchar_t *filename){ struct Root *newroot; dc.success=true; curr_disk_line = 0; dc.file=DISK_open_for_reading(filename); if(dc.file==NULL){ GFX_Message(NULL,"Could not open \"%s\" for loading\n",STRING_get_chars(filename)); return false; } DC_fgets(); if (dc.success==false) return false; if(strcmp("RADIUM SONG",dc.ls)){ GFX_Message(NULL,"First line in song was not 'RADIUM SONG', but '%s'. Last: %d\n",dc.ls,dc.ls[strlen(dc.ls)-1]); DISK_close_and_delete(dc.file); return false; } disk_load_version=DC_LoadF(); if (dc.success==false) return false; if(disk_load_version>0.4201 && disk_load_version<0.50){ disk_load_version=0.51; dc.colorize=true; dc.startcolor=5; }else{ dc.colorize=false; } #if 0 if (disk_load_version < 0.75){ GFX_Message(NULL, "<p>Note! The portamento behavior for polyphonic tracks changed in Radium V3.4.9" "</p>" "<p>" "Before Radium V3.4.9, the default final portamento value was the pitch value of the next note after the <i>start</i> of the note. " "Now, the default final portamento value is the pitch value of the next note after the <i>end</i> of the note." "</p>" "<p>" "Old songs with portamento in polyphonic tracks might not sound the same." "</p>" ); } #endif if(disk_load_version>DISKVERSION+0.0001){ GFX_Message(NULL,"Need a newer version of Radium to load this song. The song version is %f, while this program only supports %f.\n",disk_load_version,DISKVERSION); return false; }else{ printf("Song diskVersion: %f\n",disk_load_version); } dc.filename=filename; dc.playlist=NULL; DC_Next(); if (dc.success==false) return false; if(strcmp(dc.ls,"OSSTUFF")){ GFX_Message(NULL, "OSSTUFF not found, but: '%s'. File: '%s'\n",dc.ls,STRING_get_chars(filename)); DISK_close_and_delete(dc.file); EndProgram(); exit(4); } LoadOsStuff(); printf("dc.ls: -%s-\n",dc.ls); if(strcmp(dc.ls,"ROOT")){ GFX_Message(NULL, "ROOT not found. Found '%s' instead.\n", dc.ls); DISK_close_and_delete(dc.file); EndProgram(); exit(5); } newroot=LoadRoot(); DISK_close_and_delete(dc.file); if(!dc.success){ GFX_Message(NULL, "Loading failed.\n"); EndProgram(); exit(6); } ResetUndo(); #ifdef _AMIGA CloseHelpWindow(); CloseCPPWindowWindow(); CloseBlockSelectWindow(); #endif CloseAllTrackerWindows(); GL_lock();{ GL_pause_gl_thread_a_short_while(); }GL_unlock(); //GL_draw_lock();{ PLAYER_lock();{ //<-- Locks within locks are dangerous. But it doesn't matter since the player isn't playing now anyway. root=newroot; //BANG! }PLAYER_unlock(); //}GL_draw_unlock(); Undo_start_ignoring_undo_operations();{ DLoadRoot(newroot); }Undo_stop_ignoring_undo_operations(); GL_create_all(root->song->tracker_windows); if(COMMENT_show_after_loading()) COMMENTDIALOG_open(); #ifdef _AMIGA currpatch=-1; #endif ResetUndo(); return true; }