Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-QT
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chandrakant Jena
VLC-QT
Commits
76bb0f13
Commit
76bb0f13
authored
2 years ago
by
Ordissimo
Committed by
Jean-Baptiste Kempf
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix gtk_player migrate to gtk3
parent
b7ed50cb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/libvlc/gtk_player.c
+11
-9
11 additions, 9 deletions
doc/libvlc/gtk_player.c
with
11 additions
and
9 deletions
doc/libvlc/gtk_player.c
+
11
−
9
View file @
76bb0f13
...
...
@@ -33,7 +33,7 @@ void player_widget_on_realize(GtkWidget *widget, gpointer data) {
void
on_open
(
GtkWidget
*
widget
,
gpointer
data
)
{
GtkWidget
*
dialog
;
dialog
=
gtk_file_chooser_dialog_new
(
"Choose Media"
,
data
,
GTK_FILE_CHOOSER_ACTION_OPEN
,
GTK_STOCK_CANCEL
,
GTK_RESPONSE_CANCEL
,
GTK_STOCK_OPEN
,
GTK_RESPONSE_ACCEPT
,
NULL
);
dialog
=
gtk_file_chooser_dialog_new
(
"Choose Media"
,
data
,
GTK_FILE_CHOOSER_ACTION_OPEN
,
"Cancel"
,
GTK_RESPONSE_CANCEL
,
"Open"
,
GTK_RESPONSE_ACCEPT
,
NULL
);
if
(
gtk_dialog_run
(
GTK_DIALOG
(
dialog
))
==
GTK_RESPONSE_ACCEPT
)
{
char
*
uri
;
uri
=
gtk_file_chooser_get_uri
(
GTK_FILE_CHOOSER
(
dialog
));
...
...
@@ -67,12 +67,12 @@ void on_stop(GtkWidget *widget, gpointer data) {
void
play
(
void
)
{
libvlc_media_player_play
(
media_player
);
gtk_button_set_label
(
GTK_BUTTON
(
playpause_button
),
"
gtk-media-p
ause"
);
gtk_button_set_label
(
GTK_BUTTON
(
playpause_button
),
"
P
ause"
);
}
void
pause_player
(
void
)
{
libvlc_media_player_pause
(
media_player
);
gtk_button_set_label
(
GTK_BUTTON
(
playpause_button
),
"
gtk-media-p
lay"
);
gtk_button_set_label
(
GTK_BUTTON
(
playpause_button
),
"
P
lay"
);
}
int
main
(
int
argc
,
char
*
argv
[]
)
{
...
...
@@ -86,6 +86,7 @@ int main( int argc, char *argv[] ) {
*
hbuttonbox
,
*
stop_button
;
XInitThreads
();
gtk_init
(
&
argc
,
&
argv
);
// setup window
window
=
gtk_window_new
(
GTK_WINDOW_TOPLEVEL
);
...
...
@@ -95,7 +96,8 @@ int main( int argc, char *argv[] ) {
gtk_window_set_title
(
GTK_WINDOW
(
window
),
"GTK+ libVLC Demo"
);
//setup vbox
vbox
=
gtk_vbox_new
(
FALSE
,
0
);
vbox
=
gtk_box_new
(
GTK_ORIENTATION_VERTICAL
,
0
);
gtk_box_set_homogeneous
(
GTK_BOX
(
vbox
),
FALSE
);
gtk_container_add
(
GTK_CONTAINER
(
window
),
vbox
);
//setup menu
...
...
@@ -105,7 +107,7 @@ int main( int argc, char *argv[] ) {
filemenu_openitem
=
gtk_menu_item_new_with_label
(
"Open"
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
filemenu
),
filemenu_openitem
);
gtk_menu_item_set_submenu
(
GTK_MENU_ITEM
(
fileitem
),
filemenu
);
gtk_menu_shell_append
(
GTK_MENU_
BAR
(
menubar
),
fileitem
);
gtk_menu_shell_append
(
GTK_MENU_
SHELL
(
menubar
),
fileitem
);
gtk_box_pack_start
(
GTK_BOX
(
vbox
),
menubar
,
FALSE
,
FALSE
,
0
);
g_signal_connect
(
filemenu_openitem
,
"activate"
,
G_CALLBACK
(
on_open
),
window
);
...
...
@@ -115,12 +117,12 @@ int main( int argc, char *argv[] ) {
//setup controls
//playpause_button = gtk_button_new_from_stock(GTK_STOCK_MEDIA_PLAY);
playpause_button
=
gtk_button_new_with_label
(
"
gtk-media-p
lay"
);
gtk_button_set_use_stock
(
GTK_BUTTON
(
playpause_button
),
TRUE
);
stop_button
=
gtk_button_new_
from_stock
(
GTK_STOCK_MEDIA_STOP
);
playpause_button
=
gtk_button_new_with_label
(
"
P
lay"
);
//
gtk_button_set_use_stock(GTK_BUTTON(playpause_button), TRUE);
stop_button
=
gtk_button_new_
with_label
(
"Stop"
);
g_signal_connect
(
playpause_button
,
"clicked"
,
G_CALLBACK
(
on_playpause
),
NULL
);
g_signal_connect
(
stop_button
,
"clicked"
,
G_CALLBACK
(
on_stop
),
NULL
);
hbuttonbox
=
gtk_
h
button_box_new
(
);
hbuttonbox
=
gtk_button_box_new
(
GTK_ORIENTATION_HORIZONTAL
);
gtk_container_set_border_width
(
GTK_CONTAINER
(
hbuttonbox
),
BORDER_WIDTH
);
gtk_button_box_set_layout
(
GTK_BUTTON_BOX
(
hbuttonbox
),
GTK_BUTTONBOX_START
);
gtk_box_pack_start
(
GTK_BOX
(
hbuttonbox
),
playpause_button
,
FALSE
,
FALSE
,
0
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment