X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fimageframe_time_axis.cc;h=2f421a113272d7c222ead18e547abae7bdd3e611;hb=9649a94053eda177086ac2930c7d172db3a2af11;hp=cbfa50c77874acbef66f04cbf12b18f38c2dabc8;hpb=14d43ca9fe28a8309b4a52fa85e2b0c64a92248b;p=ardour.git diff --git a/gtk2_ardour/imageframe_time_axis.cc b/gtk2_ardour/imageframe_time_axis.cc index cbfa50c778..2f421a1132 100644 --- a/gtk2_ardour/imageframe_time_axis.cc +++ b/gtk2_ardour/imageframe_time_axis.cc @@ -15,23 +15,24 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #include #include -#include +#include "pbd/error.h" + +#include #include #include -#include -#include +#include "ardour/session.h" +#include "ardour/utils.h" #include "public_editor.h" #include "imageframe_time_axis.h" -#include "canvas-simplerect.h" +#include "simplerect.h" #include "enums.h" #include "imageframe_time_axis_view.h" #include "imageframe_time_axis_group.h" @@ -40,12 +41,14 @@ #include "marker_time_axis.h" #include "marker_view.h" #include "gui_thread.h" +#include "canvas_impl.h" #include "i18n.h" -using namespace ARDOUR ; -using namespace sigc ; -using namespace Gtk ; +using namespace ARDOUR; +using namespace PBD; +using namespace sigc; +using namespace Gtk; /** * Constructs a new ImageFrameTimeAxis. @@ -55,19 +58,18 @@ using namespace Gtk ; * @param sess the current session * @param canvas the parent canvas item */ -ImageFrameTimeAxis::ImageFrameTimeAxis(std::string track_id, PublicEditor& ed, ARDOUR::Session& sess, Widget *canvas) +ImageFrameTimeAxis::ImageFrameTimeAxis(const string & track_id, PublicEditor& ed, ARDOUR::Session& sess, ArdourCanvas::Canvas& canvas) : AxisView(sess), VisualTimeAxis(track_id, ed, sess, canvas) { _color = unique_random_color() ; - selection_group = gnome_canvas_item_new (GNOME_CANVAS_GROUP(canvas_display), gnome_canvas_group_get_type (), NULL) ; - gnome_canvas_item_hide(selection_group) ; + selection_group = new ArdourCanvas::Group (*canvas_display); + selection_group->hide(); // intialize our data items _marked_for_display = true; y_position = -1 ; - name_prompter = 0 ; /* create our new image frame view */ view = new ImageFrameTimeAxisView(*this) ; @@ -79,7 +81,7 @@ ImageFrameTimeAxis::ImageFrameTimeAxis(std::string track_id, PublicEditor& ed, A label_view() ; // set the initial height of this time axis - set_height(Normal) ; + set_height(hNormal) ; } /** @@ -105,38 +107,15 @@ ImageFrameTimeAxis::~ImageFrameTimeAxis () iter = next ; } - if(image_action_menu) - { - delete image_action_menu ; - image_action_menu = 0 ; - } - - for(list::iterator i = free_selection_rects.begin(); i != free_selection_rects.end(); ++i) - { - gtk_object_destroy (GTK_OBJECT((*i)->rect)); - gtk_object_destroy (GTK_OBJECT((*i)->start_trim)); - gtk_object_destroy (GTK_OBJECT((*i)->end_trim)); - } - - for(list::iterator i = used_selection_rects.begin(); i != used_selection_rects.end(); ++i) - { - gtk_object_destroy (GTK_OBJECT((*i)->rect)); - gtk_object_destroy (GTK_OBJECT((*i)->start_trim)); - gtk_object_destroy (GTK_OBJECT((*i)->end_trim)); - } + delete image_action_menu ; + image_action_menu = 0 ; - if (selection_group) - { - gtk_object_destroy (GTK_OBJECT (selection_group)); - selection_group = 0 ; - } + delete selection_group; + selection_group = 0 ; // Destroy our Axis View helper - if(view) - { - delete view ; - view = 0 ; - } + delete view ; + view = 0 ; } //---------------------------------------------------------------------------------------// @@ -145,10 +124,10 @@ ImageFrameTimeAxis::~ImageFrameTimeAxis () /** * Sets the height of this TrackView to one of ths TrackHeghts * - * @param h the TrackHeight value to set + * @param h */ void -ImageFrameTimeAxis::set_height (TrackHeight h) +ImageFrameTimeAxis::set_height (uint32_t h) { VisualTimeAxis::set_height(h) ; @@ -242,6 +221,7 @@ void ImageFrameTimeAxis::build_display_menu() { using namespace Menu_Helpers; + using Gtk::Menu; /* get the size menu ready */ @@ -276,6 +256,7 @@ void ImageFrameTimeAxis::create_imageframe_menu() { using namespace Menu_Helpers; + using Gtk::Menu; imageframe_menu = manage(new Menu) ; imageframe_menu->set_name ("ArdourContextMenu"); @@ -358,7 +339,7 @@ ImageFrameTimeAxis::add_marker_time_axis(MarkerTimeAxis* marker_track, void* src * @return the named markerTimeAxis, or 0 if the named MarkerTimeAxis is not associated with this ImageFrameTimeAxis */ MarkerTimeAxis* -ImageFrameTimeAxis::get_named_marker_time_axis(std::string track_id) +ImageFrameTimeAxis::get_named_marker_time_axis(const string & track_id) { MarkerTimeAxis* mta = 0 ; @@ -381,7 +362,7 @@ ImageFrameTimeAxis::get_named_marker_time_axis(std::string track_id) * @return the removed MarkerTimeAxis */ MarkerTimeAxis* -ImageFrameTimeAxis::remove_named_marker_time_axis(std::string track_id, void* src) +ImageFrameTimeAxis::remove_named_marker_time_axis(const string & track_id, void* src) { MarkerTimeAxis* mta = 0 ;