comparison src/audacious/input.c @ 2436:f346d30bf5ab trunk

[svn] Change the input plugin API to use a struct for the currently-playing file.
author iabervon
date Sun, 28 Jan 2007 17:02:15 -0800
parents 4e2fc64d95ef
children 62d8f9c05832
comparison
equal deleted inserted replaced
2435:5b23e9b07317 2436:f346d30bf5ab
71 71
72 static GList *vis_list = NULL; 72 static GList *vis_list = NULL;
73 73
74 gchar *input_info_text = NULL; 74 gchar *input_info_text = NULL;
75 75
76 InputPlugin * 76 InputPlayback *
77 get_current_input_plugin(void) 77 get_current_input_playback(void)
78 { 78 {
79 return ip_data.current_input_plugin; 79 return ip_data.current_input_playback;
80 } 80 }
81 81
82 void 82 void
83 set_current_input_plugin(InputPlugin * ip) 83 set_current_input_playback(InputPlayback * ip)
84 { 84 {
85 ip_data.current_input_plugin = ip; 85 ip_data.current_input_playback = ip;
86 } 86 }
87 87
88 GList * 88 GList *
89 get_input_list(void) 89 get_input_list(void)
90 { 90 {
509 input_set_eq(gint on, gfloat preamp, gfloat * bands) 509 input_set_eq(gint on, gfloat preamp, gfloat * bands)
510 { 510 {
511 if (!ip_data.playing) 511 if (!ip_data.playing)
512 return; 512 return;
513 513
514 if (!get_current_input_plugin()) 514 if (!get_current_input_playback())
515 return; 515 return;
516 516
517 if (get_current_input_plugin()->set_eq) 517 if (get_current_input_playback()->plugin->set_eq)
518 get_current_input_plugin()->set_eq(on, preamp, bands); 518 get_current_input_playback()->plugin->set_eq(on, preamp, bands);
519 } 519 }
520 520
521 void 521 void
522 input_get_song_info(const gchar * filename, gchar ** title, gint * length) 522 input_get_song_info(const gchar * filename, gchar ** title, gint * length)
523 { 523 {
734 input_get_volume(gint * l, gint * r) 734 input_get_volume(gint * l, gint * r)
735 { 735 {
736 *l = -1; 736 *l = -1;
737 *r = -1; 737 *r = -1;
738 if (playback_get_playing()) { 738 if (playback_get_playing()) {
739 if (get_current_input_plugin() && 739 if (get_current_input_playback() &&
740 get_current_input_plugin()->get_volume) { 740 get_current_input_playback()->plugin->get_volume) {
741 get_current_input_plugin()->get_volume(l, r); 741 get_current_input_playback()->plugin->get_volume(l, r);
742 return; 742 return;
743 } 743 }
744 } 744 }
745 output_get_volume(l, r); 745 output_get_volume(l, r);
746 } 746 }
747 747
748 void 748 void
749 input_set_volume(gint l, gint r) 749 input_set_volume(gint l, gint r)
750 { 750 {
751 if (playback_get_playing()) { 751 if (playback_get_playing()) {
752 if (get_current_input_plugin() && 752 if (get_current_input_playback() &&
753 get_current_input_plugin()->set_volume) { 753 get_current_input_playback()->plugin->set_volume) {
754 get_current_input_plugin()->set_volume(l, r); 754 get_current_input_playback()->plugin->set_volume(l, r);
755 return; 755 return;
756 } 756 }
757 } 757 }
758 output_set_volume(l, r); 758 output_set_volume(l, r);
759 } 759 }
812 input_set_status_buffering(gboolean status) 812 input_set_status_buffering(gboolean status)
813 { 813 {
814 if (!playback_get_playing()) 814 if (!playback_get_playing())
815 return; 815 return;
816 816
817 if (!get_current_input_plugin()) 817 if (!get_current_input_playback())
818 return; 818 return;
819 819
820 ip_data.buffering = status; 820 ip_data.buffering = status;
821 821
822 g_return_if_fail(mainwin_playstatus != NULL); 822 g_return_if_fail(mainwin_playstatus != NULL);