: hwndMain(0), hwndCB(0), hwndTB(0), hwndSlider(0), hwndLabel(0),
hwndVol(0), hwndSB(0),
fileinfo(0), messages(0), preferences(0), playlist(0),
- timer(0), open(0), video(0)
+ timer(0), open(0), video(0), b_volume_hold(0)
{
}
if( LOWORD(wp) == SB_THUMBPOSITION || LOWORD(wp) == SB_ENDSCROLL )
{
- Change( 200 - (int)dwPos );
+ VolumeChange( 200 - (int)dwPos );
+ b_volume_hold = VLC_FALSE;
+ }
+ else
+ {
+ b_volume_hold = VLC_TRUE;
}
}
-void Interface::Change( int i_volume )
+void Interface::VolumeChange( int i_volume )
{
aout_VolumeSet( p_intf, i_volume * AOUT_VOLUME_MAX / 200 / 2 );
-#if 0
- SetToolTip( wxString::Format((wxString)wxU(_("Volume")) + wxT(" %d"),
- i_volume ) );
-#endif
+}
+
+void Interface::VolumeUpdate()
+{
+ audio_volume_t i_volume;
+
+ if( b_volume_hold ) return;
+
+ aout_VolumeGet( p_intf, &i_volume );
+
+ int i_volume_ctrl = 200 - i_volume * 200 * 2 / AOUT_VOLUME_MAX;
+
+ DWORD dwPos = SendMessage( hwndVol, TBM_GETPOS, 0, 0 );
+ if( i_volume_ctrl == (int)dwPos ) return;
+
+ SendMessage( hwndVol, TBM_SETPOS, 1, i_volume_ctrl );
}
void Interface::OnStopStream( void )
var_Set( p_input, "rate-faster", val );
vlc_object_release( p_input );
}
+
+void Interface::Update()
+{
+ /* Misc updates */
+ VolumeUpdate();
+}
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 );
- SendMessage( p_main_interface->hwndVol, TBM_SETPOS, 1,
- 200 - (i_volume * 200 * 2 / AOUT_VOLUME_MAX ) );
}
}
else if( p_intf->p_sys->p_input->b_dead )
}
}
+ /* Take care of the volume, etc... */
+ p_main_interface->Update();
+
/* Manage Playing status */
var_Get( p_input, "state", &val );
if( i_old_playing_status != val.i_int )
HWND CreateMenuBar( HWND, HINSTANCE );
void TogglePlayButton( int i_playing_status );
+ void Update();
HWND hwndMain; // Handle to the main window.
void OnSliderUpdate( int wp );
void OnChange( int wp );
- void Change( int i_volume );
+ void VolumeChange( int i_volume );
+ void VolumeUpdate( void );
void OnStopStream( void );
void OnPrevStream( void );
void OnNextStream( void );
HMENU menu_video;
HMENU menu_audio;
HMENU menu_navigation;
+
+ vlc_bool_t b_volume_hold;
};
/* File Info */