MainWindow::MainWindow() : Fl_Window(w, h, "fToxTun"), toxWorker(nullptr), buttonTun(55, h-25, w/2-60, 20, "Connect"), buttonFriendAdd(5, h-25, 20, 20, "@+"), buttonFriendDelete(30, h-25, 20, 20, "@line"), buttonChangeName(w-55, 5, 50, 45, "Edit"), connectionState(w-25, h-25, 20, 20), lname(w/2+5, 5, w/2-60, 20, "Your Name:"), name(w/2+5, 30, w/2-60, 20), laddress(w/2+5, 70, w/2-10, 20, "Your Address:"), address(w/2+5, 95, w/2-10, 20), friendsWidget(this, 5, 20, w/2-10, h-60) { buttonFriendAdd.callback(onFriendAdd, this); buttonFriendDelete.callback(onFriendDelete, this); buttonChangeName.callback(onChangeName, this); buttonFriendAdd.labelcolor(fl_rgb_color(0, 255, 0)); buttonFriendDelete.labelcolor(fl_rgb_color(255, 0, 0)); tunButtonToConnect(); buttonTun.deactivate(); connectionState.box(FL_OFLAT_BOX); selfDisconnected(this); end(); }
YabColorControl::YabColorControl(int x, int y, int w, int h, const char* id) :Fl_Group(x, y, w, h), YabWidget(id) { min=0; max=255; bc[0] = fl_rgb_color(254, 100, 100); bc[1] = fl_rgb_color(100, 254, 100); bc[2] = fl_rgb_color(100, 100, 254); int tw = 30; int sh=h/3; for (int i=0; i<3; i++) { data[i] = i; slider[i] = new Fl_Slider(x, y+(i*sh), w-tw, sh); slider[i]->type(FL_HORIZONTAL); slider[i]->slider_size(0.05); slider[i]->minimum(min); slider[i]->maximum(max); slider[i]->step(1); slider[i]->value(0); slider[i]->color(bc[i]); slider[i]->callback(cb_common, (void *)data[i]); txt[i] = new Fl_Input(x+w-tw, y+(i*sh), tw, sh); txt[i]->type(FL_INT_INPUT); txt[i]->value("0"); txt[i]->textsize(12); txt[i]->when(FL_WHEN_ENTER_KEY); txt[i]->callback(cb_common, (void *)data[i]); } end(); resizable(NULL); redraw(); }
void create_about_tab(int x, int y, int w, int h) { int border; Fl_Text_Display *ptext; Fl_Text_Buffer *pbuff; Fl_Group *group1 = new Fl_Group(x, y, w, h, "About"); { border = 10; ptext = new Fl_Text_Display(x + border, y + border, w - 3 * border, h - 3 * border); pbuff = new Fl_Text_Buffer(); ptext->buffer(pbuff); ptext->textcolor(fl_rgb_color(85, 170, 255)); ptext->color(fl_rgb_color(8, 7, 5)); pbuff->text("\n" " BMS manager Feb 2016.\n" " Part of SombreroBMS (battery management system)\n" " Copyright 2016 Patrick Xavier Areny\n" "\n" "\n" " Used libraries:\n" "\n" " Tinyxml \tLee Thomason\n" " FLTK \twww.fltk.org\n" " OpenGl \tKhronos group\n" "\n" "\n" " Used font: " "\n" "\n" " VeraMono ttf, Bitstream, Inc.\n" "\n"); } group1->end(); }
SpectrumView::SpectrumView ( int X, int Y, int W, int H, const char *L ) : Fl_Box(X,Y,W,H,L) { _nframes = 0; _auto_level = 0; _data = 0; _bands = 0; _dbmin = -70; _dbmax = 30; box(FL_FLAT_BOX); color(fl_rgb_color(20,20,20)); selection_color( fl_rgb_color( 210, 80, 80 ) ); // end(); }
void GroupScreen::show(vector< Geom* > gVec ) { geomVec = gVec; geomGroup->setGeomVec( gVec ); vec3d c = geomGroup->getColor(); groupUI->primColorButton->color( fl_rgb_color((int)c.x(), (int)c.y(), (int)c.z()) ); groupUI->redSlider->value( c.x() ); groupUI->greenSlider->value( c.y() ); groupUI->blueSlider->value( c.z() ); xLocSlider->set_parm_ptr( &geomGroup->xLocOff ); xLocInput->set_parm_ptr( &geomGroup->xLocOff ); yLocSlider->set_parm_ptr( &geomGroup->yLocOff ); yLocInput->set_parm_ptr( &geomGroup->yLocOff ); zLocSlider->set_parm_ptr( &geomGroup->zLocOff ); zLocInput->set_parm_ptr( &geomGroup->zLocOff ); xRotSlider->set_parm_ptr( &geomGroup->xRotOff ); xRotInput->set_parm_ptr( &geomGroup->xRotOff ); yRotSlider->set_parm_ptr( &geomGroup->yRotOff ); yRotInput->set_parm_ptr( &geomGroup->yRotOff ); zRotSlider->set_parm_ptr( &geomGroup->zRotOff ); zRotInput->set_parm_ptr( &geomGroup->zRotOff ); scaleSlider->set_parm_ptr( &geomGroup->scaleFactor ); scaleInput->set_parm_ptr( &geomGroup->scaleFactor ); groupUI->scaleLocButton->value( geomGroup->getScaleLocFlag() ); groupUI->UIWindow->show(); }
window(int x, int y, int w, int h, const char *label = 0) : Fl_Window(x, y, w, h, label) { Fl_Box *o = new Fl_Box(10, 10, 300, 25, "Open CSV file to convert to HTML -->"); o->box(FL_BORDER_BOX); o->align(FL_ALIGN_INSIDE | FL_ALIGN_WRAP| FL_ALIGN_CENTER); o->color((Fl_Color)215); o->labelfont(FL_HELVETICA_BOLD); Fl_Button *but = new Fl_Button(320, 10, 80, 25, "Pick Files"); but->callback(on_pick_button_click, this); encode_check = new Fl_Check_Button(10, 40, 280, 25, "Escape special HTML characters."); encode_check->value(1); open_file_check = new Fl_Check_Button(10, 65, 280, 25, "Open HTML in browser."); open_file_check->value(1); Fl_Button *author = new Fl_Button(320, 65, 80, 25, "Mingjie Li"); author->box(FL_FLAT_BOX); author->align(FL_ALIGN_INSIDE | FL_ALIGN_RIGHT); author->labelsize(12); author->labelcolor(fl_rgb_color(128, 128, 128)); author->callback(on_author_click, this); }
GM2D3OptionsGUI::GM2D3OptionsGUI(int x, int y, int w, int h) { options_box = std::unique_ptr<Fl_Box>(new Fl_Box(x,y,w,h)); options_box->box(FL_EMBOSSED_BOX); options_box->color(fl_rgb_color(210, 210, 210)); options_box->align(FL_ALIGN_TOP_LEFT); options_box->label("OPTIONS:"); options_box->labelfont(FL_BOLD); const int checkbox_height = int( (h - 5*BOX_EDGE_GAP) / 5.0 ); const int checkbox_width = int(w - 2*BOX_EDGE_GAP); const int x_0 = x + BOX_EDGE_GAP; const int y_0 = y + BOX_EDGE_GAP; enable_plot_checkbox = std::unique_ptr<Fl_Check_Button> (new Fl_Check_Button(x_0, y_0, checkbox_width, checkbox_height)); enable_plot_checkbox->label("ENABLE HISTORY PLOTS"); enable_plot_checkbox->value(0); enable_indicators_checkbox = std::unique_ptr<Fl_Check_Button> (new Fl_Check_Button(x_0,y_0 + checkbox_height + BOX_EDGE_GAP, checkbox_width ,checkbox_height)); enable_indicators_checkbox->label("ENABLE INDICATORS"); enable_indicators_checkbox->value(0); enable_info_checkbox = std::unique_ptr<Fl_Check_Button> (new Fl_Check_Button(x_0,y_0 + 2*checkbox_height + 2*BOX_EDGE_GAP, checkbox_width ,checkbox_height)); enable_info_checkbox->label("ENABLE STATS"); enable_info_checkbox->value(0); config_loader = std::unique_ptr<GM2D3ConfigLoader> (new GM2D3ConfigLoader(x_0,y + 4*checkbox_height + 3*BOX_EDGE_GAP, checkbox_width, checkbox_height)); this->deactivate(); }
Desktop::Desktop() : EDE_DESKTOP_WINDOW(0, 0, 100, 100, EDE_DESKTOP_APP) { end(); /* use nice darker blue color as default for background */ color(fl_rgb_color(73, 64, 102)); conf = NULL; selbox = new SelectionOverlay; icon_opts = NULL; wallpaper = NULL; dmenu = NULL; selection_x = selection_y = 0; last_px = last_py = -1; moving = false; /* * first update workarea _then_ read configuration, as it will have correct size for * wallpaper which will prevent wallpaper load and scalle image twice */ update_workarea(); read_config(); read_desktop_folder(desktop_path()); foreign_callback_add(this, EDE_DESKTOP_APP, settings_changed_cb); dmenu = new MenuButton(0, 0, 500, 0); dmenu->menu(desktop_menu); desktop_menu[1].image((Fl_Image*)IconLoader::get("folder", ICON_SIZE_TINY)); desktop_menu[0].user_data(this); desktop_menu[1].user_data(this); desktop_menu[2].user_data(this); add(dmenu); }
void Module::init ( void ) { /* we use pointers to these vector elements for port auto connection stuff and need to prevent reallocation from invalidating them. */ audio_input.reserve(16); audio_output.reserve(16); control_input.reserve(16); control_output.reserve(16); aux_audio_input.reserve(16); aux_audio_output.reserve(16); // _latency = 0; _is_default = false; _editor = 0; _chain = 0; _instances = 1; _bypass = 0; box( FL_UP_BOX ); labeltype( FL_NO_LABEL ); align( FL_ALIGN_CENTER | FL_ALIGN_INSIDE ); set_visible_focus(); selection_color( FL_YELLOW ); labelsize(12); color( fl_rgb_color( 122,190,200 ) ); tooltip(); }
void SpectrumView::draw_semilog ( void ) { int W = w() - padding_right; int H = h() - padding_bottom; char label[50]; fl_line_style(FL_SOLID,0); fl_font( FL_HELVETICA_ITALIC, 7 ); //Db grid is easy, it is just a linear spacing for(int i=0; i<16; ++i) { int level = y()+H*i/16.0; fl_line(x(), level, x()+W, level); float value = (1-i/16.0)*(_dbmax-_dbmin) + _dbmin; sprintf(label, "%.1f", value); fl_draw(label, x() + 4, level + 3, w() - 8, 7, FL_ALIGN_LEFT ); } //The frequency grid is defined with points at //10,11,12,...,18,19,20,30,40,50,60,70,80,90,100,200,400,... //Thus we find each scale that we cover and draw the nine lines unique to //that scale float lb = 1.0f / logf( 10 ); const int min_base = logf(_fmin)*lb; const int max_base = logf(_fmax)*lb; const float b = logf(_fmin)*lb; const float a = logf(_fmax)*lb-b; for(int i=min_base; i<=max_base; ++i) { for(int j=1; j<10; ++j) { const float freq = pow(10.0, i)*j; const float xloc = (logf(freq)*lb-b)/a; if(xloc<1.0 && xloc > -0.001) { fl_line(xloc*W+x(), y(), xloc*W+x(), y()+H); if ( j == 1 || j == 2 || j == 5 ) { sprintf(label, "%0.f%s", freq < 1000.0 ? freq : freq / 1000.0, freq < 1000.0 ? "" : "k" ); int sx = x() + xloc*W + 1; if ( sx < x() * W - 20 ) fl_draw(label, sx, y()+h()); } } } } /* draw 0dB line */ { fl_line_style(FL_DASH,0); float i = ((_dbmax-_dbmin)+_dbmin) / (_dbmax-_dbmin); int level = y()+H*i; fl_color(fl_color_add_alpha(fl_rgb_color(240,240,240), 60 )); fl_line(x(), level, x()+W, level); fl_line_style(FL_SOLID,0); } }
void GroupScreen::screenCB( Fl_Widget* w ) { if ( w == groupUI->acceptScaleButton ) { scriptMgr->addLineDouble("xform scale", geomGroup->scaleFactor()); geomGroup->acceptScaleFactor(); } else if ( w == groupUI->acceptXformButton ) { scriptMgr->addLine("xform", "loc", geomGroup->xLocOff(), geomGroup->yLocOff(), geomGroup->zLocOff()); scriptMgr->addLine("xform", "rot", geomGroup->xRotOff(), geomGroup->yRotOff(), geomGroup->zRotOff()); geomGroup->acceptXform(); } else if ( w == groupUI->resetScaleButton ) { geomGroup->resetScaleFactor(); scriptMgr->addLine("xform", "resetscale"); } else if ( w == groupUI->resetXformButton ) { geomGroup->resetXform(); scriptMgr->addLine("xform", "resetxform"); } else if ( w == groupUI->redSlider || w == groupUI->greenSlider || w == groupUI->blueSlider ) { int r = (int)groupUI->redSlider->value(); int g = (int)groupUI->greenSlider->value(); int b = (int)groupUI->blueSlider->value(); geomGroup->setColor( r, g, b ); groupUI->primColorButton->color( fl_rgb_color(r, g, b) ); groupUI->primColorButton->redraw(); if (!Fl::event_state(FL_BUTTONS)) scriptMgr->addLine("gen", "color", r, g, b); } else if ( w == groupUI->materialChoice ) { geomGroup->setMaterialID( groupUI->materialChoice->value() ); Stringc matName = matMgrPtr->getMaterial(groupUI->materialChoice->value())->name(); matName.quote('\"'); // char str[128]; // sprintf(str, "\"%s\"", matMgrPtr->getMaterial(groupUI->materialChoice->value())->name()); scriptMgr->addLine("gen", "material", matName); } else if ( w == groupUI->scaleLocButton ) { geomGroup->setScaleLocFlag( groupUI->scaleLocButton->value() ); } }
CCanvas::CCanvas(int x, int y, int w,int h,const char *l) :Fl_Box(x, y, w, h, l) { box(FL_FLAT_BOX); color(fl_rgb_color(127,127,127)); m_drawing_mode = AZ_DRAW_SENSOR_STRIKE; m_simulation_running = false; }
//==== Activate Slider =====// void Slider_adj_range::activate() { sliderWidget->activate(); minButton->activate(); maxButton->activate(); sliderWidget->color(fl_rgb_color(255, 255, 255)); }
//==== Activate Slider =====// void Slider_adj_range::deactivate() { sliderWidget->deactivate(); minButton->deactivate(); maxButton->deactivate(); sliderWidget->color(fl_rgb_color(235, 235, 235)); }
void SpectrumView::draw ( void ) { //Clear Widget Fl_Box::draw(); int W = w() - padding_right; int H = h() - padding_bottom; if ( !_bands ) { analyze_data( W ); } //Draw grid fl_color(fl_color_add_alpha(fl_rgb_color( 100,100,100), 50 )); draw_semilog(); fl_push_clip( x(),y(),W,H); fl_color(fl_color_add_alpha( selection_color(), 20 )); fl_push_matrix(); fl_translate( x(), y() + 2 ); fl_scale( W,H- 2 ); fl_begin_polygon(); fl_vertex(0.0,1.0); draw_curve(); fl_vertex(1.0,1.0); fl_end_polygon(); fl_color(fl_color_add_alpha( selection_color(), 100 )); fl_begin_line(); fl_line_style(FL_SOLID,2); /* fl_vertex(0.0,1.0); */ draw_curve(); /* fl_vertex(1.0,1.0); */ fl_end_line(); fl_pop_matrix(); fl_line_style(FL_SOLID,0); fl_pop_clip(); }
void init_colors ( void ) { unsigned int i; /* velocity colors */ for ( i = 128; i--; ) { velocity_colors[i] = fl_color_average( FL_GRAY, fl_rgb_color( i * 2, 255 - i * 2, 32 ), 0.4 ); velocity2_colors[i] = fl_color_average( FL_WHITE, velocity_colors[i], 0.5 ); } state_colors = (Fl_Color*)malloc(sizeof( Fl_Color ) * MAX_STATE ); for ( i = elementsof( color_defs ); i--; ) { state_colors[ color_defs[i].state ] = fl_rgb_color( color_defs[i].r, color_defs[i].g, color_defs[i].b ); } }
int main(int argc, char **argv) { char buffer[50]; sprintf(buffer, "Kasterborous Visualizer (version. %d.%d)", kast_vis_VERSION_MAJOR, kast_vis_VERSION_MINOR); Fl_Color mainColor = fl_rgb_color(102,102,102); Fl_Color tabColor = fl_rgb_color(22,59,89); window = new Fl_Window(UI::UI_X,UI::UI_Y,buffer); window->color(mainColor); window->labelcolor(tabColor); ui = new UI(window); Utility::ui = ui; window->callback(main_callback); window->end(); window->show(argc, argv); return Fl::run(); }
void gActionWidget::baseDraw(bool clear) { /* clear the screen */ if (clear) fl_rectf(x(), y(), w(), h(), COLOR_BG_MAIN); /* draw the container */ fl_color(COLOR_BD_0); fl_rect(x(), y(), w(), h()); /* grid drawing, if > 1 */ if (pParent->gridTool->getValue() > 1) { fl_color(fl_rgb_color(54, 54, 54)); fl_line_style(FL_DASH, 0, NULL); for (int i=0; i<(int) pParent->gridTool->points.size; i++) { int px = pParent->gridTool->points.at(i)+x()-1; fl_line(px, y()+1, px, y()+h()-2); } fl_line_style(0); } /* bars and beats drawing */ fl_color(COLOR_BD_0); for (int i=0; i<(int) pParent->gridTool->beats.size; i++) { int px = pParent->gridTool->beats.at(i)+x()-1; fl_line(px, y()+1, px, y()+h()-2); } fl_color(COLOR_BG_2); for (int i=0; i<(int) pParent->gridTool->bars.size; i++) { int px = pParent->gridTool->bars.at(i)+x()-1; fl_line(px, y()+1, px, y()+h()-2); } /* cover unused area. Avoid drawing cover if width == 0 (i.e. beats * are 32) */ int coverWidth = pParent->totalWidth-pParent->coverX; if (coverWidth != 0) fl_rectf(pParent->coverX+x(), y()+1, coverWidth, h()-2, COLOR_BG_1); }
void gActionWidget::baseDraw(bool clear) { if (clear) fl_rectf(x(), y(), w(), h(), COLOR_BG_MAIN); fl_color(COLOR_BD_0); fl_rect(x(), y(), w(), h()); if (pParent->gridTool->getValue() > 1) { fl_color(fl_rgb_color(54, 54, 54)); fl_line_style(FL_DASH, 0, NULL); for (int i=0; i<(int) pParent->gridTool->points.size(); i++) { int px = pParent->gridTool->points.at(i)+x()-1; fl_line(px, y()+1, px, y()+h()-2); } fl_line_style(0); } fl_color(COLOR_BD_0); for (int i=0; i<(int) pParent->gridTool->beats.size(); i++) { int px = pParent->gridTool->beats.at(i)+x()-1; fl_line(px, y()+1, px, y()+h()-2); } fl_color(COLOR_BG_2); for (int i=0; i<(int) pParent->gridTool->bars.size(); i++) { int px = pParent->gridTool->bars.at(i)+x()-1; fl_line(px, y()+1, px, y()+h()-2); } int coverWidth = pParent->totalWidth-pParent->coverX; if (coverWidth != 0) fl_rectf(pParent->coverX+x(), y()+1, coverWidth, h()-2, COLOR_BG_1); }
/* ======================================================= Fl_Usage_Box: This is the class construcor ======================================================= */ Fl_Usage_Box::Fl_Usage_Box(int x, int y, int w, int h) : Fl_Box(x, y, w, h) { int i; // Allocate space for the usage data m_usageMapSize = (w-4) * (h-4); // Leave room for border m_pUsageMap = new unsigned char[m_usageMapSize]; for (i = 0; i < m_usageMapSize; i++) m_pUsageMap[i] = 0; m_usageMin = 0; m_usageMax = 99; m_maxUsageEntry = 0; m_backgroundColor = fl_rgb_color(255, 255, 255); m_pixelsPerUsage = m_usageMapSize / 100; m_usageScale = 1.0 / 100.0; }
PhatChat::Client::ChatWindow::ChatWindow ( ) : window ( 800 , 600 ) , log ( 10 , 10 , 780 , 540 ) , message ( 10 , 560 , 670 , 30 ) , send ( 690 , 560 , 100 , 30 , "Send" ) { this->window.label ( "PhatChat" ) ; Fl_Color c = fl_rgb_color(r, g, b); this->window.color(c); this->log.buffer ( this->buffer ) ; this->send.callback ( PhatChat::Client::ChatWindow::onSendPushed , this ) ; this->message.callback ( PhatChat::Client::ChatWindow::onSendPushed , this ) ; this->window.end ( ) ; }
static Fl_Color bgcolor() { return fl_rgb_color(237,237,237); }
void MainWindow::selfDisconnected(void *mainWindowV) { MainWindow *mw = static_cast<MainWindow*>(mainWindowV); mw->connectionState.color(fl_rgb_color(255, 0, 0)); mw->connectionState.redraw(); }
FL_EXPORT_C(Fl_Color, fl_rgb_color_with_rgbC)(uchar r, uchar g, uchar b){return fl_rgb_color(r,g,b);}
FL_EXPORT_C(Fl_Color, fl_rgb_color_with_grayscaleC)(uchar g){return fl_rgb_color(g);}
void MainWindow::tunButtonToClose() { buttonTun.copy_label("Connected"); buttonTun.labelcolor(fl_rgb_color(255, 0, 0)); buttonTun.callback(onTunButtonClose, this); }
void Track::menu_cb ( const Fl_Menu_ *m ) { char picked[256]; m->item_pathname( picked, sizeof( picked ) ); DMESSAGE( "Picked: %s", picked ); Logger log( this ); if ( ! strcmp( picked, "Type/Mono" ) ) { command_configure_channels( 1 ); } else if ( ! strcmp( picked, "Type/Stereo" ) ) { command_configure_channels( 2 ); } else if ( ! strcmp( picked, "Type/Quad" ) ) { command_configure_channels( 4 ); } else if ( ! strcmp( picked, "Type/..." ) ) { const char *s = fl_input( "How many channels?", "3" ); if ( s ) { int c = atoi( s ); if ( c <= 0 || c > 10 ) fl_alert( "Invalid number of channels." ); else { command_configure_channels(c); } } } else if ( ! strcmp( picked, "/Add Control" ) ) { /* add audio track */ char *name = get_unique_control_name( "Control" ); timeline->wrlock(); new Control_Sequence( this, name ); timeline->unlock(); } else if ( ! strcmp( picked, "/Overlay controls" ) ) { overlay_controls( ! m->mvalue()->value() ); } else if ( ! strcmp( picked, "/Add Annotation" ) ) { add( new Annotation_Sequence( this ) ); } else if ( ! strcmp( picked, "/Color" ) ) { unsigned char r, g, b; Fl::get_color( color(), r, g, b ); if ( fl_color_chooser( "Track Color", r, g, b ) ) { color( fl_rgb_color( r, g, b ) ); } redraw(); } else if ( ! strcmp( picked, "Flags/Record" ) ) { armed( m->mvalue()->flags & FL_MENU_VALUE ); } else if ( ! strcmp( picked, "Flags/Mute" ) ) { mute( m->mvalue()->flags & FL_MENU_VALUE ); } else if ( ! strcmp( picked, "Flags/Solo" ) ) { solo( m->mvalue()->flags & FL_MENU_VALUE ); } else if ( ! strcmp( picked, "Size/Small" ) ) { size( 0 ); } else if ( ! strcmp( picked, "Size/Medium" ) ) { size( 1 ); } else if ( ! strcmp( picked, "Size/Large" ) ) { size( 2 ); } else if ( ! strcmp( picked, "Size/Huge" ) ) { size( 3 ); } else if ( ! strcmp( picked, "/Remove" ) ) { int r = fl_choice( "Are you certain you want to remove track \"%s\"?", "Cancel", NULL, "Remove", name() ); if ( r == 2 ) { timeline->command_remove_track( this ); Fl::delete_widget( this ); } } else if ( ! strcmp( picked, "/Rename" ) ) { ((Fl_Sometimes_Input*)name_field)->take_focus(); } else if ( ! strcmp( picked, "/Move Up" ) ) { timeline->command_move_track_up( this ); } else if ( ! strcmp( picked, "/Move Down" ) ) { timeline->command_move_track_down( this ); } else if ( !strcmp( picked, "Takes/Show all takes" ) ) { show_all_takes( ! m->mvalue()->value() ); } else if ( !strcmp( picked, "Takes/New" ) ) { timeline->wrlock(); sequence( (Audio_Sequence*)sequence()->clone_empty() ); timeline->unlock(); } else if ( !strcmp( picked, "Takes/Remove" ) ) { if ( takes->children() ) { Loggable::block_start(); timeline->wrlock(); Audio_Sequence *s = sequence(); sequence( (Audio_Sequence*)takes->child( 0 ) ); delete s; timeline->unlock(); Loggable::block_end(); } } else if ( !strcmp( picked, "Takes/Remove others" )) { if ( takes->children() ) { Loggable::block_start(); takes->clear(); Loggable::block_end(); } } else if ( !strncmp( picked, "Takes/", sizeof( "Takes/" ) - 1 ) ) { Audio_Sequence* s = (Audio_Sequence*)m->mvalue()->user_data(); timeline->wrlock(); sequence( s ); timeline->unlock(); } }
static Fl_Color random_color ( void ) { return fl_rgb_color( rand() % 255, rand() % 255, rand() % 255 ); }
void Track::init ( void ) { _row = 0; _sequence = NULL; _name = NULL; _selected = false; _size = 1; record_ds = NULL; playback_ds = NULL; labeltype( FL_NO_LABEL ); // clear_visible_focus(); Fl_Group::size( timeline->w(), height() ); Track *o = this; o->box( FL_FLAT_BOX ); { Track_Header *o = new Track_Header( x(), y(), w(), h() ); name_field = o->name_input; record_button = o->rec_button; mute_button = o->mute_button; solo_button = o->solo_button; menu_button = o->menu_button; show_all_takes_button = o->show_all_takes_button; overlay_controls_button = o->overlay_controls_button; name_field->callback( cb_button, this ); record_button->callback( cb_button, this ); mute_button->callback( cb_button, this ); solo_button->callback( cb_button, this ); show_all_takes_button->callback( cb_button, this ); overlay_controls_button->callback( cb_button, this ); menu_button->callback( cb_button, this ); resizable( o ); // o->color( (Fl_Color)53 ); } { /* this pack holds the active sequence, annotation sequence, control sequences and takes */ Fl_Pack *o = pack = new Fl_Pack( x(), y(), w(), h() ); o->type( Fl_Pack::VERTICAL ); o->labeltype( FL_NO_LABEL ); /* o->resize( x() + width(), y(), w() - width(), h() ); */ /* resizable( o ); */ { Fl_Pack *o = annotation = new Fl_Pack( 0, 0, pack->w(), 1 ); o->type( Fl_Pack::VERTICAL ); o->end(); } { { Fl_Group *o = controls_heading = new Fl_Group( 0, 0, pack->w(), 10 ); o->box( FL_FLAT_BOX ); o->color( fl_color_add_alpha( fl_rgb_color( 1,1,1 ), 127 ) ); { Fl_Box *o = new Fl_Box( 0,0, Track::width(), 10 ); o->label( "Controls" ); o->align( FL_ALIGN_RIGHT | FL_ALIGN_INSIDE ); o->labelsize( 10 ); } o->hide(); o->end(); o->resizable( 0 ); } { Fl_Sometimes_Pack *o = control = new Fl_Sometimes_Pack( 0, 0, pack->w(), 1 ); o->spacing( 1 ); o->box( FL_NO_BOX ); o->color( FL_BACKGROUND_COLOR ); o->type( Fl_Pack::VERTICAL ); o->pack( true ); o->hide(); o->align( FL_ALIGN_TOP | FL_ALIGN_LEFT ); o->end(); } } { { Fl_Group *o = takes_heading = new Fl_Group( 0, 0, pack->w(), 10 ); o->box( FL_FLAT_BOX ); o->color( fl_color_add_alpha( fl_rgb_color( 1,1,1 ), 127 ) ); { Fl_Box *o = new Fl_Box( 0,0, Track::width(), 10 ); o->label( "Takes" ); o->align( FL_ALIGN_RIGHT | FL_ALIGN_INSIDE ); o->labelsize( 10 ); } o->hide(); o->end(); o->resizable( 0 ); } { Fl_Pack *o = takes = new Fl_Pack( 0, 0, pack->w(), 1 ); o->type( Fl_Pack::VERTICAL ); o->end(); o->hide(); o->align( FL_ALIGN_TOP | FL_ALIGN_LEFT ); } } o->end(); } end(); }
void MainWindow::tunButtonToAccept() { buttonTun.copy_label("Accept connection"); buttonTun.labelcolor(fl_rgb_color(255, 215, 0)); buttonTun.callback(onTunButtonAccept, this); }