clapper-app: Apply options from active window to newly created one

When a new window is created, apply all current values to it (volume, speed,
set GStreamer elements, etc.). It would not be the best experience when user
opens a new window, plays something and 100% volume is used in it.
This commit is contained in:
Rafał Dzięgiel
2024-05-19 14:25:41 +02:00
parent 6fb25dd22b
commit 439e5831e2
3 changed files with 201 additions and 130 deletions

View File

@@ -27,6 +27,15 @@ G_BEGIN_DECLS
#define CLAPPER_APP_TYPE_WINDOW (clapper_app_window_get_type())
#define CLAPPER_APP_WINDOW_CAST(obj) ((ClapperAppWindow *)(obj))
typedef struct
{
gchar *video_filter;
gchar *audio_filter;
gchar *video_sink;
gchar *audio_sink;
} ClapperAppWindowExtraOptions;
G_DECLARE_FINAL_TYPE (ClapperAppWindow, clapper_app_window, CLAPPER_APP, WINDOW, GtkApplicationWindow)
G_GNUC_INTERNAL
@@ -38,6 +47,9 @@ GtkWidget * clapper_app_window_get_video (ClapperAppWindow *window);
G_GNUC_INTERNAL
ClapperPlayer * clapper_app_window_get_player (ClapperAppWindow *window);
G_GNUC_INTERNAL
ClapperAppWindowExtraOptions * clapper_app_window_get_extra_options (ClapperAppWindow *window);
G_GNUC_INTERNAL
void clapper_app_window_ensure_no_initial_state (ClapperAppWindow *window);