viewgit/index.php:465 Only variables should be passed by reference [2048]

viewgit/index.php:466 Non-static method GeSHi::get_language_name_from_extension() should not be called statically [2048]

  1. #include <stdlib.h>
  2. #include <pulse/pulseaudio.h>
  3. #include <stdio.h>
  4.  
  5. pa_mainloop* mainloop;
  6. pa_operation* operation;
  7.  
  8.  
  9. void
  10. success_callback(pa_context *c, int success, void* userdata)
  11. {
  12. pa_mainloop_quit(mainloop, success);
  13. }
  14.  
  15.  
  16. void
  17. toggle_mute(pa_context *c, pa_sink_info *i, void* user_data)
  18. {
  19. int j;
  20. if (i) {
  21. printf("Name: %s\n", i->name);
  22. if (i->active_port)
  23. printf("Active port: %s\n", i->active_port->description);
  24. printf("Available ports:\n");
  25. for(j = 0; j < i->n_ports; j++) {
  26. printf(" - %s: %s\n", i->ports[j]->name,
  27. i->ports[j]->description);
  28. }
  29.  
  30. /* Cycle through available active ports */
  31. for(j = 0; j < i->n_ports; j++) {
  32. if (i->active_port == i->ports[j]) {
  33. pa_context_set_sink_port_by_index(c,
  34. i->index,
  35. i->ports[(j + 1) % i->n_ports]->name,
  36. (pa_context_success_cb_t) success_callback,
  37. NULL);
  38. }
  39. }
  40. }
  41. }
  42.  
  43.  
  44. void
  45. context_connected_cb(pa_context *c, void* user_data)
  46. {
  47. if (pa_context_get_state(c) == PA_CONTEXT_READY) {
  48. operation = pa_context_get_sink_info_list(c,
  49. (pa_sink_info_cb_t) toggle_mute,
  50. NULL);
  51. }
  52. }
  53.  
  54. int
  55. main()
  56. {
  57. mainloop = pa_mainloop_new();
  58. pa_mainloop_api *api = pa_mainloop_get_api (mainloop);
  59. pa_context *c;
  60. pa_operation* operation;
  61. pa_operation_state_t state = PA_OPERATION_RUNNING;
  62. int retval;
  63. pa_proplist *proplist;
  64.  
  65. proplist = pa_proplist_new();
  66. pa_proplist_sets(proplist, PA_PROP_DEVICE_API, "alsa");
  67. c = pa_context_new_with_proplist(api, "RobolMute",
  68. proplist);
  69.  
  70. /* Connect to the default Pulseaudio server, ask for
  71.   * information about Front so we can check if it is
  72.   * already muted or not. */
  73. pa_context_connect(c, NULL, PA_CONTEXT_NOFLAGS, NULL);
  74. pa_context_set_state_callback(c, (pa_context_notify_cb_t) context_connected_cb, mainloop);
  75.  
  76. /* Loop :) */
  77. pa_mainloop_run(mainloop, &retval);
  78. return 0;
  79. }