Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
e03e1df6
Commit
e03e1df6
authored
May 16, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/gui/wxwindows/*: some cleanup + disable seekbar if stream is not seekable.
parent
37173af1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
64 deletions
+47
-64
modules/gui/wxwindows/interface.cpp
modules/gui/wxwindows/interface.cpp
+25
-17
modules/gui/wxwindows/timer.cpp
modules/gui/wxwindows/timer.cpp
+21
-46
modules/gui/wxwindows/wxwindows.h
modules/gui/wxwindows/wxwindows.h
+1
-1
No files found.
modules/gui/wxwindows/interface.cpp
View file @
e03e1df6
...
...
@@ -80,7 +80,7 @@ public:
wxPoint
=
wxDefaultPosition
,
wxSize
=
wxSize
(
20
,
-
1
)
);
virtual
~
wxVolCtrl
()
{};
void
Change
(
int
i_volume
);
void
UpdateVolume
(
);
void
OnChange
(
wxMouseEvent
&
event
);
...
...
@@ -297,6 +297,12 @@ Interface::~Interface()
delete
timer
;
}
void
Interface
::
Update
()
{
/* Misc updates */
((
wxVolCtrl
*
)
volctrl
)
->
UpdateVolume
();
}
void
Interface
::
OnControlEvent
(
wxCommandEvent
&
event
)
{
switch
(
event
.
GetId
()
)
...
...
@@ -414,10 +420,10 @@ END_EVENT_TABLE()
VLCVolCtrl
::
VLCVolCtrl
(
intf_thread_t
*
p_intf
,
wxWindow
*
p_parent
,
wxGauge
**
pp_volctrl
)
:
wxControl
(
p_parent
,
-
1
,
wxDefaultPosition
,
wxSize
(
64
,
16
),
wxBORDER_NONE
)
:
wxControl
(
p_parent
,
-
1
,
wxDefaultPosition
,
wxSize
(
64
,
16
),
wxBORDER_NONE
)
{
*
pp_volctrl
=
new
wxVolCtrl
(
p_intf
,
this
,
-
1
,
wxPoint
(
18
,
0
),
wxSize
(
44
,
16
)
);
*
pp_volctrl
=
new
wxVolCtrl
(
p_intf
,
this
,
-
1
,
wxPoint
(
18
,
0
),
wxSize
(
44
,
16
)
);
}
void
VLCVolCtrl
::
OnPaint
(
wxPaintEvent
&
evt
)
...
...
@@ -1390,20 +1396,14 @@ bool DragAndDrop::OnDropFiles( wxCoord, wxCoord,
#endif
/*****************************************************************************
* Definition of
wx
VolCtrl class.
* Definition of VolCtrl class.
*****************************************************************************/
wxVolCtrl
::
wxVolCtrl
(
intf_thread_t
*
_p_intf
,
wxWindow
*
parent
,
wxWindowID
id
,
wxPoint
point
,
wxSize
size
)
:
wxGauge
(
parent
,
id
,
200
,
point
,
size
,
wxGA_HORIZONTAL
|
wxGA_SMOOTH
)
{
p_intf
=
_p_intf
;
audio_volume_t
i_volume
;
aout_VolumeGet
(
p_intf
,
&
i_volume
);
i_volume
=
i_volume
*
200
*
2
/
AOUT_VOLUME_MAX
;
SetValue
(
i_volume
);
SetToolTip
(
wxString
::
Format
((
wxString
)
wxU
(
_
(
"Volume"
))
+
wxT
(
" %d"
),
i_volume
)
);
UpdateVolume
();
}
void
wxVolCtrl
::
OnChange
(
wxMouseEvent
&
event
)
...
...
@@ -1411,13 +1411,21 @@ void wxVolCtrl::OnChange( wxMouseEvent& event )
if
(
!
event
.
LeftDown
()
&&
!
event
.
LeftIsDown
()
)
return
;
int
i_volume
=
event
.
GetX
()
*
200
/
GetClientSize
().
GetWidth
();
Change
(
i_volume
);
aout_VolumeSet
(
p_intf
,
i_volume
*
AOUT_VOLUME_MAX
/
200
/
2
);
UpdateVolume
();
}
void
wxVolCtrl
::
Change
(
int
i_volume
)
void
wxVolCtrl
::
UpdateVolume
(
)
{
aout_VolumeSet
(
p_intf
,
i_volume
*
AOUT_VOLUME_MAX
/
200
/
2
);
SetValue
(
i_volume
);
audio_volume_t
i_volume
;
aout_VolumeGet
(
p_intf
,
&
i_volume
);
int
i_gauge_volume
=
i_volume
*
200
*
2
/
AOUT_VOLUME_MAX
;
if
(
i_gauge_volume
==
GetValue
()
)
return
;
msg_Err
(
p_intf
,
"volume: %i"
,
i_gauge_volume
/
2
);
SetValue
(
i_gauge_volume
);
SetToolTip
(
wxString
::
Format
((
wxString
)
wxU
(
_
(
"Volume"
))
+
wxT
(
" %d"
),
i_
volume
)
);
i_
gauge_volume
/
2
)
);
}
modules/gui/wxwindows/timer.cpp
View file @
e03e1df6
...
...
@@ -104,14 +104,17 @@ void Timer::Notify()
/* Show slider */
if
(
p_intf
->
p_sys
->
p_input
)
{
//if( p_intf->p_sys->p_input->stream.b_seekable )
{
p_main_interface
->
slider
->
SetValue
(
0
);
p_main_interface
->
slider_frame
->
Show
();
p_main_interface
->
frame_sizer
->
Show
(
p_main_interface
->
slider_frame
);
p_main_interface
->
frame_sizer
->
Layout
();
p_main_interface
->
frame_sizer
->
Fit
(
p_main_interface
);
}
if
(
p_intf
->
p_sys
->
p_input
->
stream
.
b_seekable
)
p_main_interface
->
slider
->
Enable
();
else
p_main_interface
->
slider
->
Disable
();
p_main_interface
->
statusbar
->
SetStatusText
(
wxU
(
p_intf
->
p_sys
->
p_input
->
psz_source
),
2
);
...
...
@@ -119,15 +122,6 @@ 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
*
2
/
AOUT_VOLUME_MAX
);
p_main_interface
->
volctrl
->
SetToolTip
(
wxString
::
Format
((
wxString
)
wxU
(
_
(
"Volume"
))
+
wxT
(
" %d"
),
i_volume
*
200
/
AOUT_VOLUME_MAX
)
);
/* control buttons for free pace streams */
b_pace_control
=
p_intf
->
p_sys
->
p_input
->
stream
.
b_pace_control
;
}
...
...
@@ -135,8 +129,6 @@ void Timer::Notify()
else
if
(
p_intf
->
p_sys
->
p_input
->
b_dead
)
{
/* Hide slider */
//if( p_intf->p_sys->p_input->stream.b_seekable )
{
p_main_interface
->
slider_frame
->
Hide
();
p_main_interface
->
frame_sizer
->
Hide
(
p_main_interface
->
slider_frame
);
...
...
@@ -145,7 +137,6 @@ void Timer::Notify()
p_main_interface
->
TogglePlayButton
(
PAUSE_S
);
i_old_playing_status
=
PAUSE_S
;
}
p_main_interface
->
statusbar
->
SetStatusText
(
wxT
(
""
),
0
);
p_main_interface
->
statusbar
->
SetStatusText
(
wxT
(
""
),
2
);
...
...
@@ -166,17 +157,6 @@ void Timer::Notify()
{
/* New input or stream map change */
p_intf
->
p_sys
->
b_playing
=
1
;
#if 0
if( p_input->stream.b_changed )
{
wxModeManage( p_intf );
wxSetupMenus( p_intf );
p_intf->p_sys->b_playing = 1;
p_main_interface->TogglePlayButton( PLAYING_S );
i_old_playing_status = PLAYING_S;
}
#endif
/* Manage the slider */
if
(
p_input
->
stream
.
b_seekable
&&
p_intf
->
p_sys
->
b_playing
)
...
...
@@ -214,14 +194,9 @@ void Timer::Notify()
}
}
}
/* Take care of the volume */
audio_volume_t
i_volume
;
aout_VolumeGet
(
p_intf
,
&
i_volume
);
p_main_interface
->
volctrl
->
SetValue
(
i_volume
*
200
*
2
/
AOUT_VOLUME_MAX
);
p_main_interface
->
volctrl
->
SetToolTip
(
wxString
::
Format
((
wxString
)
wxU
(
_
(
"Volume"
))
+
wxT
(
" %d"
),
i_volume
*
200
/
AOUT_VOLUME_MAX
)
);
/* Take care of the volume, etc... */
p_main_interface
->
Update
();
/* Manage Playing status */
if
(
i_old_playing_status
!=
p_input
->
stream
.
control
.
i_status
)
...
...
modules/gui/wxwindows/wxwindows.h
View file @
e03e1df6
...
...
@@ -190,6 +190,7 @@ public:
Interface
(
intf_thread_t
*
p_intf
);
virtual
~
Interface
();
void
TogglePlayButton
(
int
i_playing_status
);
void
Update
();
wxBoxSizer
*
frame_sizer
;
wxStatusBar
*
statusbar
;
...
...
@@ -823,7 +824,6 @@ private:
};
#if wxUSE_DRAG_AND_DROP
/* Drag and Drop class */
class
DragAndDrop
:
public
wxFileDropTarget
...
...
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