View Issue Details

IDProjectCategoryView StatusLast Update
0002364ardourotherpublic2020-04-19 20:13
Reporterx42 Assigned Topaul  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product VersionSVN/2.0-ongoing 
Summary0002364: Image Compositor Socket regression fix(es)
DescriptionFeature request and kick-off patch to eventually get a video-timeline into ardour.
Additional Informationthe attached diffs also apply to svn rev 3650.
TagsNo tags attached.

Activities

2008-08-02 18:17

 

ardour-r3617-video-gui.patch (7,095 bytes)   
diff --git a/gtk2_ardour/imageframe.cc b/gtk2_ardour/imageframe.cc
index 7ff05ee..8758819 100644
--- a/gtk2_ardour/imageframe.cc
+++ b/gtk2_ardour/imageframe.cc
@@ -35,7 +35,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("pixbuf", pbuf, "x", x,"y", y,"width", w,"height", h, 0);
+  set("pixbuf", pbuf, "x", x,"y", y,"width", w,"height", h, "anchor", anchor, 0);
 }
 
 ImageFrame::ImageFrame(Group& parentx)
diff --git a/gtk2_ardour/imageframe_time_axis.cc b/gtk2_ardour/imageframe_time_axis.cc
index f3630e7..700a160 100644
--- a/gtk2_ardour/imageframe_time_axis.cc
+++ b/gtk2_ardour/imageframe_time_axis.cc
@@ -138,6 +138,7 @@ ImageFrameTimeAxis::~ImageFrameTimeAxis ()
 void
 ImageFrameTimeAxis::set_height (uint32_t h)
 {
+	bool changed = (height == 0) || (h != height);
 	VisualTimeAxis::set_height(h) ;
 	
 	// tell out view helper of the change too
@@ -146,8 +147,10 @@ ImageFrameTimeAxis::set_height (uint32_t h)
 		view->set_height((double) height) ;
 	}
 	
+	if (changed) {
 	// tell those interested that we have had our height changed
-	 gui_changed("track_height",(void*)0); /* EMIT_SIGNAL */
+		gui_changed("track_height",(void*)0); /* EMIT_SIGNAL */
+	}
 }
 
 /**
diff --git a/gtk2_ardour/imageframe_view.cc b/gtk2_ardour/imageframe_view.cc
index f353813..d129147 100644
--- a/gtk2_ardour/imageframe_view.cc
+++ b/gtk2_ardour/imageframe_view.cc
@@ -67,7 +67,7 @@ ImageFrameView::ImageFrameView(const string & item_id,
 	uint32_t width,
 	uint32_t height,
 	uint32_t num_channels)
-  : TimeAxisViewItem(item_id, *parent, *tv, spu, basic_color, start, duration,
+  : TimeAxisViewItem(item_id, *parent, *tv, spu, basic_color, start, duration, false,
 		     TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowNameText|
 						   TimeAxisViewItem::ShowNameHighlight|
 						   TimeAxisViewItem::ShowFrame|
@@ -86,7 +86,16 @@ ImageFrameView::ImageFrameView(const string & item_id,
 	memcpy(the_rgb_data, rgb_data, (width*height*num_channels)) ;
 
 	ArtPixBuf* pbuf ;
-	pbuf = art_pixbuf_new_rgba(the_rgb_data, width, height, (num_channels * width));
+	if (num_channels==3)
+	  pbuf = art_pixbuf_new_rgb(the_rgb_data, width, height, (num_channels * width));
+	else if (num_channels==4)
+	  pbuf = art_pixbuf_new_rgba(the_rgb_data, width, height, (num_channels * width));
+	else  {
+	  ; // error unsupported image data format
+	  art_free(the_rgb_data);
+	  std::cerr << "imageframe_view: unsupported image data format" << std::endl;
+	  return;
+	}
 	imageframe = 0 ;
 	
 	//calculate our image width based on the track height
diff --git a/gtk2_ardour/marker_time_axis.cc b/gtk2_ardour/marker_time_axis.cc
index df041f8..f5c80be 100644
--- a/gtk2_ardour/marker_time_axis.cc
+++ b/gtk2_ardour/marker_time_axis.cc
@@ -109,6 +109,7 @@ MarkerTimeAxis::~MarkerTimeAxis()
 void
 MarkerTimeAxis::set_height (uint32_t h)
 {
+	bool changed = (height == 0) || (h != height);
 	VisualTimeAxis::set_height(h) ;
 	
 	// tell out view helper of the change too
@@ -117,8 +118,10 @@ MarkerTimeAxis::set_height (uint32_t h)
 		view->set_height((double) height) ;
 	}
 	
+	if (changed) {
 	// tell those interested that we have had our height changed
 	 gui_changed("track_height",(void*)0) ; /* EMIT_SIGNAL */
