2 * Jack Connector Window
4 * Copyright (C) 2014 Markus Schmidt / Krzysztof Foltman
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General
17 * Public License along with this program; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301 USA
22 #include <jack/jack.h>
23 #include <calf/gtk_main_win.h>
26 #ifndef __CALF_CONNECTOR_H
27 #define __CALF_CONNECTOR_H
29 namespace calf_plugins
{
38 calf_connector
*connector
;
41 class calf_connector
{
43 jack_client_t
*jackclient
;
44 connector_port inports
[8];
45 connector_port outports
[8];
46 connector_port midiports
[8];
47 GtkListStore
*inlist
, *outlist
, *midilist
;
48 connector_port
*active_in
, *active_out
, *active_midi
;
53 static void on_destroy_window(GtkWidget
*window
, gpointer data
);
54 static void close_window(GtkWidget
*button
, gpointer data
);
56 static void inconnector_clicked(GtkCellRendererToggle
*cell_renderer
, gchar
*path
, gpointer data
);
57 static void outconnector_clicked(GtkCellRendererToggle
*cell_renderer
, gchar
*path
, gpointer data
);
58 static void midiconnector_clicked(GtkCellRendererToggle
*cell_renderer
, gchar
*path
, gpointer data
);
60 static void inport_clicked(GtkWidget
*button
, gpointer data
);
61 static void outport_clicked(GtkWidget
*button
, gpointer data
);
62 static void midiport_clicked(GtkWidget
*button
, gpointer data
);
64 static void disconnect_inputs(GtkWidget
*button
, gpointer data
);
65 static void disconnect_outputs(GtkWidget
*button
, gpointer data
);
66 static void disconnect_midi(GtkWidget
*button
, gpointer data
);
67 static void disconnect_all(GtkWidget
*button
, gpointer data
);
68 void _disconnect(int type
);
70 calf_connector(plugin_strip
*strip_
);
73 //static void jack_port_connect_callback(jack_port_id_t a, jack_port_id_t b, int connect, void *arg);
74 //static void jack_port_rename_callback(jack_port_id_t port, const char *old_name, const char *new_name, void *arg);
75 //static void jack_port_registration_callback(jack_port_id_t port, int register, void *arg);
77 void toggle_port(calf_connector
*self
, GtkListStore
*list
, gchar
*path_
, gchar
**port
, gboolean
&enabled
);
78 void connect(jack_client_t
*client
, gchar
*source
, gchar
*dest
, gboolean enabled
);
80 void fill_list(calf_connector
*self
, int type
);
81 void fill_inlist(gpointer data
);
82 void fill_outlist(gpointer data
);
83 void fill_midilist(gpointer data
);
85 void set_toggles(calf_connector
*self
, int type
);