advance compiling to the m*.cc point
git-svn-id: svn://localhost/trunk/ardour2@108 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
54a8032106
commit
3ff9964885
|
@ -124,7 +124,6 @@ imageframe_time_axis_view.cc
|
|||
imageframe_view.cc
|
||||
io_selector.cc
|
||||
keyboard.cc
|
||||
keyboard_target.cc
|
||||
location_ui.cc
|
||||
main.cc
|
||||
marker.cc
|
||||
|
|
|
@ -163,3 +163,15 @@ ActionManager::add_action_group (RefPtr<ActionGroup> grp)
|
|||
{
|
||||
ui_manager.insert_action_group (grp);
|
||||
}
|
||||
|
||||
Widget*
|
||||
ActionManager::get_widget (ustring name)
|
||||
{
|
||||
return ui_manager.get_widget (name);
|
||||
}
|
||||
|
||||
RefPtr<Action>
|
||||
ActionManager::get_action (ustring name)
|
||||
{
|
||||
return ui_manager.get_action (name);
|
||||
}
|
||||
|
|
|
@ -29,6 +29,9 @@ class ActionManager
|
|||
static std::string unbound_string; /* the key string returned if an action is not bound */
|
||||
static Gtk::UIManager ui_manager;
|
||||
|
||||
static Gtk::Widget* get_widget (Glib::ustring name);
|
||||
static Glib::RefPtr<Gtk::Action> get_action (Glib::ustring name);
|
||||
|
||||
static void add_action_group (Glib::RefPtr<Gtk::ActionGroup>);
|
||||
|
||||
static Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
||||
|
|
|
@ -12,6 +12,8 @@ namespace Gnome {
|
|||
class WaveView;
|
||||
class Text;
|
||||
class Line;
|
||||
class Points;
|
||||
class ImageFrame;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "i18n.h"
|
||||
|
||||
using namespace Gtk;
|
||||
using namespace Glib;
|
||||
using namespace std;
|
||||
using namespace sigc;
|
||||
using namespace ARDOUR;
|
||||
|
@ -16,8 +17,8 @@ using namespace Editing;
|
|||
void
|
||||
Editor::register_actions ()
|
||||
{
|
||||
|
||||
Glib::RefPtr<ActionGroup> editor_actions = ActionGroup::create (X_("Editor"));
|
||||
RefPtr<Action> act;
|
||||
RefPtr<ActionGroup> editor_actions = ActionGroup::create (X_("Editor"));
|
||||
|
||||
/* add named actions for the editor */
|
||||
|
||||
|
@ -169,9 +170,12 @@ Editor::register_actions ()
|
|||
RadioAction::Group sort_type_group;
|
||||
RadioAction::Group sort_order_group;
|
||||
|
||||
ActionManager::register_action (rl_actions, X_("rlAudition"), _("Audition"), mem_fun(*this, &Editor::audition_region_from_region_list));
|
||||
ActionManager::register_action (rl_actions, X_("rlHide"), _("Hide"), mem_fun(*this, &Editor::hide_region_from_region_list));
|
||||
ActionManager::register_action (rl_actions, X_("rlRemove"), _("Remove"), mem_fun (*this, &Editor::remove_region_from_region_list));
|
||||
act = ActionManager::register_action (rl_actions, X_("rlAudition"), _("Audition"), mem_fun(*this, &Editor::audition_region_from_region_list));
|
||||
ActionManager::region_list_selection_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (rl_actions, X_("rlHide"), _("Hide"), mem_fun(*this, &Editor::hide_region_from_region_list));
|
||||
ActionManager::region_list_selection_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (rl_actions, X_("rlRemove"), _("Remove"), mem_fun (*this, &Editor::remove_region_from_region_list));
|
||||
ActionManager::region_list_selection_sensitive_actions.push_back (act);
|
||||
ActionManager::register_action (rl_actions, X_("rlShowAll"), _("Show all"), mem_fun(*this, &Editor::toggle_full_region_list));
|
||||
|
||||
ActionManager::register_radio_action (rl_actions, sort_order_group, X_("SortAscending"), _("Ascending"),
|
||||
|
@ -200,13 +204,13 @@ Editor::register_actions ()
|
|||
ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFilesystem"), _("By Source Filesystem"),
|
||||
bind (mem_fun(*this, &Editor::reset_region_list_sort_type), BySourceFileFS));
|
||||
|
||||
ActionManager::register_action (rl_actions, X_("rlEmbedAudio"), _("Embed audio (link)"), mem_fun(*this, &Editor::embed_audio));
|
||||
ActionManager::register_action (rl_actions, X_("rlImportAudio"), _("Embed audio (link)"), bind (mem_fun(*this, &Editor::import_audio), false));
|
||||
|
||||
act = ActionManager::register_action (rl_actions, X_("rlEmbedAudio"), _("Embed audio (link)"), mem_fun(*this, &Editor::embed_audio));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (rl_actions, X_("rlImportAudio"), _("Embed audio (link)"), bind (mem_fun(*this, &Editor::import_audio), false));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
ActionManager::add_action_group (rl_actions);
|
||||
ActionManager::add_action_group (mouse_mode_actions);
|
||||
ActionManager::add_action_group (snap_actions);
|
||||
ActionManager::add_action_group (editor_actions);
|
||||
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "simplerect.h"
|
||||
#include "editing.h"
|
||||
#include "gui_thread.h"
|
||||
#include "simplerect.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
|
@ -70,31 +71,30 @@ Editor::add_new_location (Location *location)
|
|||
}
|
||||
|
||||
if (location->is_mark()) {
|
||||
lam->start = new Marker (*this, *marker_group, color,
|
||||
location->name(), Marker::Mark, PublicEditor::canvas_marker_event, location->start());
|
||||
lam->start = new Marker (*this, *marker_group, color, location->name(), Marker::Mark, location->start());
|
||||
lam->end = 0;
|
||||
|
||||
} else if (location->is_auto_loop()) {
|
||||
// transport marker
|
||||
lam->start = new Marker (*this, *transport_marker_group, color,
|
||||
location->name(), Marker::LoopStart, PublicEditor::canvas_marker_event, location->start());
|
||||
location->name(), Marker::LoopStart, location->start());
|
||||
lam->end = new Marker (*this, *transport_marker_group, color,
|
||||
location->name(), Marker::LoopEnd, PublicEditor::canvas_marker_event, location->end());
|
||||
location->name(), Marker::LoopEnd, location->end());
|
||||
|
||||
} else if (location->is_auto_punch()) {
|
||||
// transport marker
|
||||
lam->start = new Marker (*this, *transport_marker_group, color,
|
||||
location->name(), Marker::PunchIn, PublicEditor::canvas_marker_event, location->start());
|
||||
location->name(), Marker::PunchIn, location->start());
|
||||
lam->end = new Marker (*this, *transport_marker_group, color,
|
||||
location->name(), Marker::PunchOut, PublicEditor::canvas_marker_event, location->end());
|
||||
location->name(), Marker::PunchOut, location->end());
|
||||
|
||||
} else {
|
||||
|
||||
// range marker
|
||||
lam->start = new Marker (*this, *range_marker_group, color,
|
||||
location->name(), Marker::Start, PublicEditor::canvas_marker_event, location->start());
|
||||
location->name(), Marker::Start, location->start());
|
||||
lam->end = new Marker (*this, *range_marker_group, color,
|
||||
location->name(), Marker::End, PublicEditor::canvas_marker_event, location->end());
|
||||
location->name(), Marker::End, location->end());
|
||||
}
|
||||
|
||||
if (location->is_hidden ()) {
|
||||
|
@ -299,7 +299,7 @@ Editor::remove_marker (ArdourCanvas::Item& item, GdkEvent* event)
|
|||
Marker* marker;
|
||||
bool is_start;
|
||||
|
||||
if ((marker = item.get_data ("marker")) == 0) {
|
||||
if ((marker = static_cast<Marker*> (item.get_data ("marker"))) == 0) {
|
||||
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
|
|
@ -184,11 +184,11 @@ Do you really want to destroy %1 ?"),
|
|||
|
||||
Gtkmm2ext::Choice prompter (prompt, choices);
|
||||
|
||||
prompter.chosen.connect (Gtk::Main::quit.slot());
|
||||
prompter.chosen.connect (ptr_fun (Main::quit));
|
||||
prompter.show_all ();
|
||||
|
||||
Gtk::Main::run ();
|
||||
|
||||
Main::run ();
|
||||
|
||||
if (prompter.get_choice() != 0) {
|
||||
return;
|
||||
}
|
||||
|
@ -1462,7 +1462,7 @@ Editor::clear_locations ()
|
|||
void
|
||||
Editor::insert_region_list_drag (AudioRegion& region)
|
||||
{
|
||||
double x, y;
|
||||
int x, y;
|
||||
double wx, wy;
|
||||
double cx, cy;
|
||||
TimeAxisView *tv;
|
||||
|
@ -1471,7 +1471,6 @@ Editor::insert_region_list_drag (AudioRegion& region)
|
|||
Playlist *playlist;
|
||||
|
||||
track_canvas.get_pointer (x, y);
|
||||
|
||||
track_canvas.window_to_world (x, y, wx, wy);
|
||||
|
||||
GdkEvent event;
|
||||
|
@ -1529,7 +1528,7 @@ Editor::insert_region_list_selection (float times)
|
|||
|
||||
Glib::RefPtr<TreeSelection> selected = region_list_display.get_selection();
|
||||
|
||||
if (selected.count_selected_rows() != 1) {
|
||||
if (selected->count_selected_rows() != 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2001,7 +2000,7 @@ Editor::reject_because_rate_differs (string path, SF_INFO& finfo, string action,
|
|||
string_compose (_("%1\nThis audiofile's sample rate doesn't match the session sample rate!"), path),
|
||||
choices);
|
||||
|
||||
rate_choice.chosen.connect (Main::quit.slot());
|
||||
rate_choice.chosen.connect (ptr_fun (Main::quit));
|
||||
rate_choice.show_all ();
|
||||
|
||||
Main::run ();
|
||||
|
@ -2602,7 +2601,7 @@ Editor::region_fill_selection ()
|
|||
|
||||
Glib::RefPtr<TreeSelection> selected = region_list_display.get_selection();
|
||||
|
||||
if (selected.count_selected_rows() != 1) {
|
||||
if (selected->count_selected_rows() != 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3167,7 +3166,7 @@ Editor::paste (float times)
|
|||
void
|
||||
Editor::mouse_paste ()
|
||||
{
|
||||
double x, y;
|
||||
int x, y;
|
||||
double wx, wy;
|
||||
track_canvas.get_pointer (x, y);
|
||||
track_canvas.window_to_world (x, y, wx, wy);
|
||||
|
@ -3216,11 +3215,11 @@ Editor::paste_internal (jack_nframes_t position, float times)
|
|||
void
|
||||
Editor::paste_named_selection (float times)
|
||||
{
|
||||
TrackSelection::iterator i;
|
||||
TrackSelection::iterator t;
|
||||
|
||||
Glib::RefPtr<TreeSelection> selected = named_selection_display.get_selection();
|
||||
|
||||
if (selected.count_selected_rows() == 0 || selection->tracks.empty()) {
|
||||
if (selected->count_selected_rows() != 1 || selection->tracks.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3234,13 +3233,13 @@ Editor::paste_named_selection (float times)
|
|||
|
||||
begin_reversible_command (_("paste chunk"));
|
||||
|
||||
for (i = selection->tracks.begin(); i != selection->tracks.end(); ++i) {
|
||||
for (t = selection->tracks.begin(); t != selection->tracks.end(); ++t) {
|
||||
|
||||
AudioTimeAxisView* atv;
|
||||
Playlist* pl;
|
||||
AudioPlaylist* apl;
|
||||
|
||||
if ((atv = dynamic_cast<AudioTimeAxisView*> (*i)) == 0) {
|
||||
if ((atv = dynamic_cast<AudioTimeAxisView*> (*t)) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -3432,16 +3431,17 @@ Editor::remove_last_capture ()
|
|||
|
||||
choices.push_back (_("Yes, destroy it."));
|
||||
choices.push_back (_("No, do nothing."));
|
||||
|
||||
|
||||
Gtkmm2ext::Choice prompter (prompt, choices);
|
||||
prompter.done.connect (Gtk::Main::quit.slot());
|
||||
prompter.chosen.connect (ptr_fun (Main::quit));
|
||||
prompter.show_all ();
|
||||
|
||||
Gtk::Main::run ();
|
||||
|
||||
Main::run ();
|
||||
|
||||
if (prompter.get_choice() == 0) {
|
||||
session->remove_last_capture ();
|
||||
}
|
||||
|
||||
} else {
|
||||
session->remove_last_capture();
|
||||
}
|
||||
|
|
|
@ -42,7 +42,6 @@ using namespace sigc;
|
|||
using namespace ARDOUR;
|
||||
using namespace Gtk;
|
||||
using namespace Editing;
|
||||
using namespace ActionManager;
|
||||
|
||||
#define wave_cursor_width 43
|
||||
#define wave_cursor_height 61
|
||||
|
@ -304,7 +303,7 @@ Editor::region_list_selection_changed()
|
|||
sensitive = false;
|
||||
}
|
||||
|
||||
for (vector<Glib::RefPtr<Gtk::Action> >::iterator i = region_list_selection_sensitive_actions.begin(); i != region_list_selection_sensitive_actions.end(); ++i) {
|
||||
for (vector<Glib::RefPtr<Gtk::Action> >::iterator i = ActionManager::region_list_selection_sensitive_actions.begin(); i != ActionManager::region_list_selection_sensitive_actions.end(); ++i) {
|
||||
(*i)->set_sensitive (sensitive);
|
||||
}
|
||||
|
||||
|
@ -357,18 +356,11 @@ Editor::region_list_clear ()
|
|||
void
|
||||
Editor::build_region_list_menu ()
|
||||
{
|
||||
region_list_menu = dynamic_cast<Menu*>(ui_manager->get_widget ("/RegionListMenu"));
|
||||
region_list_menu = dynamic_cast<Menu*>(ActionManager::get_widget ("/RegionListMenu"));
|
||||
|
||||
/* now grab specific menu items that we need */
|
||||
|
||||
toggle_full_region_list_action = ui_manager->get_action ("<Actions>/RegionList/rlShowAll");
|
||||
|
||||
region_list_selection_sensitive_actions.push_back (ui_manager->get_action ("<Actions>/RegionList/rlHide"));
|
||||
region_list_selection_sensitive_actions.push_back (ui_manager->get_action ("<Actions>/RegionList/rlAudition"));
|
||||
region_list_selection_sensitive_actions.push_back (ui_manager->get_action ("<Actions>/RegionList/rlRemove"));
|
||||
|
||||
session_sensitive_actions.push_back (ui_manager->get_action ("<Actions>/RegionList/rlEmbedAudio"));
|
||||
session_sensitive_actions.push_back (ui_manager->get_action ("<Actions>/RegionList/rlImportAudio"));
|
||||
toggle_full_region_list_action = ActionManager::get_action ("<Actions>/RegionList/rlShowAll");
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -599,18 +599,14 @@ Editor::update_ruler_visibility ()
|
|||
|
||||
double tbpos = 0.0;
|
||||
double old_unit_pos ;
|
||||
GtkArg args[1] ;
|
||||
args[0].name = "y";
|
||||
|
||||
if (ruler_shown[ruler_time_meter]) {
|
||||
lab_children.push_back (Element(meter_label, PACK_SHRINK, PACK_START));
|
||||
|
||||
gtk_object_get (GTK_OBJECT(meter_group), "y", &old_unit_pos);
|
||||
old_unit_pos = meter_group->property_y();
|
||||
if (tbpos != old_unit_pos) {
|
||||
meter_group->move ( 0.0, tbpos - old_unit_pos);
|
||||
}
|
||||
|
||||
//gnome_canvas_item_set (meter_group, "y", tbpos, NULL);
|
||||
meter_group->show();
|
||||
tbpos += timebar_height;
|
||||
visible_timebars++;
|
||||
|
@ -625,7 +621,6 @@ Editor::update_ruler_visibility ()
|
|||
if (tbpos != old_unit_pos) {
|
||||
tempo_group->move(0.0, tbpos - old_unit_pos);
|
||||
}
|
||||
//gnome_canvas_item_set (tempo_group, "y", tbpos, NULL);
|
||||
tempo_group->show();
|
||||
tbpos += timebar_height;
|
||||
visible_timebars++;
|
||||
|
@ -636,13 +631,10 @@ Editor::update_ruler_visibility ()
|
|||
|
||||
if (ruler_shown[ruler_time_marker]) {
|
||||
lab_children.push_back (Element(mark_label, PACK_SHRINK, PACK_START));
|
||||
gtk_object_getv (GTK_OBJECT(marker_group), 1, args) ;
|
||||
old_unit_pos = GTK_VALUE_DOUBLE (args[0]) ;
|
||||
gtk_object_get (GTK_OBJECT(marker_group), "y", &old_unit_pos);
|
||||
old_unit_pos = marker_group->property_y();
|
||||
if (tbpos != old_unit_pos) {
|
||||
marker_group->move ( 0.0, tbpos - old_unit_pos);
|
||||
}
|
||||
//gnome_canvas_item_set (marker_group, "y", tbpos, NULL);
|
||||
marker_group->show();
|
||||
tbpos += timebar_height;
|
||||
visible_timebars++;
|
||||
|
@ -653,12 +645,10 @@ Editor::update_ruler_visibility ()
|
|||
|
||||
if (ruler_shown[ruler_time_range_marker]) {
|
||||
lab_children.push_back (Element(range_mark_label, PACK_SHRINK, PACK_START));
|
||||
gtk_object_getv (GTK_OBJECT(range_marker_group), 1, args) ;
|
||||
old_unit_pos = GTK_VALUE_DOUBLE (args[0]) ;
|
||||
old_unit_pos = range_marker_group->property_y();
|
||||
if (tbpos != old_unit_pos) {
|
||||
range_marker_group->move (0.0, tbpos - old_unit_pos);
|
||||
}
|
||||
//gnome_canvas_item_set (marker_group, "y", tbpos, NULL);
|
||||
range_marker_group->show();
|
||||
tbpos += timebar_height;
|
||||
visible_timebars++;
|
||||
|
@ -669,11 +659,10 @@ Editor::update_ruler_visibility ()
|
|||
|
||||
if (ruler_shown[ruler_time_transport_marker]) {
|
||||
lab_children.push_back (Element(transport_mark_label, PACK_SHRINK, PACK_START));
|
||||
gtk_object_get (GTK_OBJECT(transport_marker_group), "y", &old_unit_pos);
|
||||
old_unit_pos = transport_marker_group->property_y();
|
||||
if (tbpos != old_unit_pos) {
|
||||
transport_marker_group->move ( 0.0, tbpos - old_unit_pos);
|
||||
}
|
||||
//gnome_canvas_item_set (marker_group, "y", tbpos, NULL);
|
||||
transport_marker_group->show();
|
||||
tbpos += timebar_height;
|
||||
visible_timebars++;
|
||||
|
|
|
@ -72,11 +72,11 @@ Editor::draw_metric_marks (const Metrics& metrics)
|
|||
if ((ms = dynamic_cast<const MeterSection*>(*i)) != 0) {
|
||||
snprintf (buf, sizeof(buf), "%g/%g", ms->beats_per_bar(), ms->note_divisor ());
|
||||
metric_marks.push_back (new MeterMarker (*this, *meter_group, color_map[cMeterMarker], buf,
|
||||
*(const_cast<MeterSection*>(ms)), PublicEditor::canvas_meter_marker_event));
|
||||
*(const_cast<MeterSection*>(ms))));
|
||||
} else if ((ts = dynamic_cast<const TempoSection*>(*i)) != 0) {
|
||||
snprintf (buf, sizeof (buf), "%.2f", ts->beats_per_minute());
|
||||
metric_marks.push_back (new TempoMarker (*this, *tempo_group, color_map[cTempoMarker], buf,
|
||||
*(const_cast<TempoSection*>(ts)), PublicEditor::canvas_tempo_marker_event));
|
||||
*(const_cast<TempoSection*>(ts))));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "utils.h"
|
||||
#include "logmeter.h"
|
||||
#include "gui_thread.h"
|
||||
#include "keyboard.h"
|
||||
|
||||
#include <ardour/session.h>
|
||||
#include <ardour/route.h>
|
||||
|
|
|
@ -36,7 +36,7 @@ ImageFrame::ImageFrame(Group& parentx, ArtPixBuf* pbuf, double x, double y, Gtk:
|
|||
: Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0)))
|
||||
{
|
||||
item_construct(parentx);
|
||||
set("x1",x1,"y1",y1,"x2",x2,"y2",y2,0);
|
||||
set("pixbuf", pbuf, "x", x,"y", y,"width", w,"height", h, 0);
|
||||
}
|
||||
|
||||
ImageFrame::ImageFrame(Group& parentx)
|
||||
|
@ -57,9 +57,9 @@ namespace
|
|||
namespace Glib
|
||||
{
|
||||
|
||||
ArdourCanvas::ImageFrame* wrap(GnomeCanvasImageFrame* object, bool take_copy)
|
||||
Gnome::Canvas::ImageFrame* wrap(GnomeCanvasImageFrame* object, bool take_copy)
|
||||
{
|
||||
return dynamic_cast<ArdourCanvas::ImageFrame *> (Glib::wrap_auto ((GObject*)(object), take_copy));
|
||||
return dynamic_cast<Gnome::Canvas::ImageFrame *> (Glib::wrap_auto ((GObject*)(object), take_copy));
|
||||
}
|
||||
|
||||
} /* namespace Glib */
|
||||
|
|
|
@ -133,12 +133,12 @@ public:
|
|||
|
||||
namespace Glib
|
||||
{
|
||||
/** @relates ArdourCanvas::ImageFrame
|
||||
/** @relates Gnome::Canvas::ImageFrame
|
||||
* @param object The C instance
|
||||
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
|
||||
* @result A C++ instance that wraps this C instance.
|
||||
*/
|
||||
ArdourCanvas::ImageFrame* wrap(GnomeCanvasImageFrame* object, bool take_copy = false);
|
||||
Gnome::Canvas::ImageFrame* wrap(GnomeCanvasImageFrame* object, bool take_copy = false);
|
||||
}
|
||||
#endif /* _LIBGNOMECANVASMM_IMAGEFRAME_H */
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ ImageFrameTimeAxisView::ImageFrameTimeAxisView (ImageFrameTimeAxis& tv)
|
|||
canvas_rect.property_outline_color_rgba().set_value(color_map[cImageTrackOutline]);
|
||||
canvas_rect.property_fill_color_rgba().set_value(stream_base_color);
|
||||
|
||||
canvas_rect.signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_imageframe_view_event), canvas_rect, &_trackview));
|
||||
canvas_rect.signal_event().connect (bind (mem_fun (_trackview.editor, &PublicEditor::canvas_imageframe_view_event), (ArdourCanvas::Item*) &canvas_rect, &tv));
|
||||
|
||||
_samples_per_unit = _trackview.editor.get_current_zoom() ;
|
||||
|
||||
|
|
|
@ -31,11 +31,13 @@
|
|||
#include "public_editor.h"
|
||||
#include "utils.h"
|
||||
#include "imageframe_view.h"
|
||||
#include "canvas-imageframe.h"
|
||||
#include "imageframe.h"
|
||||
#include "canvas_impl.h"
|
||||
#include "gui_thread.h"
|
||||
|
||||
using namespace sigc ;
|
||||
using namespace ARDOUR ;
|
||||
using namespace Gtk;
|
||||
|
||||
sigc::signal<void,ImageFrameView*> ImageFrameView::GoingAway;
|
||||
|
||||
|
@ -90,23 +92,14 @@ ImageFrameView::ImageFrameView(std::string item_id,
|
|||
|
||||
//calculate our image width based on the track height
|
||||
double im_ratio = (double)width/(double)height ;
|
||||
int im_width = (int)((double)(trackview.height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE) * im_ratio) ;
|
||||
double im_width = ((double)(trackview.height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE) * im_ratio) ;
|
||||
|
||||
imageframe = gnome_canvas_item_new(GNOME_CANVAS_GROUP(group),
|
||||
gnome_canvas_imageframe_get_type(),
|
||||
"pixbuf", pbuf,
|
||||
"x", (gdouble) 1.0,
|
||||
"y", (gdouble) 1.0,
|
||||
"anchor", GTK_ANCHOR_NW,
|
||||
"width", (gdouble) im_width,
|
||||
"height", (gdouble) (trackview.height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE),
|
||||
NULL) ;
|
||||
imageframe = new ImageFrame (*group, pbuf, 1.0, 1.0, ANCHOR_NW, im_width, (trackview.height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE));
|
||||
|
||||
frame_handle_start->signal_event().connect() (bind (mem_fun (editor, &PublicEditor::canvas_imageframe_start_handle_event), frame_handle_start));
|
||||
frame_handle_end->signal_event().connect() (bind (mem_fun (editor, &PublicEditor::canvas_imageframe_end_handle_event), frame_handle_end));
|
||||
group->signal_event().connect() (bind (mem_fun (editor, &PublicEditor::canvas_imageframe_item_view_event, this);), group));
|
||||
frame_handle_start->signal_event().connect (bind (mem_fun (trackview.editor, &PublicEditor::canvas_imageframe_start_handle_event), frame_handle_start, this));
|
||||
frame_handle_end->signal_event().connect (bind (mem_fun (trackview.editor, &PublicEditor::canvas_imageframe_end_handle_event), frame_handle_end, this));
|
||||
group->signal_event().connect (bind (mem_fun (trackview.editor, &PublicEditor::canvas_imageframe_item_view_event), imageframe, this));
|
||||
|
||||
|
||||
frame_handle_start->raise_to_top();
|
||||
frame_handle_end->raise_to_top();
|
||||
|
||||
|
@ -162,7 +155,7 @@ ImageFrameView::~ImageFrameView()
|
|||
|
||||
if(imageframe)
|
||||
{
|
||||
gtk_object_destroy(GTK_OBJECT(imageframe)) ;
|
||||
delete imageframe;
|
||||
imageframe = 0 ;
|
||||
}
|
||||
}
|
||||
|
@ -220,7 +213,7 @@ ImageFrameView::set_duration(jack_nframes_t dur, void* src)
|
|||
if(ret)
|
||||
{
|
||||
/* handle setting the sizes of our canvas itesm based on the new duration */
|
||||
gnome_canvas_item_set(imageframe, "drawwidth", (gdouble) trackview.editor.frame_to_pixel(get_duration()), NULL) ;
|
||||
imageframe->property_drawwidth() = trackview.editor.frame_to_pixel(get_duration());
|
||||
}
|
||||
|
||||
return(ret) ;
|
||||
|
@ -267,13 +260,12 @@ ImageFrameView::set_height (gdouble h)
|
|||
// set the image size
|
||||
// @todo might have to re-get the image data, for a large height...hmmm.
|
||||
double im_ratio = (double)image_data_width/(double)image_data_height ;
|
||||
int im_width = (int)((double)(h - TimeAxisViewItem::NAME_Y_OFFSET) * im_ratio) ;
|
||||
gnome_canvas_item_set(imageframe, "width", (gdouble)im_width, NULL) ;
|
||||
gnome_canvas_item_set(imageframe, "height",(gdouble) (h - TimeAxisViewItem::NAME_Y_OFFSET), NULL) ;
|
||||
|
||||
imageframe->property_width() = (h - TimeAxisViewItem::NAME_Y_OFFSET) * im_ratio;
|
||||
imageframe->property_height() = h - TimeAxisViewItem::NAME_Y_OFFSET;
|
||||
|
||||
frame->raise_to_top();
|
||||
gnome_canvas_item_raise_to_top(imageframe) ;
|
||||
//imageframe->raise_to_top();
|
||||
imageframe->raise_to_top();
|
||||
name_highlight->raise_to_top();
|
||||
name_text->raise_to_top();
|
||||
frame_handle_start->raise_to_top();
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <sigc++/signal.h>
|
||||
#include <list>
|
||||
|
||||
#include "canvas.h"
|
||||
#include "enums.h"
|
||||
#include "time_axis_view_item.h"
|
||||
#include "marker_view.h"
|
||||
|
@ -205,7 +206,7 @@ class ImageFrameView : public TimeAxisViewItem
|
|||
// ------- Our canvas element -----------
|
||||
|
||||
/** the CanvasImageFrame to display the image */
|
||||
GnomeCanvasItem* imageframe ;
|
||||
ArdourCanvas::ImageFrame* imageframe ;
|
||||
|
||||
} ; /* class ImageFrameView */
|
||||
|
||||
|
|
|
@ -18,17 +18,18 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
#include <sigc++/bind.h>
|
||||
#include <ardour/tempo.h>
|
||||
|
||||
#include "marker.h"
|
||||
#include "public_editor.h"
|
||||
#include "canvas-simpleline.h"
|
||||
#include "utils.h"
|
||||
#include "canvas_impl.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, guint32 rgba, const string& annotation,
|
||||
Type type, gint (*callback)(ArdourCanvas::Item *, GdkEvent *, gpointer), jack_nframes_t frame)
|
||||
Type type, jack_nframes_t frame, bool handle_events)
|
||||
|
||||
: editor (ed), _type(type)
|
||||
{
|
||||
|
@ -243,14 +244,14 @@ Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, guint32 rgba, con
|
|||
group->set_property ("x", unit_position);
|
||||
group->set_property ("y", 1.0);
|
||||
// cerr << "set mark al points, nc = " << points->num_points << endl;
|
||||
mark = new ArdourCanvas::Polygon (*group);
|
||||
mark = new Polygon (*group);
|
||||
mark->set_property ("points", points);
|
||||
mark->set_property ("fill_color_rgba", rgba);
|
||||
mark->set_property ("outline_color", Gdk::Color ("black"));
|
||||
|
||||
Pango::FontDescription font = get_font_for_style (N_("MarkerText"));
|
||||
|
||||
text = new ArdourCanvas::Text (*group);
|
||||
text = new Text (*group);
|
||||
text->set_property ("text", annotation.c_str());
|
||||
text->set_property ("x", label_offset);
|
||||
text->set_property ("y", 0.0);
|
||||
|
@ -258,17 +259,30 @@ Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, guint32 rgba, con
|
|||
text->set_property ("anchor", Gtk::ANCHOR_NW);
|
||||
text->set_property ("fill_color", Gdk::Color ("black"));
|
||||
|
||||
group->signal_event().connect() (bind (mem_fun (editor, &PublicEditor::reposition), group, this));
|
||||
editor.ZoomChanged.connect (mem_fun (*this, &Marker::reposition));
|
||||
|
||||
mark->set_data ("marker", this);
|
||||
|
||||
if (handle_events) {
|
||||
group->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_marker_event), mark, this));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Marker::~Marker ()
|
||||
{
|
||||
/* destroying the group destroys its contents */
|
||||
/* destroying the parent group destroys its contents, namely any polygons etc. that we added */
|
||||
delete text;
|
||||
delete mark;
|
||||
delete points;
|
||||
}
|
||||
|
||||
ArdourCanvas::Item&
|
||||
Marker::the_item() const
|
||||
{
|
||||
return *mark;
|
||||
}
|
||||
|
||||
void
|
||||
Marker::set_name (const string& name)
|
||||
{
|
||||
|
@ -312,13 +326,12 @@ Marker::set_color_rgba (uint32_t color)
|
|||
/***********************************************************************/
|
||||
|
||||
TempoMarker::TempoMarker (PublicEditor& editor, ArdourCanvas::Group& parent, guint32 rgba, const string& text,
|
||||
ARDOUR::TempoSection& temp,
|
||||
gint (*callback)(ArdourCanvas::Item *, GdkEvent *, gpointer))
|
||||
: Marker (editor, parent, rgba, text, Tempo, callback, 0),
|
||||
ARDOUR::TempoSection& temp)
|
||||
: Marker (editor, parent, rgba, text, Tempo, 0, false),
|
||||
_tempo (temp)
|
||||
{
|
||||
set_position (_tempo.frame());
|
||||
group->set_data ("tempo_marker", this);
|
||||
group->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_tempo_marker_event), mark, this));
|
||||
}
|
||||
|
||||
TempoMarker::~TempoMarker ()
|
||||
|
@ -328,15 +341,15 @@ TempoMarker::~TempoMarker ()
|
|||
/***********************************************************************/
|
||||
|
||||
MeterMarker::MeterMarker (PublicEditor& editor, ArdourCanvas::Group& parent, guint32 rgba, const string& text,
|
||||
ARDOUR::MeterSection& m,
|
||||
gint (*callback)(ArdourCanvas::Item *, GdkEvent *, gpointer))
|
||||
: Marker (editor, parent, rgba, text, Meter, callback, 0),
|
||||
ARDOUR::MeterSection& m)
|
||||
: Marker (editor, parent, rgba, text, Meter, 0, false),
|
||||
_meter (m)
|
||||
{
|
||||
set_position (_meter.frame());
|
||||
gtk_object_set_data (GTK_OBJECT(group), "meter_marker", this);
|
||||
group->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_meter_marker_event), mark, this));
|
||||
}
|
||||
|
||||
MeterMarker::~MeterMarker ()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -24,9 +24,6 @@
|
|||
#include <string>
|
||||
#include <glib.h>
|
||||
#include <ardour/ardour.h>
|
||||
#include <libgnomecanvasmm/group.h>
|
||||
#include <libgnomecanvasmm/text.h>
|
||||
#include <libgnomecanvasmm/polygon.h>
|
||||
#include <sigc++/signal.h>
|
||||
|
||||
#include "canvas.h"
|
||||
|
@ -53,10 +50,14 @@ class Marker : public sigc::trackable
|
|||
PunchOut
|
||||
};
|
||||
|
||||
|
||||
Marker (PublicEditor& editor, ArdourCanvas::Group& parent, guint32 rgba, const string& text, Type,
|
||||
gint (*callback)(ArdourCanvas::Item *, GdkEvent *, gpointer), jack_nframes_t frame = 0);
|
||||
jack_nframes_t frame = 0, bool handle_events = true);
|
||||
|
||||
virtual ~Marker ();
|
||||
|
||||
ArdourCanvas::Item& the_item() const;
|
||||
|
||||
void set_position (jack_nframes_t);
|
||||
void set_name (const string&);
|
||||
void set_color_rgba (uint32_t rgba);
|
||||
|
@ -70,7 +71,7 @@ class Marker : public sigc::trackable
|
|||
PublicEditor& editor;
|
||||
|
||||
ArdourCanvas::Group *group;
|
||||
ArdourCanvas::Item *mark;
|
||||
ArdourCanvas::Polygon *mark;
|
||||
ArdourCanvas::Text *text;
|
||||
ArdourCanvas::Points *points;
|
||||
|
||||
|
@ -85,8 +86,7 @@ class Marker : public sigc::trackable
|
|||
class TempoMarker : public Marker
|
||||
{
|
||||
public:
|
||||
TempoMarker (PublicEditor& editor, ArdourCanvas::Group& parent, guint32 rgba, const string& text, ARDOUR::TempoSection&,
|
||||
gint (*callback)(ArdourCanvas::Item *, GdkEvent *, gpointer));
|
||||
TempoMarker (PublicEditor& editor, ArdourCanvas::Group& parent, guint32 rgba, const string& text, ARDOUR::TempoSection&);
|
||||
~TempoMarker ();
|
||||
|
||||
ARDOUR::TempoSection& tempo() const { return _tempo; }
|
||||
|
@ -98,8 +98,7 @@ class TempoMarker : public Marker
|
|||
class MeterMarker : public Marker
|
||||
{
|
||||
public:
|
||||
MeterMarker (PublicEditor& editor, ArdourCanvas::Group& parent, guint32 rgba, const string& text, ARDOUR::MeterSection&,
|
||||
gint (*callback)(ArdourCanvas::Item *, GdkEvent *, gpointer));
|
||||
MeterMarker (PublicEditor& editor, ArdourCanvas::Group& parent, guint32 rgba, const string& text, ARDOUR::MeterSection&);
|
||||
~MeterMarker ();
|
||||
|
||||
ARDOUR::MeterSection& meter() const { return _meter; }
|
||||
|
|
Loading…
Reference in New Issue