Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
fa1bf19a
Commit
fa1bf19a
authored
Jul 03, 2006
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* implemented a non-blocking progress-bar in the main interface; needs testing (closes #475)
parent
3fbed7ad
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
136 additions
and
11 deletions
+136
-11
extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib
...s/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib
+1
-0
extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib
+2
-2
extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
...OSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
+0
-0
include/vlc_interaction.h
include/vlc_interaction.h
+6
-1
modules/gui/macosx/interaction.m
modules/gui/macosx/interaction.m
+37
-8
modules/gui/macosx/intf.h
modules/gui/macosx/intf.h
+4
-0
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+25
-0
src/interface/interaction.c
src/interface/interaction.c
+61
-0
No files found.
extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib
View file @
fa1bf19a
...
@@ -226,6 +226,7 @@
...
@@ -226,6 +226,7 @@
"o_err_msg" = id;
"o_err_msg" = id;
"o_error" = id;
"o_error" = id;
"o_info" = id;
"o_info" = id;
"o_main_pgbar" = id;
"o_messages" = id;
"o_messages" = id;
"o_mi_about" = id;
"o_mi_about" = id;
"o_mi_add_intf" = id;
"o_mi_add_intf" = id;
...
...
extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib
View file @
fa1bf19a
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
<string>
777 479 187 249 0 0 1440 878
</string>
<string>
777 479 187 249 0 0 1440 878
</string>
</dict>
</dict>
<key>
IBFramework Version
</key>
<key>
IBFramework Version
</key>
<string>
4
39.0
</string>
<string>
4
46.1
</string>
<key>
IBLockedObjects
</key>
<key>
IBLockedObjects
</key>
<array/>
<array/>
<key>
IBOpenObjects
</key>
<key>
IBOpenObjects
</key>
...
@@ -26,6 +26,6 @@
...
@@ -26,6 +26,6 @@
<integer>
21
</integer>
<integer>
21
</integer>
</array>
</array>
<key>
IBSystem Version
</key>
<key>
IBSystem Version
</key>
<string>
8
I127
</string>
<string>
8
J135
</string>
</dict>
</dict>
</plist>
</plist>
extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
View file @
fa1bf19a
No preview for this file type
include/vlc_interaction.h
View file @
fa1bf19a
...
@@ -84,6 +84,7 @@ struct interaction_dialog_t
...
@@ -84,6 +84,7 @@ struct interaction_dialog_t
#define DIALOG_LOGIN_PW_OK_CANCEL 0x20
#define DIALOG_LOGIN_PW_OK_CANCEL 0x20
#define DIALOG_USER_PROGRESS 0x40
#define DIALOG_USER_PROGRESS 0x40
#define DIALOG_PSZ_INPUT_OK_CANCEL 0x80
#define DIALOG_PSZ_INPUT_OK_CANCEL 0x80
#define DIALOG_INTF_PROGRESS 0x100
/**
/**
* Possible return codes
* Possible return codes
...
@@ -175,13 +176,17 @@ VLC_EXPORT( int, __intf_UserOkayCancel,( vlc_object_t*, const char*, const char*
...
@@ -175,13 +176,17 @@ VLC_EXPORT( int, __intf_UserOkayCancel,( vlc_object_t*, const char*, const char*
#define intf_UserProgress( a, b, c, d ) __intf_UserProgress( VLC_OBJECT(a),b,c, d )
#define intf_UserProgress( a, b, c, d ) __intf_UserProgress( VLC_OBJECT(a),b,c, d )
VLC_EXPORT
(
int
,
__intf_UserProgress
,(
vlc_object_t
*
,
const
char
*
,
const
char
*
,
float
)
);
VLC_EXPORT
(
int
,
__intf_UserProgress
,(
vlc_object_t
*
,
const
char
*
,
const
char
*
,
float
)
);
#define intf_UserProgressUpdate( a, b, c, d ) __intf_UserProgressUpdate( VLC_OBJECT(a),b,c, d )
#define intf_UserProgressUpdate( a, b, c, d ) __intf_UserProgressUpdate( VLC_OBJECT(a),b,c, d )
VLC_EXPORT
(
void
,
__intf_UserProgressUpdate
,(
vlc_object_t
*
,
int
,
const
char
*
,
float
)
);
VLC_EXPORT
(
void
,
__intf_UserProgressUpdate
,(
vlc_object_t
*
,
int
,
const
char
*
,
float
)
);
#define intf_UserStringInput( a, b, c, d ) __intf_UserStringInput( VLC_OBJECT(a),b,c,d )
#define intf_UserStringInput( a, b, c, d ) __intf_UserStringInput( VLC_OBJECT(a),b,c,d )
VLC_EXPORT
(
int
,
__intf_UserStringInput
,(
vlc_object_t
*
,
const
char
*
,
const
char
*
,
char
**
)
);
VLC_EXPORT
(
int
,
__intf_UserStringInput
,(
vlc_object_t
*
,
const
char
*
,
const
char
*
,
char
**
)
);
#define intf_IntfProgress( a, b, c, d ) __intf_IntfProgress( VLC_OBJECT(a),b,c, d )
VLC_EXPORT
(
int
,
__intf_IntfProgress
,(
vlc_object_t
*
,
const
char
*
,
float
)
);
#define intf_IntfProgressUpdate( a, b, c, d ) __intf_IntfProgressUpdate( VLC_OBJECT(a),b,c, d )
VLC_EXPORT
(
void
,
__intf_IntfProgressUpdate
,(
vlc_object_t
*
,
int
,
const
char
*
,
float
)
);
#define intf_UserHide( a, b ) __intf_UserHide( VLC_OBJECT(a), b )
#define intf_UserHide( a, b ) __intf_UserHide( VLC_OBJECT(a), b )
VLC_EXPORT
(
void
,
__intf_UserHide
,(
vlc_object_t
*
,
int
));
VLC_EXPORT
(
void
,
__intf_UserHide
,(
vlc_object_t
*
,
int
));
...
...
modules/gui/macosx/interaction.m
View file @
fa1bf19a
...
@@ -160,7 +160,7 @@
...
@@ -160,7 +160,7 @@
{
{
if
(
p_dialog
->
i_flags
&
DIALOG_OK_CANCEL
)
if
(
p_dialog
->
i_flags
&
DIALOG_OK_CANCEL
)
{
{
msg_Dbg
(
p_intf
,
"
requested flag: DIALOG_OK_CANCEL
"
);
msg_Dbg
(
p_intf
,
"
OK-Cancel-dialog requested
"
);
NSBeginInformationalAlertSheet
(
o_title
,
_NS
(
"OK"
)
,
_NS
(
"Cancel"
),
NSBeginInformationalAlertSheet
(
o_title
,
_NS
(
"OK"
)
,
_NS
(
"Cancel"
),
nil
,
o_window
,
self
,
nil
,
o_window
,
self
,
@selector
(
sheetDidEnd
:
returnCode
:
contextInfo
:
),
NULL
,
nil
,
@selector
(
sheetDidEnd
:
returnCode
:
contextInfo
:
),
NULL
,
nil
,
...
@@ -168,7 +168,7 @@
...
@@ -168,7 +168,7 @@
}
}
else
if
(
p_dialog
->
i_flags
&
DIALOG_YES_NO_CANCEL
)
else
if
(
p_dialog
->
i_flags
&
DIALOG_YES_NO_CANCEL
)
{
{
msg_Dbg
(
p_intf
,
"
requested flag: DIALOG_YES_NO_CANCEL
"
);
msg_Dbg
(
p_intf
,
"
yes-no-cancel-dialog requested
"
);
NSBeginInformationalAlertSheet
(
o_title
,
_NS
(
"Yes"
),
_NS
(
"No"
),
NSBeginInformationalAlertSheet
(
o_title
,
_NS
(
"Yes"
),
_NS
(
"No"
),
_NS
(
"Cancel"
),
o_window
,
self
,
_NS
(
"Cancel"
),
o_window
,
self
,
@selector
(
sheetDidEnd
:
returnCode
:
contextInfo
:
),
NULL
,
nil
,
@selector
(
sheetDidEnd
:
returnCode
:
contextInfo
:
),
NULL
,
nil
,
...
@@ -176,7 +176,7 @@
...
@@ -176,7 +176,7 @@
}
}
else
if
(
p_dialog
->
i_flags
&
DIALOG_LOGIN_PW_OK_CANCEL
)
else
if
(
p_dialog
->
i_flags
&
DIALOG_LOGIN_PW_OK_CANCEL
)
{
{
msg_Dbg
(
p_intf
,
"
requested flag: DIALOG_LOGIN_PW_OK_CANCEL
"
);
msg_Dbg
(
p_intf
,
"
dialog for login and pw requested
"
);
[
o_auth_title
setStringValue
:
o_title
];
[
o_auth_title
setStringValue
:
o_title
];
[
o_auth_description
setStringValue
:
o_description
];
[
o_auth_description
setStringValue
:
o_description
];
[
o_auth_login_fld
setStringValue
:
@""
];
[
o_auth_login_fld
setStringValue
:
@""
];
...
@@ -187,17 +187,17 @@
...
@@ -187,17 +187,17 @@
}
}
else
if
(
p_dialog
->
i_flags
&
DIALOG_USER_PROGRESS
)
else
if
(
p_dialog
->
i_flags
&
DIALOG_USER_PROGRESS
)
{
{
msg_Dbg
(
p_intf
,
"
requested flag: DIALOG_USER_PROGRESS
"
);
msg_Dbg
(
p_intf
,
"
user progress dialog requested
"
);
[
o_prog_title
setStringValue
:
o_title
];
[
o_prog_title
setStringValue
:
o_title
];
[
o_prog_description
setStringValue
:
o_description
];
[
o_prog_description
setStringValue
:
o_description
];
[
o_prog_bar
set
DoubleValue
:
0
];
[
o_prog_bar
set
FloatValue
:
p_dialog
->
val
.
f_float
];
[
NSApp
beginSheet
:
o_prog_win
modalForWindow
:
o_window
[
NSApp
beginSheet
:
o_prog_win
modalForWindow
:
o_window
modalDelegate:
self
didEndSelector
:
nil
contextInfo
:
nil
];
modalDelegate:
self
didEndSelector
:
nil
contextInfo
:
nil
];
[
o_prog_win
makeKeyWindow
];
[
o_prog_win
makeKeyWindow
];
}
}
else
if
(
p_dialog
->
i_flags
&
DIALOG_PSZ_INPUT_OK_CANCEL
)
else
if
(
p_dialog
->
i_flags
&
DIALOG_PSZ_INPUT_OK_CANCEL
)
{
{
msg_Dbg
(
p_intf
,
"
requested flag: DIALOG_PSZ_INPUT_OK_CANCEL
"
);
msg_Dbg
(
p_intf
,
"
text input requested
"
);
[
o_input_title
setStringValue
:
o_title
];
[
o_input_title
setStringValue
:
o_title
];
[
o_input_description
setStringValue
:
o_description
];
[
o_input_description
setStringValue
:
o_description
];
[
o_input_fld
setStringValue
:
@""
];
[
o_input_fld
setStringValue
:
@""
];
...
@@ -205,6 +205,16 @@
...
@@ -205,6 +205,16 @@
modalDelegate:
self
didEndSelector
:
nil
contextInfo
:
nil
];
modalDelegate:
self
didEndSelector
:
nil
contextInfo
:
nil
];
[
o_input_win
makeKeyWindow
];
[
o_input_win
makeKeyWindow
];
}
}
else
if
(
p_dialog
->
i_flags
&
DIALOG_INTF_PROGRESS
)
{
msg_Dbg
(
p_intf
,
"progress-bar in main intf requested"
);
[[[
VLCMain
sharedInstance
]
getMainScrollField
]
setStringValue:
o_description
];
[[[
VLCMain
sharedInstance
]
getMainIntfPgbar
]
setFloatValue:
p_dialog
->
val
.
f_float
];
[[[
VLCMain
sharedInstance
]
getMainIntfPgbar
]
setHidden
:
NO
];
[[[
VLCMain
sharedInstance
]
getControllerWindow
]
makeKeyWindow
];
}
else
else
msg_Warn
(
p_intf
,
"requested dialog type unknown"
);
msg_Warn
(
p_intf
,
"requested dialog type unknown"
);
}
}
...
@@ -240,8 +250,7 @@
...
@@ -240,8 +250,7 @@
{
{
[
o_prog_description
setStringValue
:
\
[
o_prog_description
setStringValue
:
\
[
NSString
stringWithUTF8String
:
p_dialog
->
psz_description
]];
[
NSString
stringWithUTF8String
:
p_dialog
->
psz_description
]];
[
o_prog_bar
setDoubleValue
:
\
[
o_prog_bar
setFloatValue
:
p_dialog
->
val
.
f_float
];
(
double
)(
p_dialog
->
val
.
f_float
)];
if
(
[
o_prog_bar
doubleValue
]
==
100
.
0
)
if
(
[
o_prog_bar
doubleValue
]
==
100
.
0
)
{
{
...
@@ -250,6 +259,20 @@
...
@@ -250,6 +259,20 @@
return
;
return
;
}
}
}
}
if
(
p_dialog
->
i_flags
&
DIALOG_INTF_PROGRESS
)
{
[[[
VLCMain
sharedInstance
]
getMainScrollField
]
setStringValue
:
\
[
NSString
stringWithUTF8String
:
p_dialog
->
psz_description
]];
[[[
VLCMain
sharedInstance
]
getMainIntfPgbar
]
setFloatValue
:
\
p_dialog
->
val
.
f_float
];
if
(
[[[
VLCMain
sharedInstance
]
getMainIntfPgbar
]
doubleValue
]
==
100
.
0
)
{
/* we are done, let's hide */
[
self
hideDialog
];
return
;
}
}
}
}
-
(
void
)
hideDialog
-
(
void
)
hideDialog
...
@@ -270,6 +293,12 @@
...
@@ -270,6 +293,12 @@
[
NSApp
endSheet
:
o_input_win
];
[
NSApp
endSheet
:
o_input_win
];
[
o_input_win
close
];
[
o_input_win
close
];
}
}
if
(
p_dialog
->
i_flags
&
DIALOG_INTF_PROGRESS
)
{
[[[
VLCMain
sharedInstance
]
getMainIntfPgbar
]
setIndeterminate
:
YES
];
[[[
VLCMain
sharedInstance
]
getMainScrollField
]
setStringValue
:
@""
];
[[[
VLCMain
sharedInstance
]
getMainIntfPgbar
]
setHidden
:
YES
];
}
}
}
-
(
void
)
destroyDialog
-
(
void
)
destroyDialog
...
...
modules/gui/macosx/intf.h
View file @
fa1bf19a
...
@@ -119,6 +119,7 @@ struct intf_sys_t
...
@@ -119,6 +119,7 @@ struct intf_sys_t
float
f_slider_old
;
/* old slider val */
float
f_slider_old
;
/* old slider val */
IBOutlet
id
o_volumeslider
;
/* volume slider */
IBOutlet
id
o_volumeslider
;
/* volume slider */
IBOutlet
id
o_main_pgbar
;
/* main interface progress bar */
IBOutlet
id
o_btn_prev
;
/* btn previous */
IBOutlet
id
o_btn_prev
;
/* btn previous */
IBOutlet
id
o_btn_rewind
;
/* btn rewind */
IBOutlet
id
o_btn_rewind
;
/* btn rewind */
IBOutlet
id
o_btn_play
;
/* btn play */
IBOutlet
id
o_btn_play
;
/* btn play */
...
@@ -292,6 +293,9 @@ struct intf_sys_t
...
@@ -292,6 +293,9 @@ struct intf_sys_t
-
(
id
)
getBookmarks
;
-
(
id
)
getBookmarks
;
-
(
id
)
getEmbeddedList
;
-
(
id
)
getEmbeddedList
;
-
(
id
)
getInteractionList
;
-
(
id
)
getInteractionList
;
-
(
id
)
getMainIntfPgbar
;
-
(
id
)
getMainScrollField
;
-
(
id
)
getControllerWindow
;
-
(
void
)
terminate
;
-
(
void
)
terminate
;
-
(
NSString
*
)
localizedString
:(
char
*
)
psz
;
-
(
NSString
*
)
localizedString
:(
char
*
)
psz
;
-
(
char
*
)
delocalizeString
:(
NSString
*
)
psz
;
-
(
char
*
)
delocalizeString
:(
NSString
*
)
psz
;
...
...
modules/gui/macosx/intf.m
View file @
fa1bf19a
...
@@ -913,6 +913,31 @@ static VLCMain *_o_sharedMainInstance = nil;
...
@@ -913,6 +913,31 @@ static VLCMain *_o_sharedMainInstance = nil;
return
nil
;
return
nil
;
}
}
-
(
id
)
getMainIntfPgbar
{
if
(
o_main_pgbar
)
return
o_main_pgbar
;
msg_Err
(
p_intf
,
"main interface progress bar item wasn't found"
);
return
nil
;
}
-
(
id
)
getMainScrollField
{
if
(
o_scrollfield
)
return
o_scrollfield
;
msg_Err
(
p_intf
,
"main scroll field item wasn't found"
);
return
nil
;
}
-
(
id
)
getControllerWindow
{
if
(
o_window
)
return
o_window
;
return
nil
;
}
-
(
void
)
manage
-
(
void
)
manage
{
{
playlist_t
*
p_playlist
;
playlist_t
*
p_playlist
;
...
...
src/interface/interaction.c
View file @
fa1bf19a
...
@@ -457,6 +457,67 @@ int __intf_UserStringInput( vlc_object_t *p_this,
...
@@ -457,6 +457,67 @@ int __intf_UserStringInput( vlc_object_t *p_this,
return
i_ret
;
return
i_ret
;
}
}
/** Helper function to create a progress-bar in the main interface with a
* single-line description
* \param p_this Parent vlc_object
* \param psz_status Current status
* \param f_position Current position (0.0->100.0)
* \return Dialog id, to give to IntfProgressUpdate
*/
int
__intf_IntfProgress
(
vlc_object_t
*
p_this
,
const
char
*
psz_status
,
float
f_pos
)
{
int
i_ret
;
interaction_dialog_t
*
p_new
=
NULL
;
INTERACT_INIT
(
p_new
);
p_new
->
i_type
=
INTERACT_DIALOG_ONEWAY
;
p_new
->
psz_description
=
strdup
(
psz_status
);
p_new
->
val
.
f_float
=
f_pos
;
p_new
->
i_flags
=
DIALOG_INTF_PROGRESS
;
i_ret
=
intf_Interact
(
p_this
,
p_new
);
return
p_new
->
i_id
;
}
/** Update the progress bar in the main interface
* \param p_this Parent vlc_object
* \param i_id Identifier of the dialog
* \param psz_status New status
* \param f_position New position (0.0->100.0)
* \return nothing
*/
void
__intf_IntfProgressUpdate
(
vlc_object_t
*
p_this
,
int
i_id
,
const
char
*
psz_status
,
float
f_pos
)
{
interaction_t
*
p_interaction
=
intf_InteractionGet
(
p_this
);
interaction_dialog_t
*
p_dialog
;
if
(
!
p_interaction
)
return
;
vlc_mutex_lock
(
&
p_interaction
->
object_lock
);
p_dialog
=
intf_InteractionGetById
(
p_this
,
i_id
);
if
(
!
p_dialog
)
{
vlc_mutex_unlock
(
&
p_interaction
->
object_lock
)
;
return
;
}
if
(
p_dialog
->
psz_description
)
free
(
p_dialog
->
psz_description
);
p_dialog
->
psz_description
=
strdup
(
psz_status
);
p_dialog
->
val
.
f_float
=
f_pos
;
p_dialog
->
i_status
=
UPDATED_DIALOG
;
vlc_mutex_unlock
(
&
p_interaction
->
object_lock
)
;
}
/** Hide an interaction dialog
/** Hide an interaction dialog
* \param p_this the parent vlc object
* \param p_this the parent vlc object
* \param i_id the id of the item to hide
* \param i_id the id of the item to hide
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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