diff options
-rw-r--r-- | callbacks.c | 7 | ||||
-rw-r--r-- | plugins.c | 19 | ||||
-rw-r--r-- | plugins.h | 6 |
3 files changed, 29 insertions, 3 deletions
diff --git a/callbacks.c b/callbacks.c index 8119ac5b..452e473f 100644 --- a/callbacks.c +++ b/callbacks.c @@ -1130,10 +1130,15 @@ on_volumebar_button_release_event (GtkWidget *widget, GdkEventButton *event, gpointer user_data) { - return FALSE; } +void +volumebar_notify_changed (void) { + GtkWidget *widget = lookup_widget (mainwin, "volumebar"); + volumebar_draw (widget); + volumebar_expose (widget, 0, 0, widget->allocation.width, widget->allocation.height); +} gboolean on_mainwin_delete_event (GtkWidget *widget, @@ -79,12 +79,27 @@ DB_functions_t deadbeef_api = { // cuesheet support .pl_insert_cue = (DB_playItem_t *(*)(DB_playItem_t *, const char *, struct DB_decoder_s *, const char *))pl_insert_cue, // volume control - .volume_set_db = volume_set_db, + .volume_set_db = plug_volume_set_db, .volume_get_db = volume_get_db, - .volume_set_amp = volume_set_amp, + .volume_set_amp = plug_volume_set_amp, .volume_get_amp = volume_get_amp, }; +void +volumebar_notify_changed (void); + +void +plug_volume_set_db (float db) { + volume_set_db (db); + volumebar_notify_changed (); +} + +void +plug_volume_set_amp (float amp) { + volume_set_amp (amp); + volumebar_notify_changed (); +} + #define MAX_DECODERS 50 DB_decoder_t *g_decoders[MAX_DECODERS+1]; @@ -71,4 +71,10 @@ plug_playback_set_pos (float pos); struct DB_decoder_s ** plug_get_decoder_list (void); +void +plug_volume_set_db (float db); + +void +plug_volume_set_amp (float amp); + #endif // __PLUGINS_H |