Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guido Gunther
livi
Commits
e0f31cf1
Commit
e0f31cf1
authored
Jul 08, 2021
by
Guido Gunther
💤
Browse files
Hide mute/unmute button when there are no audio tracks
parent
8d31b050
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/livi-window.c
View file @
e0f31cf1
...
...
@@ -244,6 +244,18 @@ on_player_position_updated (GstPlayer *player, guint64 position, gpointer user_d
}
static
void
on_media_info_updated
(
GstPlayer
*
player
,
GstPlayerMediaInfo
*
info
,
gpointer
user_data
)
{
LiviWindow
*
self
=
LIVI_WINDOW
(
user_data
);
g_autofree
char
*
text
=
NULL
;
const
gchar
*
title
;
gint
show
;
show
=
gst_player_media_info_get_number_of_audio_streams
(
info
);
gtk_widget_set_visible
(
GTK_WIDGET
(
self
->
btn_mute
),
!!
show
);
}
static
void
on_realize
(
LiviWindow
*
self
)
...
...
@@ -265,6 +277,7 @@ on_realize (LiviWindow *self)
"signal::mute-changed"
,
G_CALLBACK
(
on_player_mute_changed
),
self
,
"signal::duration-changed"
,
G_CALLBACK
(
on_player_duration_changed
),
self
,
"signal::position-updated"
,
G_CALLBACK
(
on_player_position_updated
),
self
,
"signal::media-info-updated"
,
G_CALLBACK
(
on_media_info_updated
),
self
,
NULL
);
}
}
...
...
@@ -298,6 +311,7 @@ livi_window_class_init (LiviWindowClass *klass)
gtk_widget_class_set_template_from_resource
(
widget_class
,
"/org/sigxcpu/Livi/livi-window.ui"
);
gtk_widget_class_bind_template_child
(
widget_class
,
LiviWindow
,
adj_duration
);
gtk_widget_class_bind_template_child
(
widget_class
,
LiviWindow
,
box_content
);
gtk_widget_class_bind_template_child
(
widget_class
,
LiviWindow
,
btn_mute
);
gtk_widget_class_bind_template_child
(
widget_class
,
LiviWindow
,
btn_play
);
gtk_widget_class_bind_template_child
(
widget_class
,
LiviWindow
,
img_fullscreen
);
gtk_widget_class_bind_template_child
(
widget_class
,
LiviWindow
,
img_play
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment