#ifndef CONTROLS_H
#define CONTROLS_H

#include <gtk/gtk.h>
#include "dialogs.h"

typedef struct Controls Controls;

/* Callbacks for UI updates */
typedef void (*ControlsFullscreenCallback)(gboolean fullscreen, gpointer user_data);
typedef void (*ControlsPlayPauseCallback)(gpointer user_data);

/* Create controls widget */
Controls* controls_new(Player *player, Preferences *prefs);
void controls_destroy(Controls *controls);

/* Get main widget */
GtkWidget* controls_get_widget(Controls *controls);

/* Update functions (called from mpv events) */
void controls_update_position(Controls *controls, double position);
void controls_update_duration(Controls *controls, double duration);
void controls_update_pause_state(Controls *controls, gboolean paused);
void controls_update_volume(Controls *controls, double volume);
void controls_update_volume_boost(Controls *controls, gboolean enable);
void controls_update_mute_state(Controls *controls, gboolean muted);
void controls_update_title(Controls *controls, const char *title);
void controls_set_chapters(Controls *controls, int count, double *times);
void controls_reset(Controls *controls);

/* Seek slider interaction (to prevent feedback loop) */
void controls_set_seeking(Controls *controls, gboolean seeking);
  gboolean controls_is_seeking(Controls *controls);

/* Callbacks */
void controls_set_fullscreen_callback(Controls *controls, 
                                      ControlsFullscreenCallback callback,
                                      gpointer user_data);
void controls_set_play_pause_callback(Controls *controls,
                                      ControlsPlayPauseCallback callback,
                                      gpointer user_data);

#endif /* CONTROLS_H */
