Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
0aebd656
Commit
0aebd656
authored
Mar 24, 2008
by
Dylan
Committed by
Jean-Baptiste Kempf
Mar 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Hotkey to cycle through audio devices
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
83a70bc8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
1 deletion
+56
-1
include/vlc_keys.h
include/vlc_keys.h
+2
-1
modules/control/hotkeys.c
modules/control/hotkeys.c
+48
-0
src/libvlc-module.c
src/libvlc-module.c
+6
-0
No files found.
include/vlc_keys.h
View file @
0aebd656
...
...
@@ -334,5 +334,6 @@ static inline int StringToKey( char *psz_key )
#define ACTIONID_ZOOM_HALF 93
#define ACTIONID_ZOOM_ORIGINAL 94
#define ACTIONID_ZOOM_DOUBLE 95
/* Cycle Through Audio Devices */
#define ACTIONID_AUDIODEVICE_CYCLE 96
#endif
modules/control/hotkeys.c
View file @
0aebd656
...
...
@@ -504,6 +504,54 @@ static void Run( intf_thread_t *p_intf )
_
(
"Audio track: %s"
),
list2
.
p_list
->
p_values
[
i
].
psz_string
);
}
else
if
(
i_action
==
ACTIONID_AUDIODEVICE_CYCLE
&&
p_vout
)
{
vlc_value_t
val
,
list
,
list2
;
int
i_count
,
i
;
aout_instance_t
*
p_aout
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
var_Get
(
p_aout
,
"audio-device"
,
&
val
);
var_Change
(
p_aout
,
"audio-device"
,
VLC_VAR_GETCHOICES
,
&
list
,
&
list2
);
i_count
=
list
.
p_list
->
i_count
;
if
(
i_count
<=
1
)
{
continue
;
}
for
(
i
=
1
;
i
<
i_count
;
i
)
{
if
(
val
.
i_int
==
list
.
p_list
->
p_values
[
i
].
i_int
)
{
break
;
}
}
if
(
i
==
i_count
)
{
msg_Warn
(
p_aout
,
"invalid current audio device, selecting 0"
);
var_Set
(
p_aout
,
"audio-device"
,
list
.
p_list
->
p_values
[
1
]
);
i
=
1
;
}
else
if
(
i
==
i_count
-
1
)
{
var_Set
(
p_aout
,
"audio-device"
,
list
.
p_list
->
p_values
[
0
]
);
i
=
0
;
}
else
{
var_Set
(
p_aout
,
"audio-device"
,
list
.
p_list
->
p_values
[
i1
]
);
i
;
}
vout_OSDMessage
(
VLC_OBJECT
(
p_input
),
DEFAULT_CHAN
,
_
(
"Audio Device: %s"
),
list2
.
p_list
->
p_values
[
i
].
psz_string
);
}
else
if
(
i_action
==
ACTIONID_SUBTITLE_TRACK
)
{
vlc_value_t
val
,
list
,
list2
;
...
...
src/libvlc-module.c
View file @
0aebd656
...
...
@@ -1356,6 +1356,8 @@ static const char *ppsz_pltree_descriptions[] = { N_("Default"), N_("Always"), N
#define MENU_SELECT_KEY_LONGTEXT N_( \
"Selecting current widget performs the associated action.")
#define AUDI_DEVICE_CYCLE_KEY_TEXT N_("Cycle through audio devices")
#define AUDI_DEVICE_CYCLE_KEY_LONGTEXT N_("Cycle through available audio devices")
const
char
vlc_usage
[]
=
N_
(
"Usage: %s [options] [stream] ..."
"
\n
You can specify multiple streams on the commandline. They will be enqueued in the playlist."
...
...
@@ -2192,6 +2194,7 @@ vlc_module_begin();
# define KEY_MENU_UP KEY_MODIFIER_ALT|KEY_MODIFIER_SHIFT|KEY_UP
# define KEY_MENU_DOWN KEY_MODIFIER_ALT|KEY_MODIFIER_SHIFT|KEY_DOWN
# define KEY_MENU_SELECT KEY_MODIFIER_ALT|KEY_MODIFIER_SHIFT|KEY_ENTER
# define KEY_AUDIODEVICE_CYCLE KEY_MODIFIER_ALT|'a'
#endif
add_key
(
"key-toggle-fullscreen"
,
KEY_TOGGLE_FULLSCREEN
,
NULL
,
TOGGLE_FULLSCREEN_KEY_TEXT
,
...
...
@@ -2272,6 +2275,8 @@ vlc_module_begin();
AUDIODELAY_DOWN_KEY_TEXT
,
AUDIODELAY_DOWN_KEY_LONGTEXT
,
VLC_TRUE
);
add_key
(
"key-audio-track"
,
KEY_AUDIO_TRACK
,
NULL
,
AUDIO_TRACK_KEY_TEXT
,
AUDIO_TRACK_KEY_LONGTEXT
,
VLC_FALSE
);
add_key
(
"key-audiodevice-cycle"
,
KEY_STOP
,
NULL
,
AUDI_DEVICE_CYCLE_KEY_TEXT
,
AUDI_DEVICE_CYCLE_KEY_LONGTEXT
,
VLC_FALSE
);
add_key
(
"key-subtitle-track"
,
KEY_SUBTITLE_TRACK
,
NULL
,
SUBTITLE_TRACK_KEY_TEXT
,
SUBTITLE_TRACK_KEY_LONGTEXT
,
VLC_FALSE
);
add_key
(
"key-aspect-ratio"
,
KEY_ASPECT_RATIO
,
NULL
,
...
...
@@ -2605,6 +2610,7 @@ const struct hotkey libvlc_hotkeys[] =
{
"key-menu-up"
,
ACTIONID_MENU_UP
,
0
,
0
,
0
,
0
},
{
"key-menu-down"
,
ACTIONID_MENU_DOWN
,
0
,
0
,
0
,
0
},
{
"key-menu-select"
,
ACTIONID_MENU_SELECT
,
0
,
0
,
0
,
0
},
{
"key-audiodevice-cycle"
,
ACTIONID_AUDIODEVICE_CYCLE
,
0
,
0
,
0
,
0
},
{
NULL
,
0
,
0
,
0
,
0
,
0
}
};
...
...
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