add media tab, load files in veejay's working directory

git-svn-id: svn://code.dyne.org/veejay/trunk@1288 eb8d1916-c9e9-0310-b8de-cf0c9472ead5
This commit is contained in:
Niels Elburg
2008-12-30 22:53:20 +00:00
parent 23fb2e90e9
commit 8c7a03abba
4 changed files with 557 additions and 136 deletions

View File

@@ -3010,71 +3010,7 @@
</child>
<child>
<widget class="GtkButton" id="button_browse">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Open EditList/Videofile</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_HALF</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_browse_clicked" last_modification_time="Tue, 22 Mar 2005 02:45:11 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment74">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox211">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkAlignment" id="alignment225">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">1</property>
<property name="yscale">1</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkImage" id="image304">
<property name="visible">True</property>
<property name="pixbuf">icon_open.png</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
<placeholder/>
</child>
<child>
@@ -15705,6 +15641,10 @@ YUV (current)</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</widget>
</child>
</widget>
@@ -16044,6 +15984,230 @@ YUV (current)</property>
<property name="type">tab</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox635">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkVBox" id="vbox636">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkFrame" id="frame329">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0.5</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<child>
<widget class="GtkAlignment" id="alignment544">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">1</property>
<property name="yscale">1</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox922">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkVBox" id="vbox636">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkButton" id="button_browse">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Refresh Veejay's Working Directory</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_HALF</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_browse_clicked" last_modification_time="Tue, 22 Mar 2005 02:45:11 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment74">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox211">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkAlignment" id="alignment225">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">1</property>
<property name="yscale">1</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkImage" id="image304">
<property name="visible">True</property>
<property name="pixbuf">icon_open.png</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="server_files_window">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
<property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="server_files">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
<property name="rules_hint">False</property>
<property name="reorderable">True</property>
<property name="enable_search">True</property>
<property name="fixed_height_mode">False</property>
<property name="hover_selection">False</property>
<property name="hover_expand">False</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label948">
<property name="visible">True</property>
<property name="label" translatable="yes">Listing of Veejay's working directory. Doube click a row to add it as a Sample</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="tab_expand">False</property>
<property name="tab_fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label947">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Media&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="type">tab</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>

View File

@@ -3010,71 +3010,7 @@
</child>
<child>
<widget class="GtkButton" id="button_browse">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Open EditList/Videofile</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_HALF</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_browse_clicked" last_modification_time="Tue, 22 Mar 2005 02:45:11 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment74">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox211">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkAlignment" id="alignment225">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">1</property>
<property name="yscale">1</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkImage" id="image304">
<property name="visible">True</property>
<property name="pixbuf">icon_open.png</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
<placeholder/>
</child>
<child>
@@ -9270,8 +9206,7 @@
<child>
<widget class="GtkNotebook" id="panels">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="show_tabs">True</property>
<property name="show_tabs">False</property>
<property name="show_border">False</property>
<property name="tab_pos">GTK_POS_TOP</property>
<property name="scrollable">False</property>
@@ -15706,6 +15641,10 @@ YUV (current)</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</widget>
</child>
</widget>
@@ -16045,6 +15984,230 @@ YUV (current)</property>
<property name="type">tab</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox635">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkVBox" id="vbox636">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkFrame" id="frame329">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0.5</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<child>
<widget class="GtkAlignment" id="alignment544">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">1</property>
<property name="yscale">1</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox922">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkVBox" id="vbox636">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkButton" id="button_browse">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Refresh Veejay's Working Directory</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_HALF</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_browse_clicked" last_modification_time="Tue, 22 Mar 2005 02:45:11 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment74">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox211">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkAlignment" id="alignment225">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">1</property>
<property name="yscale">1</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkImage" id="image304">
<property name="visible">True</property>
<property name="pixbuf">icon_open.png</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="server_files_window">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
<property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="server_files">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
<property name="rules_hint">False</property>
<property name="reorderable">True</property>
<property name="enable_search">True</property>
<property name="fixed_height_mode">False</property>
<property name="hover_selection">False</property>
<property name="hover_expand">False</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label948">
<property name="visible">True</property>
<property name="label" translatable="yes">Listing of Veejay's working directory. Doube click a row to add it as a Sample</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="tab_expand">False</property>
<property name="tab_fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label947">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Media&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="type">tab</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
@@ -16952,7 +17115,7 @@ YUV (current)</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="padding">4</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>

View File

