| 489 volume = (float)(CLAMP(purple_prefs_get_int(PIDGIN_PREFS_ROOT "/sound/volume"),0,100)) / 50; |
489 volume = (float)(CLAMP(purple_prefs_get_int(PIDGIN_PREFS_ROOT "/sound/volume"),0,100)) / 50; |
| 490 if (!strcmp(method, "automatic")) { |
490 if (!strcmp(method, "automatic")) { |
| 491 if (purple_running_gnome()) { |
491 if (purple_running_gnome()) { |
| 492 sink = gst_element_factory_make("gconfaudiosink", "sink"); |
492 sink = gst_element_factory_make("gconfaudiosink", "sink"); |
| 493 } |
493 } |
| 494 if (!sink) |
|
| 495 sink = gst_element_factory_make("autoaudiosink", "sink"); |
|
| 496 if (!sink) { |
|
| 497 purple_debug_error("sound", "Unable to create GStreamer audiosink.\n"); |
|
| 498 return; |
|
| 499 } |
|
| 500 } |
494 } |
| 501 #ifndef _WIN32 |
495 #ifndef _WIN32 |
| 502 else if (!strcmp(method, "esd")) { |
496 else if (!strcmp(method, "esd")) { |
| 503 sink = gst_element_factory_make("esdsink", "sink"); |
497 sink = gst_element_factory_make("esdsink", "sink"); |
| 504 if (!sink) { |
|
| 505 purple_debug_error("sound", "Unable to create GStreamer audiosink.\n"); |
|
| 506 return; |
|
| 507 } |
|
| 508 } else if (!strcmp(method, "alsa")) { |
498 } else if (!strcmp(method, "alsa")) { |
| 509 sink = gst_element_factory_make("alsasink", "sink"); |
499 sink = gst_element_factory_make("alsasink", "sink"); |
| 510 if (!sink) { |
|
| 511 purple_debug_error("sound", "Unable to create GStreamer audiosink.\n"); |
|
| 512 return; |
|
| 513 } |
|
| 514 } |
500 } |
| 515 #endif |
501 #endif |
| 516 else { |
502 else { |
| 517 purple_debug_error("sound", "Unknown sound method '%s'\n", method); |
503 purple_debug_error("sound", "Unknown sound method '%s'\n", method); |
| |
504 return; |
| |
505 } |
| |
506 |
| |
507 if (strcmp(method, "automatic") != 0 && !sink) { |
| |
508 purple_debug_error("sound", "Unable to create GStreamer audiosink.\n"); |
| 518 return; |
509 return; |
| 519 } |
510 } |
| 520 |
511 |
| 521 play = gst_element_factory_make("playbin", "play"); |
512 play = gst_element_factory_make("playbin", "play"); |
| 522 |
513 |