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
e3684cac
Commit
e3684cac
authored
Jun 12, 2003
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/gui/wxwindows/*: added a volume control.
parent
c15d6f5e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
8 deletions
+73
-8
modules/gui/wxwindows/interface.cpp
modules/gui/wxwindows/interface.cpp
+61
-6
modules/gui/wxwindows/timer.cpp
modules/gui/wxwindows/timer.cpp
+8
-1
modules/gui/wxwindows/wxwindows.h
modules/gui/wxwindows/wxwindows.h
+4
-1
No files found.
modules/gui/wxwindows/interface.cpp
View file @
e3684cac
...
...
@@ -2,7 +2,7 @@
* interface.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: interface.cpp,v 1.3
7 2003/06/05 21:22:27
gbazin Exp $
* $Id: interface.cpp,v 1.3
8 2003/06/12 21:28:39
gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
...
...
@@ -30,6 +30,7 @@
#include <stdio.h>
#include <vlc/vlc.h>
#include <vlc/aout.h>
#ifdef WIN32
/* mingw32 hack */
#undef Yield
...
...
@@ -92,6 +93,28 @@ private:
};
class
wxVolCtrl
:
public
wxGauge
{
public:
/* Constructor */
wxVolCtrl
(
intf_thread_t
*
_p_intf
,
wxWindow
*
parent
,
wxWindowID
id
);
virtual
~
wxVolCtrl
()
{};
void
Change
(
int
i_volume
);
void
OnChange
(
wxMouseEvent
&
event
);
private:
intf_thread_t
*
p_intf
;
DECLARE_EVENT_TABLE
();
};
BEGIN_EVENT_TABLE
(
wxVolCtrl
,
wxWindow
)
/* Mouse events */
EVT_LEFT_DOWN
(
wxVolCtrl
::
OnChange
)
END_EVENT_TABLE
()
/*****************************************************************************
* Event Table.
*****************************************************************************/
...
...
@@ -219,6 +242,7 @@ Interface::~Interface()
/* Clean up */
if
(
p_open_dialog
)
delete
p_open_dialog
;
if
(
p_prefs_dialog
)
p_prefs_dialog
->
Destroy
();
if
(
p_intf
->
p_sys
->
p_icon
)
delete
p_intf
->
p_sys
->
p_icon
;
}
/*****************************************************************************
...
...
@@ -381,9 +405,11 @@ void Interface::CreateOurToolBar()
void
Interface
::
CreateOurSlider
()
{
/* Create a new frame containing the slider */
/* Create a new frame
and sizer
containing the slider */
slider_frame
=
new
wxPanel
(
this
,
-
1
,
wxDefaultPosition
,
wxDefaultSize
);
slider_frame
->
SetAutoLayout
(
TRUE
);
wxBoxSizer
*
frame_sizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
/* Create static box to surround the slider */
slider_box
=
new
wxStaticBox
(
slider_frame
,
-
1
,
wxT
(
""
)
);
...
...
@@ -391,15 +417,22 @@ void Interface::CreateOurSlider()
/* Create sizer for slider frame */
wxStaticBoxSizer
*
slider_sizer
=
new
wxStaticBoxSizer
(
slider_box
,
wxHORIZONTAL
);
slider_frame
->
SetSizer
(
slider_sizer
);
slider_sizer
->
SetMinSize
(
-
1
,
50
);
/* Create slider */
slider
=
new
wxSlider
(
slider_frame
,
SliderScroll_Event
,
0
,
0
,
SLIDER_MAX_POS
,
wxDefaultPosition
,
wxDefaultSize
);
slider_sizer
->
Add
(
slider
,
1
,
wxGROW
|
wxALL
,
5
);
slider_sizer
->
Layout
();
slider_sizer
->
SetSizeHints
(
slider_frame
);
slider_sizer
->
Add
(
slider
,
1
,
wxEXPAND
|
wxALL
,
5
);
volctrl
=
new
wxVolCtrl
(
p_intf
,
slider_frame
,
-
1
);
/* Add everything to the frame */
frame_sizer
->
Add
(
slider_sizer
,
1
,
wxEXPAND
|
wxBOTTOM
,
5
);
frame_sizer
->
Add
(
volctrl
,
0
,
wxEXPAND
|
wxALL
,
5
);
slider_frame
->
SetSizer
(
frame_sizer
);
frame_sizer
->
Layout
();
frame_sizer
->
SetSizeHints
(
slider_frame
);
/* Hide the slider by default */
slider_frame
->
Hide
();
...
...
@@ -851,3 +884,25 @@ bool DragAndDrop::OnDropFiles( wxCoord, wxCoord,
return
TRUE
;
}
#endif
/*****************************************************************************
* Definition of wxVolCtrl class.
*****************************************************************************/
wxVolCtrl
::
wxVolCtrl
(
intf_thread_t
*
_p_intf
,
wxWindow
*
parent
,
wxWindowID
id
)
:
wxGauge
(
parent
,
id
,
200
,
wxDefaultPosition
,
wxDefaultSize
,
wxGA_VERTICAL
)
{
p_intf
=
_p_intf
;
}
void
wxVolCtrl
::
OnChange
(
wxMouseEvent
&
event
)
{
int
i_volume
=
(
GetRect
().
height
-
event
.
GetY
())
*
200
/
GetRect
().
height
;
Change
(
i_volume
);
}
void
wxVolCtrl
::
Change
(
int
i_volume
)
{
aout_VolumeSet
(
p_intf
,
i_volume
*
AOUT_VOLUME_MAX
/
200
);
SetValue
(
i_volume
);
SetToolTip
(
wxString
::
Format
(
wxU
(
_
(
"Volume"
))
+
wxT
(
" %d"
),
i_volume
)
);
}
modules/gui/wxwindows/timer.cpp
View file @
e3684cac
...
...
@@ -2,7 +2,7 @@
* timer.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: timer.cpp,v 1.2
2 2003/06/05 21:22:28
gbazin Exp $
* $Id: timer.cpp,v 1.2
3 2003/06/12 21:28:39
gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
...
...
@@ -30,6 +30,7 @@
#include <stdio.h>
#include <vlc/vlc.h>
#include <vlc/aout.h>
#ifdef WIN32
/* mingw32 hack */
#undef Yield
...
...
@@ -143,6 +144,12 @@ void Timer::Notify()
p_main_interface
->
TogglePlayButton
(
PLAYING_S
);
i_old_playing_status
=
PLAYING_S
;
/* Take care of the volume */
audio_volume_t
i_volume
;
aout_VolumeGet
(
p_intf
,
&
i_volume
);
p_main_interface
->
volctrl
->
SetValue
(
i_volume
*
200
/
AOUT_VOLUME_MAX
);
}
/* control buttons for free pace streams */
...
...
modules/gui/wxwindows/wxwindows.h
View file @
e3684cac
...
...
@@ -2,7 +2,7 @@
* wxwindows.h: private wxWindows interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: wxwindows.h,v 1.3
5 2003/06/05 21:22:28
gbazin Exp $
* $Id: wxwindows.h,v 1.3
6 2003/06/12 21:28:39
gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
...
...
@@ -27,6 +27,7 @@
#include <wx/spinctrl.h>
#include <wx/dnd.h>
#include <wx/treectrl.h>
#include <wx/gauge.h>
class
Playlist
;
class
Messages
;
...
...
@@ -123,6 +124,8 @@ public:
wxWindow
*
slider_frame
;
wxStaticBox
*
slider_box
;
wxGauge
*
volctrl
;
/* So we don't recreate the open dialog box each time
* (and keep the last settings) */
OpenDialog
*
p_open_dialog
;
...
...
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