@@ -1469,15 +1469,70 @@ void on_button_openactionfile_clicked(GtkWidget *widget, gpointer user_data)
}
}
static void load_server_files(char *buf, int len)
{
GtkWidget *tree = glade_xml_get_widget_( info->main_window, "server_files");
GtkTreeIter iter;
GtkTreeModel *model = gtk_tree_view_get_model( GTK_TREE_VIEW(tree ));
GtkListStore *store = GTK_LIST_STORE(model);
#ifdef STRICT_CHECKING
assert(tree != NULL );
#endif
int i = 0;
int idx = 0;
char *ptr = buf;
while( i < len ) {
int filelen = 0;
char name[1024];
char header[5];
memset(header,0,sizeof(header));
memset(name, 0,sizeof(name));
strncpy(header,ptr, 4 );
if(sscanf(header,"%04d", &filelen)==1) {
strncpy( name, ptr+4, filelen);
gchar *filename = _utf8str( name );
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter, 0,filename,-1);
gtk_tree_view_set_model(GTK_TREE_VIEW(tree),
GTK_TREE_MODEL(store));
veejay_msg(0, "'%s'", name);
idx ++;
ptr += filelen;
}
ptr += 4;
i+=4;
i+=filelen;
}
veejay_msg(0, "done");
}
void on_button_browse_clicked(GtkWidget *widget, gpointer user_data)
{
// open file browser for launcher
gchar *filename = dialog_open_file( "Open Videofile or EditList",0 );
/* gchar *filename = dialog_open_file( "Open Videofile or EditList",0 );
if(filename)
{
put_text( "entry_filename", filename );
g_free(filename);
}*/
single_vims(VIMS_WORKINGDIR);
gint len = 0;
fprintf(stderr, "wainting for 8 bytes\n");
gchar *test = recv_vims( 8, &len );
if(!test || len <= 0 ) {
fprintf(stderr, "no results.\n");
return ;
}
fprintf(stderr, "'%s'\n", test);
fprintf(stderr, "Size of buffer: %d\n", len);
reset_tree( "server_files");
load_server_files( test,len);
free(test);
}
void on_button_clipcopy_clicked(GtkWidget *widget, gpointer user_data)

View File

@@ -1974,7 +1974,7 @@ int gveejay_new_slot(int mode)
if( id <= 0 )
{
gveejay_error_slot( mode );
// gveejay_error_slot( mode );
return 0;
}
else
@@ -2113,8 +2113,10 @@ static void single_vims(int id)
sprintf(block, "%03d:;",id);
if(vj_client_send( info->client, V_CMD, block)<=0 )
reloaded_schedule_restart();
}
static gchar *recv_vims(int slen, int *bytes_written)
{
int tmp_len = slen+1;
@@ -3306,8 +3308,44 @@ static void setup_tree_pixmap_column( const char *tree_name, int type, const cha
column = gtk_tree_view_column_new_with_attributes( title, renderer, "pixbuf", type, NULL );
gtk_tree_view_append_column( GTK_TREE_VIEW( tree ), column );
}
void
server_files_selection_func (GtkTreeView *treeview,
GtkTreePath *path,
GtkTreeViewColumn *col,
gpointer user_data)
{
GtkTreeModel *model;
GtkTreeIter iter;
model = gtk_tree_view_get_model(treeview);
if(gtk_tree_model_get_iter(model,&iter,path))
{
gchar *name = NULL;
gtk_tree_model_get(model, &iter, 0, &name, -1);
multi_vims(VIMS_EDITLIST_ADD_SAMPLE, "0 %s" , name );
vj_msg(VEEJAY_MSG_INFO, "Tried to open %s",name);
gveejay_new_slot(MODE_SAMPLE);
g_free(name);
}
}
static void setup_server_files(void)
{
GtkWidget *tree = glade_xml_get_widget_( info->main_window, "server_files");
GtkListStore *store = gtk_list_store_new( 1, G_TYPE_STRING );
gtk_tree_view_set_model( GTK_TREE_VIEW(tree), GTK_TREE_MODEL(store));
g_object_unref( G_OBJECT( store ));
GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree));
setup_tree_text_column( "server_files", 0, "Filename",0 );
// gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
// gtk_tree_selection_set_select_function(selection, server_files_selection_func, NULL, NULL);
g_signal_connect( tree, "row-activated", (GCallback) server_files_selection_func, NULL);
}
static void setup_effectchain_info( void )
{
@@ -6634,6 +6672,7 @@ void vj_gui_init(char *glade_file, int launcher, char *hostname, int port_num,
setup_colorselection();
setup_rgbkey();
setup_bundles();
setup_server_files();
text_defaults();