Commit ee754501 authored by Bastien Nocera's avatar Bastien Nocera Committed by Bastien Nocera

add CDDA support, needs a very very recent xine-lib, and works nicely

2003-01-19  Bastien Nocera  <hadess@hadess.net>

        * data/totem.glade:
	* src/gtk-xine.c: (gtk_xine_realize), (gtk_xine_can_play),
	(gtk_xine_get_mrls):
	* src/gtk-xine.h:
	* README:
	* src/totem.c: (drag_video_cb), (totem_action_open_files),
	(on_play_cd1_activate), (totem_callback_connect): add CDDA support,
	needs a very very recent xine-lib, and works nicely (where's cddb
	support though ? ;)
parent 9fec2751
2003-01-19 Bastien Nocera <hadess@hadess.net>
* data/totem.glade:
* src/gtk-xine.c: (gtk_xine_realize), (gtk_xine_can_play),
(gtk_xine_get_mrls):
* src/gtk-xine.h:
* README:
* src/totem.c: (drag_video_cb), (totem_action_open_files),
(on_play_cd1_activate), (totem_callback_connect): add CDDA support,
needs a very very recent xine-lib, and works nicely (where's cddb
support though ? ;)
2003-01-19 Bastien Nocera <hadess@hadess.net>
* README:
......
......@@ -21,6 +21,7 @@ News
* some cleanups making seeking faster
* added visual effects for audio-only files
* added a statusbar
* added CDDA support (Digital CD playback)
0.13.1:
* Make it work again on glib-2.x based platforms
......
......@@ -48,12 +48,12 @@
<child>
<widget class="GtkImageMenuItem" id="play_dvd1">
<property name="visible">True</property>
<property name="label" translatable="yes">Play DVD</property>
<property name="label" translatable="yes">Play _DVD</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_play_dvd1_activate" last_modification_time="Fri, 09 Aug 2002 22:46:45 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1055">
<widget class="GtkImage" id="image1073">
<property name="visible">True</property>
<property name="stock">gtk-cdrom</property>
<property name="icon_size">1</property>
......@@ -69,12 +69,33 @@
<child>
<widget class="GtkImageMenuItem" id="play_vcd1">
<property name="visible">True</property>
<property name="label" translatable="yes">Play VCD</property>
<property name="label" translatable="yes">Play _VCD</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_play_vcd1_activate" last_modification_time="Fri, 09 Aug 2002 22:46:45 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1056">
<widget class="GtkImage" id="image1074">
<property name="visible">True</property>
<property name="stock">gtk-cdrom</property>
<property name="icon_size">1</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>
</child>
<child>
<widget class="GtkImageMenuItem" id="play_audio_cd1">
<property name="visible">True</property>
<property name="label" translatable="yes">Play _Audio CD</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_play_cd1_activate" last_modification_time="Sun, 19 Jan 2003 22:48:19 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1075">
<property name="visible">True</property>
<property name="stock">gtk-cdrom</property>
<property name="icon_size">1</property>
......@@ -138,7 +159,7 @@
<signal name="activate" handler="on_take_screenshot1_activate" last_modification_time="Mon, 06 Jan 2003 19:35:01 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1057">
<widget class="GtkImage" id="image1076">
<property name="visible">True</property>
<property name="stock">gtk-convert</property>
<property name="icon_size">1</property>
......@@ -194,7 +215,7 @@
<accelerator key="F" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image1058">
<widget class="GtkImage" id="image1077">
<property name="visible">True</property>
<property name="stock">gtk-zoom-fit</property>
<property name="icon_size">1</property>
......@@ -216,7 +237,7 @@
<accelerator key="0" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image1059">
<widget class="GtkImage" id="image1078">
<property name="visible">True</property>
<property name="stock">gtk-zoom-out</property>
<property name="icon_size">1</property>
......@@ -238,7 +259,7 @@
<accelerator key="1" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image1060">
<widget class="GtkImage" id="image1079">
<property name="visible">True</property>
<property name="stock">gtk-zoom-100</property>
<property name="icon_size">1</property>
......@@ -260,7 +281,7 @@
<accelerator key="2" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image1061">
<widget class="GtkImage" id="image1080">
<property name="visible">True</property>
<property name="stock">gtk-zoom-in</property>
<property name="icon_size">1</property>
......@@ -288,7 +309,7 @@
<accelerator key="A" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image1062">
<widget class="GtkImage" id="image1081">
<property name="visible">True</property>
<property name="stock">gnome-stock-table-fill</property>
<property name="icon_size">1</property>
......@@ -315,7 +336,7 @@
<signal name="activate" handler="on_show_playlist1_activate" last_modification_time="Fri, 14 Jun 2002 22:36:54 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1063">
<widget class="GtkImage" id="image1082">
<property name="visible">True</property>
<property name="pixbuf">playlist-16.png</property>
<property name="xalign">0.5</property>
......@@ -350,7 +371,7 @@
<accelerator key="m" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image1064">
<widget class="GtkImage" id="image1083">
<property name="visible">True</property>
<property name="stock">gtk-index</property>
<property name="icon_size">1</property>
......@@ -399,7 +420,7 @@
<accelerator key="c" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image1065">
<widget class="GtkImage" id="image1084">
<property name="visible">True</property>
<property name="stock">gnome-stock-text-numbered-list</property>
<property name="icon_size">1</property>
......@@ -427,7 +448,7 @@
<accelerator key="n" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image1066">
<widget class="GtkImage" id="image1085">
<property name="visible">True</property>
<property name="stock">gtk-goto-last</property>
<property name="icon_size">1</property>
......@@ -449,7 +470,7 @@
<accelerator key="b" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image1067">
<widget class="GtkImage" id="image1086">
<property name="visible">True</property>
<property name="stock">gtk-goto-first</property>
<property name="icon_size">1</property>
......@@ -478,7 +499,7 @@
<accelerator key="Right" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image1068">
<widget class="GtkImage" id="image1087">
<property name="visible">True</property>
<property name="stock">gtk-go-forward</property>
<property name="icon_size">1</property>
......@@ -501,7 +522,7 @@
<accelerator key="Left" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image1069">
<widget class="GtkImage" id="image1088">
<property name="visible">True</property>
<property name="stock">gtk-go-back</property>
<property name="icon_size">1</property>
......@@ -536,7 +557,7 @@
<accelerator key="Up" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image1070">
<widget class="GtkImage" id="image1089">
<property name="visible">True</property>
<property name="stock">gnome-stock-volume</property>
<property name="icon_size">1</property>
......@@ -558,7 +579,7 @@
<accelerator key="Down" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image1071">
<widget class="GtkImage" id="image1090">
<property name="visible">True</property>
<property name="stock">gnome-stock-volume</property>
<property name="icon_size">1</property>
......
......@@ -142,7 +142,7 @@ struct GtkXinePrivate {
/* Other stuff */
int xpos, ypos;
gboolean init_finished;
gboolean can_dvd, can_vcd;
gboolean can_dvd, can_vcd, can_cdda;
GAsyncQueue *queue;
int video_width, video_height;
......@@ -896,6 +896,8 @@ gtk_xine_realize (GtkWidget *widget)
gtx->priv->can_vcd = TRUE;
else if (g_ascii_strcasecmp (autoplug_list[i], "DVD") == 0)
gtx->priv->can_dvd = TRUE;
else if (g_ascii_strcasecmp (autoplug_list[i], "CDDA") == 0)
gtx->priv->can_cdda = TRUE;
i++;
}
......@@ -1712,6 +1714,8 @@ gtk_xine_can_play (GtkXine *gtx, MediaType type)
return gtx->priv->can_dvd;
case MEDIA_VCD:
return gtx->priv->can_vcd;
case MEDIA_CDDA:
return gtx->priv->can_cdda;
default:
return FALSE;
}
......@@ -1731,6 +1735,8 @@ G_CONST_RETURN gchar
plugin_id = "DVD";
else if (type == MEDIA_VCD)
plugin_id = "VCD";
else if (type == MEDIA_CDDA)
plugin_id = "CDDA";
else
return NULL;
......
......@@ -59,6 +59,7 @@ typedef enum {
typedef enum {
MEDIA_DVD,
MEDIA_VCD,
MEDIA_CDDA,
} MediaType;
typedef enum {
......
......@@ -112,8 +112,8 @@ static const GtkTargetEntry target_table[] = {
};
static const GtkTargetEntry source_table[] = {
{ "text/plain", 0, 0 },
// { "_NETSCAPE_URL", 0, 0 },
{ "_NETSCAPE_URL", 0, 0 },
{ "text/uri-list", 0, 1 },
};
static gboolean popup_hide (Totem *totem);
......@@ -744,7 +744,7 @@ drag_video_cb (GtkWidget *widget,
gpointer callback_data)
{
Totem *totem = (Totem *) callback_data;
char *text;
char *text;// = "file:///tmp/";
int len;
g_assert (selection_data != NULL);
......@@ -752,9 +752,11 @@ drag_video_cb (GtkWidget *widget,
if (totem->mrl == NULL)
return;
text = totem->mrl;
text = gnome_vfs_get_uri_from_local_path (totem->mrl);
len = strlen (text);
g_print ("info: %d text: %s len: %d\n", info, text, len);
gtk_selection_data_set (selection_data,
selection_data->target,
8, (guchar *) text, len);
......@@ -999,7 +1001,9 @@ totem_action_open_files (Totem *totem, char **list, gboolean ignore_first)
| G_FILE_TEST_EXISTS)
|| strstr (filename, "://") != NULL
|| strncmp (filename, "dvd:", 4) == 0
|| strncmp (filename, "vcd:", 4) == 0)
|| strncmp (filename, "vcd:", 4) == 0
|| strncmp (filename, "cdda:", 5) == 0
|| strncmp (filename, "cd:", 3) == 0)
{
g_free (filename);
......@@ -1021,6 +1025,9 @@ totem_action_open_files (Totem *totem, char **list, gboolean ignore_first)
} else if (strcmp (list[i], "vcd:") == 0) {
totem_action_play_media (totem, MEDIA_VCD);
continue;
} else if (strcmp (list[i], "cd:") == 0) {
totem_action_play_media (totem, MEDIA_CDDA);
continue;
} else if (gtk_playlist_add_mrl (totem->playlist,
list[i], NULL) == TRUE)
{
......@@ -1125,6 +1132,14 @@ on_play_vcd1_activate (GtkButton *button, gpointer user_data)
totem_action_play_media (totem, MEDIA_VCD);
}
static void
on_play_cd1_activate (GtkButton *button, gpointer user_data)
{
Totem *totem = (Totem *) user_data;
totem_action_play_media (totem, MEDIA_CDDA);
}
static void
on_play1_activate (GtkButton *button, gpointer user_data)
{
......@@ -1980,6 +1995,9 @@ totem_callback_connect (Totem *totem)
item = glade_xml_get_widget (totem->xml, "play_vcd1");
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (on_play_vcd1_activate), totem);
item = glade_xml_get_widget (totem->xml, "play_audio_cd1");
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (on_play_cd1_activate), totem);
item = glade_xml_get_widget (totem->xml, "play1");
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (on_play1_activate), totem);
......
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