Ejemplo n.º 1
0
		SimpleFileInfoRenderer(FileInfoItem *fileInfo) : pause(Stock::MEDIA_PAUSE), cancel(Stock::CANCEL), icon(fileInfo->getDirection()?Stock::GOTO_TOP:Stock::GOTO_BOTTOM, IconSize(ICON_SIZE_DND)) {
			finfo = fileInfo;
			textInfo.pack_start(fileName, PACK_EXPAND_WIDGET);
			textInfo.pack_start(peerName, PACK_EXPAND_WIDGET);
			progressContainer.pack_start(progress, PACK_EXPAND_WIDGET);
			progressContainer.pack_start(pause, PACK_SHRINK);
			progressContainer.pack_start(cancel, PACK_SHRINK);
			info.pack_start(textInfo, PACK_EXPAND_WIDGET);
			info.pack_start(icon, PACK_SHRINK);
			mainBox.pack_start(info, PACK_SHRINK);
			mainBox.pack_start(progressContainer, PACK_SHRINK);
			updateData();
		}
Ejemplo n.º 2
0
FindDialog::FindDialog(Properties* prop)
    : DialogBox(btn_ok_cancel, "Find")
    , RadioGroupHelper(*this, prop)
    , prop_(prop)
    , textEntry_(0)
{
    Frame* frame = manage(new Frame);
    get_vbox()->add(*frame);
    Gtk_set_size(frame, 400, -1);

    VBox* box = manage(new VBox);
    frame->add(*box);
    frame->set_border_width(5);

    textEntry_ = manage(new TextEntry(*this, prop_, "find"));
    box->pack_start(*textEntry_, false, false);
    box->set_border_width(10);

    textEntry_->set_text(properties()->get_string("search", ""));
    if (size_t length = textEntry_->get_text_length())
    {
        textEntry_->select_region(0, length);
    }

    Box* hbox = manage(new HBox);
    hbox->set_border_width(10);
    box->pack_start(*hbox, false, false);

    // Radio buttons
    VBox* bbox = manage(new VBox);
    hbox->pack_start(*bbox, false, false);
    bbox->set_border_width(10);

    bbox->pack_start(create_button("Search _Forward", "search_forward", &grp_));
    bbox->pack_start(create_button("Search _Backwards", "search_backward", &grp_));

    // Check buttons
    bbox = manage(new VBox);
    hbox->pack_end(*bbox, false, false);
    bbox->set_border_width(10);
    bbox->pack_start(create_button("Case Insensitive", "case_ins"), false, false);
    //todo
    //bbox->add(create_button("Match Whole Words", "match_words"));
    frame->show();
}
Ejemplo n.º 3
0
/*Jack Sync page */
void
options::add_jack_sync_page()
{
#ifdef JACK_SUPPORT
    VBox *vbox = manage(new VBox());
    vbox->set_border_width(4);
    m_notebook->append_page(*vbox, "_Jack Sync", true);

    /*Frame for transport options*/
    Frame* transportframe = manage(new Frame("Transport"));
    transportframe->set_border_width(4);
    vbox->pack_start(*transportframe, Gtk::PACK_SHRINK);

    VBox *transportbox = manage(new VBox());
    transportbox->set_border_width(4);
    transportframe->add(*transportbox);

    CheckButton *check = manage(new CheckButton("Jack _Transport", true));
    check->set_active (global_with_jack_transport);
    add_tooltip( check, "Enable sync with JACK Transport.");
    check->signal_toggled().connect(bind(mem_fun(*this,
                                         &options::transport_callback), e_jack_transport, check));

    transportbox->pack_start(*check, false, false);

    check = manage(new CheckButton("Trans_port Master", true));
    check->set_active (global_with_jack_master);
    add_tooltip( check, "Seq24 will attempt to serve as JACK Master.");
    check->signal_toggled().connect(bind(mem_fun(*this,
                                         &options::transport_callback), e_jack_master, check));

    transportbox->pack_start(*check, false, false);

    check = manage (new CheckButton ("Master C_onditional", true));
    check->set_active (global_with_jack_master_cond);
    add_tooltip( check,
                 "Seq24 will fail to be master if there is already a master set.");
    check->signal_toggled().connect(bind(mem_fun(*this,
                                         &options::transport_callback), e_jack_master_cond, check));

    transportbox->pack_start(*check, false, false);

#endif
}
Ejemplo n.º 4
0
/*Mouse page*/
void
options::add_mouse_page()
{
    VBox *vbox = manage(new VBox());
    m_notebook->append_page(*vbox, "_Mouse", true);

    /*Frame for transport options*/
    Frame* interactionframe = manage(new Frame("Interaction method"));
    interactionframe->set_border_width(4);
    vbox->pack_start(*interactionframe, Gtk::PACK_SHRINK);

    VBox *interactionbox = manage(new VBox());
    interactionbox->set_border_width(4);
    interactionframe->add(*interactionbox);

    Gtk::RadioButton *rb_seq24 = manage(new RadioButton(
                                            "se_q24 (original style)", true));
    interactionbox->pack_start(*rb_seq24, Gtk::PACK_SHRINK);

    Gtk::RadioButton * rb_fruity = manage(new RadioButton(
            "_fruity (similar to a certain well known sequencer)", true));
    interactionbox->pack_start(*rb_fruity, Gtk::PACK_SHRINK);

    Gtk::RadioButton::Group group = rb_seq24->get_group();
    rb_fruity->set_group(group);

    switch(global_interactionmethod)
    {
    case e_fruity_interaction:
        rb_fruity->set_active();
        break;

    case e_seq24_interaction:
    default:
        rb_seq24->set_active();
        break;
    }

    rb_seq24->signal_toggled().connect(sigc::bind(mem_fun(*this,
                                       &options::mouse_seq24_callback), rb_seq24));

    rb_fruity->signal_toggled().connect(sigc::bind(mem_fun(*this,
                                        &options::mouse_fruity_callback), rb_fruity));
}
Ejemplo n.º 5
0
/*MIDI Input page*/
void
options::add_midi_input_page()
{
    // Input Buses
    int buses = m_perf->get_master_midi_bus ()->get_num_in_buses ();

    VBox *vbox = manage(new VBox ());
    vbox->set_border_width(6);
    m_notebook->append_page(*vbox, "MIDI _Input", true);

    for (int i = 0; i < buses; i++)
    {
        CheckButton *check = manage(new CheckButton(
                                        m_perf->get_master_midi_bus()->get_midi_in_bus_name(i), 0));
        check->signal_toggled().connect(bind(mem_fun(*this,
                                             &options::input_callback), i, check));
        check->set_active(m_perf->get_master_midi_bus()->get_input(i));

        vbox->pack_start(*check, false, false);
    }
}
Ejemplo n.º 6
0
mainwnd::mainwnd(perform *a_p)
{


    /* set the performance */
    m_mainperf = a_p;

    /* main window */
    set_window_title_filename( global_filename );

    m_main_wid = manage( new mainwid(  m_mainperf ));
    m_main_time = manage( new maintime( ));

    m_menubar   = manage(new MenuBar());
    m_menu_file = manage(new Menu());
    m_menu_control = manage( new Menu());
    m_menu_help    = manage( new Menu());
    
    /* fill with items */
    m_menu_file->items().push_back(MenuElem("New", mem_fun(*this,&mainwnd::file_new_dialog)));
    m_menu_file->items().push_back(SeparatorElem());
    m_menu_file->items().push_back(MenuElem("Open...",   mem_fun(*this,&mainwnd::file_open_dialog)));
    m_menu_file->items().push_back(MenuElem("Import...", mem_fun(*this,&mainwnd::file_import_dialog)));
    m_menu_file->items().push_back(SeparatorElem());
    m_menu_file->items().push_back(MenuElem("Save", mem_fun(*this,&mainwnd::file_save_dialog)));
    m_menu_file->items().push_back(MenuElem("Save As...", mem_fun(*this,&mainwnd::file_saveas_dialog)));
    m_menu_file->items().push_back(SeparatorElem());
    m_menu_file->items().push_back(MenuElem("Options...", mem_fun(*this,&mainwnd::options_dialog)));
    m_menu_file->items().push_back(SeparatorElem());
    m_menu_file->items().push_back(MenuElem("Exit", mem_fun(*this,&mainwnd::file_exit_dialog)));

    m_menu_help->items().push_back(MenuElem("About", mem_fun(*this,&mainwnd::about_dialog)));
 
    m_menubar->items().push_front(MenuElem("File", *m_menu_file));
    m_menubar->items().push_back(MenuElem("Help", *m_menu_help));

    HBox *hbox = manage( new HBox( false, 2 ) );

    m_button_stop = manage( new Button( ));
    m_button_stop->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( stop_xpm ))));
    m_button_stop->signal_clicked().connect( mem_fun(*this,&mainwnd::stop_playing));
    hbox->pack_start(*m_button_stop, false, false);

    m_button_play = manage( new Button() );
    m_button_play->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( play2_xpm  ))));
    m_button_play->signal_clicked().connect(  mem_fun( *this, &mainwnd::start_playing));
    hbox->pack_start(*m_button_play, false, false);

    //m_button_test = manage( new Button("test") );
    //m_button_test->signal_clicked().connect(  mem_fun( *this, &mainwnd::test));
    //hbox->pack_start(*m_button_test, false, false);

    m_button_perfedit = manage( new Button(  ));
    m_button_perfedit->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( perfedit_xpm  ))));
    m_button_perfedit->signal_clicked().connect( mem_fun( *this, &mainwnd::open_performance_edit ));
    hbox->pack_end(*m_button_perfedit, false, false, 4);

    m_adjust_bpm = manage( new Adjustment(  m_mainperf->get_bpm(), 20, 500, 1 ));
    m_spinbutton_bpm = manage( new SpinButton( *m_adjust_bpm ));
    m_spinbutton_bpm->set_editable( false );
    hbox->pack_start(*(manage( new Label( "  bpm " ))), false, false, 4);
    hbox->pack_start(*m_spinbutton_bpm, false, false );
  
    m_adjust_ss = manage( new Adjustment( 0, 0, c_max_sets - 1, 1 ));
    m_spinbutton_ss = manage( new SpinButton( *m_adjust_ss ));
    m_spinbutton_ss->set_editable( false );
    m_spinbutton_ss->set_wrap( true );
    hbox->pack_end(*m_spinbutton_ss, false, false );
    hbox->pack_end(*(manage( new Label( "  set " ))), false, false, 4);

    m_adjust_bpm->signal_value_changed().connect( mem_fun(*this,&mainwnd::adj_callback_bpm ));
    m_adjust_ss->signal_value_changed().connect( mem_fun(*this,&mainwnd::adj_callback_ss ));
 
    m_entry_notes = manage( new Entry());
    m_entry_notes->signal_changed().connect( mem_fun(*this,&mainwnd::edit_callback_notepad ));

    hbox->pack_start( *m_entry_notes, true, true );

    /* 2nd hbox */
    HBox *hbox2 = manage( new HBox( false, 0 ) );
    hbox2->pack_start( *manage(  new Image(Gdk::Pixbuf::create_from_xpm_data( seq24_xpm ))), false, false );
    hbox2->pack_end( *m_main_time, false, false );

    /* set up a vbox, put the menu in it, and add it */
    VBox *vbox = new VBox();
    vbox->set_border_width( 10 );
    vbox->pack_start(*hbox2, false, false );
    vbox->pack_start(*m_main_wid, true, true, 10 );
    vbox->pack_start(*hbox, false, false ); 
 

    VBox *ovbox = new VBox();
 
    ovbox->pack_start(*m_menubar, false, false );
    ovbox->pack_start( *vbox );

    /* add box */
    this->add (*ovbox);
  
    /* show everything */
    show_all();

    add_events( Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK );

    m_entry_notes->set_text( * m_mainperf->get_screen_set_notepad(  m_mainperf->get_screenset() )); 

    m_timeout_connect = Glib::signal_timeout().connect(mem_fun(*this,&mainwnd::timer_callback), 25);
    
    m_quit = false;

    m_perf_edit = new perfedit( m_mainperf );
    m_options = NULL;
  
}
Ejemplo n.º 7
0
/*MIDI Clock page*/
void
options::add_midi_clock_page()
{
    // Clock  Buses
    int buses = m_perf->get_master_midi_bus ()->get_num_out_buses ();

    VBox *vbox = manage(new VBox());
    vbox->set_border_width(6);
    m_notebook->append_page(*vbox, "MIDI _Clock", true);

    manage (new Tooltips ());

    for (int i = 0; i < buses; i++)
    {
        HBox *hbox2 = manage (new HBox ());
        Label *label = manage( new Label(m_perf->get_master_midi_bus ()->
                                         get_midi_out_bus_name (i), 0));

        hbox2->pack_start (*label, false, false);

        Gtk::RadioButton * rb_off = manage (new RadioButton ("Off"));
        add_tooltip( rb_off, "Midi Clock will be disabled.");

        Gtk::RadioButton * rb_on = manage (new RadioButton ("On (Pos)"));
        add_tooltip( rb_on,
                     "Midi Clock will be sent. Midi Song Position and Midi Continue will be sent if starting greater than tick 0 in song mode, otherwise Midi Start is sent.");

        Gtk::RadioButton * rb_mod = manage (new RadioButton ("On (Mod)"));
        add_tooltip( rb_mod, "Midi Clock will be sent.  Midi Start will be sent and clocking will begin once the song position has reached the modulo of the specified Size. (Used for gear that doesn't respond to Song Position)");

        Gtk::RadioButton::Group group = rb_off->get_group ();
        rb_on->set_group (group);
        rb_mod->set_group (group);

        rb_off->signal_toggled().connect (sigc::bind(mem_fun (*this,
                                          &options::clock_callback_off), i, rb_off ));
        rb_on->signal_toggled ().connect (sigc::bind(mem_fun (*this,
                                          &options::clock_callback_on),  i, rb_on  ));
        rb_mod->signal_toggled().connect (sigc::bind(mem_fun (*this,
                                          &options::clock_callback_mod), i, rb_mod ));

        hbox2->pack_end (*rb_mod, false, false );
        hbox2->pack_end (*rb_on, false, false);
        hbox2->pack_end (*rb_off, false, false);

        vbox->pack_start( *hbox2, false, false );

        switch ( m_perf->get_master_midi_bus ()->get_clock (i))
        {
        case e_clock_off:
            rb_off->set_active(1);
            break;
        case e_clock_pos:
            rb_on->set_active(1);
            break;
        case e_clock_mod:
            rb_mod->set_active(1);
            break;
        }
    }

    Adjustment *clock_mod_adj = new Adjustment(midibus::get_clock_mod(),
            1, 16 << 10, 1 );
    SpinButton *clock_mod_spin = new SpinButton( *clock_mod_adj );

    HBox *hbox2 = manage (new HBox ());

    //m_spinbutton_bpm->set_editable( false );
    hbox2->pack_start(*(manage(new Label(
                                   "Clock Start Modulo (1/16 Notes)"))), false, false, 4);
    hbox2->pack_start(*clock_mod_spin, false, false );

    vbox->pack_start( *hbox2, false, false );

    clock_mod_adj->signal_value_changed().connect(sigc::bind(mem_fun(*this,
            &options::clock_mod_callback), clock_mod_adj));
}
Ejemplo n.º 8
0
/*Keybinding setup (editor for .seq24rc keybindings).*/
void
options::add_keyboard_page()
{
    VBox *mainbox = manage(new VBox());
    mainbox->set_spacing(6);
    m_notebook->append_page(*mainbox, "_Keyboard", true);

    Label* label;
    KeyBindEntry* entry;

    HBox *hbox = manage (new HBox());
    CheckButton *check = manage(new CheckButton(
                                    "_Show key labels on sequences", true));
    check->signal_toggled().connect(bind(mem_fun(*this,
                                         &options::input_callback), (int)e_keylabelsonsequence,
                                         check));
    check->set_active(m_perf->m_show_ui_sequence_key);
    mainbox->pack_start(*check, false, false);

    /*Frame for sequence toggle keys*/
    Frame* controlframe = manage(new Frame("Control keys"));
    controlframe->set_border_width(4);
    mainbox->pack_start(*controlframe, Gtk::PACK_SHRINK);

    Table* controltable = manage(new Table(4, 8, false));
    controltable->set_border_width(4);
    controltable->set_spacings(4);
    controlframe->add(*controltable);

    label = manage(new Label("Start", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_start));
    controltable->attach(*label, 0, 1, 0, 1);
    controltable->attach(*entry, 1, 2, 0, 1);

    label = manage(new Label("Stop", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_stop));
    controltable->attach(*label, 0, 1, 1, 2);
    controltable->attach(*entry, 1, 2, 1, 2);

    label = manage(new Label("Song", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_song));
    controltable->attach(*label, 0, 1, 2, 3);
    controltable->attach(*entry, 1, 2, 2, 3);
#ifdef JACK_SUPPORT
    label = manage(new Label("Jack", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_jack));
    controltable->attach(*label, 0, 1, 3, 4);
    controltable->attach(*entry, 1, 2, 3, 4);
#endif // JACK_SUPPORT

    label = manage(new Label("Snapshot 1", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_snapshot_1));
    controltable->attach(*label, 2, 3, 0, 1);
    controltable->attach(*entry, 3, 4, 0, 1);

    label = manage(new Label("Snapshot 2", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_snapshot_2));
    controltable->attach(*label, 2, 3, 1, 2);
    controltable->attach(*entry, 3, 4, 1, 2);

    label = manage(new Label("bpm down", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_bpm_dn));
    controltable->attach(*label, 2, 3, 3, 4);
    controltable->attach(*entry, 3, 4, 3, 4);

    label = manage(new Label("bpm up", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_bpm_up));
    controltable->attach(*label, 2, 3, 2, 3);
    controltable->attach(*entry, 3, 4, 2, 3);

    label = manage(new Label("Replace", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_replace));
    controltable->attach(*label, 4, 5, 0, 1);
    controltable->attach(*entry, 5, 6, 0, 1);

    label = manage(new Label("Queue", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_queue));
    controltable->attach(*label, 4, 5, 1, 2);
    controltable->attach(*entry, 5, 6, 1, 2);

    label = manage(new Label("Keep queue", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_keep_queue));
    controltable->attach(*label, 4, 5, 2, 3);
    controltable->attach(*entry, 5, 6, 2, 3);

    label = manage(new Label("Menu mode", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_menu));
    controltable->attach(*label, 4, 5, 3, 4);
    controltable->attach(*entry, 5, 6, 3, 4);

    label = manage(new Label("Screenset up", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_screenset_up));
    controltable->attach(*label, 6, 7, 0, 1);
    controltable->attach(*entry, 7, 8, 0, 1);

    label = manage(new Label("Screenset down", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_screenset_dn));
    controltable->attach(*label, 6, 7, 1, 2);
    controltable->attach(*entry, 7, 8, 1, 2);

    label = manage(new Label("Set playing screenset", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_set_playing_screenset));
    controltable->attach(*label, 6, 7, 2, 3);
    controltable->attach(*entry, 7, 8, 2, 3);

    label = manage(new Label("Follow transport", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_follow_trans));
    controltable->attach(*label, 6, 7, 3, 4);
    controltable->attach(*entry, 7, 8, 3, 4);

    /*Frame for sequence toggle keys*/
    Frame* toggleframe = manage(new Frame("Sequence toggle keys"));
    toggleframe->set_border_width(4);
    mainbox->pack_start(*toggleframe, Gtk::PACK_SHRINK);

    Table* toggletable = manage(new Table(4, 16, false));
    toggletable->set_border_width(4);
    toggletable->set_spacings(4);
    toggleframe->add(*toggletable);

    int x = 0;
    int y = 0;
    Label* numlabel;

    for (int i = 0; i < 32; i++)
    {
        x = i % 8 * 2;
        y = i / 8;
        int slot = x * 2 + y; // count this way: 0, 4, 8, 16...
        char buf[16];
        snprintf(buf, sizeof(buf), "%d", slot);
        numlabel = manage(new Label(buf, Gtk::ALIGN_RIGHT));
        entry = manage(new KeyBindEntry(KeyBindEntry::events, NULL,
                                        m_perf, slot));
        toggletable->attach(*numlabel, x, x + 1, y, y + 1);
        toggletable->attach(*entry, x + 1, x + 2, y, y + 1);
    }

    /*Frame for mute group slots*/
    Frame* mutegroupframe = manage(new Frame("Mute-group slots"));
    mutegroupframe->set_border_width(4);
    mainbox->pack_start(*mutegroupframe, Gtk::PACK_SHRINK);

    Table* mutegrouptable = manage(new Table(4, 16, false));
    mutegrouptable->set_border_width(4);
    mutegrouptable->set_spacings(4);
    mutegroupframe->add(*mutegrouptable);

    for (int i = 0; i <32; i++)
    {
        x = i%8*2;
        y = i/8;
        char buf[16];
        snprintf(buf, sizeof(buf), "%d", i);
        numlabel = manage(new Label(buf, Gtk::ALIGN_RIGHT));
        entry = manage(new KeyBindEntry(KeyBindEntry::groups, NULL,
                                        m_perf, i));
        mutegrouptable->attach(*numlabel, x, x + 1, y, y + 1);
        mutegrouptable->attach(*entry, x + 1, x + 2, y, y + 1);
    }

#define AddKey(text, integer) \
    label = manage(new Label(text)); \
    hbox->pack_start(*label, false, false, 4); \
    entry = manage(new KeyBindEntry(KeyBindEntry::location, &integer)); \
    hbox->pack_start(*entry, false, false, 4);

    hbox = manage(new HBox());
    AddKey("Learn (while pressing a mute-group key):",
           m_perf->m_key_group_learn);
    AddKey("Disable:", m_perf->m_key_group_off);
    AddKey("Enable:", m_perf->m_key_group_on);
    mainbox->pack_start (*hbox, false, false);

#undef AddKey
}
Ejemplo n.º 9
0
mainwnd::mainwnd(perform *a_p):
    m_mainperf(a_p),
    m_modified(false),
    m_options(NULL)
{
    set_icon(Gdk::Pixbuf::create_from_xpm_data(seq24_32_xpm));


    /*sjh stuff...*/
    set_wsetlist_mode(m_mainperf->get_setlist_mode());
    /*............*/


    /* register for notification */
    m_mainperf->m_notify.push_back( this );

    /* main window */
    update_window_title();

#if GTK_MINOR_VERSION < 12
    m_tooltips = manage( new Tooltips() );
#endif
    m_main_wid = manage( new mainwid( m_mainperf ));
    m_main_time = manage( new maintime( ));

    m_menubar = manage(new MenuBar());

    m_menu_file = manage(new Menu());
    m_menubar->items().push_front(MenuElem("_File", *m_menu_file));

    m_menu_view = manage( new Menu());
    m_menubar->items().push_back(MenuElem("_View", *m_menu_view));

    m_menu_help = manage( new Menu());
    m_menubar->items().push_back(MenuElem("_Help", *m_menu_help));

    /* file menu items */
    m_menu_file->items().push_back(MenuElem("_New",
                Gtk::AccelKey("<control>N"),
                mem_fun(*this, &mainwnd::file_new)));
    m_menu_file->items().push_back(MenuElem("_Open...",
                Gtk::AccelKey("<control>O"),
                mem_fun(*this, &mainwnd::file_open)));
    m_menu_file->items().push_back(MenuElem("_Save",
                Gtk::AccelKey("<control>S"),
                mem_fun(*this, &mainwnd::file_save)));
    m_menu_file->items().push_back(MenuElem("Save _as...",
                mem_fun(*this, &mainwnd::file_save_as)));

    m_menu_file->items().push_back(MenuElem("Open _setlist...",
                mem_fun(*this, &mainwnd::file_open_setlist)));

    m_menu_file->items().push_back(SeparatorElem());
    m_menu_file->items().push_back(MenuElem("_Import...",
                mem_fun(*this, &mainwnd::file_import_dialog)));
    m_menu_file->items().push_back(MenuElem("O_ptions...",
                mem_fun(*this,&mainwnd::options_dialog)));
    m_menu_file->items().push_back(SeparatorElem());
    m_menu_file->items().push_back(MenuElem("E_xit",
                Gtk::AccelKey("<control>Q"),
                mem_fun(*this, &mainwnd::file_exit)));

    /* view menu items */
    m_menu_view->items().push_back(MenuElem("_Song Editor...",
                Gtk::AccelKey("<control>E"),
                mem_fun(*this, &mainwnd::open_performance_edit)));

    /* help menu items */
    m_menu_help->items().push_back(MenuElem("_About...",
                mem_fun(*this, &mainwnd::about_dialog)));

    /* top line items */
    HBox *tophbox = manage( new HBox( false, 0 ) );
    tophbox->pack_start(
    		*m_s24_pic,
    		// *manage(new Image(Gdk::Pixbuf::create_from_xpm_data(seq24_xpm))),
            false, false);

    // adjust placement...
    VBox *vbox_b = manage( new VBox() );
    HBox *hbox3 = manage( new HBox( false, 0 ) );
    vbox_b->pack_start( *hbox3, false, false );
    tophbox->pack_end( *vbox_b, false, false );
    hbox3->set_spacing( 10 );

    /* timeline */
    hbox3->pack_start( *m_main_time, false, false );

    /* group learn button */
    m_button_learn = manage( new Button( ));
    m_button_learn->set_focus_on_click( false );
    m_button_learn->set_flags( m_button_learn->get_flags() & ~Gtk::CAN_FOCUS );
    m_button_learn->set_image(*manage(new Image(
                    Gdk::Pixbuf::create_from_xpm_data( learn_xpm ))));
    m_button_learn->signal_clicked().connect(
            mem_fun(*this, &mainwnd::learn_toggle));
    add_tooltip( m_button_learn, "Mute Group Learn\n\n"
            "Click 'L' then press a mutegroup key to store the mute state of "
            "the sequences in that key.\n\n"
            "(see File/Options/Keyboard for available mutegroup keys "
            "and the corresponding hotkey for the 'L' button)" );
    hbox3->pack_end( *m_button_learn, false, false );

    /*this seems to be a dirty hack:*/
    Button w;
    hbox3->set_focus_child( w ); // clear the focus not to trigger L via keys


    /* bottom line items */
    HBox *bottomhbox = manage( new HBox(false, 10));

    /* container for start+stop buttons */
    HBox *startstophbox = manage(new HBox(false, 4));
    bottomhbox->pack_start(*startstophbox, Gtk::PACK_SHRINK);

    /* stop button */
    m_button_stop = manage( new Button());
    m_button_stop->add(*manage(new Image(
                    Gdk::Pixbuf::create_from_xpm_data( stop_xpm ))));
    m_button_stop->signal_clicked().connect(
            mem_fun(*this, &mainwnd::stop_playing));/*sjh - can't pass anything into the stop_playing function because of this. */
    add_tooltip( m_button_stop, "Stop playing MIDI sequence" );
    m_button_stop->set_can_focus(false);
    startstophbox->pack_start(*m_button_stop, Gtk::PACK_SHRINK);

    /* play button */
    m_button_play = manage(new Button() );
    m_button_play->add(*manage(new Image(
                    Gdk::Pixbuf::create_from_xpm_data( play2_xpm ))));
    m_button_play->signal_clicked().connect(
            mem_fun( *this, &mainwnd::start_playing));
    add_tooltip( m_button_play, "Play MIDI sequence" );
    startstophbox->pack_start(*m_button_play, Gtk::PACK_SHRINK);

    /* bpm spin button with label*/
    HBox *bpmhbox = manage(new HBox(false, 4));
    bottomhbox->pack_start(*bpmhbox, Gtk::PACK_SHRINK);

    m_adjust_bpm = manage(new Adjustment(m_mainperf->get_bpm(), 20, 500, 1));
    m_spinbutton_bpm = manage( new SpinButton( *m_adjust_bpm ));
    m_spinbutton_bpm->set_editable( false );
    m_adjust_bpm->signal_value_changed().connect(
            mem_fun(*this, &mainwnd::adj_callback_bpm));
    add_tooltip( m_spinbutton_bpm, "Adjust beats per minute (BPM) value");
    Label* bpmlabel = manage(new Label("_bpm", true));
    bpmlabel->set_mnemonic_widget(*m_spinbutton_bpm);
    bpmhbox->pack_start(*bpmlabel, Gtk::PACK_SHRINK);
    bpmhbox->pack_start(*m_spinbutton_bpm, Gtk::PACK_SHRINK);

    /* screen set name edit line */
    HBox *notebox = manage(new HBox(false, 4));
    bottomhbox->pack_start(*notebox, Gtk::PACK_EXPAND_WIDGET);

    m_entry_notes = manage( new Entry());
    m_entry_notes->signal_changed().connect(
            mem_fun(*this, &mainwnd::edit_callback_notepad));
    m_entry_notes->set_text(*m_mainperf->get_screen_set_notepad(
                m_mainperf->get_screenset()));
    add_tooltip( m_entry_notes, "Enter screen set name" );
    Label* notelabel = manage(new Label("_Name", true));
    notelabel->set_mnemonic_widget(*m_entry_notes);
    notebox->pack_start(*notelabel, Gtk::PACK_SHRINK);
    notebox->pack_start(*m_entry_notes, Gtk::PACK_EXPAND_WIDGET);

    /* sequence set spin button */
    HBox *sethbox = manage(new HBox(false, 4));
    bottomhbox->pack_start(*sethbox, Gtk::PACK_SHRINK);

    m_adjust_ss = manage( new Adjustment( 0, 0, c_max_sets - 1, 1 ));
    m_spinbutton_ss = manage( new SpinButton( *m_adjust_ss ));
    m_spinbutton_ss->set_editable( false );
    m_spinbutton_ss->set_wrap( true );
    m_adjust_ss->signal_value_changed().connect(
            mem_fun(*this, &mainwnd::adj_callback_ss ));
    add_tooltip( m_spinbutton_ss, "Select screen set" );
    Label* setlabel = manage(new Label("_Set", true));
    setlabel->set_mnemonic_widget(*m_spinbutton_ss);
    sethbox->pack_start(*setlabel, Gtk::PACK_SHRINK);
    sethbox->pack_start(*m_spinbutton_ss, Gtk::PACK_SHRINK);

    /* song edit button */
    m_button_songedit = manage( new Button( ));
    m_button_songedit->add( *manage( new Image(
                    Gdk::Pixbuf::create_from_xpm_data( perfedit_xpm  ))));
    m_button_songedit->signal_clicked().connect(
            mem_fun( *this, &mainwnd::open_performance_edit ));
    add_tooltip( m_button_songedit, "Show or hide song editor window" );
    bottomhbox->pack_end(*m_button_songedit, Gtk::PACK_SHRINK);


    /* vertical layout container for window content*/
    VBox *contentvbox = new VBox();
    contentvbox->set_spacing(10);
    contentvbox->set_border_width(10);
    contentvbox->pack_start(*tophbox, Gtk::PACK_SHRINK);
    contentvbox->pack_start(*m_main_wid, Gtk::PACK_SHRINK);
    contentvbox->pack_start(*bottomhbox, Gtk::PACK_SHRINK);


    /*main container for menu and window content */
    VBox *mainvbox = new VBox();

    mainvbox->pack_start(*m_menubar, false, false );
    mainvbox->pack_start( *contentvbox );

    /* add main layout box */
    this->add (*mainvbox);

    /* show everything */
    show_all();

    add_events( Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK );

    m_timeout_connect = Glib::signal_timeout().connect(
            mem_fun(*this, &mainwnd::timer_callback), 25);


    m_perf_edit = new perfedit( m_mainperf );
//    m_playlist_wnd = new playlist_wnd( m_mainperf);
    m_playplay = new playlist_player();

    m_sigpipe[0] = -1;
    m_sigpipe[1] = -1;
    install_signal_handlers();
}
Ejemplo n.º 10
0
BackupDialog::BackupDialog(Gtk::Window& parent, Config* ppConfig, tSectionID section)
	: Dialog("Backup", parent), mSection(section),
	mOptionDummyRun("Dummy run"),
	mpConfig(ppConfig), mpBackupThread(NULL), mOptionLevel(1.0),
	mExecButton(Stock::EXECUTE)
{
#ifdef DEBUG
	cerr << "BackupDialog constructor" << endl;
#endif

	set_default_size(650,550);
	// add close button
	add_button(Stock::CLOSE, 1);

	VBox* mainbox = get_vbox(); 
	
	// add Option frame
	Frame* poptionFrame = manage(new Frame());

	poptionFrame->set_border_width(2);
	poptionFrame->set_label("Options");
	mainbox->pack_start(*poptionFrame, false, false);	

	/// add options
	{
		ustring backupType = mpConfig->get_option(mSection, "type");
		Table* optionTable = manage(new Table(2,2));

		Label* label = manage(new Label("Level:"));
		optionTable->attach(*label, 0, 1, 0, 1, Gtk::FILL, Gtk::FILL, 5, 0);
		optionTable->attach(mOptionLevel, 1, 2, 0, 1, Gtk::FILL, Gtk::FILL, 5, 0);						
		label->set_sensitive(false);
		mOptionLevel.set_sensitive(false);

		if(backupType == "incremental") // incremental backup
		{
//TODO: automatic level			mOptionLevel.set_value(mpConfig->get_num_option(mSection, "level"));
			mOptionLevel.set_range(1,999);
			mOptionLevel.set_increments(1,2);
			mOptionLevel.set_numeric();
			mOptionLevel.set_sensitive();
			label->set_sensitive();
		}

		// dummy run option
		mOptionDummyRun.set_active(false);
		optionTable->attach(mOptionDummyRun, 0, 2, 1, 2, FILL, FILL, 5, 0);
		
		// add option table to option frame
		poptionFrame->add(*optionTable);
	}


	// Buttons
	HButtonBox* buttons = manage(new HButtonBox(BUTTONBOX_START));
	buttons->set_border_width(2);
	buttons->set_spacing(10);
	mainbox->pack_start(*buttons, false, false);

	mExecButton.set_use_stock(true);
	mExecButton.signal_clicked().connect( sigc::mem_fun(*this, &BackupDialog::on_button_exec) );
	buttons->pack_start(mExecButton);

	// Log Frame
	Frame* logframe = manage(new Frame());
	logframe->set_border_width(2);
	logframe->set_label("Output");
	mainbox->pack_start(*logframe, true, true);
	
	ScrolledWindow* scrolled = manage(new ScrolledWindow());
	scrolled->set_policy(POLICY_AUTOMATIC, POLICY_ALWAYS);
	scrolled->set_shadow_type(SHADOW_IN);
	scrolled->set_border_width(2);
	logframe->add(*scrolled);

	// Log buffer

	mrefTag = Gtk::TextBuffer::Tag::create();
	mrefTag->property_foreground() = "red";

	Glib::RefPtr<Gtk::TextBuffer::TagTable> refTagTable = Gtk::TextBuffer::TagTable::create();
	refTagTable->add(mrefTag);
	
	mrefLogBuffer = Gtk::TextBuffer::create(refTagTable);
	mLogEnd = mrefLogBuffer->create_mark("bottom", mrefLogBuffer->end());
	mrefLogBuffer->signal_insert().connect(sigc::mem_fun(*this, &BackupDialog::on_buffer_insert));
	
	mLogView.set_buffer(mrefLogBuffer);
	mLogView.set_editable(false);
	mLogView.set_cursor_visible(false);
	scrolled->add(mLogView);

	mpLog = new TextBufferLog(mrefTag, mrefLogBuffer, &mLogView);
	signal_delete_event().connect(
			sigc::mem_fun(*this, &BackupDialog::on_delete_it));

	show_all_children();
}
Ejemplo n.º 11
0
options::options (Gtk::Window & parent, perform * a_p):
    Gtk::Dialog ("Options", parent, true, true)
{
    m_perf = a_p;
    VBox *vbox = NULL;
    
    HBox *hbox = manage (new HBox ());
    get_vbox ()->pack_start (*hbox, false, false);

    get_action_area ()->set_border_width (2);
    hbox->set_border_width (6);

    m_button_ok = manage (new Button ("Ok"));
    get_action_area ()->pack_end (*m_button_ok, false, false);
    m_button_ok->signal_clicked ().connect (mem_fun (*this, &options::hide));


    m_notebook = manage (new Notebook ());
    hbox->pack_start (*m_notebook);

    // Clock  Buses
    int buses = m_perf->get_master_midi_bus ()->get_num_out_buses ();
    //Notebook *clock_notebook = manage( new Notebook());
    //clock_notebook->set_scrollable(true);

    vbox = manage(new VBox());
    m_notebook->pages().push_back(Notebook_Helpers::TabElem(*vbox,
                "MIDI Clock"));

    CheckButton *check;
    Label *label;
    
    Gtk::Tooltips * tooltips = manage (new Tooltips ());

    for (int i = 0; i < buses; i++)
    {  
        HBox *hbox2 = manage (new HBox ());
        label = manage( new Label(m_perf->get_master_midi_bus ()->
                                            get_midi_out_bus_name (i), 0));

        hbox2->pack_start (*label, false, false);
        
        
        Gtk::RadioButton * rb_off = manage (new RadioButton ("Off"));
        add_tooltip( rb_off, "Midi Clock will be disabled.");
        
        Gtk::RadioButton * rb_on = manage (new RadioButton ("On (Pos)"));
        add_tooltip( rb_on,
                "Midi Clock will be sent. Midi Song Position and Midi Continue will be sent if starting greater than tick 0 in song mode, otherwise Midi Start is sent.");

        Gtk::RadioButton * rb_mod = manage (new RadioButton ("On (Mod)"));
        add_tooltip( rb_mod, "Midi Clock will be sent.  Midi Start will be sent and clocking will begin once the song position has reached the modulo of the specified Size. (Used for gear that doesn't respond to Song Position)");

        Gtk::RadioButton::Group group = rb_off->get_group ();
        rb_on->set_group (group);
        rb_mod->set_group (group);

        rb_off->signal_toggled().connect (sigc::bind(mem_fun (*this, &options::clock_callback_off), i, rb_off ));
        rb_on->signal_toggled ().connect (sigc::bind(mem_fun (*this, &options::clock_callback_on),  i, rb_on  ));
        rb_mod->signal_toggled().connect (sigc::bind(mem_fun (*this, &options::clock_callback_mod), i, rb_mod ));
        
        hbox2->pack_end (*rb_mod, false, false ); 
        hbox2->pack_end (*rb_on, false, false);
        hbox2->pack_end (*rb_off, false, false);

        vbox->pack_start( *hbox2, false, false );
       
        switch ( m_perf->get_master_midi_bus ()->get_clock (i))
        {
            case e_clock_off: rb_off->set_active(1); break;
            case e_clock_pos: rb_on->set_active(1); break;
            case e_clock_mod: rb_mod->set_active(1); break;
        }
                              
        // SET DEFAULT STATES check->set_active (m_perf->get_master_midi_bus ()->get_clock (i));
    }

    Adjustment *clock_mod_adj = new Adjustment( midibus::get_clock_mod(), 1, 16 << 10, 1 );
    SpinButton *clock_mod_spin = new SpinButton( *clock_mod_adj );

    HBox *hbox2 = manage (new HBox ());
    
    //m_spinbutton_bpm->set_editable( false );
    hbox2->pack_start(*(manage( new Label( "Clock Start Modulo (1/16 Notes)"))), false, false, 4);
    hbox2->pack_start(*clock_mod_spin, false, false );

    vbox->pack_start( *hbox2, false, false );
    
    clock_mod_adj->signal_value_changed().connect( sigc::bind(mem_fun(*this,&options::clock_mod_callback),clock_mod_adj));

    // add controls for input method
    {
        Adjustment *adj = new Adjustment( global_interactionmethod, 0, e_number_of_interactions-1, 1 );
        SpinButton *spin = new SpinButton( *adj );

        HBox *hbox2 = manage (new HBox ());
        HBox *hbox3 = manage (new HBox ());

        //m_spinbutton_bpm->set_editable( false );
        interaction_method_label = new Label("Input Method");
        hbox2->pack_start(*(manage( interaction_method_label )), false, false, 4);
        hbox2->pack_start(*spin, false, false );

        vbox->pack_start( *hbox2, false, false );

        interaction_method_desc_label = new Label(" ----- ");
        hbox3->pack_start(*(manage( interaction_method_desc_label )), false, false, 4);
        vbox->pack_start(*hbox3, false, false );

        adj->signal_value_changed().connect( sigc::bind(mem_fun(*this,&options::interaction_method_callback),adj));

        // force it to refresh.
        interaction_method_callback( adj );
    }

    // Input Buses
    buses = m_perf->get_master_midi_bus ()->get_num_in_buses ();

    vbox = manage (new VBox ());
    m_notebook->pages ().
        push_back (Notebook_Helpers::TabElem (*vbox, "MIDI Input"));

    for (int i = 0; i < buses; i++)
    {

        check =
            manage (new
                    CheckButton (m_perf->get_master_midi_bus ()->
                        get_midi_in_bus_name (i), 0));
        check->signal_toggled ().
            connect (bind (mem_fun (*this, &options::input_callback), i, check));
        check->set_active (m_perf->get_master_midi_bus ()->get_input (i));

        vbox->pack_start (*check, false, false);
    }

    // KeyBoard keybinding setup (editor for .seq42rc keybindings.
    vbox = manage (new VBox ());
    m_notebook->pages ().push_back (Notebook_Helpers::TabElem (*vbox, "Keyboard"));
    {
        Label* label;
        KeyBindEntry* entry;
        HBox *hbox;

        #define AddKey(text, integer) \
            label = manage (new Label( text )); \
            hbox->pack_start (*label, false, false, 4); \
            entry = manage (new KeyBindEntry( &integer )); \
            hbox->pack_start (*entry, false, false, 4);

        hbox = manage (new HBox ());
        AddKey( "start:", m_perf->m_key_start );
        AddKey( "stop:", m_perf->m_key_stop );
        AddKey( "toggle looping:", m_perf->m_key_loop );
        vbox->pack_start (*hbox, false, false);

        hbox = manage (new HBox ());
        AddKey( "bpm dn:", m_perf->m_key_bpm_dn );
        AddKey( "bpm up:", m_perf->m_key_bpm_up );
        vbox->pack_start (*hbox, false, false);

        #undef AddKey
    }

    // Jack
#ifdef JACK_SUPPORT
    VBox *vbox2 = manage (new VBox ());
    vbox2->set_border_width (4);
    m_notebook->pages().push_back(Notebook_Helpers::TabElem(*vbox2,
                "Jack Sync"));

    check = manage (new CheckButton ("Jack Transport"));
    check->set_active (global_with_jack_transport);
    add_tooltip( check, "Enable sync with JACK Transport.");
    check->signal_toggled ().
        connect (bind
                (mem_fun (*this, &options::transport_callback), e_jack_transport,
                 check));
    vbox2->pack_start (*check, false, false);

    check = manage (new CheckButton ("Transport Master"));
    check->set_active (global_with_jack_master);
    add_tooltip( check, "Seq42 will attempt to serve as JACK Master.");
    check->signal_toggled ().
        connect (bind
                (mem_fun (*this, &options::transport_callback), e_jack_master,
                 check));

    vbox2->pack_start (*check, false, false);

    check = manage (new CheckButton ("Master Conditional"));
    check->set_active (global_with_jack_master_cond);
    add_tooltip( check,
            "Seq42 will fail to be master if there is already a master set.");
    check->signal_toggled ().
        connect (bind
                (mem_fun (*this, &options::transport_callback), e_jack_master_cond,
                 check));

    vbox2->pack_start (*check, false, false);


    Gtk::Button * button = manage (new Button ("Connect"));
    add_tooltip( button, "Connect to Jack.");
    button->signal_clicked().connect(bind(mem_fun(*this,
                    &options::transport_callback), e_jack_connect, button));
    vbox2->pack_start (*button, false, false);

    button = manage (new Button ("Disconnect"));
    add_tooltip( button, "Disconnect Jack.");
    button->signal_clicked().connect(bind(mem_fun(*this,
                    &options::transport_callback), e_jack_disconnect, button));
    vbox2->pack_start (*button, false, false);
#endif

    /* show everything */
    show_all_children ();
}
Ejemplo n.º 12
0
DinoGUI::DinoGUI(int argc, char** argv) 
  : m_seq("Dino", m_song),
    m_proxy(m_song),
    m_dbus("org.nongnu.dino"),
    m_dbus_obj(0),
    m_plif(*this, m_song, m_seq, m_proxy, m_dbus.get_name()),
    m_plib(m_plif),
    m_valid(false) {
  
  if (!m_seq.is_valid()) {
    MessageDialog dlg("Could not initialise the sequencer!", 
                      false, MESSAGE_ERROR);
    dlg.run();
    return;
  }
  
  if (!init_lash(argc, argv, m_seq.get_jack_name())) {
    MessageDialog dlg("Could not initialise LASH!", 
                      false, MESSAGE_ERROR);
    dlg.run();
    return;
  }
  
  m_valid = true;
  
  m_dbus_obj = new DinoDBusObject(m_proxy, m_seq);
  m_dbus.register_object("/", m_dbus_obj);
  signal_timeout().
    connect(bind(mem_fun(m_dbus, &DBus::Connection::run), 0), 50);
  
  // initialise the main window
  m_window.set_title("Dino");
  Gtk::Window::set_default_icon_from_file(DATA_DIR "/head.png");
  VBox* vbox = manage(new VBox);
  m_window.add(*vbox);
  MenuBar* mbar = manage(new MenuBar);
  init_menus(*mbar);
  vbox->pack_start(*mbar, PACK_SHRINK);
  vbox->pack_start(m_nb);
  m_statusbar.set_has_resize_grip(false);
  vbox->pack_start(m_statusbar, PACK_SHRINK);
  m_nb.set_border_width(3);
  
  // initialise the "About" dialog
  m_about_dialog.set_icon_from_file(DATA_DIR "/head.png");
  m_about_dialog.set_name("Dino");
  m_about_dialog.set_version(VERSION);
  m_about_dialog.set_copyright("\u00A9 " CR_YEAR " Lars Luthman "
                               "<*****@*****.**>");
  m_about_dialog.set_comments("A pattern based MIDI sequencer for GNU/Linux");
  m_about_dialog.set_license(GPL_TEXT);
  m_about_dialog.set_logo(Pixbuf::create_from_file(DATA_DIR "/midisaurus.png"));
  
  // initialise the "Plugins" dialog
  m_plug_dialog.set_icon_from_file(DATA_DIR "/head.png");
  m_plug_dialog.set_library(m_plib);
  
  m_nb.signal_switch_page().
    connect(sigc::hide<0>(mem_fun(*this, &DinoGUI::page_switched)));
  
  load_plugins(argc, argv);
  
  reset_gui();
  set_status("Welcome to Dino!");
}