Commit 83e72916 authored by Laurent Aimar's avatar Laurent Aimar

* added stream output dialog box.

parent 3bcbf474
COMMON_gtk = \
modules/gui/gtk/display.c \
modules/gui/gtk/open.c \
modules/gui/gtk/sout.c \
modules/gui/gtk/control.c \
modules/gui/gtk/menu.c \
modules/gui/gtk/playlist.c \
......
......@@ -2,7 +2,7 @@
* gtk_common.h: private Gtk+ interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: common.h,v 1.6 2003/01/20 20:07:06 fenrir Exp $
* $Id: common.h,v 1.7 2003/01/26 14:49:09 fenrir Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -66,6 +66,7 @@ struct intf_sys_t
GtkWidget * p_about; /* about window */
GtkWidget * p_open; /* multiopen window */
GtkWidget * p_jump; /* jump window */
GtkWidget * p_sout; /* stream output */
GtkTooltips * p_tooltips; /* tooltips */
......
......@@ -2,7 +2,7 @@
* gnome.c : Gnome plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: gnome.c,v 1.6 2003/01/20 20:07:06 fenrir Exp $
* $Id: gnome.c,v 1.7 2003/01/26 14:49:09 fenrir Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -167,6 +167,8 @@ static void Run( intf_thread_t *p_intf )
{ "text/uri-list", 0, DROP_ACCEPT_TEXT_URI_LIST },
{ "text/plain", 0, DROP_ACCEPT_TEXT_PLAIN }
};
char *psz_sout;
GString * p_target;
gdk_threads_enter();
......@@ -176,6 +178,7 @@ static void Run( intf_thread_t *p_intf )
p_intf->p_sys->p_playwin = create_intf_playlist();
p_intf->p_sys->p_messages = create_intf_messages();
p_intf->p_sys->p_tooltips = gtk_tooltips_new();
p_intf->p_sys->p_sout = create_intf_sout();
/* Set the title of the main window */
gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window),
......@@ -254,6 +257,23 @@ static void Run( intf_thread_t *p_intf )
gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_adj),
"p_intf", p_intf );
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_sout ),
"p_intf", p_intf );
psz_sout = config_GetPsz( p_intf, "sout" );
p_target = g_string_new( psz_sout ? psz_sout : "" );
if( psz_sout ) free( psz_sout );
gtk_entry_set_text( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_sout ), "sout_entry_target" ), p_target->str );
g_string_free( p_target, TRUE );
/* FIXME it's to be sure that only file entry is selected */
gtk_toggle_button_set_active( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_sout ),
"sout_access_udp" ), TRUE );
gtk_toggle_button_set_active( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_sout ),
"sout_access_file" ), TRUE );
/* Show the control window */
gtk_widget_show( p_intf->p_sys->p_window );
......
This diff is collapsed.
/*****************************************************************************
* This file is not used: everything is in gtk_callbacks.c
*****************************************************************************/
void
GtkOpenSoutShow (GtkButton *button,
gpointer user_data)
{
}
void
GtkSoutSettings (GtkButton *button,
gpointer user_data)
{
}
......@@ -3,3 +3,12 @@
*****************************************************************************/
#include "gtk_callbacks.h"
void
GtkOpenSoutShow (GtkButton *button,
gpointer user_data);
void
GtkSoutSettings (GtkButton *button,
gpointer user_data);
This diff is collapsed.
......@@ -11,3 +11,4 @@ GtkWidget* create_intf_modules (void);
GtkWidget* create_intf_playlist (void);
GtkWidget* create_intf_jump (void);
GtkWidget* create_intf_messages (void);
GtkWidget* create_intf_sout (void);
......@@ -2,7 +2,7 @@
* gtk.c : Gtk+ plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: gtk.c,v 1.11 2003/01/20 20:07:06 fenrir Exp $
* $Id: gtk.c,v 1.12 2003/01/26 14:49:09 fenrir Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -172,6 +172,8 @@ static void Run( intf_thread_t *p_intf )
{ "text/uri-list", 0, DROP_ACCEPT_TEXT_URI_LIST },
{ "text/plain", 0, DROP_ACCEPT_TEXT_PLAIN }
};
char *psz_sout;
GString * p_target;
#ifdef NEED_GTK_MAIN
gdk_threads_enter();
......@@ -192,6 +194,7 @@ static void Run( intf_thread_t *p_intf )
p_intf->p_sys->p_playwin = create_intf_playlist();
p_intf->p_sys->p_messages = create_intf_messages();
p_intf->p_sys->p_tooltips = gtk_tooltips_new();
p_intf->p_sys->p_sout = create_intf_sout();
/* Set the title of the main window */
gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window),
......@@ -235,6 +238,8 @@ static void Run( intf_thread_t *p_intf )
p_intf->p_sys->f_adj_oldvalue = 0;
#undef P_SLIDER
/* We don't create these ones yet because we perhaps won't need them */
p_intf->p_sys->p_about = NULL;
p_intf->p_sys->p_modules = NULL;
......@@ -262,6 +267,22 @@ static void Run( intf_thread_t *p_intf )
gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_adj),
"p_intf", p_intf );
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_sout ),
"p_intf", p_intf );
psz_sout = config_GetPsz( p_intf, "sout" );
p_target = g_string_new( psz_sout ? psz_sout : "" );
if( psz_sout ) free( psz_sout );
gtk_entry_set_text( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_sout ), "sout_entry_target" ), p_target->str );
g_string_free( p_target, TRUE );
/* FIXME it's to be sure that only file entry is selected */
gtk_toggle_button_set_active( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_sout ),
"sout_access_udp" ), TRUE );
gtk_toggle_button_set_active( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_sout ),
"sout_access_file" ), TRUE );
/* Show the control window */
gtk_widget_show( p_intf->p_sys->p_window );
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* gtk_callbacks.c : Callbacks for the Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.c,v 1.9 2003/01/21 12:36:11 fenrir Exp $
* $Id: gtk_callbacks.c,v 1.10 2003/01/26 14:49:09 fenrir Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -688,3 +688,5 @@ GtkPopupDeinterlace (GtkRadioMenuItem *radiomenuitem,
msg_Dbg( p_intf, "GtkPopupDeinterlace" );
}
......@@ -2,7 +2,7 @@
* gtk_callbacks.h : Callbacks for the gtk plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.h,v 1.4 2003/01/21 12:36:11 fenrir Exp $
* $Id: gtk_callbacks.h,v 1.5 2003/01/26 14:49:09 fenrir Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -178,3 +178,32 @@ GtkPopupDeinterlace (GtkRadioMenuItem *radiomenuitem,
void
GtkOpenSubtitleShow (GtkButton *button,
gpointer user_data);
void
GtkSoutSettings (GtkButton *button,
gpointer user_data);
void
GtkSoutSettingsCancel (GtkButton *button,
gpointer user_data);
void
GtkSoutSettingsChanged (GtkWidget *button,
gpointer user_data);
void
GtkSoutSettingsOk (GtkButton *button,
gpointer user_data);
void
GtkSoutSettingsAccessFile (GtkToggleButton *togglebutton,
gpointer user_data);
void
GtkSoutSettingsAccessUdp (GtkToggleButton *togglebutton,
gpointer user_data);
void
GtkOpenSoutShow (GtkButton *button,
gpointer user_data);
This diff is collapsed.
......@@ -10,3 +10,4 @@ GtkWidget* create_intf_file (void);
GtkWidget* create_intf_jump (void);
GtkWidget* create_intf_playlist (void);
GtkWidget* create_intf_messages (void);
GtkWidget* create_intf_sout (void);
......@@ -2,7 +2,7 @@
* gtk_open.c : functions to handle file/disc/network open widgets.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: open.c,v 1.10 2003/01/21 17:00:41 fenrir Exp $
* $Id: open.c,v 1.11 2003/01/26 14:49:09 fenrir Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -453,6 +453,28 @@ GtkOpenSubtitleShow (GtkButton *button,
}
}
/*****************************************************************************
* Open sout callbacks
*****************************************************************************
* The following callbacks are related to the sout
*****************************************************************************/
void GtkOpenSoutShow ( GtkButton *button,
gpointer user_data)
{
intf_thread_t * p_intf = GtkGetIntf( button );
if( GTK_TOGGLE_BUTTON( button )->active )
{
gtk_widget_set_sensitive( GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_open ), "sout_settings" ) ), TRUE );
}
else
{
gtk_widget_set_sensitive( GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_open ), "sout_settings" ) ), FALSE );
}
}
/******************************
******************************/
......@@ -538,6 +560,19 @@ static void GtkOpenShow( intf_thread_t *p_intf, int i_page )
/* subtitle stuff */
/* hide hbox_subtitle */
gtk_widget_hide_all( GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_open ), "hbox_subtitle" ) ) );
/* sout */
psz_var = config_GetPsz( p_intf, "sout" );
if( psz_var && *psz_var )
{
gtk_toggle_button_set_active( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_open ), "show_sout_settings" ), TRUE );
gtk_widget_set_sensitive( GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_open ), "sout_settings" ) ), TRUE );
}
else
{
gtk_toggle_button_set_active( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_open ), "show_sout_settings" ), FALSE );
gtk_widget_set_sensitive( GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_open ), "sout_settings" ) ), FALSE );
}
if( psz_var ) free( psz_var );
/* Set the right page */
setpage:
......@@ -601,6 +636,19 @@ void GtkOpenOk( GtkButton * button, gpointer user_data )
{
config_PutPsz( p_intf, "sub-file", "" );
}
/* export sout */
if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
"show_sout_settings" ) )->active )
{
char *psz_sout;
psz_sout = gtk_entry_get_text( GTK_ENTRY( lookup_widget( GTK_WIDGET( p_intf->p_sys->p_sout ), "sout_entry_target" ) ) );
config_PutPsz( p_intf, "sout", psz_sout );
}
else
{
config_PutPsz( p_intf, "sout", "" );
}
/* Enable the channel box when network channel is selected */
if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
......
/*****************************************************************************
* sout.c :
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: sout.c,v 1.1 2003/01/26 14:49:09 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <sys/types.h> /* off_t */
#include <stdlib.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#ifdef MODULE_NAME_IS_gnome
# include <gnome.h>
#else
# include <gtk/gtk.h>
#endif
#include <string.h>
#include "gtk_callbacks.h"
#include "gtk_interface.h"
#include "gtk_support.h"
#include "playlist.h"
#include "common.h"
#include "netutils.h"
void GtkSoutSettings ( GtkButton *button,
gpointer user_data );
void GtkSoutSettingsChanged ( GtkWidget *button, gpointer user_data);
void GtkSoutSettingsAccessFile (GtkToggleButton *togglebutton,
gpointer user_data)
{
GtkWidget * p_sout;
p_sout = gtk_widget_get_toplevel( GTK_WIDGET (togglebutton) );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_sout ),
"sout_file_path_label" ),
gtk_toggle_button_get_active( togglebutton ) );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_sout ),
"sout_file_path" ),
gtk_toggle_button_get_active( togglebutton ) );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_sout ),
"sout_mux_ts" ), TRUE );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_sout ),
"sout_mux_ps" ), TRUE );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_sout ),
"sout_mux_avi" ), TRUE );
GtkSoutSettingsChanged( GTK_WIDGET( togglebutton ), user_data );
}
void GtkSoutSettingsAccessUdp (GtkToggleButton *togglebutton,
gpointer user_data)
{
GtkWidget * p_sout;
p_sout = gtk_widget_get_toplevel( GTK_WIDGET (togglebutton) );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_sout ),
"sout_udp_address_label" ),
gtk_toggle_button_get_active( togglebutton ) );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_sout ),
"sout_udp_address_combo" ),
gtk_toggle_button_get_active( togglebutton ) );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_sout ),
"sout_udp_port_label" ),
gtk_toggle_button_get_active( togglebutton ) );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_sout ),
"sout_udp_port" ),
gtk_toggle_button_get_active( togglebutton ) );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_sout ),
"sout_mux_ts" ), TRUE );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_sout ),
"sout_mux_ps" ), FALSE );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_sout ),
"sout_mux_avi" ), FALSE );
gtk_toggle_button_set_active( gtk_object_get_data( GTK_OBJECT( p_sout ),
"sout_mux_ts" ), TRUE );
GtkSoutSettingsChanged( GTK_WIDGET( togglebutton ), user_data );
}
void GtkSoutSettingsChanged ( GtkWidget *button,
gpointer user_data)
{
#define SELECTED( s ) GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button), \
(s) ) )->active
//intf_thread_t * p_intf = GtkGetIntf( button );
GString * p_target;
p_target = g_string_new( "" );
/* first set access */
if( SELECTED( "sout_access_file" ) )
{
g_string_append( p_target, "file/" );
}
else if( SELECTED( "sout_access_udp" ) )
{
g_string_append( p_target, "udp/" );
}
else if( SELECTED( "sout_access_rtp" ) )
{
g_string_append( p_target, "rtp/" );
}
/* then set muxer */
if( SELECTED( "sout_mux_ts" ) )
{
g_string_append( p_target, "ts://" );
}
else if( SELECTED( "sout_mux_ps" ) )
{
g_string_append( p_target, "ps://" );
}
else if( SELECTED( "sout_mux_avi" ) )
{
g_string_append( p_target, "avi://" );
}
/* last part of the url */
if( SELECTED( "sout_access_file" ) )
{
g_string_append( p_target,
gtk_entry_get_text( GTK_ENTRY( lookup_widget(
GTK_WIDGET(button), "sout_file_path" ) ) ) );
}
else if( SELECTED( "sout_access_udp" ) || SELECTED( "sout_access_rtp" ) )
{
g_string_append( p_target,
gtk_entry_get_text( GTK_ENTRY( lookup_widget(
GTK_WIDGET(button), "sout_udp_address" ) ) ) );
g_string_append( p_target, ":" );
g_string_sprintfa( p_target, "%i",
gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( lookup_widget(
GTK_WIDGET(button), "sout_udp_port" ) ) ) );
}
gtk_entry_set_text( GTK_ENTRY( lookup_widget(
GTK_WIDGET(button), "sout_entry_target" ) ),
p_target->str );
g_string_free( p_target, TRUE );
}
/****************************************************************************/
void GtkSoutSettingsOk ( GtkButton *button,
gpointer user_data)
{
/* Hide the dialog box */
gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
/* set sout */
#if 0
psz_target = gtk_entry_get_text( GTK_ENTRY( lookup_widget(
GTK_WIDGET(button), "sout_entry_target" ) ) );
config_PutPsz( p_intf, "sout", psz_target );
#endif
}
void GtkSoutSettingsCancel ( GtkButton *button,
gpointer user_data)
{
/* Hide the dialog box */
gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
}
void GtkSoutSettings ( GtkButton *button,
gpointer user_data )
{
intf_thread_t * p_intf = GtkGetIntf( button );
gtk_widget_show( p_intf->p_sys->p_sout );
gdk_window_raise( p_intf->p_sys->p_sout->window );
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment