diff options
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 10 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui_ed.cc | 3 | ||||
-rw-r--r-- | gtk2_ardour/audio_region_view.cc | 27 | ||||
-rw-r--r-- | gtk2_ardour/audio_region_view.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/editor.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor_keys.cc | 8 | ||||
-rw-r--r-- | gtk2_ardour/editor_mouse.cc | 282 | ||||
-rw-r--r-- | gtk2_ardour/export_dialog.cc | 3 | ||||
-rw-r--r-- | gtk2_ardour/export_dialog.h | 5 | ||||
-rw-r--r-- | gtk2_ardour/export_range_markers_dialog.cc | 10 | ||||
-rw-r--r-- | gtk2_ardour/export_range_markers_dialog.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/export_region_dialog.cc | 3 | ||||
-rw-r--r-- | gtk2_ardour/export_session_dialog.cc | 3 | ||||
-rw-r--r-- | gtk2_ardour/mixer_ui.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/region_view.cc | 16 | ||||
-rw-r--r-- | gtk2_ardour/region_view.h | 5 | ||||
-rw-r--r-- | gtk2_ardour/route_params_ui.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/time_axis_view_item.cc | 32 | ||||
-rw-r--r-- | gtk2_ardour/time_axis_view_item.h | 4 |
20 files changed, 242 insertions, 183 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index ab06f4952b..d27a0505f2 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -997,7 +997,8 @@ ARDOUR_UI::session_add_audio_route (bool track, int32_t input_channels, int32_t if (how_many == 1) { error << _("could not create a new audio track") << endmsg; } else { - error << string_compose (_("could not create %1 new audio tracks"), how_many) << endmsg; + error << string_compose (_("could only create %1 of %2 new audio %3"), + tracks.size(), how_many, (track ? _("tracks") : _("busses"))) << endmsg; } } @@ -1028,6 +1029,7 @@ ARDOUR_UI::session_add_audio_route (bool track, int32_t input_channels, int32_t } catch (...) { + cerr << "About to complain about JACK\n"; MessageDialog msg (*editor, _("There are insufficient JACK ports available\n\ to create a new track or bus.\n\ @@ -2259,7 +2261,7 @@ releasing %4 %5bytes of disk space")); } void -ARDOUR_UI::add_route () +ARDOUR_UI::add_route (Gtk::Window* float_window) { int count; @@ -2269,7 +2271,9 @@ ARDOUR_UI::add_route () if (add_route_dialog == 0) { add_route_dialog = new AddRouteDialog; - editor->ensure_float (*add_route_dialog); + if (float_window) { + add_route_dialog->set_transient_for (*float_window); + } } if (add_route_dialog->is_visible()) { diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 6f9cc8dfce..599debaf1e 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -188,7 +188,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI void store_clock_modes (); void restore_clock_modes (); - void add_route (); + void add_route (Gtk::Window* float_window); void session_add_audio_track (int input_channels, int32_t output_channels, ARDOUR::TrackMode mode, uint32_t how_many) { session_add_audio_route (true, input_channels, output_channels, mode, how_many); diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index f80e71a410..f79564bb43 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -99,7 +99,8 @@ ARDOUR_UI::install_actions () act = ActionManager::register_action (main_actions, X_("Close"), _("Close"), mem_fun(*this, &ARDOUR_UI::close_session)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (main_actions, X_("AddTrackBus"), _("Add Track/Bus"), mem_fun(*this, &ARDOUR_UI::add_route)); + act = ActionManager::register_action (main_actions, X_("AddTrackBus"), _("Add Track/Bus"), + bind (mem_fun(*this, &ARDOUR_UI::add_route), (Gtk::Window*) 0)); ActionManager::session_sensitive_actions.push_back (act); diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index 6e6fc39ba8..04324a7d60 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -89,14 +89,37 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView { } + +AudioRegionView::AudioRegionView (const AudioRegionView& other) + : RegionView (other) + , zero_line(0) + , fade_in_shape(0) + , fade_out_shape(0) + , fade_in_handle(0) + , fade_out_handle(0) + , gain_line(0) + , _amplitude_above_axis(1.0) + , _flags(0) + , fade_color(0) + +{ + Gdk::Color c; + int r,g,b,a; + + UINT_TO_RGBA (other.fill_color, &r, &g, &b, &a); + c.set_rgb_p (r/255.0, g/255.0, b/255.0); + + init (c, false); +} + void AudioRegionView::init (Gdk::Color& basic_color, bool wfd) { // FIXME: Some redundancy here with RegionView::init. Need to figure out // where order is important and where it isn't... - RegionView::init(basic_color, wfd); - + RegionView::init(basic_color, false); + XMLNode *node; _amplitude_above_axis = 1.0; diff --git a/gtk2_ardour/audio_region_view.h b/gtk2_ardour/audio_region_view.h index 193cd80e96..761c0eafd8 100644 --- a/gtk2_ardour/audio_region_view.h +++ b/gtk2_ardour/audio_region_view.h @@ -55,6 +55,8 @@ class AudioRegionView : public RegionView double initial_samples_per_unit, Gdk::Color& basic_color); + AudioRegionView (const AudioRegionView& other); + ~AudioRegionView (); virtual void init (Gdk::Color& base_color, bool wait_for_data = false); @@ -143,7 +145,7 @@ class AudioRegionView : public RegionView void reset_width_dependent_items (double pixel_width); void set_waveview_data_src(); - void color_handler (ColorID, uint32_t); + void color_handler (ColorID, uint32_t); vector<GnomeCanvasWaveViewCache*> wave_caches; vector<ArdourCanvas::WaveView *> waves; diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 9ad78634b9..2bd6c04f9d 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -3031,7 +3031,7 @@ gint Editor::edit_controls_button_release (GdkEventButton* ev) { if (Keyboard::is_context_menu_event (ev)) { - ARDOUR_UI::instance()->add_route (); + ARDOUR_UI::instance()->add_route (this); } return TRUE; } diff --git a/gtk2_ardour/editor_keys.cc b/gtk2_ardour/editor_keys.cc index e38fe9e2e7..b3081e8c8a 100644 --- a/gtk2_ardour/editor_keys.cc +++ b/gtk2_ardour/editor_keys.cc @@ -69,7 +69,7 @@ Editor::keyboard_duplicate_region () return; } - float prefix; + float prefix = 0; bool was_floating; if (get_prefix (prefix, was_floating) == 0) { @@ -82,7 +82,7 @@ Editor::keyboard_duplicate_region () void Editor::keyboard_duplicate_selection () { - float prefix; + float prefix = 0; bool was_floating; if (get_prefix (prefix, was_floating) == 0) { @@ -95,7 +95,7 @@ Editor::keyboard_duplicate_selection () void Editor::keyboard_paste () { - float prefix; + float prefix = 0; bool was_floating; if (get_prefix (prefix, was_floating) == 0) { @@ -108,7 +108,7 @@ Editor::keyboard_paste () void Editor::keyboard_insert_region_list_selection () { - float prefix; + float prefix = 0; bool was_floating; if (get_prefix (prefix, was_floating) == 0) { diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 88b4333878..f8c9b0124a 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -1520,12 +1520,11 @@ Editor::motion_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item */ if (!drag_info.move_threshold_passed) { - drag_info.move_threshold_passed = (abs ((int) (drag_info.current_pointer_x - drag_info.grab_x)) > 4); - - if (drag_info.copy && !drag_info.move_threshold_passed) { - drag_info.move_threshold_passed = (abs ((int) (drag_info.current_pointer_y - drag_info.grab_y)) > 4); - } + bool x_threshold_passed = (abs ((int) (drag_info.current_pointer_x - drag_info.grab_x)) > 4); + bool y_threshold_passed = (abs ((int) (drag_info.current_pointer_y - drag_info.grab_y)) > 4); + drag_info.move_threshold_passed = (x_threshold_passed || y_threshold_passed); + // and change the initial grab loc/frame if this drag info wants us to if (drag_info.want_move_threshold && drag_info.move_threshold_passed) { @@ -2830,67 +2829,31 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event) vector<int32_t> height_list(512) ; vector<int32_t>::iterator j; - /* don't copy regions if we're doing x-constrained and we're in the same track, or - if we haven't passed the move threshold yet - */ - - if ((!drag_info.x_constrained || (drag_info.last_trackview != &rv->get_time_axis_view())) && - drag_info.copy && drag_info.move_threshold_passed && drag_info.want_move_threshold) { - - cerr << "COPY, xcons = " << drag_info.x_constrained << " last = " << drag_info.last_trackview->name() << " rv = " << rv->get_time_axis_view().name() << endl; + if (drag_info.copy && drag_info.move_threshold_passed && drag_info.want_move_threshold) { drag_info.want_move_threshold = false; // don't copy again - /* this is committed in the grab finished callback. */ - - begin_reversible_command (_("Drag region copy")); - /* duplicate the region(s) */ vector<RegionView*> new_regionviews; - set<boost::shared_ptr<Playlist> > affected_playlists; - pair<set<boost::shared_ptr<Playlist> >::iterator,bool> insert_result; - for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ++i) { RegionView* rv; - + RegionView* nrv; + AudioRegionView* arv; + rv = (*i); - - boost::shared_ptr<Playlist> to_playlist = rv->region()->playlist(); - RouteTimeAxisView* atv = dynamic_cast<RouteTimeAxisView*>(&rv->get_time_axis_view()); - insert_result = affected_playlists.insert (to_playlist); - if (insert_result.second) { - session->add_command (new MementoCommand<Playlist>(*to_playlist, &to_playlist->get_state(), 0)); - } - latest_regionview = 0; - - /* create a new region with the same name. */ - - // FIXME: ew. need a (virtual) Region::duplicate() or something? - - boost::shared_ptr<Region> newregion; - boost::shared_ptr<Region> ar; - - if ((ar = boost::dynamic_pointer_cast<AudioRegion>(rv->region())) != 0) { - newregion = RegionFactory::create (ar); + if ((arv = dynamic_cast<AudioRegionView*>(rv)) == 0) { + /* XXX handle MIDI here */ + continue; } - assert(newregion != 0); - /* if the original region was locked, we don't care */ - - newregion->set_locked (false); - - sigc::connection c = atv->view()->RegionViewAdded.connect (mem_fun(*this, &Editor::collect_new_region_view)); - to_playlist->add_region (newregion, (nframes_t) (rv->region()->position() * atv->get_diskstream()->speed())); + nrv = new AudioRegionView (*arv); + nrv->get_canvas_group()->show (); - c.disconnect (); - - if (latest_regionview) { - new_regionviews.push_back (latest_regionview); - } + new_regionviews.push_back (nrv); } if (new_regionviews.empty()) { @@ -2904,6 +2867,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event) /* reset drag_info data to reflect the fact that we are dragging the copies */ drag_info.data = new_regionviews.front(); + swap_grab (new_regionviews.front()->get_canvas_group (), 0, event->motion.time); } @@ -3301,26 +3265,8 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event) rv->get_canvas_group()->raise_to_top(); rv->get_time_axis_view().canvas_display->raise_to_top(); cursor_group->raise_to_top(); - - /* freeze the playlists from notifying till - the motion is done. - */ - - AudioTimeAxisView* atv = dynamic_cast<AudioTimeAxisView*> (&rv->get_time_axis_view()); - if (atv && atv->is_audio_track()) { - boost::shared_ptr<AudioPlaylist> pl = boost::dynamic_pointer_cast<AudioPlaylist>(atv->get_diskstream()->playlist()); - if (pl) { - /* only freeze and capture state once */ - - insert_result = motion_frozen_playlists.insert (pl); - if (insert_result.second) { - pl->freeze(); - session->add_command(new MementoCommand<Playlist>(*pl, &pl->get_state(), 0)); - } - } - } - - rv->fake_set_opaque (false); + + rv->fake_set_opaque (true); } if (drag_info.brushing) { @@ -3391,106 +3337,94 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event //printf ("last_frame: %s position is %lu %g\n", rv->get_time_axis_view().name().c_str(), drag_info.last_frame_position, speed); //printf ("last_rackview: %s \n", drag_info.last_trackview->name().c_str()); + char* op_string; + + if (drag_info.copy) { + if (drag_info.x_constrained) { + op_string = _("fixed time region copy"); + } else { + op_string = _("region copy"); + } + } else { + if (drag_info.x_constrained) { + op_string = _("fixed time region drag"); + } else { + op_string = _("region drag"); + } + } + + begin_reversible_command (op_string); + if (regionview_y_movement) { - /* motion between tracks */ + /* moved to a different audio track. */ list<RegionView*> new_selection; - - /* moved to a different audio track. */ + new_selection = selection->regions.by_layer(); + selection->clear_regions (); - for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ) { + for (list<RegionView*>::const_iterator i = new_selection.begin(); i != new_selection.end(); ++i) { - RegionView* rv2 = (*i); - - /* the region that used to be in the old playlist is not - moved to the new one - we make a copy of it. as a result, - any existing editor for the region should no longer be - visible. - */ - - if (!drag_info.copy) { - rv2->hide_region_editor(); - } - new_selection.push_back (rv2); - i++; - } + RegionView* rv = (*i); - /* first, freeze the target tracks */ - - for (list<RegionView*>::const_iterator i = new_selection.begin(); i != new_selection.end();i++ ) { - - boost::shared_ptr<Playlist> from_playlist; - boost::shared_ptr<Playlist> to_playlist; - double ix1, ix2, iy1, iy2; - - (*i)->get_canvas_frame()->get_bounds (ix1, iy1, ix2, iy2); - (*i)->get_canvas_group()->i2w (ix1, iy1); + + rv->get_canvas_frame()->get_bounds (ix1, iy1, ix2, iy2); + rv->get_canvas_group()->i2w (ix1, iy1); TimeAxisView* tvp2 = trackview_by_y_position (iy1); AudioTimeAxisView* atv2 = dynamic_cast<AudioTimeAxisView*>(tvp2); - (*i)->fake_set_opaque (true); + boost::shared_ptr<Playlist> from_playlist = rv->region()->playlist(); + boost::shared_ptr<Playlist> to_playlist = atv2->playlist(); - from_playlist = (*i)->region()->playlist(); - to_playlist = atv2->playlist(); - - /* the from_playlist was frozen in the "first_move" case - of the motion handler. the insert can fail, - but that doesn't matter. it just means - we already have the playlist in the list. - */ - - motion_frozen_playlists.insert (from_playlist); - - /* only freeze the to_playlist once */ - - insert_result = motion_frozen_playlists.insert(to_playlist); - if (insert_result.second) { - to_playlist->freeze(); - session->add_command(new MementoCommand<Playlist>(*to_playlist, &to_playlist->get_state(), 0)); - } - - } - - /* now do it again with the actual operations */ - - for (list<RegionView*>::const_iterator i = new_selection.begin(); i != new_selection.end();i++ ) { + where = (nframes_t) (unit_to_frame (ix1) * speed); + boost::shared_ptr<Region> new_region (RegionFactory::create (rv->region())); - boost::shared_ptr<Playlist> from_playlist; - boost::shared_ptr<Playlist> to_playlist; + if (!drag_info.copy) { - double ix1, ix2, iy1, iy2; + /* the region that used to be in the old playlist is not + moved to the new one - we make a copy of it. as a result, + any existing editor for the region should no longer be + visible. + */ - (*i)->get_canvas_frame()->get_bounds (ix1, iy1, ix2, iy2); - (*i)->get_canvas_group()->i2w (ix1, iy1); - TimeAxisView* tvp2 = trackview_by_y_position (iy1); - AudioTimeAxisView* atv2 = dynamic_cast<AudioTimeAxisView*>(tvp2); - - from_playlist = (*i)->region()->playlist(); - to_playlist = atv2->playlist(); + rv->hide_region_editor(); + rv->fake_set_opaque (false); - latest_regionview = 0; - - where = (nframes_t) (unit_to_frame (ix1) * speed); - boost::shared_ptr<Region> new_region (RegionFactory::create ((*i)->region())); + session->add_command (new MementoCommand<Playlist>(*from_playlist, &from_playlist->get_state(), 0)); + from_playlist->remove_region ((rv->region())); + session->add_command (new MementoCommand<Playlist>(*from_playlist, 0, &from_playlist->get_state())); + } - from_playlist->remove_region (((*i)->region())); + latest_regionview = 0; sigc::connection c = atv2->view()->RegionViewAdded.connect (mem_fun(*this, &Editor::collect_new_region_view)); + session->add_command (new MementoCommand<Playlist>(*to_playlist, &to_playlist->get_state(), 0)); to_playlist->add_region (new_region, where); + session->add_command (new MementoCommand<Playlist>(*to_playlist, 0, &to_playlist->get_state())); c.disconnect (); if (latest_regionview) { selection->add (latest_regionview); } + + if (drag_info.copy) { + // get rid of the copy + delete rv; + } } } else { /* motion within a single track */ + + list<RegionView*> regions = selection->regions.by_layer(); + + if (drag_info.copy) { + selection->clear_regions(); + } - for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ++i) { + for (list<RegionView*>::iterator i = regions.begin(); i != regions.end(); ++i) { rv = (*i); @@ -3498,9 +3432,10 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event continue; } + if (regionview_x_movement) { double ownspeed = 1.0; - AudioTimeAxisView* atv = dynamic_cast<AudioTimeAxisView*> (&(rv->get_time_axis_view())); + atv = dynamic_cast<AudioTimeAxisView*> (&(rv->get_time_axis_view())); if (atv && atv->get_diskstream()) { ownspeed = atv->get_diskstream()->speed(); @@ -3519,23 +3454,62 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event where = rv->region()->position(); } - rv->get_time_axis_view().reveal_dependent_views (*rv); + boost::shared_ptr<Playlist> to_playlist = rv->region()->playlist(); + + /* add the undo */ + + session->add_command (new MementoCommand<Playlist>(*to_playlist, &to_playlist->get_state(), 0)); + + if (drag_info.copy) { + + boost::shared_ptr<Region> newregion; + boost::shared_ptr<Region> ar; + + if ((ar = boost::dynamic_pointer_cast<AudioRegion>(rv->region())) != 0) { + newregion = RegionFactory::create (ar); + } else { + /* XXX MIDI HERE drobilla */ + continue; + } + + /* add it */ + + latest_regionview = 0; + sigc::connection c = atv->view()->RegionViewAdded.connect (mem_fun(*this, &Editor::collect_new_region_view)); + to_playlist->add_region (newregion, (nframes_t) (where * atv->get_diskstream()->speed())); + c.disconnect (); + + if (latest_regionview) { + atv->reveal_dependent_views (*latest_regionview); + selection->add (latest_regionview); + } + + /* if the original region was locked, we don't care for the new one */ + + newregion->set_locked (false); + + } else { + + /* just change the model */ + + rv->region()->set_position (where, (void*) this); + + } + + /* add the redo */ - /* no need to add an undo here, we did that when we added this playlist to motion_frozen playlists */ - - rv->region()->set_position (where, (void *) this); - rv->fake_set_opaque (true); + session->add_command (new MementoCommand<Playlist>(*to_playlist, 0, &to_playlist->get_state())); + + /* get rid of the copy */ + + if (drag_info.copy) { + delete rv; + } } } out: - for (set<boost::shared_ptr<Playlist> >::iterator p = motion_frozen_playlists.begin(); p != motion_frozen_playlists.end(); ++p) { - (*p)->thaw (); - session->add_command (new MementoCommand<Playlist>(*((*p).get()), 0, & (*p)->get_state())); - } - - motion_frozen_playlists.clear (); - + if (!nocommit) { commit_reversible_command (); } @@ -4010,8 +3984,6 @@ Editor::start_trim (ArdourCanvas::Item* item, GdkEvent* event) nframes_t region_end = (nframes_t) (clicked_regionview->region()->last_frame() / speed); nframes_t region_length = (nframes_t) (clicked_regionview->region()->length() / speed); - motion_frozen_playlists.clear(); - //drag_info.item = clicked_regionview->get_name_highlight(); drag_info.item = item; drag_info.motion_callback = &Editor::trim_motion_callback; diff --git a/gtk2_ardour/export_dialog.cc b/gtk2_ardour/export_dialog.cc index 538f0ed74c..8902391b0b 100644 --- a/gtk2_ardour/export_dialog.cc +++ b/gtk2_ardour/export_dialog.cc @@ -106,7 +106,6 @@ ExportDialog::ExportDialog(PublicEditor& e) src_quality_label (_("Conversion Quality"), 1.0, 0.5), dither_type_label (_("Dither Type"), 1.0, 0.5), cuefile_only_checkbox (_("Export CD Marker File Only")), - file_frame (_("Export to File")), file_browse_button (_("Browse")), track_selector_button (_("Specific tracks ...")) { @@ -1305,7 +1304,7 @@ ExportDialog::window_closed (GdkEventAny *ignored) void ExportDialog::browse () { - FileChooserDialog dialog("Export to file", FILE_CHOOSER_ACTION_SAVE); + FileChooserDialog dialog("Export to file", browse_action()); dialog.set_transient_for(*this); dialog.set_filename (file_entry.get_text()); diff --git a/gtk2_ardour/export_dialog.h b/gtk2_ardour/export_dialog.h index 632d855163..2831384cd3 100644 --- a/gtk2_ardour/export_dialog.h +++ b/gtk2_ardour/export_dialog.h @@ -29,6 +29,7 @@ #include <gtkmm/progressbar.h> #include <gtkmm/scrolledwindow.h> #include <gtkmm/fileselection.h> +#include <gtkmm/filechooser.h> #include <gtkmm/comboboxtext.h> #include <gtkmm/treeview.h> #include <gtkmm/liststore.h> @@ -56,8 +57,11 @@ class ExportDialog : public ArdourDialog virtual void set_range (nframes_t start, nframes_t end); void start_export (); + virtual Gtk::FileChooserAction browse_action() const { return Gtk::FILE_CHOOSER_ACTION_SAVE; } + protected: ARDOUR::AudioExportSpecification spec; + Gtk::Frame file_frame; struct ExportModelColumns : public Gtk::TreeModel::ColumnRecord { @@ -140,7 +144,6 @@ class ExportDialog : public ArdourDialog Gtk::CheckButton cuefile_only_checkbox; - Gtk::Frame file_frame; Gtk::Entry file_entry; Gtk::HBox file_hbox; Gtk::Button file_browse_button; diff --git a/gtk2_ardour/export_range_markers_dialog.cc b/gtk2_ardour/export_range_markers_dialog.cc index 2a1e2a9af4..b6bd25a60d 100644 --- a/gtk2_ardour/export_range_markers_dialog.cc +++ b/gtk2_ardour/export_range_markers_dialog.cc @@ -38,12 +38,20 @@ using namespace std; ExportRangeMarkersDialog::ExportRangeMarkersDialog (PublicEditor& editor) : ExportDialog(editor) { + set_title (_("ardour: export ranges")); + file_frame.set_label (_("Export to Directory")); + do_not_allow_export_cd_markers(); total_duration = 0; current_range_marker_index = 0; } - + +Gtk::FileChooserAction +ExportRangeMarkersDialog::browse_action () const +{ + return Gtk::FILE_CHOOSER_ACTION_CREATE_FOLDER; +} void ExportRangeMarkersDialog::export_audio_data () diff --git a/gtk2_ardour/export_range_markers_dialog.h b/gtk2_ardour/export_range_markers_dialog.h index 1087f4c4c6..7d231c62d5 100644 --- a/gtk2_ardour/export_range_markers_dialog.h +++ b/gtk2_ardour/export_range_markers_dialog.h @@ -30,6 +30,8 @@ class ExportRangeMarkersDialog : public ExportDialog public: ExportRangeMarkersDialog (PublicEditor&); + Gtk::FileChooserAction browse_action() const; + protected: virtual bool is_filepath_valid(string &filepath); diff --git a/gtk2_ardour/export_region_dialog.cc b/gtk2_ardour/export_region_dialog.cc index 30ff05dc5c..cb3804c11b 100644 --- a/gtk2_ardour/export_region_dialog.cc +++ b/gtk2_ardour/export_region_dialog.cc @@ -31,6 +31,9 @@ ExportRegionDialog::ExportRegionDialog (PublicEditor& editor, boost::shared_ptr<ARDOUR::Region> region) : ExportDialog(editor) { + set_title (_("ardour: export region")); + file_frame.set_label (_("Export to File")), + audio_region = boost::dynamic_pointer_cast<ARDOUR::AudioRegion>(region); assert(audio_region); diff --git a/gtk2_ardour/export_session_dialog.cc b/gtk2_ardour/export_session_dialog.cc index 7cd7fdc06f..006f9675b3 100644 --- a/gtk2_ardour/export_session_dialog.cc +++ b/gtk2_ardour/export_session_dialog.cc @@ -21,13 +21,14 @@ #include "ardour_ui.h" #include "export_session_dialog.h" +#include "i18n.h" ExportSessionDialog::ExportSessionDialog (PublicEditor& editor) : ExportDialog(editor) { + file_frame.set_label (_("Export to File")); } - void ExportSessionDialog::export_audio_data () { diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 39d753bf61..192d4d1301 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -1017,7 +1017,7 @@ Mixer_UI::strip_scroller_button_release (GdkEventButton* ev) using namespace Menu_Helpers; if (Keyboard::is_context_menu_event (ev)) { - ARDOUR_UI::instance()->add_route(); + ARDOUR_UI::instance()->add_route (this); return true; } diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc index 5e3a612654..3e6921aab9 100644 --- a/gtk2_ardour/region_view.cc +++ b/gtk2_ardour/region_view.cc @@ -67,7 +67,6 @@ RegionView::RegionView (ArdourCanvas::Group* parent, TimeAxisViewItem::ShowFrame)) , _region (r) , sync_mark(0) - , no_wave_msg(0) , editor(0) , current_visible_sync_position(0.0) , valid(false) @@ -78,6 +77,19 @@ RegionView::RegionView (ArdourCanvas::Group* parent, { } +RegionView::RegionView (const RegionView& other) + : TimeAxisViewItem (other) +{ + /* derived concrete type will call init () */ + + _region = other._region; + editor = other.editor; + current_visible_sync_position = other.current_visible_sync_position; + valid = false; + _pixel_width = other._pixel_width; + _height = other._height; +} + RegionView::RegionView (ArdourCanvas::Group* parent, TimeAxisView& tv, boost::shared_ptr<ARDOUR::Region> r, @@ -87,7 +99,6 @@ RegionView::RegionView (ArdourCanvas::Group* parent, : TimeAxisViewItem (r->name(), *parent, tv, spu, basic_color, r->position(), r->length(), visibility) , _region (r) , sync_mark(0) - , no_wave_msg(0) , editor(0) , current_visible_sync_position(0.0) , valid(false) @@ -101,7 +112,6 @@ RegionView::RegionView (ArdourCanvas::Group* parent, void RegionView::init (Gdk::Color& basic_color, bool wfd) { - editor = 0; valid = true; in_destructor = false; _height = 0; diff --git a/gtk2_ardour/region_view.h b/gtk2_ardour/region_view.h index b89011e38d..64ab256f89 100644 --- a/gtk2_ardour/region_view.h +++ b/gtk2_ardour/region_view.h @@ -47,6 +47,8 @@ class RegionView : public TimeAxisViewItem double samples_per_unit, Gdk::Color& basic_color); + RegionView (const RegionView& other); + ~RegionView (); virtual void init (Gdk::Color& base_color, bool wait_for_data); @@ -90,7 +92,7 @@ class RegionView : public TimeAxisViewItem /** Allows derived types to specify their visibility requirements * to the TimeAxisViewItem parent class - */ + */ RegionView (ArdourCanvas::Group *, TimeAxisView&, boost::shared_ptr<ARDOUR::Region>, @@ -120,7 +122,6 @@ class RegionView : public TimeAxisViewItem boost::shared_ptr<ARDOUR::Region> _region; ArdourCanvas::Polygon* sync_mark; ///< polgyon for sync position - ArdourCanvas::Text* no_wave_msg; RegionEditor* editor; diff --git a/gtk2_ardour/route_params_ui.cc b/gtk2_ardour/route_params_ui.cc index 93496920c1..895cb2a785 100644 --- a/gtk2_ardour/route_params_ui.cc +++ b/gtk2_ardour/route_params_ui.cc @@ -507,7 +507,7 @@ RouteParams_UI::show_track_menu() track_menu->set_name ("ArdourContextMenu"); track_menu->items().push_back (MenuElem (_("Add Track/Bus"), - mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::add_route))); + bind (mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::add_route), (Gtk::Window*) 0))); } track_menu->popup (1, gtk_get_current_event_time()); } diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc index 18ea3c255e..87eac74ccf 100644 --- a/gtk2_ardour/time_axis_view_item.cc +++ b/gtk2_ardour/time_axis_view_item.cc @@ -95,6 +95,35 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group& have_name_font = true; } + group = new ArdourCanvas::Group (parent); + + init (it_name, spu, base_color, start, duration, vis); + +} + +TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other) + : trackview (other.trackview) +{ + + Gdk::Color c; + int r,g,b,a; + + UINT_TO_RGBA (other.fill_color, &r, &g, &b, &a); + c.set_rgb_p (r/255.0, g/255.0, b/255.0); + + /* share the other's parent, but still create a new group */ + + Gnome::Canvas::Group* parent = other.group->property_parent(); + + group = new ArdourCanvas::Group (*parent); + + init (other.item_name, other.samples_per_unit, c, other.frame_position, other.item_duration, other.visibility); +} + + +void +TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_color, nframes_t start, nframes_t duration, Visibility vis) +{ item_name = it_name ; samples_per_unit = spu ; should_show_selection = true; @@ -112,8 +141,6 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group& warning << "Time Axis Item Duration == 0" << endl ; } - group = new ArdourCanvas::Group (parent); - vestigial_frame = new ArdourCanvas::SimpleRect (*group); vestigial_frame->property_x1() = (double) 0.0; vestigial_frame->property_y1() = (double) 1.0; @@ -220,7 +247,6 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group& set_position (start, this) ; } - /** * Destructor */ diff --git a/gtk2_ardour/time_axis_view_item.h b/gtk2_ardour/time_axis_view_item.h index bae0a27506..d41ad5a327 100644 --- a/gtk2_ardour/time_axis_view_item.h +++ b/gtk2_ardour/time_axis_view_item.h @@ -339,6 +339,10 @@ class TimeAxisViewItem : public Selectable */ TimeAxisViewItem(const std::string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color& base_color, nframes_t start, nframes_t duration, Visibility v = Visibility (0)); + + TimeAxisViewItem (const TimeAxisViewItem& other); + + void init (const std::string& it_name, double spu, Gdk::Color& base_color, nframes_t start, nframes_t duration, Visibility vis); /** * Calculates some contrasting color for displaying various parts of this item, based upon the base color |