+	}
 }
 
 /**
diff --git a/gtk2_ardour/visual_time_axis.cc b/gtk2_ardour/visual_time_axis.cc
index 2035293..468b967 100644
--- a/gtk2_ardour/visual_time_axis.cc
+++ b/gtk2_ardour/visual_time_axis.cc
@@ -84,18 +84,22 @@ VisualTimeAxis::VisualTimeAxis(const string & name, PublicEditor& ed, ARDOUR::Se
 	size_button.set_name("TrackSizeButton") ;
 	visual_button.set_name("TrackVisualButton") ;
 	hide_button.set_name("TrackRemoveButton") ;
-	hide_button.add(*(Gtk::manage(new Gtk::Image(get_xpm("small_x.xpm")))));
+	hide_button.add (*(manage (new Image (::get_icon("hide")))));
+	hide_button.show_all ();
+
 	size_button.signal_button_release_event().connect (mem_fun (*this, &VisualTimeAxis::size_click)) ;
 	visual_button.signal_clicked().connect (mem_fun (*this, &VisualTimeAxis::visual_click)) ;
 	hide_button.signal_clicked().connect (mem_fun (*this, &VisualTimeAxis::hide_click)) ;
 	ARDOUR_UI::instance()->tooltips().set_tip(size_button,_("Display Height")) ;
 	ARDOUR_UI::instance()->tooltips().set_tip(visual_button, _("Visual options")) ;
 	ARDOUR_UI::instance()->tooltips().set_tip(hide_button, _("Hide this track")) ;
-		
+
+if (0) {		
+		/* old school - when we used to put an extra row of buttons in place */
 	controls_table.attach (hide_button, 0, 1, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
 	controls_table.attach (visual_button, 1, 2, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
 	controls_table.attach (size_button, 2, 3, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
-
+}
 	/* remove focus from the buttons */
 	size_button.unset_flags(Gtk::CAN_FOCUS) ;
 	hide_button.unset_flags(Gtk::CAN_FOCUS) ;
@@ -154,15 +158,21 @@ VisualTimeAxis::set_height(uint32_t h)
 	if (h >= hNormal) {
 		hide_name_label ();
 		show_name_entry ();
-		other_button_hbox.show_all() ;
+		visual_button.show();
+		size_button.show();
+		hide_button.show();
 	} else if (h >= hSmaller) {
 		hide_name_label ();
 		show_name_entry ();
-		other_button_hbox.hide_all() ;
+		visual_button.hide ();
+		size_button.hide ();
+		hide_button.hide();
 	} else if (h >= hSmall) {
 		hide_name_entry ();
 		show_name_label ();
-		other_button_hbox.hide_all() ;
+		visual_button.hide ();
+		size_button.hide ();
+		hide_button.hide ();
 	}
 }
 
diff --git a/gtk2_ardour/editor_imageframe.cc b/gtk2_ardour/editor_imageframe.cc
index d2defd4..0dcbf46 100644
--- a/gtk2_ardour/editor_imageframe.cc
+++ b/gtk2_ardour/editor_imageframe.cc
@@ -1081,19 +1081,34 @@ Editor::markerview_end_handle_end_trim (ArdourCanvas::Item* item, GdkEvent* even
 void
 Editor::handle_new_imageframe_time_axis_view(const string & track_name, void* src)
 {
+	ignore_route_list_reorder = true;
+	ignore_route_order_sync = true;
+	no_route_list_redisplay = true;
+
 	ImageFrameTimeAxis* iftav ;
 	iftav = new ImageFrameTimeAxis(track_name, *this, *session, *track_canvas) ;
 	iftav->set_time_axis_name(track_name, this) ;
 	track_views.push_back(iftav) ;
 
-	TreeModel::Row row = *(route_display_model->append());
 
+	TreeModel::Row row = *(route_display_model->append());
+#if 1 // fake Route workaround
+	row[route_display_columns.route] = 
+		session->new_video_track(iftav->name());
+#endif
 	row[route_display_columns.text] = iftav->name();
 	row[route_display_columns.tv] = iftav;
+	row[route_display_columns.visible] = true;
 	route_list_display.get_selection()->select (row);
 
 	iftav->GoingAway.connect(bind(mem_fun(*this, &Editor::remove_route), (TimeAxisView*)iftav)) ;
+	iftav->set_old_order_key (route_display_model->children().size() - 1);
 	iftav->gui_changed.connect(mem_fun(*this, &Editor::handle_gui_changes)) ;
+
+	ignore_route_list_reorder = false;
+	ignore_route_order_sync = false;
+	no_route_list_redisplay = false;
+	redisplay_route_list ();
 }
 
 void
ardour-r3617-video-gui.patch (7,095 bytes)   

2008-08-02 18:17

 

ardour-r3617-video-ics.patch (5,982 bytes)   
diff --git a/gtk2_ardour/ardour_image_compositor_socket.h b/gtk2_ardour/ardour_image_compositor_socket.h
index 6ed92ef..03f0086 100644
--- a/gtk2_ardour/ardour_image_compositor_socket.h
+++ b/gtk2_ardour/ardour_image_compositor_socket.h
@@ -46,6 +46,8 @@ namespace ardourvis
 	/** the number of characters used to for the size of the image data message */
 	const int32_t IMAGE_DATA_MESSAGE_SIZE_CHARS = 32 ;
 
+	/** the number of characters in a return/reply message */
+	const int32_t RETURN_MSG_SIZE = 3 ;
 	// ------------------------------------------------------------------------- //
 	// Main Actions
 	// we join the action chars with items to create the message
diff --git a/gtk2_ardour/imageframe_socket_handler.cc b/gtk2_ardour/imageframe_socket_handler.cc
index 1b0250b..f92b378 100644
--- a/gtk2_ardour/imageframe_socket_handler.cc
+++ b/gtk2_ardour/imageframe_socket_handler.cc
@@ -316,8 +316,7 @@ ImageFrameSocketHandler::send_imageframe_time_axis_removed(const string & track_
 	send_message(msgBuffer.str()) ;
 
 	// XXX should do something with the return
-	std::string retmsg ;
-	read_message(retmsg) ;
+	read_result();
 }
 		
 /**
@@ -357,8 +356,7 @@ ImageFrameSocketHandler::send_imageframe_time_axis_renamed(const string & new_id
 	send_message(msgBuffer.str()) ;
 
 	// XXX should do something with the return
-	std::string retmsg ;
-	read_message(retmsg) ;
+	read_result();
 }
 
 //------------------------
@@ -393,8 +391,7 @@ ImageFrameSocketHandler::send_marker_time_axis_removed(const string & track_id,
 	send_message(msgBuffer.str()) ;
 
 	// XXX should do something with the return
-	std::string retmsg ;
-	read_message(retmsg) ;
+	read_result();
 }
 		
 /**
@@ -434,8 +431,7 @@ ImageFrameSocketHandler::send_marker_time_axis_renamed(const string & new_id, co
 	send_message(msgBuffer.str()) ;
 	
 	// XXX should do something with the return
-	std::string retmsg ;
-	read_message(retmsg) ;
+	read_result();
 }
 
 //---------------------------------
@@ -476,8 +472,7 @@ ImageFrameSocketHandler::send_imageframe_time_axis_group_removed(const string &
 	send_message(msgBuffer.str()) ;
 
 	// XXX should do something with the return
-	std::string retmsg ;
-	read_message(retmsg) ;
+	read_result();
 }
 
 /**
@@ -521,8 +516,7 @@ ImageFrameSocketHandler::send_imageframe_time_axis_group_renamed(const string &
 	send_message(msgBuffer.str()) ;
 	
 	// XXX should do something with the return
-	std::string retmsg ;
-	read_message(retmsg) ;
+	read_result();
 }
 
 
@@ -561,8 +555,7 @@ ImageFrameSocketHandler::send_imageframe_view_position_change(nframes_t pos, voi
 	send_message(msgBuffer.str()) ;
 	
 	// XXX should do something with the return
-	std::string retmsg ;
-	read_message(retmsg) ;
+	read_result();
 }
 		
 /**
@@ -596,8 +589,7 @@ ImageFrameSocketHandler::send_imageframe_view_duration_change(nframes_t dur, voi
 	send_message(msgBuffer.str()) ;
 	
 	// XXX should do something with the return
-	std::string retmsg ;
-	read_message(retmsg) ;
+	read_result();
 }
 		
 /**
@@ -632,8 +624,7 @@ ImageFrameSocketHandler::send_imageframe_view_renamed(const string & new_id, con
 	send_message(msgBuffer.str()) ;
 	
 	// XXX should do something with the return
-	std::string retmsg ;
-	read_message(retmsg) ;
+	read_result();
 }
 		
 /**
@@ -669,8 +660,7 @@ ImageFrameSocketHandler::send_imageframe_view_removed(const string & item_id, vo
 	send_message(msgBuffer.str()) ;
 
 	// XXX should do something with the return
-	std::string retmsg ;
-	read_message(retmsg) ;
+	read_result();
 }
 
 
@@ -709,8 +699,7 @@ ImageFrameSocketHandler::send_marker_view_position_change(nframes_t pos, void* s
 	send_message(msgBuffer.str()) ;
 
 	// XXX should do something with the return
-	std::string retmsg ;
-	read_message(retmsg) ;
+	read_result();
 }
 		
 /**
@@ -742,8 +731,7 @@ ImageFrameSocketHandler::send_marker_view_duration_change(nframes_t dur, void* s
 	send_message(msgBuffer.str()) ;
 
 	// XXX should do something with the return
-	std::string retmsg ;
-	read_message(retmsg) ;
+	read_result();
 }	
 
 		
@@ -780,8 +768,7 @@ ImageFrameSocketHandler::send_marker_view_renamed(const string & new_id, const s
 	send_message(msgBuffer.str()) ;
 	
 	// XXX should do something with the return
-	std::string retmsg ;
-	read_message(retmsg) ;
+	read_result();
 }
 		
 /**
@@ -815,8 +802,7 @@ ImageFrameSocketHandler::send_marker_view_removed(const string & item_id, void*
 	send_message(msgBuffer.str()) ;
 
 	// XXX should do something with the return
-	std::string retmsg ;
-	read_message(retmsg) ;
+	read_result();
 }
 
 
@@ -2323,6 +2309,25 @@ ImageFrameSocketHandler::read_message(std::string& msg)
 	return(retcode) ;
 }
 
+/**
+ * Reads a reply message ("RT0"/"RT1") from the Socket
+ *
+ * @return true if "RT0" was received,, otherwise false
+ */
+bool
+ImageFrameSocketHandler::read_result()
+{
+	char buf[(ardourvis::RETURN_MSG_SIZE)+1] ;
+	int retcode = ::recv(theArdourToCompositorSocket, buf, ardourvis::RETURN_MSG_SIZE, 0) ;
+	buf[ardourvis::RETURN_MSG_SIZE]='\0';
+	if (retcode > 0) {
+	  std::cout << "Received Result [" << buf << "]\n" ;
+	  if (retcode == ardourvis::RETURN_MSG_SIZE && buf == ardourvis::RETURN_TRUE) {
+	    return (true);
+	  }
+	}
+	return(false) ;
+}
 
 /**
  * Convenience method to string_compose and send a success messasge back to the Image Compositor
diff --git a/gtk2_ardour/imageframe_socket_handler.h b/gtk2_ardour/imageframe_socket_handler.h
index 3a87f5b..0835f18 100644
--- a/gtk2_ardour/imageframe_socket_handler.h
+++ b/gtk2_ardour/imageframe_socket_handler.h
@@ -669,6 +669,13 @@ class ImageFrameSocketHandler : public sigc::trackable
 		 * @return the return value from the socket call
 		 */
 		int read_message(std::string& msg) ;
+
+		/**
+		 * Reads a return message ("RT0"/"RT1") from the Socket
+		 *
+		 * @return true if "RT0" was received,, otherwise false
+		 */
+		bool read_result();
 		
 		/**
 		 * Convenience method to compose and send a success messasge back to the Image Compositor
ardour-r3617-video-ics.patch (5,982 bytes)   

2008-08-02 18:17

 

ardour-r3617-video-route.patch (2,124 bytes)   
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 2c9ef60..62b7f09 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -490,6 +490,8 @@ class Session : public PBD::StatefulDestructible
 	std::list<boost::shared_ptr<AudioTrack> > new_audio_track (int input_channels, int output_channels, TrackMode mode = Normal, uint32_t how_many = 1);
 	RouteList new_audio_route (int input_channels, int output_channels, uint32_t how_many);
 
+	boost::shared_ptr<Route> new_video_track (string name);
+
 	void   remove_route (boost::shared_ptr<Route>);
 
 	void   resort_routes ();
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index af0f31b..27aba5f 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -2004,6 +2004,25 @@ Session::new_audio_route (int input_channels, int output_channels, uint32_t how_
 
 }
 
+boost::shared_ptr<Route>
+Session::new_video_track (string name)
+{
+	uint32_t control_id = ntracks() + nbusses() + 1;
+	shared_ptr<Route> new_route (
+		new Route ( *this, name, -1, -1, -1, -1, Route::Flag(0), ARDOUR::DataType::NIL));
+	new_route->set_remote_control_id (control_id);
+
+	RouteList rl;
+	rl.push_back (new_route);
+        {
+		RCUWriter<RouteList> writer (routes);
+		shared_ptr<RouteList> r = writer.get_copy ();
+                r->insert (r->end(), rl.begin(), rl.end());
+		resort_routes_using (r);
+        }
+	return new_route;
+}
+
 void
 Session::add_routes (RouteList& new_routes, bool save)
 {
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index cecaefb..ab7bae5 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -1358,6 +1358,11 @@ Session::load_routes (const XMLNode& node)
 	set_dirty();
 
 	for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
+		if ((*niter)->property ("default-type")->value() == "unknown" ) {
+		  std::cout << "ignoring route with type unknown. (video-track)" << std::endl;
+		  // Note: this may mess up remote_control IDs or more..
+		  continue;
+		}
 
 		boost::shared_ptr<Route> route (XMLRouteFactory (**niter));
 
ardour-r3617-video-route.patch (2,124 bytes)   

x42

2008-08-02 18:19

administrator   ~0005127

Last edited: 2008-08-03 12:35

These patches fix regressions in ardour-2.5 to get ICS work as it does in ardour-0.99

* ardour-r3617-video-ics.patch - adds a dedicated reply-message parser. The old one would "eat up" incoming requests if they are received directly after a reply-message.

* ardour-r3617-video-gui.patch - various small UI bugs: image-anchor, rgb/rgba, resize-signals

* ardour-r3617-video-route.patch - the hacky business. Having Video-tracks pretending to be an <ARDOUR::Route> simplifies /a lot/ in the GUI. Editor::redisplay_route_list():283 currently requires it, but..

Note: video-route.patch creates <Route> Objects with the data-type NIL. - they're saved with the session but ignored during load.

more information can be found at http://mir.dnsalias.com/wiki/ics and the ardour-dev email list.

seablade

2008-11-24 18:18

manager   ~0005354

Assigned to Paul to take a look at the patches.

     Seablade

paul

2009-03-02 21:01

administrator   ~0005785

applied to 2.0-ongoing, rev 4720. patches needed for 3.0 as well. i had to modify the function that handles a new image track because the patch was out of date. let me know if there are any issues. Session::new_video_track() ... heh, heh.

system

2020-04-19 20:13

developer   ~0021780

Issue has been closed automatically, by Trigger Close Plugin.
Feel free to re-open with additional information if you think the issue is not resolved.

Issue History

Date Modified Username Field Change
2008-08-02 18:17 x42 New Issue
2008-08-02 18:17 x42 File Added: ardour-r3617-video-gui.patch
2008-08-02 18:17 x42 File Added: ardour-r3617-video-ics.patch
2008-08-02 18:17 x42 File Added: ardour-r3617-video-route.patch
2008-08-02 18:19 x42 Note Added: 0005127
2008-08-02 18:22 x42 Note Edited: 0005127
2008-08-03 12:35 x42 Note Edited: 0005127
2008-11-24 18:14 seablade Status new => acknowledged
2008-11-24 18:17 seablade Status acknowledged => assigned
2008-11-24 18:17 seablade Assigned To => paul
2008-11-24 18:18 seablade Note Added: 0005354
2009-03-02 21:01 paul cost => 0.00
2009-03-02 21:01 paul Status assigned => resolved
2009-03-02 21:01 paul Resolution open => fixed
2009-03-02 21:01 paul Note Added: 0005785
2020-04-19 20:13 system Note Added: 0021780
2020-04-19 20:13 system Status resolved => closed