42 vector<string>::iterator
p;
43 for (p=portNames.begin(); p!=portNames.end(); ++
p) {
50 map<string, map<string, vector<string> > >::iterator
p;
51 for (p=portNames.begin(); p!=portNames.end(); ++
p) {
109 string dragClientPortInfo;
112 dragClientPortInfo+=
':';
115 dragClientPortInfo=
"";
121 return dragClientPortInfo;
128 gtk_selection_data_set(selectionData, gtk_selection_data_get_target(selectionData),
sizeof(
char), (
unsigned char*)dragClientPortInfo.c_str(), dragClientPortInfo.length());
134 outputPortGui.reverseHBoxStacking();
137 inputPortGui.setPorts(inputPortNamesAndConnections);
138 outputPortGui.setPorts(outputPortNames);
143 string inputData((
const char*)selectionStoredData);
147 if (w==inputPortGui.getClientWidget())
148 connectPorts(inputPortGui.getClientName(), inputData);
150 connectPorts(inputPortGui.getFullPortName(w), inputData);
152 if (w==outputPortGui.getClientWidget())
153 disconnectPorts(outputPortGui.getClientName(), inputData);
155 disconnectPorts(outputPortGui.getFullPortName(w), inputData);
166 if (inputPortGui.getWidgetsPortName(w)!=
"")
168 if (outputPortGui.getWidgetsPortName(w)!=
"")
176 cairo_t *cr=cairo_create(getSurface());
177 cairo_set_source_rgb(cr, 1.,1.,1.);
179 cairo_set_line_width(cr, width);
180 bool closed=
true, filled=
false;
181 map<GtkWidget*, vector<GtkWidget*> >::const_iterator wids;
182 for (wids=connections.begin(); wids!=connections.end(); ++wids) {
183 GtkWidget *inWid=(*wids).first;
184 int inX, inY, inW, inH;
188 vector<GtkWidget*>::const_iterator oWids;
189 for (oWids=(*wids).second.begin(); oWids!=(*wids).second.end(); ++oWids) {
190 int outX, outY, outW, outH;
191 Widget((GtkWidget*)(*oWids)).getLocationSize(outX, outY, outW, outH);
193 int surfaceW, surfaceH;
197 CairoArrow().
draw(cr, 0, outY+outH/2, surfaceW, inY+inH/2, .08, width, closed, filled);
207 if (knownClients.size()>0) {
208 for (
int i=0; i<knownClients.size(); i++)
209 delete knownClients[i];
210 knownClients.resize(0);
216 *
this<<
BoxIS(
true,
true,
true)
219 <<
BoxIS(
true,
true,
true)<<connectionSurface
222 <<
BoxIS(
true,
false,
false)
224 (controlButtons<<
BUTTONCHECKSTRUCT(
"Connect 1 to 1", reinterpret_cast<GCallback>(connect1To1Static),
this)
225 <<
BUTTONCHECKSTRUCT(
"Autoconnect net clients", reinterpret_cast<GCallback>(autoConnectNetClientsPortsStatic),
this))
234 controlButtons.
grab(1);
236 controlButtons.
next();
237 controlButtons.
setActive(autoConnectNetClients);
260 for (
typename vector<JackBaseWithPortNames*>::iterator kc=knownClients.begin(); kc!=knownClients.end(); ++kc) {
268 for (
typename vector<JackBaseWithPortNames*>::iterator kc=knownClients.begin(); kc!=knownClients.end(); ++kc) {
278 dnd<<(GtkTargetEntry){(
char*)
"CONNECT", 0, CONNECT_PORTS}<<(GtkTargetEntry){(
char*)
"DISCONNECT", 0, DISCONNECT_PORTS};
279 for (
typename vector<JackBaseWithPortNames*>::iterator kc=knownClients.begin(); kc!=knownClients.end(); ++kc) {
287 dnd<<*dynamic_cast<JackBaseWithPortNamesGui*>(*kc);
292 dnd<<*dynamic_cast<JackBaseWithPortNamesGui*>(*kc);
302 typename vector<JackBaseWithPortNames *>::iterator kc;
303 for (kc=knownClients.begin(); kc!=knownClients.end(); ++kc) {
305 map<string, map<string, vector<string> > >::iterator ipnac;
306 for (ipnac=(*kc)->inputPortNamesAndConnections.begin(); ipnac!=(*kc)->inputPortNamesAndConnections.end(); ++ipnac) {
307 string portName=(*ipnac).first;
310 map<string, vector<string> >::iterator connectedClientsPorts;
311 for (connectedClientsPorts=(*ipnac).second.begin(); connectedClientsPorts!=(*ipnac).second.end(); ++connectedClientsPorts) {
313 typename vector<JackBaseWithPortNames *>::iterator cc=find_if(knownClients.begin(), knownClients.end(), cs);
314 if (cc!=knownClients.end()) {
315 vector<string>::iterator connectedPorts;
316 for (connectedPorts=(*connectedClientsPorts).second.begin(); connectedPorts!=(*connectedClientsPorts).second.end(); ++connectedPorts) {
339 connectionSurface.clear();
340 typename vector<JackBaseWithPortNames *>::iterator kc;
341 for (kc=knownClients.begin(); kc!=knownClients.end(); ++kc)
342 connectionSurface.drawConnections(dynamic_cast<JackBaseWithPortNamesGui*>(*kc)->inputPortGui.getInputWidgetConn());
343 gtk_widget_queue_draw(connectionSurface.getWidget());
virtual void jackPortRenamed(jack_port_id_t port, const char *oldName, const char *newName)
GtkWidget * getPortWidget(string portName)
ClientIOGui outputPortGui
The output port gui.
#define JACK_UNKNOWN_DND_TYPE_ERROR
error when a GUI drop signals neither CONNECT_PORTS nor DISCONNECT_PORTS
TYPE current(void)
return a pointer to the current lug
void setupDrop(DragNDrop &dnd)
TYPE grab(int i)
returns the i'th lug in the chain irrespective of direction
void renameClient(string clientName_)
void setPorts(vector< string > &portNames)
virtual int evaluateError(int errorNum)
virtual void reSyncPorts(void)
void draw(cairo_t *cr, float xBase, float yBase, float xPoint, float yPoint, float headToLengthRatio, float width, bool closed, bool filled)
Buttons clientNameButton
Button representing all of the half duplex client ports.
void clearAllWidgetConnections(void)
virtual void jackPortConnected(jack_port_id_t a, jack_port_id_t b, int connect)
string cn
The string to compare against.
void addWidgetConnections(GtkWidget *wid, GtkWidget *cWid)
string getClientName(void)
void reverseHBoxStacking()
TYPE remove(void)
remove the current lug from the LinkList The current lug is removed form the list and passed back to ...
TYPE next(void)
Return a pointer to the next lug and move on to that lug Increments according to dir (either forward ...
ClientIOGui inputPortGui
The input port gui.
virtual int chooseTheTargetToUse(GtkWidget *w, GtkWidget *sourceWidget, DragNDrop &dnd)
void setupDrag(DragNDrop &dnd)
virtual void reSyncConnections(void)
#define JACK_PORTNAME_NOTFOUND_ERROR
error when the port name is not found
Buttons portButtons
The clients half duplex ports. either input or output.
virtual void dragDataGet(GtkWidget *w, GtkSelectionData *selectionData, guint info)
map< GtkWidget *, vector< GtkWidget * > > inputWidgetConnections
Each of the port buttons map to connected port buttons.
string getWidgetsPortName(GtkWidget *wid)
virtual void jackPortRegistered(jack_port_id_t port, int reg)
void drawConnections(const map< GtkWidget *, vector< GtkWidget *> > &connections)
virtual void reSyncPorts(void)
virtual void reSyncConnections(void)
virtual void jackPortRegistered(jack_port_id_t port, int reg)
VBox portVBox
A holder for the port buttons.
string getFullPortName(GtkWidget *wid)
virtual void jackPortConnected(jack_port_id_t a, jack_port_id_t b, int connect)
virtual bool dragDataReceived(GtkWidget *w, GtkWidget *sourceWidget, int info, const unsigned char *selectionStoredData, int length)
#define JACK_DRAG_OPTION_UNKNOWN_ERROR
error when the the drag and drop drops to a widget which can't be found
virtual void jackPortRenamed(jack_port_id_t port, const char *oldName, const char *newName)