option editor and some prompters, misc stuff. this commit message contains no apostrophes.

git-svn-id: svn://localhost/trunk/ardour2@69 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Nick Mainsbridge 2005-10-27 01:10:36 +00:00
parent a0ee84a673
commit c71fc0272d
10 changed files with 168 additions and 195 deletions

View file

@ -117,7 +117,7 @@ Editor::hscroll_slider_button_press (GdkEventButton *ev)
edit_hscroll_drag_last = x;
edit_hscroll_dragging = true;
Gtk::Main::grab_add (edit_hscroll_slider);
edit_hscroll_slider.add_modal_grab();
}
return TRUE;
@ -164,7 +164,7 @@ Editor::hscroll_slider_button_release (GdkEventButton *ev)
// lets do a tempo redisplay now only, because it is dog slow
tempo_map_changed (Change (0));
edit_hscroll_dragging = false;
Gtk::Main::grab_remove (edit_hscroll_slider);
edit_hscroll_slider.remove_modal_grab();
}
return TRUE;

View file

@ -31,7 +31,7 @@ Editor::kbd_driver (sigc::slot<void,GdkEvent*> theslot, bool use_track_canvas, b
double dx, dy;
GdkEvent ev;
GdkModifierType mask;
GdkWindow evw (track_canvas->get_window().get_pointer (x, y, mask));
GdkWindow evw (track_canvas.get_window()->get_pointer (x, y, mask));
bool doit = false;
if (use_track_canvas && gdk_window_get_pointer (track_canvas_event_box.get_window()->gobj(),

View file

@ -264,9 +264,9 @@ Editor::session_going_away ()
/* rip everything out of the list displays */
region_list_clear (); // no clear() method in gtkmm 1.2
route_list.clear ();
named_selection_display.clear ();
edit_group_list.clear ();
route_display_model.clear ();
named_selection_model.clear ();
group_model.clear ();
edit_cursor_clock.set_session (0);
selection_start_clock.set_session (0);

View file

@ -85,14 +85,14 @@ Editor::event_frame (GdkEvent* event, double* pcx, double* pcy)
case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS:
case GDK_3BUTTON_PRESS:
gnome_canvas_w2c_d (GNOME_CANVAS(track_canvas), event->button.x, event->button.y, pcx, pcy);
gnome_canvas_w2c_d (GNOME_CANVAS(&track_canvas), event->button.x, event->button.y, pcx, pcy);
break;
case GDK_MOTION_NOTIFY:
gnome_canvas_w2c_d (GNOME_CANVAS(track_canvas), event->motion.x, event->motion.y, pcx, pcy);
gnome_canvas_w2c_d (GNOME_CANVAS(&track_canvas), event->motion.x, event->motion.y, pcx, pcy);
break;
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
gnome_canvas_w2c_d (GNOME_CANVAS(track_canvas), event->crossing.x, event->crossing.y, pcx, pcy);
gnome_canvas_w2c_d (GNOME_CANVAS(&track_canvas), event->crossing.x, event->crossing.y, pcx, pcy);
break;
default:
warning << string_compose (_("Editor::event_frame() used on unhandled event type %1"), event->type) << endmsg;
@ -724,8 +724,7 @@ Editor::button_press_handler (GnomeCanvasItem* item, GdkEvent* event, ItemType i
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::Shift)) {
if (clicked_trackview) {
if (!current_stepping_trackview) {
TimeoutSig t;
step_timeout = t.connect (mem_fun(*this, &Editor::track_height_step_timeout), 500);
step_timeout = Glib::signal_timeout().connect (mem_fun(*this, &Editor::track_height_step_timeout), 500);
current_stepping_trackview = clicked_trackview;
}
gettimeofday (&last_track_height_step_timestamp, 0);
@ -761,8 +760,7 @@ Editor::button_press_handler (GnomeCanvasItem* item, GdkEvent* event, ItemType i
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::Shift)) {
if (clicked_trackview) {
if (!current_stepping_trackview) {
TimeoutSig t;
step_timeout = t.connect (mem_fun(*this, &Editor::track_height_step_timeout), 500);
step_timeout = Glib::signal_timeout().connect (mem_fun(*this, &Editor::track_height_step_timeout), 500);
current_stepping_trackview = clicked_trackview;
}
gettimeofday (&last_track_height_step_timestamp, 0);
@ -1449,7 +1447,7 @@ Editor::motion_handler (GnomeCanvasItem* item, GdkEvent* event, ItemType item_ty
event might do, its a good tradeoff.
*/
track_canvas->get_pointer (x, y);
track_canvas.get_pointer (x, y);
if (current_stepping_trackview) {
/* don't keep the persistent stepped trackview if the mouse moves */
@ -1540,7 +1538,7 @@ Editor::motion_handler (GnomeCanvasItem* item, GdkEvent* event, ItemType item_ty
}
handled:
track_canvas_motion (item, event);
track_canvas_motion (event);
return TRUE;
not_handled:
@ -4450,19 +4448,17 @@ Editor::mouse_rename_region (GnomeCanvasItem* item, GdkEvent* event)
prompter.set_prompt (_("Name for region:"));
prompter.set_initial_text (clicked_regionview->region.name());
prompter.show_all ();
prompter.done.connect (Main::quit.slot());
prompter.chosen.connect(sigc::ptr_fun(Gtk::Main::quit));
switch (prompter.run ()) {
case GTK_RESPONSE_ACCEPT:
string str;
prompter.get_result(str);
if (str.length()) {
Main::run ();
if (prompter.status == Prompter::cancelled) {
return TRUE;
clicked_regionview->region.set_name (str);
}
break;
}
string str;
prompter.get_result(str);
clicked_regionview->region.set_name (str);
return TRUE;
}

View file

@ -1469,7 +1469,7 @@ Editor::insert_region_list_drag (AudioRegion& region)
AudioTimeAxisView *atv = 0;
Playlist *playlist;
track_canvas->get_pointer (x, y);
track_canvas.get_pointer (x, y);
gnome_canvas_window_to_world (GNOME_CANVAS(track_canvas), x, y, &wx, &wy);
@ -2904,7 +2904,7 @@ Editor::freeze_route ()
interthread_progress_window->set_title (_("ardour: freeze"));
interthread_progress_window->set_position (Gtk::WIN_POS_MOUSE);
interthread_progress_window->show_all ();
interthread_progress_bar.set_percentage (0.0f);
interthread_progress_bar.set_fraction (0.0f);
interthread_progress_label.set_text ("");
interthread_cancel_label.set_text (_("Cancel Freeze"));
current_interthread_info = &itt;
@ -2918,7 +2918,7 @@ Editor::freeze_route ()
pthread_create (&itt.thread, 0, _freeze_thread, this);
track_canvas_scroller.get_window()->set_cursor (GDK_WATCH);
track_canvas_scroller.get_window()->set_cursor (Gdk::WATCH);
while (!itt.done && !itt.cancel) {
gtk_main_iteration ();
@ -3070,7 +3070,7 @@ Editor::cut_copy_points (CutCopyOp op)
void
Editor::cut_copy_regions (CutCopyOp op)
{
typedef map<AudioPlaylist*,AudioPlaylist*> PlaylistMapping;
typedef std::map<AudioPlaylist*,AudioPlaylist*> PlaylistMapping;
PlaylistMapping pmap;
jack_nframes_t first_position = max_frames;
set<Playlist*> freezelist;
@ -3166,7 +3166,7 @@ Editor::mouse_paste ()
{
gint x, y;
double wx, wy;
track_canvas->get_pointer (x, y);
track_canvas.get_pointer (x, y);
gnome_canvas_window_to_world (GNOME_CANVAS(track_canvas), x, y, &wx, &wy);

View file

@ -166,7 +166,7 @@ OptionEditor::OptionEditor (ARDOUR_UI& uip, PublicEditor& ed, Mixer_UI& mixui)
vbox->set_spacing (4);
vbox->pack_start(notebook);
delete_event.connect (mem_fun(*this, &OptionEditor::wm_close));
signal_delete_event().connect (mem_fun(*this, &OptionEditor::wm_close));
notebook.set_show_tabs (true);
notebook.set_show_border (true);
@ -266,19 +266,19 @@ OptionEditor::set_session (Session *s)
if (!s->smpte_drop_frames) {
// non-drop frames
if (s->smpte_frames_per_second == 24.0)
smpte_fps_combo.get_entry ()->set_text (_("24 FPS"));
smpte_fps_combo.set_active_text (_("24 FPS"));
else if (s->smpte_frames_per_second == 25.0)
smpte_fps_combo.get_entry ()->set_text (_("25 FPS"));
smpte_fps_combo.set_active_text (_("25 FPS"));
else if (s->smpte_frames_per_second == 30.0)
smpte_fps_combo.get_entry ()->set_text (_("30 FPS"));
smpte_fps_combo.set_active_text (_("30 FPS"));
else
smpte_fps_combo.get_entry ()->set_text (_("???"));
smpte_fps_combo.set_active_text (_("???"));
} else {
// drop frames
if (floor(s->smpte_frames_per_second) == 29.0)
smpte_fps_combo.get_entry ()->set_text (_("30 FPS drop"));
smpte_fps_combo.set_active_text (_("30 FPS drop"));
else
smpte_fps_combo.get_entry ()->set_text (_("???"));
smpte_fps_combo.set_active_text (_("???"));
}
smpte_offset_clock.set_session (s);
@ -296,7 +296,7 @@ OptionEditor::set_session (Session *s)
/* set up port assignments */
map<MIDI::Port*,vector<RadioButton*> >::iterator res;
std::map<MIDI::Port*,vector<RadioButton*> >::iterator res;
if (session->mtc_port()) {
if ((res = port_toggle_buttons.find (session->mtc_port())) != port_toggle_buttons.end()) {
@ -333,8 +333,8 @@ OptionEditor::set_session (Session *s)
plugins_on_rec_button.set_active (session->get_recording_plugins ());
verify_remove_last_capture_button.set_active (Config->get_verify_remove_last_capture());
layer_mode_combo.get_entry()->set_text (layer_mode_strings[session->get_layer_model()]);
xfade_model_combo.get_entry()->set_text (xfade_model_strings[session->get_xfade_model()]);
layer_mode_combo.set_active_text (layer_mode_strings[session->get_layer_model()]);
xfade_model_combo.set_active_text (xfade_model_strings[session->get_xfade_model()]);
short_xfade_adjustment.set_value ((Crossfade::short_xfade_length() / (float) session->frame_rate()) * 1000.0);
@ -354,33 +354,33 @@ OptionEditor::set_session (Session *s)
// meter stuff
if (session->meter_falloff() == 0.0f) {
meter_falloff_combo.get_entry ()->set_text (_("Off"));
meter_falloff_combo.set_active_text (_("Off"));
} else if (session->meter_falloff() <= 0.3f) {
meter_falloff_combo.get_entry ()->set_text (_("Slowest"));
meter_falloff_combo.set_active_text (_("Slowest"));
} else if (session->meter_falloff() <= 0.4f) {
meter_falloff_combo.get_entry ()->set_text (_("Slow"));
meter_falloff_combo.set_active_text (_("Slow"));
} else if (session->meter_falloff() <= 0.8f) {
meter_falloff_combo.get_entry ()->set_text (_("Medium"));
meter_falloff_combo.set_active_text (_("Medium"));
} else if (session->meter_falloff() <= 1.4f) {
meter_falloff_combo.get_entry ()->set_text (_("Fast"));
meter_falloff_combo.set_active_text (_("Fast"));
} else if (session->meter_falloff() <= 2.0f) {
meter_falloff_combo.get_entry ()->set_text (_("Faster"));
meter_falloff_combo.set_active_text (_("Faster"));
} else {
meter_falloff_combo.get_entry ()->set_text (_("Fastest"));
meter_falloff_combo.set_active_text (_("Fastest"));
}
switch ((int) floor (session->meter_hold())) {
case 0:
meter_hold_combo.get_entry ()->set_text (_("Off"));
meter_hold_combo.set_active_text (_("Off"));
break;
case 40:
meter_hold_combo.get_entry ()->set_text (_("Short"));
meter_hold_combo.set_active_text (_("Short"));
break;
case 100:
meter_hold_combo.get_entry ()->set_text (_("Medium"));
meter_hold_combo.set_active_text (_("Medium"));
break;
case 200:
meter_hold_combo.get_entry ()->set_text (_("Long"));
meter_hold_combo.set_active_text (_("Long"));
break;
}
@ -410,32 +410,32 @@ OptionEditor::setup_path_options()
session_raid_entry.set_name ("OptionsEntry");
session_raid_entry.activate.connect (mem_fun(*this, &OptionEditor::raid_path_changed));
session_raid_entry.signal_activate().connect (mem_fun(*this, &OptionEditor::raid_path_changed));
session_raid_entry.signal_focus_in_event()().connect (mem_fun (Keyboard::the_keyboard(), &Keyboard::focus_in_handler));
session_raid_entry.signal_focus_out_event()().connect (bind (mem_fun(*this, &OptionEditor::focus_out_event_handler), &OptionEditor::raid_path_changed));
session_raid_entry.signal_focus_in_event().connect (mem_fun (Keyboard::the_keyboard(), &Keyboard::focus_in_handler));
session_raid_entry.signal_focus_out_event().connect (bind (mem_fun(*this, &OptionEditor::focus_out_event_handler), &OptionEditor::raid_path_changed));
label = manage(new Label(_("session RAID path")));
label->set_name ("OptionsLabel");
path_table.attach (*label, 0, 1, 0, 1, 0, 0);
path_table.attach (session_raid_entry, 1, 3, 0, 1, Gtk::FILL|Gtk::EXPAND, 0);
path_table.attach (*label, 0, 1, 0, 1, FILL|EXPAND, FILL);
path_table.attach (session_raid_entry, 1, 3, 0, 1, Gtk::FILL|Gtk::EXPAND, FILL);
label = manage(new Label(_("Native Format")));
label->set_name ("OptionsLabel");
path_table.attach (*label, 0, 1, 1, 2, 0, 0);
path_table.attach (native_format_combo, 1, 3, 1, 2, Gtk::FILL|Gtk::EXPAND, 0);
path_table.attach (*label, 0, 1, 1, 2, FILL|EXPAND, FILL);
path_table.attach (native_format_combo, 1, 3, 1, 2, Gtk::FILL|Gtk::EXPAND, FILL);
vector<string> nfstrings = internationalize (native_format_strings);
set_popdown_strings (native_format_combo, nfstrings);
native_format_combo.get_popwin()->signal_unmap_event().connect (mem_fun(*this, &OptionEditor::native_format_chosen));
native_format_combo.signal_unmap_event().connect (mem_fun(*this, &OptionEditor::native_format_chosen));
fixup_combo_size (native_format_combo, nfstrings);
if (Config->get_native_format_is_bwf()) {
native_format_combo.get_entry()->set_text (native_format_strings[0]);
native_format_combo.set_active_text (native_format_strings[0]);
} else {
native_format_combo.get_entry()->set_text (native_format_strings[1]);
native_format_combo.set_active_text (native_format_strings[1]);
}
path_table.show_all();
@ -489,7 +489,7 @@ OptionEditor::setup_fade_options ()
dumb.push_back (lmode_strings[Session::AddHigher]);
set_popdown_strings (layer_mode_combo, dumb);
layer_mode_combo.get_popwin()->signal_unmap_event().connect (mem_fun(*this, &OptionEditor::layer_mode_chosen));
layer_mode_combo.signal_unmap_event().connect (mem_fun(*this, &OptionEditor::layer_mode_chosen));
fixup_combo_size (layer_mode_combo, layer_mode_strings);
@ -507,7 +507,7 @@ OptionEditor::setup_fade_options ()
dumb.push_back (xfade_model_strings[ShortCrossfade]);
set_popdown_strings (xfade_model_combo, dumb);
xfade_model_combo.get_popwin()->signal_unmap_event().connect (mem_fun(*this, &OptionEditor::xfade_model_chosen));
xfade_model_combo.signal_unmap_event().connect (mem_fun(*this, &OptionEditor::xfade_model_chosen));
fixup_combo_size (xfade_model_combo, xfade_model_strings);
@ -534,7 +534,7 @@ OptionEditor::setup_fade_options ()
hbox->pack_start (short_xfade_slider, true, true);
fade_packer.pack_start (*hbox, false, false);
short_xfade_adjustment.value_changed.connect (mem_fun(*this, &OptionEditor::short_xfade_adjustment_changed));
short_xfade_adjustment.signal_value_changed().connect (mem_fun(*this, &OptionEditor::short_xfade_adjustment_changed));
fade_packer.show_all ();
}
@ -558,7 +558,7 @@ OptionEditor::layer_mode_chosen (GdkEventAny* ev)
return FALSE;
}
string which = layer_mode_combo.get_entry()->get_text ();
string which = layer_mode_combo.get_active_text ();
if (which == layer_mode_strings[Session::LaterHigher]) {
session->set_layer_model (Session::LaterHigher);
@ -577,7 +577,7 @@ OptionEditor::xfade_model_chosen (GdkEventAny* ev)
return FALSE;
}
string which = xfade_model_combo.get_entry()->get_text ();
string which = xfade_model_combo.get_active_text ();
if (which == xfade_model_strings[FullCrossfade]) {
session->set_xfade_model (FullCrossfade);
@ -705,7 +705,7 @@ OptionEditor::setup_display_options ()
dumb.push_back (_("Medium"));
dumb.push_back (_("Long"));
set_popdown_strings (meter_hold_combo, dumb);
meter_hold_combo.get_popwin()->signal_unmap_event().connect (mem_fun(*this, &OptionEditor::meter_hold_chosen));
meter_hold_combo.signal_unmap_event().connect (mem_fun(*this, &OptionEditor::meter_hold_chosen));
hbox = manage (new HBox);
hbox->set_border_width (8);
hbox->set_spacing (8);
@ -724,7 +724,7 @@ OptionEditor::setup_display_options ()
dumb.push_back (_("Faster"));
dumb.push_back (_("Fastest"));
set_popdown_strings (meter_falloff_combo, dumb);
meter_falloff_combo.get_popwin()->signal_unmap_event().connect (mem_fun(*this, &OptionEditor::meter_falloff_chosen));
meter_falloff_combo.signal_unmap_event().connect (mem_fun(*this, &OptionEditor::meter_falloff_chosen));
hbox = manage (new HBox);
hbox->set_border_width (8);
hbox->set_spacing (8);
@ -751,7 +751,7 @@ gint
OptionEditor::meter_hold_chosen (GdkEventAny* ev)
{
if (session) {
string str = meter_hold_combo.get_entry()->get_text();
string str = meter_hold_combo.get_active_text();
if (str == _("Off")) {
session->set_meter_hold (0);
@ -771,7 +771,7 @@ gint
OptionEditor::meter_falloff_chosen (GdkEventAny* ev)
{
if (session) {
string str = meter_falloff_combo.get_entry()->get_text();
string str = meter_falloff_combo.get_active_text();
if (str == _("Off")) {
session->set_meter_falloff (0.0f);
@ -835,9 +835,9 @@ OptionEditor::setup_sync_options ()
slave_type_combo.set_use_arrows_always (true);
slave_type_combo.set_value_in_list (true, false);
slave_type_combo.get_entry()->set_editable (false);
slave_type_combo.get_entry()->set_name ("OptionsEntry");
slave_type_combo.get_popwin()->signal_unmap_event().connect (mem_fun(*this, &OptionEditor::slave_type_chosen));
slave_type_combo.set_editable (false);
slave_type_combo.set_name ("OptionsEntry");
slave_type_combo.signal_unmap_event().connect (mem_fun(*this, &OptionEditor::slave_type_chosen));
dumb.clear ();
dumb.push_back (X_("24 FPS"));
@ -846,7 +846,7 @@ OptionEditor::setup_sync_options ()
dumb.push_back (X_("30 FPS non-drop"));
set_popdown_strings (smpte_fps_combo, dumb);
smpte_fps_combo.get_popwin()->signal_unmap_event().connect (mem_fun(*this, &OptionEditor::smpte_fps_chosen));
smpte_fps_combo.signal_unmap_event().connect (mem_fun(*this, &OptionEditor::smpte_fps_chosen));
smpte_offset_clock.set_mode (AudioClock::SMPTE);
smpte_offset_clock.ValueChanged.connect (mem_fun(*this, &OptionEditor::smpte_offset_chosen));
@ -918,7 +918,7 @@ gint
OptionEditor::smpte_fps_chosen (GdkEventAny* ev)
{
if (session) {
string str = smpte_fps_combo.get_entry()->get_text();
string str = smpte_fps_combo.get_active_text();
if (str == X_("24 FPS")) {
session->set_smpte_type (24.0, false);
@ -980,7 +980,7 @@ OptionEditor::setup_midi_options ()
newpair.first = i->second;
table->attach (*(manage (new Label (i->first))), 0, 1, n+2, n+3, 0, 0);
table->attach (*(manage (new Label (i->first))), 0, 1, n+2, n+3,FILL|EXPAND, FILL );
tb = manage (new ToggleButton (_("online")));
tb->set_name ("OptionEditorToggleButton");
@ -997,19 +997,19 @@ OptionEditor::setup_midi_options ()
tb->set_active (!(*i).second->input()->offline());
tb->signal_button_press_event().connect (bind (mem_fun(*this, &OptionEditor::port_online_toggled), (*i).second, tb));
(*i).second->input()->OfflineStatusChanged.connect (bind (mem_fun(*this, &OptionEditor::map_port_online), (*i).second, tb));
table->attach (*tb, 1, 2, n+2, n+3, 0, 0);
table->attach (*tb, 1, 2, n+2, n+3, FILL|EXPAND, FILL);
tb = manage (new ToggleButton ());
tb->set_name ("OptionEditorToggleButton");
tb->signal_button_press_event().connect (bind (mem_fun(*this, &OptionEditor::port_trace_in_toggled), (*i).second, tb));
tb->set_size_request (10, 10);
table->attach (*tb, 2, 3, n+2, n+3, 0, 0);
table->attach (*tb, 2, 3, n+2, n+3, FILL|EXPAND, FILL);
tb = manage (new ToggleButton ());
tb->set_name ("OptionEditorToggleButton");
tb->signal_button_press_event().connect (bind (mem_fun(*this, &OptionEditor::port_trace_out_toggled), (*i).second, tb));
tb->set_size_request (10, 10);
table->attach (*tb, 3, 4, n+2, n+3, 0, 0);
table->attach (*tb, 3, 4, n+2, n+3, FILL|EXPAND, FILL);
rb = manage (new RadioButton ());
newpair.second.push_back (rb);
@ -1017,9 +1017,9 @@ OptionEditor::setup_midi_options ()
if (n == 0) {
first_mtc_button = rb;
} else {
rb->set_group (first_mtc_button->group());
rb->set_group (first_mtc_button->get_group());
}
table->attach (*rb, 4, 5, n+2, n+3, 0, 0);
table->attach (*rb, 4, 5, n+2, n+3, FILL|EXPAND, FILL);
rb->signal_button_press_event().connect (bind (mem_fun(*this, &OptionEditor::mtc_port_chosen), (*i).second, rb));
if (Config->get_mtc_port_name() == i->first) {
@ -1032,9 +1032,9 @@ OptionEditor::setup_midi_options ()
if (n == 0) {
first_mmc_button = rb;
} else {
rb->set_group (first_mmc_button->group());
rb->set_group (first_mmc_button->get_group());
}
table->attach (*rb, 6, 7, n+2, n+3, 0, 0);
table->attach (*rb, 6, 7, n+2, n+3, FILL|EXPAND, FILL);
rb->signal_button_press_event().connect (bind (mem_fun(*this, &OptionEditor::mmc_port_chosen), (*i).second, rb));
if (Config->get_mmc_port_name() == i->first) {
@ -1047,9 +1047,9 @@ OptionEditor::setup_midi_options ()
if (n == 0) {
first_midi_button = rb;
} else {
rb->set_group (first_midi_button->group());
rb->set_group (first_midi_button->get_group());
}
table->attach (*rb, 8, 9, n+2, n+3, 0, 0);
table->attach (*rb, 8, 9, n+2, n+3, FILL|EXPAND, FILL);
rb->signal_button_press_event().connect (bind (mem_fun(*this, &OptionEditor::midi_port_chosen), (*i).second, rb));
if (Config->get_midi_port_name() == i->first) {
@ -1431,16 +1431,16 @@ OptionEditor::session_control_changed (Session::ControlType t)
case Session::SlaveType:
switch (session->slave_source()) {
case Session::None:
slave_type_combo.get_entry()->set_text (positional_sync_strings[Session::None]);
slave_type_combo.set_active_text (positional_sync_strings[Session::None]);
break;
case Session::MTC:
slave_type_combo.get_entry()->set_text (positional_sync_strings[Session::MTC]);
slave_type_combo.set_active_text (positional_sync_strings[Session::MTC]);
break;
case Session::JACK:
slave_type_combo.get_entry()->set_text (positional_sync_strings[Session::JACK]);
slave_type_combo.set_active_text (positional_sync_strings[Session::JACK]);
break;
default:
slave_type_combo.get_entry()->set_text (_("--unknown--"));
slave_type_combo.set_active_text (_("--unknown--"));
break;
}
@ -1480,7 +1480,7 @@ OptionEditor::native_format_chosen (GdkEventAny *ignored)
return FALSE;
}
bool use_bwf = (native_format_combo.get_entry()->get_text() == native_format_strings[0]);
bool use_bwf = (native_format_combo.get_active_text() == native_format_strings[0]);
if (use_bwf != Config->get_native_format_is_bwf()) {
Config->set_native_format_is_bwf (use_bwf);
@ -1499,7 +1499,7 @@ OptionEditor::slave_type_chosen (GdkEventAny *ignored)
return FALSE;
}
which = slave_type_combo.get_entry()->get_text();
which = slave_type_combo.get_active_text();
if (which == positional_sync_strings[Session::None]) {
session->request_slave_source (Session::None);
@ -1536,13 +1536,13 @@ OptionEditor::setup_click_editor ()
click_path_entry.set_name ("OptionsEntry");
click_emphasis_path_entry.set_name ("OptionsEntry");
click_path_entry.activate.connect (mem_fun(*this, &OptionEditor::click_sound_changed));
click_emphasis_path_entry.activate.connect (mem_fun(*this, &OptionEditor::click_emphasis_sound_changed));
click_path_entry.signal_activate().connect (mem_fun(*this, &OptionEditor::click_sound_changed));
click_emphasis_path_entry.signal_activate().connect (mem_fun(*this, &OptionEditor::click_emphasis_sound_changed));
click_path_entry.signal_focus_in_event()().connect (mem_fun (Keyboard::the_keyboard(), &Keyboard::focus_in_handler));
click_path_entry.signal_focus_out_event()().connect (bind (mem_fun(*this, &OptionEditor::focus_out_event_handler), &OptionEditor::click_sound_changed));
click_emphasis_path_entry.signal_focus_in_event()().connect (mem_fun (Keyboard::the_keyboard(), &Keyboard::focus_in_handler));
click_emphasis_path_entry.signal_focus_out_event()().connect (bind (mem_fun(*this, &OptionEditor::focus_out_event_handler), &OptionEditor::click_emphasis_sound_changed));
click_path_entry.signal_focus_in_event().connect (mem_fun (Keyboard::the_keyboard(), &Keyboard::focus_in_handler));
click_path_entry.signal_focus_out_event().connect (bind (mem_fun(*this, &OptionEditor::focus_out_event_handler), &OptionEditor::click_sound_changed));
click_emphasis_path_entry.signal_focus_in_event().connect (mem_fun (Keyboard::the_keyboard(), &Keyboard::focus_in_handler));
click_emphasis_path_entry.signal_focus_out_event().connect (bind (mem_fun(*this, &OptionEditor::focus_out_event_handler), &OptionEditor::click_emphasis_sound_changed));
click_browse_button.set_name ("EditorGTKButton");
click_emphasis_browse_button.set_name ("EditorGTKButton");
@ -1559,15 +1559,15 @@ OptionEditor::setup_click_editor ()
label = manage(new Label(_("Click audio file")));
label->set_name ("OptionsLabel");
click_table.attach (*label, 0, 1, 0, 1, 0, 0);
click_table.attach (click_path_entry, 1, 2, 0, 1, Gtk::FILL|Gtk::EXPAND, 0);
click_table.attach (click_browse_button, 2, 3, 0, 1, 0, 0);
click_table.attach (*label, 0, 1, 0, 1, FILL|EXPAND, FILL);
click_table.attach (click_path_entry, 1, 2, 0, 1, Gtk::FILL|Gtk::EXPAND, FILL);
click_table.attach (click_browse_button, 2, 3, 0, 1, FILL|EXPAND, FILL);
label = manage(new Label(_("Click emphasis audiofile")));
label->set_name ("OptionsLabel");
click_table.attach (*label, 0, 1, 1, 2, 0, 0);
click_table.attach (click_emphasis_path_entry, 1, 2, 1, 2, Gtk::FILL|Gtk::EXPAND, 0);
click_table.attach (click_emphasis_browse_button, 2, 3, 1, 2, 0, 0);
click_table.attach (*label, 0, 1, 1, 2, FILL|EXPAND, FILL);
click_table.attach (click_emphasis_path_entry, 1, 2, 1, 2, Gtk::FILL|Gtk::EXPAND, FILL);
click_table.attach (click_emphasis_browse_button, 2, 3, 1, 2, FILL|EXPAND, FILL);
hpacker->set_spacing (10);
hpacker->pack_start (*click_io_selector, false, false);
@ -1639,16 +1639,16 @@ OptionEditor::setup_misc_options()
misc_packer.set_spacing (3);
misc_packer.pack_start (*table, true, true);
table->attach (hw_monitor_button, 0, 1, 0, 1, Gtk::FILL, 0, 8, 0);
table->attach (sw_monitor_button, 0, 1, 1, 2, Gtk::FILL, 0, 8, 0);
table->attach (plugins_stop_button, 0, 1, 2, 3, Gtk::FILL, 0, 8, 0);
table->attach (plugins_on_rec_button, 0, 1, 3, 4, Gtk::FILL, 0, 8, 0);
table->attach (verify_remove_last_capture_button, 0, 1, 4, 5, Gtk::FILL, 0, 8, 0);
table->attach (hw_monitor_button, 0, 1, 0, 1, Gtk::FILL, FILL, 8, 0);
table->attach (sw_monitor_button, 0, 1, 1, 2, Gtk::FILL, FILL, 8, 0);
table->attach (plugins_stop_button, 0, 1, 2, 3, Gtk::FILL, FILL, 8, 0);
table->attach (plugins_on_rec_button, 0, 1, 3, 4, Gtk::FILL, FILL, 8, 0);
table->attach (verify_remove_last_capture_button, 0, 1, 4, 5, Gtk::FILL, FILL, 8, 0);
table->attach (stop_rec_on_xrun_button, 1, 2, 0, 1, Gtk::FILL, 0, 8, 0);
table->attach (stop_at_end_button, 1, 2, 1, 2, Gtk::FILL, 0, 8, 0);
table->attach (debug_keyboard_button, 1, 2, 2, 3, Gtk::FILL, 0, 8, 0);
table->attach (speed_quieten_button, 1, 2, 3, 4, Gtk::FILL, 0, 8, 0);
table->attach (stop_rec_on_xrun_button, 1, 2, 0, 1, Gtk::FILL, FILL, 8, 0);
table->attach (stop_at_end_button, 1, 2, 1, 2, Gtk::FILL, FILL, 8, 0);
table->attach (debug_keyboard_button, 1, 2, 2, 3, Gtk::FILL, FILL, 8, 0);
table->attach (speed_quieten_button, 1, 2, 3, 4, Gtk::FILL, FILL, 8, 0);
Gtk::VBox* connect_box = manage (new VBox);
connect_box->set_spacing (3);
@ -1837,11 +1837,11 @@ OptionEditor::setup_keyboard_options ()
}
set_popdown_strings (edit_modifier_combo, dumb);
edit_modifier_combo.get_popwin()->signal_unmap_event().connect (mem_fun(*this, &OptionEditor::edit_modifier_chosen));
edit_modifier_combo.signal_unmap_event().connect (mem_fun(*this, &OptionEditor::edit_modifier_chosen));
for (int x = 0; modifiers[x].name; ++x) {
if (modifiers[x].modifier == Keyboard::edit_modifier ()) {
edit_modifier_combo.get_entry()->set_text (_(modifiers[x].name));
edit_modifier_combo.set_active_text (_(modifiers[x].name));
break;
}
}
@ -1850,25 +1850,25 @@ OptionEditor::setup_keyboard_options ()
label->set_name ("OptionsLabel");
label->set_alignment (1.0, 0.5);
keyboard_mouse_table.attach (*label, 0, 1, 0, 1, Gtk::FILL|Gtk::EXPAND, 0);
keyboard_mouse_table.attach (edit_modifier_combo, 1, 2, 0, 1, Gtk::FILL|Gtk::EXPAND, 0);
keyboard_mouse_table.attach (*label, 0, 1, 0, 1, Gtk::FILL|Gtk::EXPAND, FILL);
keyboard_mouse_table.attach (edit_modifier_combo, 1, 2, 0, 1, Gtk::FILL|Gtk::EXPAND, FILL);
label = manage (new Label (_("+ button")));
label->set_name ("OptionsLabel");
keyboard_mouse_table.attach (*label, 3, 4, 0, 1, Gtk::FILL|Gtk::EXPAND, 0);
keyboard_mouse_table.attach (edit_button_spin, 4, 5, 0, 1, Gtk::FILL|Gtk::EXPAND, 0);
keyboard_mouse_table.attach (*label, 3, 4, 0, 1, Gtk::FILL|Gtk::EXPAND, FILL);
keyboard_mouse_table.attach (edit_button_spin, 4, 5, 0, 1, Gtk::FILL|Gtk::EXPAND, FILL);
edit_button_spin.set_name ("OptionsEntry");
edit_button_adjustment.set_value (Keyboard::edit_button());
edit_button_adjustment.value_changed.connect (mem_fun(*this, &OptionEditor::edit_button_changed));
edit_button_adjustment.signal_value_changed().connect (mem_fun(*this, &OptionEditor::edit_button_changed));
set_popdown_strings (delete_modifier_combo, dumb);
delete_modifier_combo.get_popwin()->signal_unmap_event().connect (mem_fun(*this, &OptionEditor::delete_modifier_chosen));
delete_modifier_combo.signal_unmap_event().connect (mem_fun(*this, &OptionEditor::delete_modifier_chosen));
for (int x = 0; modifiers[x].name; ++x) {
if (modifiers[x].modifier == Keyboard::delete_modifier ()) {
delete_modifier_combo.get_entry()->set_text (_(modifiers[x].name));
delete_modifier_combo.set_active_text (_(modifiers[x].name));
break;
}
}
@ -1877,25 +1877,25 @@ OptionEditor::setup_keyboard_options ()
label->set_name ("OptionsLabel");
label->set_alignment (1.0, 0.5);
keyboard_mouse_table.attach (*label, 0, 1, 1, 2, Gtk::FILL|Gtk::EXPAND, 0);
keyboard_mouse_table.attach (delete_modifier_combo, 1, 2, 1, 2, Gtk::FILL|Gtk::EXPAND, 0);
keyboard_mouse_table.attach (*label, 0, 1, 1, 2, Gtk::FILL|Gtk::EXPAND, FILL);
keyboard_mouse_table.attach (delete_modifier_combo, 1, 2, 1, 2, Gtk::FILL|Gtk::EXPAND, FILL);
label = manage (new Label (_("+ button")));
label->set_name ("OptionsLabel");
keyboard_mouse_table.attach (*label, 3, 4, 1, 2, Gtk::FILL|Gtk::EXPAND, 0);
keyboard_mouse_table.attach (delete_button_spin, 4, 5, 1, 2, Gtk::FILL|Gtk::EXPAND, 0);
keyboard_mouse_table.attach (*label, 3, 4, 1, 2, Gtk::FILL|Gtk::EXPAND, FILL);
keyboard_mouse_table.attach (delete_button_spin, 4, 5, 1, 2, Gtk::FILL|Gtk::EXPAND, FILL);
delete_button_spin.set_name ("OptionsEntry");
delete_button_adjustment.set_value (Keyboard::delete_button());
delete_button_adjustment.value_changed.connect (mem_fun(*this, &OptionEditor::delete_button_changed));
delete_button_adjustment.signal_value_changed().connect (mem_fun(*this, &OptionEditor::delete_button_changed));
set_popdown_strings (snap_modifier_combo, dumb);
snap_modifier_combo.get_popwin()->signal_unmap_event().connect (mem_fun(*this, &OptionEditor::snap_modifier_chosen));
snap_modifier_combo.signal_unmap_event().connect (mem_fun(*this, &OptionEditor::snap_modifier_chosen));
for (int x = 0; modifiers[x].name; ++x) {
if (modifiers[x].modifier == (guint) Keyboard::snap_modifier ()) {
snap_modifier_combo.get_entry()->set_text (_(modifiers[x].name));
snap_modifier_combo.set_active_text (_(modifiers[x].name));
break;
}
}
@ -1904,8 +1904,8 @@ OptionEditor::setup_keyboard_options ()
label->set_name ("OptionsLabel");
label->set_alignment (1.0, 0.5);
keyboard_mouse_table.attach (*label, 0, 1, 2, 3, Gtk::FILL|Gtk::EXPAND, 0);
keyboard_mouse_table.attach (snap_modifier_combo, 1, 2, 2, 3, Gtk::FILL|Gtk::EXPAND, 0);
keyboard_mouse_table.attach (*label, 0, 1, 2, 3, Gtk::FILL|Gtk::EXPAND, FILL);
keyboard_mouse_table.attach (snap_modifier_combo, 1, 2, 2, 3, Gtk::FILL|Gtk::EXPAND, FILL);
}
gint
@ -1913,7 +1913,7 @@ OptionEditor::edit_modifier_chosen (GdkEventAny *ev)
{
string txt;
txt = edit_modifier_combo.get_entry()->get_text();
txt = edit_modifier_combo.get_active_text();
for (int i = 0; modifiers[i].name; ++i) {
if (txt == _(modifiers[i].name)) {
@ -1929,7 +1929,7 @@ OptionEditor::delete_modifier_chosen (GdkEventAny *ev)
{
string txt;
txt = delete_modifier_combo.get_entry()->get_text();
txt = delete_modifier_combo.get_active_text();
for (int i = 0; modifiers[i].name; ++i) {
if (txt == _(modifiers[i].name)) {
@ -1945,7 +1945,7 @@ OptionEditor::snap_modifier_chosen (GdkEventAny *ev)
{
string txt;
txt = snap_modifier_combo.get_entry()->get_text();
txt = snap_modifier_combo.get_active_text();
for (int i = 0; modifiers[i].name; ++i) {
if (txt == _(modifiers[i].name)) {

View file

@ -476,7 +476,7 @@ PluginUI::build_control_ui (AudioEngine &engine, guint32 port_index, MIDI::Contr
control_ui->combo = new Gtk::Combo;
control_ui->combo->set_value_in_list(true, false);
set_popdown_strings (*control_ui->combo, setup_scale_values(port_index, control_ui));
control_ui->combo->get_popwin()->signal_unmap_event(), mem_fun(*this, &PluginUI::control_combo_changed), control_ui));
control_ui->combo->signal_unmap_event().connect( mem_fun(*this, &PluginUI::control_combo_changed), control_ui);
plugin.ParameterChanged.connect (bind (mem_fun(*this, &PluginUI::parameter_changed), control_ui));
control_ui->pack_start(control_ui->label, true, true);
control_ui->pack_start(*control_ui->combo, false, true);
@ -715,7 +715,7 @@ PluginUI::update_control_display (ControlUI* cui)
std::map<string,float>::iterator it;
for (it = cui->combo_map->begin(); it != cui->combo_map->end(); ++it) {
if (it->second == val) {
cui->combo->get_entry()->set_text(it->first);
cui->combo->set_active_text(it->first);
break;
}
}
@ -750,7 +750,7 @@ gint
PluginUI::control_combo_changed (GdkEventAny* ignored, ControlUI* cui)
{
if (!cui->ignore_change) {
string value = cui->combo->get_entry()->get_text();
string value = cui->combo->get_active_text();
std::map<string,float> mapping = *cui->combo_map;
insert.set_parameter (cui->port_index, mapping[value]);
}
@ -874,7 +874,7 @@ PlugUIBase::PlugUIBase (PluginInsert& pi)
combo.set_use_arrows_always(true);
set_popdown_strings (combo, plugin.get_presets());
combo.set_active_text ("");
combo.get_popwin()->signal_unmap_event().connect(mem_fun(*this, &PlugUIBase::setting_selected));
combo.signal_unmap_event().connect(mem_fun(*this, &PlugUIBase::setting_selected));
save_button.set_name ("PluginSaveButton");
save_button.signal_clicked().connect(mem_fun(*this, &PlugUIBase::save_plugin_setting));
@ -886,10 +886,9 @@ PlugUIBase::PlugUIBase (PluginInsert& pi)
gint
PlugUIBase::setting_selected(GdkEventAny* ignored)
{
Entry* entry = combo.get_entry();
if (entry->get_text().length() > 0) {
if (!plugin.load_preset(entry->get_text())) {
warning << string_compose(_("Plugin preset %1 not found"), entry->get_text()) << endmsg;
if (combo.get_active_text().length() > 0) {
if (!plugin.load_preset(combo.get_active_text())) {
warning << string_compose(_("Plugin preset %1 not found"), combo.get_active_text()) << endmsg;
}
}
@ -903,11 +902,10 @@ PlugUIBase::save_plugin_setting ()
prompter.set_prompt(_("Name for plugin settings:"));
prompter.show_all();
prompter.done.connect(Main::quit.slot());
Main::run();
switch (prompter.run ()) {
case GTK_RESPONSE_ACCEPT:
if (prompter.status == Gtkmm2ext::Prompter::entered) {
string name;
prompter.get_result(name);
@ -918,6 +916,7 @@ PlugUIBase::save_plugin_setting ()
combo.set_active_text (name);
}
}
break;
}
}

View file

@ -687,26 +687,24 @@ void
RouteUI::route_rename ()
{
ArdourPrompter name_prompter (true);
string result;
name_prompter.set_prompt (_("new name: "));
name_prompter.set_initial_text (_route.name());
name_prompter.done.connect (Gtk::Main::quit.slot());
name_prompter.show_all ();
Gtk::Main::run();
switch (name_prompter.run ()) {
if (name_prompter.status == Gtkmm2ext::Prompter::cancelled) {
return;
}
string result;
name_prompter.get_result (result);
if (result.length() == 0) {
return;
case GTK_RESPONSE_ACCEPT:
name_prompter.get_result (result);
if (result.length()) {
strip_whitespace_edges (result);
_route.set_name (result, this);
}
break;
}
strip_whitespace_edges (result);
_route.set_name (result, this);
return;
}
void

View file

@ -360,8 +360,24 @@ VisualTimeAxis::start_time_axis_rename()
name_prompter->set_prompt (_("new name: ")) ;
ARDOUR_UI::instance()->allow_focus(true) ;
name_prompter->done.connect (mem_fun(*this, &VisualTimeAxis::finish_time_axis_rename)) ;
name_prompter->show_all() ;
switch (name_prompter->run ()) {
case GTK_RESPONSE_ACCEPT:
string result;
name_prompter->get_result (result);
if (editor.get_named_time_axis(result) != 0) {
ARDOUR_UI::instance()->popup_error (_("A track already exists with that name"));
return ;
}
set_time_axis_name(result, this) ;
}
delete name_prompter ;
name_prompter = 0 ;
label_view() ;
}
/**
@ -369,37 +385,7 @@ VisualTimeAxis::start_time_axis_rename()
*
* @see start_time_axis_rename()
*/
void
VisualTimeAxis::finish_time_axis_rename()
{
name_prompter->hide_all () ;
ARDOUR_UI::instance()->allow_focus (false) ;
if (name_prompter->status == Gtkmm2ext::Prompter::cancelled)
{
return;
}
string result ;
name_prompter->get_result (result) ;
//time_axis_name = result ;
if (editor.get_named_time_axis(result) != 0) {
ARDOUR_UI::instance()->popup_error (_("A track already exists with that name"));
return ;
}
set_time_axis_name(result, this) ;
delete name_prompter ;
name_prompter = 0 ;
label_view() ;
}
/**
* Handle the (re-)displaying of the TimeAxis name label
*
*/
void
VisualTimeAxis::label_view()
{

View file

@ -220,12 +220,6 @@ class VisualTimeAxis : public TimeAxisView
*
* @see start_time_axis_rename()
*/
void finish_time_axis_rename() ;
/**
* Handle the (re-)displaying of the TimeAxis name label
*
*/
virtual void label_view() ;