NxWM::CMediaPlayer: Fix of state related bugs + Size if CLabel is increased (in preparation for becoming a CListBox)

This commit is contained in:
Gregory Nutt 2014-07-16 11:11:00 -06:00
parent c3401b677b
commit abc11dd52a
2 changed files with 64 additions and 40 deletions

42
Kconfig
View File

@ -311,7 +311,7 @@ config NXWM
if NXWM if NXWM
menu "NxWM General settings" menu "NxWM General Settings"
config NXWM_LARGE_ICONS config NXWM_LARGE_ICONS
bool "Use large icons" bool "Use large icons"
@ -675,7 +675,9 @@ config NXWM_STARTWINDOW_STACKSIZE
endmenu # Start Window Configuration endmenu # Start Window Configuration
menuconfig NXWM_NXCONSOLE menu "NxConsole Window Settings"
config NXWM_NXCONSOLE
bool "NxConsole Window" bool "NxConsole Window"
default y default y
---help--- ---help---
@ -759,6 +761,7 @@ config NXWM_NXCONSOLE_ICON
endif # NXWM_NXCONSOLE_ICON endif # NXWM_NXCONSOLE_ICON
endif # NXWM_NXCONSOLE endif # NXWM_NXCONSOLE
endmenu # NxConsole Window Settings
menu "NxWM Touchscreen Configuration" menu "NxWM Touchscreen Configuration"
@ -771,7 +774,7 @@ config NXWM_TOUCHSCREEN
if NXWM_TOUCHSCREEN if NXWM_TOUCHSCREEN
comment "Touchscreen device settings" comment "Touchscreen Device Settings"
config NXWM_TOUCHSCREEN_DEVINIT config NXWM_TOUCHSCREEN_DEVINIT
bool "Touchscreen Device Initialization" bool "Touchscreen Device Initialization"
@ -844,7 +847,7 @@ config NXWM_KEYBOARD
if NXWM_KEYBOARD if NXWM_KEYBOARD
comment "Keyboard device settings" comment "Keyboard Device Settings"
config NXWM_KEYBOARD_DEVPATH config NXWM_KEYBOARD_DEVPATH
string "Keyboard Device Path" string "Keyboard Device Path"
@ -880,7 +883,7 @@ config NXWM_KEYBOARD_LISTENERSTACK
endif # NXWM_KEYBOARD endif # NXWM_KEYBOARD
endmenu # NxWM Keyboard Configuration endmenu # NxWM Keyboard Configuration
menu "NxWM Calibration display settings" menu "NxWM Calibration Display Settings"
config NXWM_CALIBRATION_MARGIN config NXWM_CALIBRATION_MARGIN
int "Calibration Margin" int "Calibration Margin"
@ -1045,9 +1048,9 @@ config NXWM_CALIBRATION_LISTENERSTACK
---help--- ---help---
Calibration listener thread stack size. Default 2048 Calibration listener thread stack size. Default 2048
endmenu # NxWM Calibration display settings endmenu # NxWM Calibration Display Settings
menu "NxWM Hex Calculator display settings" menu "NxWM Hex Calculator Display Settings"
config NXWM_HEXCALCULATOR_CUSTOM_COLORS config NXWM_HEXCALCULATOR_CUSTOM_COLORS
bool "Custom Hex Calculator Colors" bool "Custom Hex Calculator Colors"
@ -1103,7 +1106,9 @@ config NXWM_HEXCALCULATOR_FONTID
NxWM font ID (NXWM_DEFAULT_FONTID). Default: 0 NxWM font ID (NXWM_DEFAULT_FONTID). Default: 0
endif # NXWM_HEXCALCULATOR_FONTID endif # NXWM_HEXCALCULATOR_FONTID
endmenu # NxWM Hex Calculator display settings endmenu # NxWM Hex Calculator Display Dettings
menu "NxWM Media Player Display Settings"
config NXWM_MEDIAPLAYER config NXWM_MEDIAPLAYER
bool "NxWM Media Player" bool "NxWM Media Player"
@ -1119,13 +1124,28 @@ config NXWM_MEDIAPLAYER
if NXWM_MEDIAPLAYER if NXWM_MEDIAPLAYER
config NXWM_MEDIAPLAYER_MEDIAPATH
string "Path to media"
default "/mnt/sdcard"
---help---
This is the full path to the mount point of the storage device
containing all of the media files accessible by the media player.
config NXWM_MEDIAPLAYER_XSPACING config NXWM_MEDIAPLAYER_XSPACING
int "Media Player Button Spacing" int "Media Player Horizontal Spacing"
default 12 default 12
---help--- ---help---
This is the space between play, forward, and reverse buttons in This is the space between play, forward, and reverse controls in
units of pixels. units of pixels.
config NXWM_MEDIAPLAYER_YSPACING
int "Media Player Vertical Spacing"
default 8
---help---
This is the space between vertical element: (1) list box, (2) play,
forward, and reverse controls, and the volume slider in units of
lines.
config NXWM_MEDIAPLAYER_BORDERS config NXWM_MEDIAPLAYER_BORDERS
bool "Media Player Button Borders" bool "Media Player Button Borders"
default n default n
@ -1135,4 +1155,6 @@ config NXWM_MEDIAPLAYER_BORDERS
then have buttons with boarders might make more sense. then have buttons with boarders might make more sense.
endif # NXWM_MEDIAPLAYER endif # NXWM_MEDIAPLAYER
endmenu # NxWM Media Player Display Settings
endif # NXWM endif # NXWM

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* NxWidgets/libnxwidgets/include/cglyphsliderhorizontal.hxx * NxWidgets/libnxwidgets/include/cglyphsliderhorizontal.hxx
* *
* Copyright (C) 2013 Ken Pettit. All rights reserved. * Copyright (C) 2013, 2014 Ken Pettit. All rights reserved.
* Author: Ken Pettit <pettitkd@gmail.com> * Author: Ken Pettit <pettitkd@gmail.com>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -99,8 +99,8 @@ namespace NXWidgets
{ {
protected: protected:
CGlyphSliderHorizontalGrip *m_grip; /**< Pointer to the grip. */ CGlyphSliderHorizontalGrip *m_grip; /**< Pointer to the grip. */
nxgl_coord_t m_minimumValue; /**< Minimum value that the grip can represent. */ int m_minimumValue; /**< Minimum value that the grip can represent. */
nxgl_coord_t m_maximumValue; /**< Maximum value that the grip can represent. */ int m_maximumValue; /**< Maximum value that the grip can represent. */
int32_t m_value; /**< Current value of the slider. */ int32_t m_value; /**< Current value of the slider. */
nxgl_coord_t m_minimumGripWidth; /**< Smallest width that the grip can become */ nxgl_coord_t m_minimumGripWidth; /**< Smallest width that the grip can become */
nxgl_coord_t m_pageSize; /**< Value of a page of data, used when clicking nxgl_coord_t m_pageSize; /**< Value of a page of data, used when clicking
@ -116,7 +116,7 @@ namespace NXWidgets
* Get the maximum possible value that the slider can represent. Useful when * Get the maximum possible value that the slider can represent. Useful when
* using the slider as a scrollbar, as the height of the grip prevents the full * using the slider as a scrollbar, as the height of the grip prevents the full
* range of values being accessed (intentionally). * range of values being accessed (intentionally).
* The returned value is bitshfted left 16 places for more accuracy in fixed-point * The returned value is shifted left 16 places for more accuracy in fixed-point
* calculations. * calculations.
* *
* @return The maximum possible value that the slider can represent. * @return The maximum possible value that the slider can represent.
@ -188,6 +188,9 @@ namespace NXWidgets
/** /**
* Destructor. * Destructor.
*
* NOTE: That the contained bitmap image is not destroyed when the image
* container is destroyed.
*/ */
virtual inline ~CGlyphSliderHorizontal(void) { } virtual inline ~CGlyphSliderHorizontal(void) { }
@ -198,7 +201,7 @@ namespace NXWidgets
* @return The smallest value. * @return The smallest value.
*/ */
inline const nxgl_coord_t getMinimumValue(void) const inline const int getMinimumValue(void) const
{ {
return m_minimumValue; return m_minimumValue;
} }
@ -209,7 +212,7 @@ namespace NXWidgets
* @return The largest value. * @return The largest value.
*/ */
inline const nxgl_coord_t getMaximumValue(void) const inline const int getMaximumValue(void) const
{ {
return m_maximumValue; return m_maximumValue;
} }
@ -220,16 +223,15 @@ namespace NXWidgets
* return The current slider value. * return The current slider value.
*/ */
inline const nxgl_coord_t getValue(void) const inline const int getValue(void) const
{ {
return m_value >> 16; return (int)(m_value >> 16);
} }
/** /**
* Get the value represented by the height of the grip. * Get the value represented by the height of the grip. For sliders,
* For sliders, this would typically be 1 (so each new * this would typically be 1 (so each new grip position is worth 1).
* grip position is worth 1). For scrollbars, this * For scrollbars, this would be the height of the scrolling widget.
* would be the height of the scrolling widget.
* *
* @return The page size. * @return The page size.
*/ */
@ -245,7 +247,7 @@ namespace NXWidgets
* @param value The smallest value. * @param value The smallest value.
*/ */
inline void setMinimumValue(const nxgl_coord_t value) inline void setMinimumValue(const int value)
{ {
m_minimumValue = value; m_minimumValue = value;
m_contentSize = m_maximumValue - m_minimumValue + 1; m_contentSize = m_maximumValue - m_minimumValue + 1;
@ -258,7 +260,7 @@ namespace NXWidgets
* @param value The largest value. * @param value The largest value.
*/ */
inline void setMaximumValue(const nxgl_coord_t value) inline void setMaximumValue(const int value)
{ {
m_maximumValue = value; m_maximumValue = value;
m_contentSize = m_maximumValue - m_minimumValue + 1; m_contentSize = m_maximumValue - m_minimumValue + 1;
@ -272,11 +274,11 @@ namespace NXWidgets
* @param value The new value. * @param value The new value.
*/ */
void setValue(const nxgl_coord_t value); void setValue(const int value);
/** /**
* Set the value that of the slider. This will reposition and redraw * Set the value that of the slider. This will reposition and redraw
* the grip. The supplied value should be bitshifted left 16 places. * the grip. The supplied value should be shifted left 16 places.
* This ensures greater accuracy than the standard setValue() method if * This ensures greater accuracy than the standard setValue() method if
* the slider is being used as a scrollbar. * the slider is being used as a scrollbar.
* *