Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
511888ee
Commit
511888ee
authored
Feb 09, 2014
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show OSD when drag-n-dropping subtitles
And when it was successfully added Close #8395
parent
da84acd0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
16 deletions
+31
-16
include/vlc_input.h
include/vlc_input.h
+23
-8
modules/gui/macosx/CoreInteraction.m
modules/gui/macosx/CoreInteraction.m
+1
-1
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+1
-1
modules/gui/macosx/playlist.m
modules/gui/macosx/playlist.m
+1
-1
modules/gui/qt4/dialogs_provider.cpp
modules/gui/qt4/dialogs_provider.cpp
+2
-2
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+2
-2
modules/gui/skins2/src/top_window.cpp
modules/gui/skins2/src/top_window.cpp
+1
-1
No files found.
include/vlc_input.h
View file @
511888ee
...
...
@@ -36,6 +36,7 @@
#include <vlc_epg.h>
#include <vlc_events.h>
#include <vlc_input_item.h>
#include <vlc_vout_osd.h>
#include <string.h>
...
...
@@ -526,14 +527,6 @@ static inline input_state_e input_GetState( input_thread_t * p_input )
input_Control
(
p_input
,
INPUT_GET_STATE
,
&
state
);
return
state
;
}
/**
* It will add a new subtitle source to the input.
* Provided for convenience.
*/
static
inline
int
input_AddSubtitle
(
input_thread_t
*
p_input
,
const
char
*
psz_url
,
bool
b_check_extension
)
{
return
input_Control
(
p_input
,
INPUT_ADD_SUBTITLE
,
psz_url
,
b_check_extension
);
}
/**
* Return one of the video output (if any). If possible, you should use
...
...
@@ -558,6 +551,28 @@ static inline vout_thread_t *input_GetVout( input_thread_t *p_input )
return
p_vout
;
}
/**
* It will add a new subtitle source to the input.
* Provided for convenience.
*/
static
inline
int
input_AddSubtitleOSD
(
input_thread_t
*
p_input
,
const
char
*
psz_url
,
bool
b_check_extension
,
bool
b_osd
)
{
int
i_result
=
input_Control
(
p_input
,
INPUT_ADD_SUBTITLE
,
psz_url
,
b_check_extension
);
if
(
i_result
!=
VLC_SUCCESS
||
!
b_osd
)
return
i_result
;
vout_thread_t
*
p_vout
=
input_GetVout
(
p_input
);
if
(
p_vout
)
{
vout_OSDMessage
(
p_vout
,
SPU_DEFAULT_CHANNEL
,
_
(
"Subtitle track added"
)
);
vlc_object_release
(
(
vlc_object_t
*
)
p_vout
);
}
return
i_result
;
}
#define input_AddSubtitle(a, b, c) input_AddSubtitleOSD(a, b, c, false)
/**
* Return the audio output (if any) associated with an input.
* @param p_input an input thread
...
...
modules/gui/macosx/CoreInteraction.m
View file @
511888ee
...
...
@@ -576,7 +576,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
BOOL
b_returned
=
NO
;
if
(
count
==
1
&&
p_input
)
{
b_returned
=
input_AddSubtitle
(
p_input
,
[[
o_values
objectAtIndex
:
0
]
UTF8String
]
,
true
);
b_returned
=
input_AddSubtitle
OSD
(
p_input
,
[[
o_values
objectAtIndex
:
0
]
UTF8String
],
true
,
true
);
vlc_object_release
(
p_input
);
if
(
!
b_returned
)
return
YES
;
...
...
modules/gui/macosx/intf.m
View file @
511888ee
...
...
@@ -1046,7 +1046,7 @@ static VLCMain *_o_sharedMainInstance = nil;
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCIntf
);
if
(
p_input
)
{
BOOL
b_returned
=
NO
;
b_returned
=
input_AddSubtitle
(
p_input
,
[[
o_names
objectAtIndex
:
0
]
UTF8String
]
,
true
);
b_returned
=
input_AddSubtitle
OSD
(
p_input
,
[[
o_names
objectAtIndex
:
0
]
UTF8String
],
true
,
true
);
vlc_object_release
(
p_input
);
if
(
!
b_returned
)
{
free
(
psz_uri
);
...
...
modules/gui/macosx/playlist.m
View file @
511888ee
...
...
@@ -1597,7 +1597,7 @@
BOOL
b_returned
=
NO
;
if
(
count
==
1
&&
p_input
)
{
b_returned
=
input_AddSubtitle
(
p_input
,
vlc_path2uri
([[
o_values
objectAtIndex
:
0
]
UTF8String
],
NULL
)
,
true
);
b_returned
=
input_AddSubtitle
OSD
(
p_input
,
vlc_path2uri
([[
o_values
objectAtIndex
:
0
]
UTF8String
],
NULL
),
true
,
true
);
vlc_object_release
(
p_input
);
if
(
!
b_returned
)
return
YES
;
...
...
modules/gui/qt4/dialogs_provider.cpp
View file @
511888ee
...
...
@@ -781,8 +781,8 @@ void DialogsProvider::loadSubtitlesFile()
free
(
path2
);
foreach
(
const
QString
&
qsFile
,
qsl
)
{
if
(
input_AddSubtitle
(
p_input
,
qtu
(
toNativeSeparators
(
qsFile
)
),
true
)
)
if
(
input_AddSubtitle
OSD
(
p_input
,
qtu
(
toNativeSeparators
(
qsFile
)
),
true
,
true
)
)
msg_Warn
(
p_intf
,
"unable to load subtitles from '%s'"
,
qtu
(
qsFile
)
);
}
...
...
modules/gui/qt4/main_interface.cpp
View file @
511888ee
...
...
@@ -1276,9 +1276,9 @@ void MainInterface::dropEventPlay( QDropEvent *event, bool b_play, bool b_playli
/* D&D of a subtitles file, add it on the fly */
if
(
mimeData
->
urls
().
count
()
==
1
&&
THEMIM
->
getIM
()
->
hasInput
()
)
{
if
(
!
input_AddSubtitle
(
THEMIM
->
getInput
(),
if
(
!
input_AddSubtitle
OSD
(
THEMIM
->
getInput
(),
qtu
(
toNativeSeparators
(
mimeData
->
urls
()[
0
].
toLocalFile
()
)
),
true
)
)
true
,
true
)
)
{
event
->
accept
();
return
;
...
...
modules/gui/skins2/src/top_window.cpp
View file @
511888ee
...
...
@@ -288,7 +288,7 @@ void TopWindow::processEvent( EvtDragDrop &rEvtDragDrop )
char
*
psz_file
=
make_path
(
it
->
c_str
()
);
if
(
psz_file
)
{
is_subtitle
=
!
input_AddSubtitle
(
pInput
,
psz_fil
e
,
true
);
is_subtitle
=
!
input_AddSubtitle
OSD
(
pInput
,
psz_file
,
tru
e
,
true
);
free
(
psz_file
);
}
}
...
...
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