| 447 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/sound/mute")) |
447 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/sound/mute")) |
| 448 return; |
448 return; |
| 449 |
449 |
| 450 method = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"); |
450 method = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"); |
| 451 |
451 |
| 452 if (!strcmp(method, "none")) { |
452 if (purple_strequal(method, "none")) { |
| 453 return; |
453 return; |
| 454 } else if (!strcmp(method, "beep")) { |
454 } else if (purple_strequal(method, "beep")) { |
| 455 gdk_beep(); |
455 gdk_beep(); |
| 456 return; |
456 return; |
| 457 } |
457 } |
| 458 #ifdef _WIN32 |
458 #ifdef _WIN32 |
| 459 else if (!strcmp(method, "playsoundw")) { |
459 else if (purple_strequal(method, "playsoundw")) { |
| 460 pidgin_sound_play_file_win32(filename); |
460 pidgin_sound_play_file_win32(filename); |
| 461 return; |
461 return; |
| 462 } |
462 } |
| 463 #endif /* _WIN32 */ |
463 #endif /* _WIN32 */ |
| 464 |
464 |
| 519 |
519 |
| 520 #ifdef USE_GSTREAMER |
520 #ifdef USE_GSTREAMER |
| 521 if (gst_init_failed) /* Perhaps do gdk_beep instead? */ |
521 if (gst_init_failed) /* Perhaps do gdk_beep instead? */ |
| 522 return; |
522 return; |
| 523 #ifdef _WIN32 |
523 #ifdef _WIN32 |
| 524 if (!strcmp(method, "automatic")) { |
524 if (purple_strequal(method, "automatic")) { |
| 525 sink = gst_element_factory_make("directsoundsink", "sink"); |
525 sink = gst_element_factory_make("directsoundsink", "sink"); |
| 526 if (sink == NULL) |
526 if (sink == NULL) |
| 527 sink = gst_element_factory_make("waveformsink", "sink"); |
527 sink = gst_element_factory_make("waveformsink", "sink"); |
| 528 if (sink == NULL) |
528 if (sink == NULL) |
| 529 sink = gst_element_factory_make("gconfaudiosink", "sink"); |
529 sink = gst_element_factory_make("gconfaudiosink", "sink"); |
| 530 } else if (!strcmp(method, "directsound")) { |
530 } else if (purple_strequal(method, "directsound")) { |
| 531 sink = gst_element_factory_make("directsoundsink", "sink"); |
531 sink = gst_element_factory_make("directsoundsink", "sink"); |
| 532 } else if (!strcmp(method, "waveform")) { |
532 } else if (purple_strequal(method, "waveform")) { |
| 533 sink = gst_element_factory_make("waveformsink", "sink"); |
533 sink = gst_element_factory_make("waveformsink", "sink"); |
| 534 } |
534 } |
| 535 #else |
535 #else |
| 536 if (!strcmp(method, "automatic")) { |
536 if (purple_strequal(method, "automatic")) { |
| 537 sink = gst_element_factory_make("gconfaudiosink", "sink"); |
537 sink = gst_element_factory_make("gconfaudiosink", "sink"); |
| 538 } else if (!strcmp(method, "esd")) { |
538 } else if (purple_strequal(method, "esd")) { |
| 539 sink = gst_element_factory_make("esdsink", "sink"); |
539 sink = gst_element_factory_make("esdsink", "sink"); |
| 540 } else if (!strcmp(method, "alsa")) { |
540 } else if (purple_strequal(method, "alsa")) { |
| 541 sink = gst_element_factory_make("alsasink", "sink"); |
541 sink = gst_element_factory_make("alsasink", "sink"); |
| 542 } |
542 } |
| 543 #endif |
543 #endif |
| 544 else { |
544 else { |
| 545 purple_debug_error("sound", "Unknown sound method '%s'\n", method); |
545 purple_debug_error("sound", "Unknown sound method '%s'\n", method); |
| 546 return; |
546 return; |
| 547 } |
547 } |
| 548 |
548 |
| 549 if (strcmp(method, "automatic") != 0 && !sink) { |
549 if (!purple_strequal(method, "automatic") && !sink) { |
| 550 purple_debug_error("sound", "Unable to create GStreamer audiosink.\n"); |
550 purple_debug_error("sound", "Unable to create GStreamer audiosink.\n"); |
| 551 return; |
551 return; |
| 552 } |
552 } |
| 553 |
553 |
| 554 play = gst_element_factory_make("playbin", "play"); |
554 play = gst_element_factory_make("playbin", "play"); |