void (*track_change) (GstElement * element, guint track);
};
+#define DEFAULT_DEVICE "/dev/cdrom"
+#define DEFAULT_VOLUME_FR 255
+#define DEFAULT_VOLUME_FL 255
+#define DEFAULT_VOLUME_BR 255
+#define DEFAULT_VOLUME_BL 255
+
/* props */
enum
{
- ARG_0,
- ARG_DEVICE,
- ARG_VOLUME_FR,
- ARG_VOLUME_FL,
- ARG_VOLUME_BR,
- ARG_VOLUME_BL
+ PROP_0,
+ PROP_DEVICE,
+ PROP_VOLUME_FR,
+ PROP_VOLUME_FL,
+ PROP_VOLUME_BR,
+ PROP_VOLUME_BL,
+ PROP_LAST
};
/* signals */
gobject_klass->set_property = gst_cdaudio_set_property;
gobject_klass->get_property = gst_cdaudio_get_property;
- g_object_class_install_property (gobject_klass, ARG_DEVICE,
+ g_object_class_install_property (gobject_klass, PROP_DEVICE,
g_param_spec_string ("device", "Device", "CDROM device",
NULL, G_PARAM_READWRITE));
- g_object_class_install_property (gobject_klass, ARG_VOLUME_FL,
+ g_object_class_install_property (gobject_klass, PROP_VOLUME_FL,
g_param_spec_int ("volume_fl", "Volume fl", "Front left volume",
0, 255, 255, G_PARAM_READWRITE));
- g_object_class_install_property (gobject_klass, ARG_VOLUME_FR,
+ g_object_class_install_property (gobject_klass, PROP_VOLUME_FR,
g_param_spec_int ("volume_fr", "Volume fr", "Front right volume",
0, 255, 255, G_PARAM_READWRITE));
- g_object_class_install_property (gobject_klass, ARG_VOLUME_BL,
+ g_object_class_install_property (gobject_klass, PROP_VOLUME_BL,
g_param_spec_int ("volume_bl", "Volume bl", "Back left volume",
0, 255, 255, G_PARAM_READWRITE));
- g_object_class_install_property (gobject_klass, ARG_VOLUME_BR,
+ g_object_class_install_property (gobject_klass, PROP_VOLUME_BR,
g_param_spec_int ("volume_br", "Volume br", "Back right volume",
0, 255, 255, G_PARAM_READWRITE));
static void
gst_cdaudio_init (GstCDAudio * cdaudio, GstCDAudioClass * g_class)
{
- cdaudio->device = g_strdup ("/dev/cdrom");
+ cdaudio->device = g_strdup (DEFAULT_DEVICE);
+ cdaudio->volume.vol_front.right = DEFAULT_VOLUME_FR;
+ cdaudio->volume.vol_front.left = DEFAULT_VOLUME_FL;
+ cdaudio->volume.vol_back.right = DEFAULT_VOLUME_BR;
+ cdaudio->volume.vol_back.left = DEFAULT_VOLUME_BL;
+
cdaudio->was_playing = FALSE;
cdaudio->timer = g_timer_new ();
cdaudio = GST_CDAUDIO (object);
switch (prop_id) {
- case ARG_DEVICE:
+ case PROP_DEVICE:
+ g_free (cdaudio->device);
+ cdaudio->device = g_value_dup_string (value);
break;
- case ARG_VOLUME_FR:
+ case PROP_VOLUME_FR:
+ cdaudio->volume.vol_front.right = g_value_get_int (value);
break;
- case ARG_VOLUME_FL:
+ case PROP_VOLUME_FL:
+ cdaudio->volume.vol_front.left = g_value_get_int (value);
break;
- case ARG_VOLUME_BR:
+ case PROP_VOLUME_BR:
+ cdaudio->volume.vol_back.right = g_value_get_int (value);
break;
- case ARG_VOLUME_BL:
+ case PROP_VOLUME_BL:
+ cdaudio->volume.vol_back.left = g_value_get_int (value);
break;
default:
break;
cdaudio = GST_CDAUDIO (object);
switch (prop_id) {
- case ARG_DEVICE:
+ case PROP_DEVICE:
g_value_set_string (value, cdaudio->device);
break;
- case ARG_VOLUME_FR:
+ case PROP_VOLUME_FR:
g_value_set_int (value, cdaudio->volume.vol_front.right);
break;
- case ARG_VOLUME_FL:
+ case PROP_VOLUME_FL:
g_value_set_int (value, cdaudio->volume.vol_front.left);
break;
- case ARG_VOLUME_BR:
+ case PROP_VOLUME_BR:
g_value_set_int (value, cdaudio->volume.vol_back.right);
break;
- case ARG_VOLUME_BL:
+ case PROP_VOLUME_BL:
g_value_set_int (value, cdaudio->volume.vol_back.left);
break;
default:
{
return GST_URI_SRC;
}
+
static gchar **
cdaudio_uri_get_protocols (void)
{
return protocols;
}
+
static const gchar *
cdaudio_uri_get_uri (GstURIHandler * handler)
{