13
0

new design for region dragging; make add route dialog float over the correct window(s); try to remove confusion from different export dialogs regarding file/directory requirements ; minor cleanups

git-svn-id: svn://localhost/ardour2/trunk@1555 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2007-03-05 15:34:56 +00:00
parent f0c6bdfb84
commit 62c4e81884
20 changed files with 246 additions and 187 deletions

View File

@ -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()) {

View File

@ -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);

View File

@ -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);

View File

@ -89,13 +89,36 @@ 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;

View File

@ -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);

View File

@ -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;
}

View File

@ -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) {

View File

@ -1520,11 +1520,10 @@ 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);
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);
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);
}
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
@ -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));
if ((arv = dynamic_cast<AudioRegionView*>(rv)) == 0) {
/* XXX handle MIDI here */
continue;
}
latest_regionview = 0;
nrv = new AudioRegionView (*arv);
nrv->get_canvas_group()->show ();
/* 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);
}
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()));
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);
}
@ -3302,25 +3266,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
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,17 +3337,50 @@ 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 */
list<RegionView*> new_selection;
/* moved to a different audio track. */
for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ) {
list<RegionView*> new_selection;
new_selection = selection->regions.by_layer();
selection->clear_regions ();
RegionView* rv2 = (*i);
for (list<RegionView*>::const_iterator i = new_selection.begin(); i != new_selection.end(); ++i) {
RegionView* rv = (*i);
double ix1, ix2, iy1, iy2;
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);
boost::shared_ptr<Playlist> from_playlist = rv->region()->playlist();
boost::shared_ptr<Playlist> to_playlist = atv2->playlist();
where = (nframes_t) (unit_to_frame (ix1) * speed);
boost::shared_ptr<Region> new_region (RegionFactory::create (rv->region()));
if (!drag_info.copy) {
/* 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,
@ -3409,88 +3388,43 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
visible.
*/
if (!drag_info.copy) {
rv2->hide_region_editor();
rv->hide_region_editor();
rv->fake_set_opaque (false);
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()));
}
new_selection.push_back (rv2);
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);
TimeAxisView* tvp2 = trackview_by_y_position (iy1);
AudioTimeAxisView* atv2 = dynamic_cast<AudioTimeAxisView*>(tvp2);
(*i)->fake_set_opaque (true);
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++ ) {
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);
TimeAxisView* tvp2 = trackview_by_y_position (iy1);
AudioTimeAxisView* atv2 = dynamic_cast<AudioTimeAxisView*>(tvp2);
from_playlist = (*i)->region()->playlist();
to_playlist = atv2->playlist();
latest_regionview = 0;
where = (nframes_t) (unit_to_frame (ix1) * speed);
boost::shared_ptr<Region> new_region (RegionFactory::create ((*i)->region()));
from_playlist->remove_region (((*i)->region()));
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 */
for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ++i) {
list<RegionView*> regions = selection->regions.by_layer();
if (drag_info.copy) {
selection->clear_regions();
}
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,22 +3454,61 @@ 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();
/* no need to add an undo here, we did that when we added this playlist to motion_frozen playlists */
/* add the undo */
rv->region()->set_position (where, (void *) this);
rv->fake_set_opaque (true);
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 */
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;

View File

@ -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());

View File

@ -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;

View File

@ -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 ()

View File

@ -30,6 +30,8 @@ class ExportRangeMarkersDialog : public ExportDialog
public:
ExportRangeMarkersDialog (PublicEditor&);
Gtk::FileChooserAction browse_action() const;
protected:
virtual bool is_filepath_valid(string &filepath);

View File

@ -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);

View File

@ -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 ()
{

View File

@ -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;
}

View File

@ -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;

View File

@ -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);
@ -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;

View File

@ -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());
}

View File

@ -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
*/

View File

@ -340,6 +340,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
*