2005-09-25 14:42:24 -04:00
|
|
|
/*
|
2009-10-14 12:10:01 -04:00
|
|
|
Copyright (C) 2003 Paul Davis
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ardour_gtk_imageframe_socket_handler_h__
|
|
|
|
#define __ardour_gtk_imageframe_socket_handler_h__
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <list>
|
|
|
|
#include "ardour_image_compositor_socket.h"
|
|
|
|
|
|
|
|
class TimeAxisViewItem ;
|
|
|
|
class ImageFrameView ;
|
|
|
|
class MarkerView ;
|
|
|
|
class ImageFrameTimeAxisGroup ;
|
2009-02-26 20:26:47 -05:00
|
|
|
class Editor ;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* ImageFrameSocketHandler defines the handler between Ardour and an Image Compositor
|
|
|
|
* As this is purely visual, we do all processing within the main gtk loop via
|
|
|
|
* message passing through a socket.
|
|
|
|
*
|
|
|
|
*/
|
2005-09-25 16:33:00 -04:00
|
|
|
class ImageFrameSocketHandler : public sigc::trackable
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Constructs a new ImageFrameSocketHandler to handle communication between Ardour and the Image Compositor
|
|
|
|
*
|
|
|
|
* @param ed the PublicEditor
|
|
|
|
*/
|
|
|
|
ImageFrameSocketHandler(PublicEditor& ed) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Descructor
|
|
|
|
* this will shutdown the socket if open
|
|
|
|
*/
|
|
|
|
virtual ~ImageFrameSocketHandler() ;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the instance of the ImageFrameSocketHandler
|
|
|
|
* the instance should first be created with createInstance
|
|
|
|
*
|
|
|
|
* @return the instance of the ImageFrameSocketHandler
|
|
|
|
*/
|
|
|
|
static ImageFrameSocketHandler* get_instance() ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* call back to handle doing the processing work
|
|
|
|
* This method is added to the gdk main loop and called when there is data
|
|
|
|
* upon the socket.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
static void image_socket_callback(void *arg, int32_t fd, GdkInputCondition cond) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Attempt to connect to the image compositor on the specified host and port
|
|
|
|
*
|
|
|
|
* @param hostIp the ip address of the image compositor host
|
|
|
|
* @param port the oprt number to attemp the connection on
|
|
|
|
* @return true if the connection was a succees
|
|
|
|
* false otherwise
|
|
|
|
*/
|
2005-12-24 08:07:36 -05:00
|
|
|
bool connect(const char * hostIp, int32_t port) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Closes the connection to th Image Compositor
|
|
|
|
*
|
|
|
|
*/
|
2009-10-14 12:10:01 -04:00
|
|
|
void close_connection() ;
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Returns true if this ImagFrameSocketHandler is currently connected to rthe image compositor
|
|
|
|
*
|
|
|
|
* @return true if connected to the image compositor
|
|
|
|
*/
|
|
|
|
bool is_connected() ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Sets the tag used to describe this input within gtk
|
|
|
|
* this is returned when gdk_input_add is called and is required to remove the input
|
|
|
|
*
|
|
|
|
* @param tag the gdk input tag of this input
|
|
|
|
*/
|
|
|
|
void set_gdk_input_tag(int tag) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Returns the gdk input tag of this input
|
|
|
|
*
|
|
|
|
* @return the gdk input tag of this input
|
|
|
|
* @see setGdkInputTag
|
|
|
|
*/
|
|
|
|
int get_gdk_input_tag() ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Returns the socket file descriptor
|
|
|
|
*
|
|
|
|
* @return the Sockt file descriptor
|
|
|
|
*/
|
|
|
|
int get_socket_descriptor() ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// Handle Sending messages to the Image Compositor
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//----------------------------
|
|
|
|
// ImageFrameTimeAxis Messages
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Sends a message stating that the named image frame time axis has been removed
|
|
|
|
*
|
|
|
|
* @param track_id the unique id of the removed image frame time axis
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
*/
|
2009-10-01 21:49:57 -04:00
|
|
|
void send_imageframe_time_axis_removed(const std::string & track_id, void* src) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Sends a message indicating that an ImageFrameTimeAxis has been renamed
|
|
|
|
*
|
|
|
|
* @param new_id the new name, or Id, of the track
|
|
|
|
* @param old_id the old name, or Id, of the track
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
* @param time_axis the time axis that has changed
|
|
|
|
*/
|
2009-10-01 21:49:57 -04:00
|
|
|
void send_imageframe_time_axis_renamed(const std::string & new_id, const std::string & old_id, void* src, ImageFrameTimeAxis* time_axis) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//------------------------
|
|
|
|
// MarkerTimeAxis Messages
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Sends a message stating that the named marker time axis has been removed
|
|
|
|
*
|
|
|
|
* @param track_id the unique id of the removed image frame time axis
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
*/
|
2009-10-01 21:49:57 -04:00
|
|
|
void send_marker_time_axis_removed(const std::string & track_id, void* src) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Sends a message indicating that an MarkerTimeAxis has been renamed
|
|
|
|
*
|
|
|
|
* @param new_id the new name, or Id, of the track
|
|
|
|
* @param old_id the old name, or Id, of the track
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
* @param time_axis the time axis that has changed
|
|
|
|
*/
|
2009-10-01 21:49:57 -04:00
|
|
|
void send_marker_time_axis_renamed(const std::string & new_id, const std::string & old_id, void* src, MarkerTimeAxis* time_axis) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------
|
|
|
|
// ImageFrameTimeAxisGroup Messages
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Sends a message stating that the group has been removed
|
|
|
|
*
|
|
|
|
* @param group_id the unique id of the removed image frame time axis
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
* @param group the group that has changed
|
|
|
|
*/
|
2009-10-01 21:49:57 -04:00
|
|
|
void send_imageframe_time_axis_group_removed(const std::string & group_id, void* src, ImageFrameTimeAxisGroup* group) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Send a message indicating that an ImageFrameTimeAxisGroup has been renamed
|
|
|
|
*
|
|
|
|
* @param new_id the new name, or Id, of the group
|
|
|
|
* @param old_id the old name, or Id, of the group
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
* @param group the group that has changed
|
|
|
|
*/
|
2009-10-01 21:49:57 -04:00
|
|
|
void send_imageframe_time_axis_group_renamed(const std::string & new_id, const std::string & old_id, void* src, ImageFrameTimeAxisGroup* group) ;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------
|
|
|
|
// ImageFrameView Messages
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Send an Image Frame View Item position changed message
|
|
|
|
*
|
|
|
|
* @param pos the new position value
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
* @param item the time axis item whos position has changed
|
|
|
|
*/
|
2006-09-28 13:23:52 -04:00
|
|
|
void send_imageframe_view_position_change(nframes_t pos, void* src, ImageFrameView* item) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Send a Image Frame View item duration changed message
|
|
|
|
*
|
|
|
|
* @param dur the the new duration value
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
* @param item the item which has had a duration change
|
|
|
|
*/
|
2006-09-28 13:23:52 -04:00
|
|
|
void send_imageframe_view_duration_change(nframes_t dur, void* src, ImageFrameView* item) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Send a message indicating that an ImageFrameView has been renamed
|
|
|
|
*
|
|
|
|
* @param item the ImageFrameView which has been renamed
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
* @param item the renamed item
|
|
|
|
*/
|
2009-10-01 21:49:57 -04:00
|
|
|
void send_imageframe_view_renamed(const std::string & new_id, const std::string & old_id, void* src, ImageFrameView* item) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Send a message indicating that an ImageFrameView item has been removed message
|
|
|
|
*
|
|
|
|
* @param item_id the id of the item that was removed
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
* @param item the removed item
|
|
|
|
*/
|
2009-10-01 21:49:57 -04:00
|
|
|
void send_imageframe_view_removed(const std::string & item_id, void* src, ImageFrameView* item) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------
|
|
|
|
// MarkerView Messages
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Send a Marker View Item position changed message
|
|
|
|
*
|
|
|
|
* @param pos the new position value
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
* @param item the time axis item whos position has changed
|
|
|
|
*/
|
2006-09-28 13:23:52 -04:00
|
|
|
void send_marker_view_position_change(nframes_t pos, void* src, MarkerView* item) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Send a Marker View item duration changed message
|
|
|
|
*
|
|
|
|
* @param dur the new duration value
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
* @param item the time axis item whos position has changed
|
|
|
|
*/
|
2006-09-28 13:23:52 -04:00
|
|
|
void send_marker_view_duration_change(nframes_t dur, void* src, MarkerView* item) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Send a message indicating that a MarkerView has been renamed
|
|
|
|
*
|
|
|
|
* @param new_id the new_id of the object
|
|
|
|
* @param old_id the old_id of the object
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
* @param item the MarkerView which has been renamed
|
|
|
|
*/
|
2009-10-01 21:49:57 -04:00
|
|
|
void send_marker_view_renamed(const std::string & new_id, const std::string & old_id, void* src, MarkerView* item) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Send a message indicating that a MarkerView item has been removed message
|
|
|
|
*
|
|
|
|
* @param item_id the id of the item that was removed
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
* @param item the MarkerView which has been removed
|
|
|
|
*/
|
2009-10-01 21:49:57 -04:00
|
|
|
void send_marker_view_removed(const std::string & item_id, void* src, MarkerView* item) ;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// Emitted Signals
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/** Emitted if the socket connection is shutdown at the other end */
|
2005-09-25 16:33:00 -04:00
|
|
|
sigc::signal<void> CompositorSocketShutdown ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/** Emitted as a generic error is captured from the socket connection to the animatic compositor */
|
2005-09-25 16:33:00 -04:00
|
|
|
sigc::signal<void> CompositorSocketError ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
protected:
|
2009-10-14 12:10:01 -04:00
|
|
|
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
private:
|
|
|
|
/* I dont like friends :-( */
|
|
|
|
friend class Editor;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Create an new instance of the ImageFrameSocketHandler, if one does not already exist
|
|
|
|
*
|
|
|
|
* @param ed the Ardour PublicEditor
|
|
|
|
*/
|
|
|
|
static ImageFrameSocketHandler* create_instance(PublicEditor& ed) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// Message breakdown ie avoid a big if...then...else
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle insert item requests
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_insert_message(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle remove item requests
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_remove_message(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle rename item requests
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_rename_message(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle a request for session information
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_request_data(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the update of a particular item
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_item_update_message(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the selection of an Item
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_item_selected(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle s session action message
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_session_action(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// handlers for specific insert procedures
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the insertion of a new ImaegFrameTimeAxis
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_insert_imageframe_time_axis(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the insertion of a new MarkerTimeAxis
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_insert_marker_time_axis(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the insertion of a time axis group (a scene)
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_insert_imageframe_group(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the insertion of a new ImageFrameItem
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_insert_imageframe_view(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the insertion of a new MarkerItem
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_insert_marker_view(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// handlers for specific removal procedures
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the removal of an ImageTimeAxis
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_remove_imageframe_time_axis(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the removal of an MarkerTimeAxis
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_remove_marker_time_axis(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the removal of an ImageFrameTimeAxisGroup
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_remove_imageframe_time_axis_group(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the removal of an ImageFrameItem
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_remove_imageframe_view(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the removal of an MarkerItem
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_remove_marker_view(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// handlers for the specific rename procedures
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the renaming of an ImageTimeAxis
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_rename_imageframe_time_axis(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the renaming of an MarkerTimeAxis
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_rename_marker_time_axis(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the renaming of an ImageFrameItem
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_rename_imageframe_time_axis_group(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the renaming of an ImageFrameItem
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_rename_imageframe_view(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the renaming of an Marker
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_rename_marker_view(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// handlers for data request
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle a request for the sessnio naem fo the current session
|
|
|
|
* We return a failure state if no session is open
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_session_name_request(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// handlers for specific item update changes
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle ImageFrameView positional changes
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_imageframe_view_position_update(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle ImageFrameView Duration changes
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_imageframe_view_duration_update(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle ImageFrameView Position Lock Constraint changes
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_imageframe_position_lock_update(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle ImageFrameView Maximum Duration changes
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_imageframe_view_max_duration_update(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle image frame max duration enable constraint changes
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_imageframe_view_max_duration_enable_update(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle ImageFrameView Minimum Duration changes
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_imageframe_view_min_duration_update(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle image frame min duration enable constraint changes
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_imageframe_view_min_duration_enable_update(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle MarkerView position changes
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_marker_view_position_update(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle MarkerView duration changes
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_marker_view_duration_update(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle MarkerView Position Lock Constraint changes
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_marker_view_position_lock_update(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle MarkerView maximum duration changes
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_marker_view_max_duration_update(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle MarkerView minimum duration changes
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_marker_view_min_duration_update(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// handlers for Session Actions
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the opening of a named audio session
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_open_session(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the closing of a named audio session
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_closed_session(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// handlers for the shutdown of the Image Compositor
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the shutdown message from the image compositor
|
|
|
|
*
|
|
|
|
* @param msg the received message
|
|
|
|
*/
|
|
|
|
void handle_shutdown(const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// convenince methods to break up messages
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Returns part of the received message as a std::string
|
|
|
|
*
|
|
|
|
* @param start the start character
|
|
|
|
* @param num_chars the number of characters to read
|
|
|
|
* @param the message to break apart
|
2009-10-01 21:49:57 -04:00
|
|
|
* @return the sub std::string of the message
|
2005-09-25 14:42:24 -04:00
|
|
|
*/
|
|
|
|
std::string get_message_part(int start, int32_t num_chars, const char* msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* break up am image item description message
|
|
|
|
* we break the mesage up into the parent Image Track id and size,
|
|
|
|
* the parent group id and size, and the image id and size
|
|
|
|
*
|
|
|
|
* @param track_id
|
|
|
|
* @param track_id_size
|
|
|
|
* @param scene_id
|
|
|
|
* @param scene_id_size
|
|
|
|
* @param item_id
|
|
|
|
* @param item_id_size
|
|
|
|
*/
|
|
|
|
void decompose_imageframe_item_desc(const char* msg, int& position, std::string& track_id, int& track_id_size, std::string& scene_id, int& scene_id_size, std::string& item_id, int& item_id_size) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Compose a description of the specified image frame view
|
|
|
|
* The description consists of the parent track name size and name,
|
|
|
|
* the parent group name size and name, and the item name size and name
|
|
|
|
*
|
|
|
|
* @param ifv the item to compose a description of
|
|
|
|
* @param buffer the buffer to write the description
|
|
|
|
*/
|
|
|
|
void compose_imageframe_item_desc(ImageFrameView* ifv, std::ostringstream& buffer) ;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Compose a description of the specified marker view
|
|
|
|
* The description consists of the parent track name size and name,
|
|
|
|
* and the item name size and name
|
|
|
|
*
|
|
|
|
* @param mv the item to compose a description of
|
|
|
|
* @param buffer the buffer to write the description
|
|
|
|
*/
|
|
|
|
void compose_marker_item_desc(MarkerView* mv, std::ostringstream& buffer) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Returns the ImageFrameView from the specified description
|
|
|
|
* The errcode parameter is used to indicate the item which caused
|
|
|
|
* an error on failure of this method
|
|
|
|
* 0 = suces
|
|
|
|
* 1 = the track item was not found
|
|
|
|
* 2 = the group item was not found
|
|
|
|
* 3 = the imageframe item was not found
|
|
|
|
*
|
|
|
|
* @paran track_id the track on which the item is placed
|
|
|
|
* @param group_id the group in which the item is a member
|
|
|
|
* @param item_id the id of the item
|
|
|
|
* @param int32_t reference used for error codes on failure
|
|
|
|
* @param errmsg populated with a description of the error on failure
|
|
|
|
* @return the described item on success, 0 otherwise
|
|
|
|
*/
|
2009-10-01 21:49:57 -04:00
|
|
|
ImageFrameView* get_imageframe_view_from_desc(const std::string & track_id, const std::string & group_ud, const std::string & item_id, int& errcode, std::string& errmsg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// Convenince Message Send Methods
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Sends a message throught the socket
|
|
|
|
*
|
|
|
|
* @param msg the message to send
|
|
|
|
* @return the return value of the socket call
|
|
|
|
*/
|
2009-10-01 21:49:57 -04:00
|
|
|
int send_message(const std::string & msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Reads a message from the Socket
|
|
|
|
*
|
2009-10-01 21:49:57 -04:00
|
|
|
* @param msg a std::string to populate with the received message
|
2005-09-25 14:42:24 -04:00
|
|
|
* @return the return value from the socket call
|
|
|
|
*/
|
|
|
|
int read_message(std::string& msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Convenience method to compose and send a success messasge back to the Image Compositor
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void send_return_success() ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Convenience method to compose and send a failure messasge back to the Image Compositor
|
|
|
|
*
|
|
|
|
* @param msg the failure message
|
|
|
|
*/
|
|
|
|
void send_return_failure(const std::string& msg) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// Memebr Data
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/** Our instance of the socket handler, singleton */
|
|
|
|
static ImageFrameSocketHandler* _instance ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/** The Ardour PublicEditor */
|
|
|
|
PublicEditor& thePublicEditor ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/** the socket file descriptor */
|
|
|
|
int theArdourToCompositorSocket ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/** This stores the 'tag' returned from gdk_input_add, which is required for removing the input */
|
|
|
|
int theGdkInputTag ;
|
|
|
|
|
|
|
|
} ; /* class ImageFrameSocketHandler */
|
|
|
|
|
|
|
|
#endif /* __ardour_gtk_imageframe_socket_handler_h__ */
|