Show views in the world tree
This commit is contained in:
parent
5172f7ffe9
commit
321621834e
|
@ -485,11 +485,11 @@ The bar represents the percentage of available time used for audio processing (i
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||||
<property name="position">204</property>
|
<property name="position">204</property>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkViewport" id="project_list_viewport">
|
<widget class="GtkViewport" id="world_tree_viewport">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="resize_mode">GTK_RESIZE_QUEUE</property>
|
<property name="resize_mode">GTK_RESIZE_QUEUE</property>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkTreeView" id="projects_list">
|
<widget class="GtkTreeView" id="world_tree">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "dbus_helpers.h"
|
#include "dbus_helpers.h"
|
||||||
#include "control_proxy.h"
|
#include "control_proxy.h"
|
||||||
#include "../dbus_constants.h"
|
#include "../dbus_constants.h"
|
||||||
|
#include "world_tree.h"
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
class Patchage {
|
class Patchage {
|
||||||
|
@ -965,15 +966,21 @@ void control_proxy_on_studio_appeared(void)
|
||||||
{
|
{
|
||||||
g_studio_view = create_view("Studio", SERVICE_NAME, STUDIO_OBJECT_PATH);
|
g_studio_view = create_view("Studio", SERVICE_NAME, STUDIO_OBJECT_PATH);
|
||||||
attach_view(g_studio_view);
|
attach_view(g_studio_view);
|
||||||
|
world_tree_add_studio(g_studio_view->graph);
|
||||||
|
|
||||||
g_jack_view = create_view("Raw JACK", JACKDBUS_SERVICE_NAME, JACKDBUS_OBJECT_PATH);
|
g_jack_view = create_view("Raw JACK", JACKDBUS_SERVICE_NAME, JACKDBUS_OBJECT_PATH);
|
||||||
attach_view(g_jack_view);
|
attach_view(g_jack_view);
|
||||||
|
world_tree_add_jack(g_jack_view->graph);
|
||||||
}
|
}
|
||||||
|
|
||||||
void control_proxy_on_studio_disappeared(void)
|
void control_proxy_on_studio_disappeared(void)
|
||||||
{
|
{
|
||||||
detach_view(g_jack_view);
|
detach_view(g_jack_view);
|
||||||
|
world_tree_remove(g_jack_view->graph);
|
||||||
destroy_view(g_jack_view);
|
destroy_view(g_jack_view);
|
||||||
|
|
||||||
detach_view(g_studio_view);
|
detach_view(g_studio_view);
|
||||||
|
world_tree_remove(g_studio_view->graph);
|
||||||
destroy_view(g_studio_view);
|
destroy_view(g_studio_view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -998,6 +1005,8 @@ int main(int argc, char** argv)
|
||||||
main_win = get_glade_widget("main_win");
|
main_win = get_glade_widget("main_win");
|
||||||
g_main_scrolledwin = GTK_SCROLLED_WINDOW(get_glade_widget("main_scrolledwin"));
|
g_main_scrolledwin = GTK_SCROLLED_WINDOW(get_glade_widget("main_scrolledwin"));
|
||||||
|
|
||||||
|
world_tree_init();
|
||||||
|
|
||||||
patchage_dbus_init();
|
patchage_dbus_init();
|
||||||
|
|
||||||
if (!control_proxy_init())
|
if (!control_proxy_init())
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "world_tree.h"
|
#include "world_tree.h"
|
||||||
|
#include "glade.h"
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -378,22 +379,69 @@ project_list::set_lash_availability(
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
COL_NAME = 0,
|
||||||
|
COL_GRAPH,
|
||||||
|
NUM_COLS
|
||||||
|
};
|
||||||
|
|
||||||
|
GtkWidget * g_world_tree_widget;
|
||||||
|
GtkTreeStore * g_treestore;
|
||||||
|
|
||||||
void world_tree_init(void)
|
void world_tree_init(void)
|
||||||
{
|
{
|
||||||
|
GtkTreeViewColumn * col;
|
||||||
|
GtkCellRenderer * renderer;
|
||||||
|
|
||||||
|
g_world_tree_widget = get_glade_widget("world_tree");
|
||||||
|
gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(g_world_tree_widget), FALSE);
|
||||||
|
|
||||||
|
col = gtk_tree_view_column_new();
|
||||||
|
gtk_tree_view_column_set_title(col, "Name");
|
||||||
|
gtk_tree_view_append_column(GTK_TREE_VIEW(g_world_tree_widget), col);
|
||||||
|
renderer = gtk_cell_renderer_text_new();
|
||||||
|
gtk_tree_view_column_pack_start(col, renderer, TRUE);
|
||||||
|
gtk_tree_view_column_add_attribute(col, renderer, "text", COL_NAME);
|
||||||
|
|
||||||
|
g_treestore = gtk_tree_store_new(NUM_COLS, G_TYPE_STRING, G_TYPE_POINTER);
|
||||||
|
gtk_tree_view_set_model(GTK_TREE_VIEW(g_world_tree_widget), GTK_TREE_MODEL(g_treestore));
|
||||||
}
|
}
|
||||||
|
|
||||||
void world_tree_add_studio(graph_handle graph)
|
void world_tree_add_studio(graph_handle graph)
|
||||||
{
|
{
|
||||||
}
|
GtkTreeIter iter;
|
||||||
|
|
||||||
void world_tree_remove_studio(graph_handle graph)
|
gtk_tree_store_append(g_treestore, &iter, NULL);
|
||||||
{
|
gtk_tree_store_set(g_treestore, &iter, COL_NAME, "Studio", COL_GRAPH, graph, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void world_tree_add_jack(graph_handle graph)
|
void world_tree_add_jack(graph_handle graph)
|
||||||
{
|
{
|
||||||
|
GtkTreeIter toplevel;
|
||||||
|
|
||||||
|
gtk_tree_store_append(g_treestore, &toplevel, NULL);
|
||||||
|
gtk_tree_store_set(g_treestore, &toplevel, COL_NAME, "JACK", COL_GRAPH, graph, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void world_tree_remove_jack(graph_handle graph)
|
void world_tree_remove(graph_handle graph)
|
||||||
{
|
{
|
||||||
|
GtkTreeIter iter;
|
||||||
|
gchar * name;
|
||||||
|
graph_handle graph2;
|
||||||
|
|
||||||
|
if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(g_treestore), &iter))
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
gtk_tree_model_get(GTK_TREE_MODEL(g_treestore), &iter, COL_NAME, &name, COL_GRAPH, &graph2, -1);
|
||||||
|
//lash_info("'%s' %p", name, graph2);
|
||||||
|
if (graph == graph2)
|
||||||
|
{
|
||||||
|
gtk_tree_store_remove(g_treestore, &iter);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (gtk_tree_model_iter_next(GTK_TREE_MODEL(g_treestore), &iter));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,9 +32,7 @@
|
||||||
void world_tree_init(void);
|
void world_tree_init(void);
|
||||||
|
|
||||||
void world_tree_add_studio(graph_handle graph);
|
void world_tree_add_studio(graph_handle graph);
|
||||||
void world_tree_remove_studio(graph_handle graph);
|
|
||||||
|
|
||||||
void world_tree_add_jack(graph_handle graph);
|
void world_tree_add_jack(graph_handle graph);
|
||||||
void world_tree_remove_jack(graph_handle graph);
|
void world_tree_remove(graph_handle graph);
|
||||||
|
|
||||||
#endif // #ifndef WORLD_TREE_H__D786489B_E400_4E92_85C7_2BAE606DE56D__INCLUDED
|
#endif // #ifndef WORLD_TREE_H__D786489B_E400_4E92_85C7_2BAE606DE56D__INCLUDED
|
||||||
|
|
Loading…
Reference in New Issue