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
59e3f0e2
Commit
59e3f0e2
authored
Feb 09, 2003
by
Eric Petit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified volume functions
parent
7d3c9e87
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
66 deletions
+22
-66
modules/gui/beos/Interface.cpp
modules/gui/beos/Interface.cpp
+2
-2
modules/gui/beos/InterfaceWindow.cpp
modules/gui/beos/InterfaceWindow.cpp
+2
-10
modules/gui/beos/VlcWrapper.cpp
modules/gui/beos/VlcWrapper.cpp
+16
-50
modules/gui/beos/VlcWrapper.h
modules/gui/beos/VlcWrapper.h
+2
-4
No files found.
modules/gui/beos/Interface.cpp
View file @
59e3f0e2
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* intf_beos.cpp: beos interface
* intf_beos.cpp: beos interface
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: Interface.cpp,v 1.
9 2003/02/01 12:01:10 stippi
Exp $
* $Id: Interface.cpp,v 1.
10 2003/02/09 11:51:36 titer
Exp $
*
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Samuel Hocevar <sam@zoy.org>
...
@@ -122,7 +122,7 @@ static void Run( intf_thread_t *p_intf )
...
@@ -122,7 +122,7 @@ static void Run( intf_thread_t *p_intf )
{
{
while
(
!
p_intf
->
b_die
)
while
(
!
p_intf
->
b_die
)
{
{
if
(
p_intf
->
p_sys
->
p_wrapper
->
UpdateInput
AndAOut
()
)
if
(
p_intf
->
p_sys
->
p_wrapper
->
UpdateInput
()
)
{
{
/* Manage the slider */
/* Manage the slider */
p_intf
->
p_sys
->
p_window
->
UpdateInterface
();
p_intf
->
p_sys
->
p_window
->
UpdateInterface
();
...
...
modules/gui/beos/InterfaceWindow.cpp
View file @
59e3f0e2
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* InterfaceWindow.cpp: beos interface
* InterfaceWindow.cpp: beos interface
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: InterfaceWindow.cpp,v 1.2
7 2003/02/03 17:18:48 stippi
Exp $
* $Id: InterfaceWindow.cpp,v 1.2
8 2003/02/09 11:51:36 titer
Exp $
*
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Samuel Hocevar <sam@zoy.org>
...
@@ -870,7 +870,7 @@ void InterfaceWindow::UpdateInterface()
...
@@ -870,7 +870,7 @@ void InterfaceWindow::UpdateInterface()
p_wrapper
->
GetNavCapabilities
(
&
canSkipPrev
,
&
canSkipNext
);
p_wrapper
->
GetNavCapabilities
(
&
canSkipPrev
,
&
canSkipNext
);
p_mediaControl
->
SetSkippable
(
canSkipPrev
,
canSkipNext
);
p_mediaControl
->
SetSkippable
(
canSkipPrev
,
canSkipNext
);
if
(
p_wrapper
->
Has
Audio
()
)
if
(
p_wrapper
->
Has
Input
()
)
{
{
p_mediaControl
->
SetAudioEnabled
(
true
);
p_mediaControl
->
SetAudioEnabled
(
true
);
p_mediaControl
->
SetMuted
(
p_wrapper
->
IsMuted
()
);
p_mediaControl
->
SetMuted
(
p_wrapper
->
IsMuted
()
);
...
@@ -906,14 +906,6 @@ void InterfaceWindow::UpdateInterface()
...
@@ -906,14 +906,6 @@ void InterfaceWindow::UpdateInterface()
}
}
}
}
/* always force the user-specified volume */
/* FIXME : I'm quite sure there is a cleaner way to do this */
int
i_volume
=
p_mediaControl
->
GetVolume
();
if
(
p_wrapper
->
GetVolume
()
!=
i_volume
)
{
p_wrapper
->
SetVolume
(
i_volume
);
}
// strangly, someone is calling this function even after the object has been destructed!
// strangly, someone is calling this function even after the object has been destructed!
// even more strangly, this workarround seems to work
// even more strangly, this workarround seems to work
if
(
fMessagesWindow
)
if
(
fMessagesWindow
)
...
...
modules/gui/beos/VlcWrapper.cpp
View file @
59e3f0e2
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* VlcWrapper.cpp: BeOS plugin for vlc (derived from MacOS X port)
* VlcWrapper.cpp: BeOS plugin for vlc (derived from MacOS X port)
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* Copyright (C) 2001 VideoLAN
* $Id: VlcWrapper.cpp,v 1.2
4 2003/02/01 12:01:11 stippi
Exp $
* $Id: VlcWrapper.cpp,v 1.2
5 2003/02/09 11:51:36 titer
Exp $
*
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
* Jon Lech Johansen <jon-vl@nanocrew.net>
...
@@ -45,7 +45,6 @@ VlcWrapper::VlcWrapper( intf_thread_t *p_interface )
...
@@ -45,7 +45,6 @@ VlcWrapper::VlcWrapper( intf_thread_t *p_interface )
{
{
p_intf
=
p_interface
;
p_intf
=
p_interface
;
p_input
=
NULL
;
p_input
=
NULL
;
p_aout
=
NULL
;
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
FIND_ANYWHERE
);
}
}
...
@@ -61,26 +60,17 @@ VlcWrapper::~VlcWrapper()
...
@@ -61,26 +60,17 @@ VlcWrapper::~VlcWrapper()
{
{
vlc_object_release
(
p_playlist
);
vlc_object_release
(
p_playlist
);
}
}
if
(
p_aout
)
{
vlc_object_release
(
p_aout
);
}
}
}
/* UpdateInput
AndAOut: updates p_input and p_aout, returns true if the
/* UpdateInput
: updates p_input, returns true if the interface needs to
interface needs to
be updated */
be updated */
bool
VlcWrapper
::
UpdateInput
AndAOut
()
bool
VlcWrapper
::
UpdateInput
()
{
{
if
(
p_input
==
NULL
)
if
(
p_input
==
NULL
)
{
{
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_INPUT
,
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
FIND_ANYWHERE
);
}
}
if
(
p_aout
==
NULL
)
{
p_aout
=
(
aout_instance_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
}
if
(
p_input
!=
NULL
)
if
(
p_input
!=
NULL
)
{
{
...
@@ -88,12 +78,6 @@ bool VlcWrapper::UpdateInputAndAOut()
...
@@ -88,12 +78,6 @@ bool VlcWrapper::UpdateInputAndAOut()
{
{
vlc_object_release
(
p_input
);
vlc_object_release
(
p_input
);
p_input
=
NULL
;
p_input
=
NULL
;
if
(
p_aout
)
{
vlc_object_release
(
p_aout
);
p_aout
=
NULL
;
}
}
}
return
true
;
return
true
;
}
}
...
@@ -757,51 +741,33 @@ VlcWrapper::PlaylistSetPlaying( int index ) const
...
@@ -757,51 +741,33 @@ VlcWrapper::PlaylistSetPlaying( int index ) const
* audio *
* audio *
*********/
*********/
bool
VlcWrapper
::
HasAudio
()
{
return
(
p_aout
!=
NULL
);
}
unsigned
short
VlcWrapper
::
GetVolume
()
unsigned
short
VlcWrapper
::
GetVolume
()
{
{
if
(
p_aout
!=
NULL
)
{
unsigned
short
i_volume
;
unsigned
short
i_volume
;
aout_VolumeGet
(
p_aout
,
(
audio_volume_t
*
)
&
i_volume
);
aout_VolumeGet
(
p_intf
,
(
audio_volume_t
*
)
&
i_volume
);
return
i_volume
;
return
i_volume
;
}
return
0
;
}
}
void
VlcWrapper
::
SetVolume
(
int
value
)
void
VlcWrapper
::
SetVolume
(
int
value
)
{
{
if
(
p_aout
!=
NULL
)
{
if
(
p_intf
->
p_sys
->
b_mute
)
if
(
p_intf
->
p_sys
->
b_mute
)
{
{
p_intf
->
p_sys
->
b_mute
=
0
;
p_intf
->
p_sys
->
b_mute
=
0
;
}
}
aout_VolumeSet
(
p_aout
,
value
);
aout_VolumeSet
(
p_intf
,
value
);
}
}
}
void
VlcWrapper
::
VolumeMute
()
void
VlcWrapper
::
VolumeMute
()
{
{
if
(
p_aout
!=
NULL
)
aout_VolumeGet
(
p_intf
,
&
p_intf
->
p_sys
->
i_saved_volume
);
{
aout_VolumeMute
(
p_intf
,
NULL
);
aout_VolumeGet
(
p_aout
,
&
p_intf
->
p_sys
->
i_saved_volume
);
aout_VolumeMute
(
p_aout
,
NULL
);
p_intf
->
p_sys
->
b_mute
=
1
;
p_intf
->
p_sys
->
b_mute
=
1
;
}
}
}
void
VlcWrapper
::
VolumeRestore
()
void
VlcWrapper
::
VolumeRestore
()
{
{
if
(
p_aout
!=
NULL
)
aout_VolumeSet
(
p_intf
,
p_intf
->
p_sys
->
i_saved_volume
);
{
aout_VolumeSet
(
p_aout
,
p_intf
->
p_sys
->
i_saved_volume
);
p_intf
->
p_sys
->
b_mute
=
0
;
p_intf
->
p_sys
->
b_mute
=
0
;
}
}
}
bool
VlcWrapper
::
IsMuted
()
bool
VlcWrapper
::
IsMuted
()
...
...
modules/gui/beos/VlcWrapper.h
View file @
59e3f0e2
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* VlcWrapper.h: BeOS plugin for vlc (derived from MacOS X port)
* VlcWrapper.h: BeOS plugin for vlc (derived from MacOS X port)
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* Copyright (C) 2001 VideoLAN
* $Id: VlcWrapper.h,v 1.
19 2003/02/01 12:01:11 stippi
Exp $
* $Id: VlcWrapper.h,v 1.
20 2003/02/09 11:51:36 titer
Exp $
*
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
* Jon Lech Johansen <jon-vl@nanocrew.net>
...
@@ -62,7 +62,7 @@ public:
...
@@ -62,7 +62,7 @@ public:
VlcWrapper
(
intf_thread_t
*
p_intf
);
VlcWrapper
(
intf_thread_t
*
p_intf
);
~
VlcWrapper
();
~
VlcWrapper
();
bool
UpdateInput
AndAOut
();
bool
UpdateInput
();
/* Input */
/* Input */
bool
HasInput
();
bool
HasInput
();
...
@@ -116,7 +116,6 @@ public:
...
@@ -116,7 +116,6 @@ public:
void
PlaylistSetPlaying
(
int
index
)
const
;
void
PlaylistSetPlaying
(
int
index
)
const
;
/* Audio */
/* Audio */
bool
HasAudio
();
unsigned
short
GetVolume
();
unsigned
short
GetVolume
();
void
SetVolume
(
int
value
);
void
SetVolume
(
int
value
);
void
VolumeMute
();
void
VolumeMute
();
...
@@ -146,5 +145,4 @@ private:
...
@@ -146,5 +145,4 @@ private:
intf_thread_t
*
p_intf
;
intf_thread_t
*
p_intf
;
input_thread_t
*
p_input
;
input_thread_t
*
p_input
;
playlist_t
*
p_playlist
;
playlist_t
*
p_playlist
;
aout_instance_t
*
p_aout
;
};
};
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