-->
<!DOCTYPE ScenePanel SYSTEM "UIForm.dtd">
-<ScenePanel Bversion="3.0.0.201301251814" Dversion="20120315">
+<ScenePanel Bversion="2.0.0.201303111437" Dversion="20120315">
<Panel id="IDC_VIBRATOR_PANEL">
<property backgroundColor="" backgroundColorOpacity="0" compositeEnabled="true" groupStyle="GROUP_STYLE_NONE"/>
<layout height="622" mode="Portrait" type="NONE" width="480" x="0" y="0"/>
<layout height="300" mode="Landscape" type="NONE" width="93" x="0" y="0"/>
</Panel>
<Label id="IDC_LABEL_VIBRATOR_TIME" parent="IDC_VIBRATOR_PANEL">
- <property backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" horizontalAlign="ALIGN_CENTER" text="SET VIBRATION TIME" textColor="" textSize="30" textStyle="LABEL_TEXT_STYLE_NORMAL" verticalAlign="ALIGN_MIDDLE"/>
- <layout height="112" mode="Portrait" width="440" x="20" y="32"/>
+ <property backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" horizontalAlign="ALIGN_CENTER" text="Set vibration time" textColor="" textSize="30" textStyle="LABEL_TEXT_STYLE_NORMAL" verticalAlign="ALIGN_MIDDLE"/>
+ <layout height="84" mode="Portrait" width="440" x="23" y="14"/>
<layout height="71" mode="Landscape" width="388" x="0" y="41"/>
</Label>
<Label id="IDC_LABEL_VIBRATOR_LEVEL" parent="IDC_VIBRATOR_PANEL">
- <property backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" horizontalAlign="ALIGN_CENTER" text="SET VIBRATION LEVEL" textColor="" textSize="30" textStyle="LABEL_TEXT_STYLE_NORMAL" verticalAlign="ALIGN_MIDDLE"/>
- <layout height="112" mode="Portrait" width="440" x="20" y="288"/>
+ <property backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" horizontalAlign="ALIGN_CENTER" text="Set vibration level" textColor="" textSize="30" textStyle="LABEL_TEXT_STYLE_NORMAL" verticalAlign="ALIGN_MIDDLE"/>
+ <layout height="84" mode="Portrait" width="440" x="23" y="181"/>
<layout height="71" mode="Landscape" width="388" x="0" y="219"/>
</Label>
<Slider id="IDC_SLIDER_VIBRATOR_TIME" parent="IDC_VIBRATOR_PANEL">
- <property backgroundColor="" backgroundStyle="BACKGROUND_STYLE_DEFAULT" barColor="" color="" colorOfTitleText="" colorOpacity="100" disabledThumbBitmap="" disabledThumbTextColor="" groupStyle="GROUP_STYLE_NONE" highlightedThumbBitmap="" highlightedThumbTextColor="" leftIconBitmapPath="" max="10" min="1" normalThumbBitmap="" normalThumbTextColor="" pressedThumbBitmap="" pressedThumbTextColor="" rightIconBitmapPath="" showTitleText="false" sliderStyle="SLIDER_STYLE_BUBBLE" titleText="" value="10"/>
- <layout height="112" mode="Portrait" width="440" x="20" y="144"/>
+ <property backgroundColor="" backgroundStyle="BACKGROUND_STYLE_DEFAULT" barColor="" color="" colorOfTitleText="" colorOpacity="100" disabledThumbBitmap="" disabledThumbTextColor="" groupStyle="GROUP_STYLE_NONE" highlightedThumbBitmap="" highlightedThumbTextColor="" leftIconBitmapPath="" max="10" min="1" normalThumbBitmap="" normalThumbTextColor="" pressedThumbBitmap="" pressedThumbTextColor="" rightIconBitmapPath="" showTitleText="false" titleText="" value="10"/>
+ <layout height="84" mode="Portrait" width="440" x="23" y="98"/>
<layout height="122" mode="Landscape" width="388" x="0" y="133"/>
</Slider>
<Slider id="IDC_SLIDER_VIBRATOR_LEVEL" parent="IDC_VIBRATOR_PANEL">
- <property backgroundColor="" backgroundStyle="BACKGROUND_STYLE_DEFAULT" barColor="" color="" colorOfTitleText="" colorOpacity="100" disabledThumbBitmap="" disabledThumbTextColor="" groupStyle="GROUP_STYLE_NONE" highlightedThumbBitmap="" highlightedThumbTextColor="" leftIconBitmapPath="" max="100" min="1" normalThumbBitmap="" normalThumbTextColor="" pressedThumbBitmap="" pressedThumbTextColor="" rightIconBitmapPath="" showTitleText="false" sliderStyle="SLIDER_STYLE_BUBBLE" titleText="" value="100"/>
- <layout height="112" mode="Portrait" width="439" x="20" y="400"/>
+ <property backgroundColor="" backgroundStyle="BACKGROUND_STYLE_DEFAULT" barColor="" color="" colorOfTitleText="" colorOpacity="100" disabledThumbBitmap="" disabledThumbTextColor="" groupStyle="GROUP_STYLE_NONE" highlightedThumbBitmap="" highlightedThumbTextColor="" leftIconBitmapPath="" max="100" min="1" normalThumbBitmap="" normalThumbTextColor="" pressedThumbBitmap="" pressedThumbTextColor="" rightIconBitmapPath="" showTitleText="false" titleText="" value="100"/>
+ <layout height="84" mode="Portrait" width="440" x="23" y="264"/>
<layout height="122" mode="Landscape" width="388" x="0" y="178"/>
</Slider>
<Button id="IDC_BUTTON_START" parent="IDC_VIBRATOR_PANEL">
- <property DisabledBitmapX="0" DisabledBitmapY="0" NormalBitmapX="0" NormalBitmapY="0" PressedBitmapX="0" PressedBitmapY="0" disableTextColor="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="Custom Lv." textSize="24" verticalAlign="ALIGN_MIDDLE"/>
+ <property DisabledBitmapX="0" DisabledBitmapY="0" NormalBitmapX="0" NormalBitmapY="0" PressedBitmapX="0" PressedBitmapY="0" disableTextColor="" disabledBGBitmapPath="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedBitmapPath="" highlightedBitmapX="0" highlightedBitmapY="0" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="Custom Lv." textSize="24" verticalAlign="ALIGN_MIDDLE"/>
<layout height="74" mode="Portrait" width="146" x="170" y="531"/>
<layout height="72" mode="Landscape" width="388" x="0" y="228"/>
</Button>
<Button id="IDC_BUTTON_STOP" parent="IDC_VIBRATOR_PANEL">
- <property DisabledBitmapX="0" DisabledBitmapY="0" NormalBitmapX="0" NormalBitmapY="0" PressedBitmapX="0" PressedBitmapY="0" disableTextColor="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="STOP" textSize="24" verticalAlign="ALIGN_MIDDLE"/>
+ <property DisabledBitmapX="0" DisabledBitmapY="0" NormalBitmapX="0" NormalBitmapY="0" PressedBitmapX="0" PressedBitmapY="0" disableTextColor="" disabledBGBitmapPath="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedBitmapPath="" highlightedBitmapX="0" highlightedBitmapY="0" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="STOP" textSize="24" verticalAlign="ALIGN_MIDDLE"/>
<layout height="74" mode="Portrait" width="146" x="320" y="531"/>
<layout height="72" mode="Landscape" width="259" x="0" y="228"/>
</Button>
<Button id="IDC_BUTTON_SET_DEFAULT" parent="IDC_VIBRATOR_PANEL">
- <property DisabledBitmapX="0" DisabledBitmapY="0" NormalBitmapX="0" NormalBitmapY="0" PressedBitmapX="0" PressedBitmapY="0" disableTextColor="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="System Lv." textSize="24" verticalAlign="ALIGN_MIDDLE"/>
+ <property DisabledBitmapX="0" DisabledBitmapY="0" NormalBitmapX="0" NormalBitmapY="0" PressedBitmapX="0" PressedBitmapY="0" disableTextColor="" disabledBGBitmapPath="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedBitmapPath="" highlightedBitmapX="0" highlightedBitmapY="0" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="System Lv." textSize="24" verticalAlign="ALIGN_MIDDLE"/>
<layout height="74" mode="Portrait" width="146" x="20" y="531"/>
<layout height="72" mode="Landscape" width="93" x="0" y="228"/>
</Button>
+ <Label id="IDC_LABEL1" parent="IDC_VIBRATOR_PANEL">
+ <property backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" horizontalAlign="ALIGN_CENTER" text="Set vibration repeat" textColor="" textSize="30" textStyle="LABEL_TEXT_STYLE_NORMAL" verticalAlign="ALIGN_MIDDLE"/>
+ <layout height="84" mode="Portrait" width="440" x="23" y="348"/>
+ <layout height="71" mode="Landscape" width="388" x="-295" y="229"/>
+ </Label>
+ <Slider id="IDC_SLIDER_VIBRATOR_REPEAT" parent="IDC_VIBRATOR_PANEL">
+ <property backgroundColor="" backgroundStyle="BACKGROUND_STYLE_DEFAULT" barColor="" color="" colorOfTitleText="" colorOpacity="100" disabledThumbBitmap="" disabledThumbTextColor="" groupStyle="GROUP_STYLE_NONE" highlightedThumbBitmap="" highlightedThumbTextColor="" leftIconBitmapPath="" max="10" min="1" normalThumbBitmap="" normalThumbTextColor="" pressedThumbBitmap="" pressedThumbTextColor="" rightIconBitmapPath="" showTitleText="false" titleText="" value="10"/>
+ <layout height="84" mode="Portrait" width="440" x="23" y="431"/>
+ <layout height="122" mode="Landscape" width="622" x="-529" y="178"/>
+ </Slider>
</ScenePanel>
const int VIBRATION_DURATION = 5;
const int VIBRATION_LEVEL = 50;
const int VIBRATION_TIME_IN_SEC = 1000;
+const int VIBRATION_REPEAT_COUNT = 3;
VibratorPanel::VibratorPanel(void)
: __pButtonStart(null)
, __pLabelVibrationLevel(null)
, __vibrationTime(VIBRATION_DURATION)
, __vibrationLevel(VIBRATION_LEVEL)
+ , __vibrationRepeat(VIBRATION_REPEAT_COUNT)
{
__pVibrator->Construct();
}
__pSliderSetLevel->SetValue(this->__vibrationLevel);
}
+ __pSliderSetRepeat = static_cast< Slider* >(GetControl(L"IDC_SLIDER_VIBRATOR_REPEAT"));
+ if (__pSliderSetRepeat != null)
+ {
+ __pSliderSetRepeat->SetValue(this->__vibrationRepeat);
+ }
+
__pButtonStart = static_cast< Button* >(GetControl(L"IDC_BUTTON_START"));
if (__pButtonStart != null)
{
{
__pButtonStop->SetActionId(ID_BUTTON_STOP);
__pButtonStop->AddActionEventListener(*this);
- __pButtonStop->SetEnabled(false);
}
__pButtonDefault = static_cast< Button* >(GetControl(L"IDC_BUTTON_SET_DEFAULT"));
{
case ID_BUTTON_START:
{
- __pVibrator->Start((__pSliderSetTime->GetValue()) * VIBRATION_TIME_IN_SEC, VIBRATION_TIME_IN_SEC,
- VIBRATION_DURATION, __pSliderSetLevel->GetValue());
- __pButtonDefault->SetEnabled(false);
- __pButtonStart->SetEnabled(false);
- __pButtonStop->SetEnabled(true);
+ // Initialise vibration pattern
+ int length = sizeof(_vibartionPattern);
+
+ _vibartionPattern[0].intensity = __pSliderSetLevel->GetValue();
+ _vibartionPattern[0].duration = (__pSliderSetTime->GetValue()) * VIBRATION_TIME_IN_SEC;
+ _vibartionPattern[1].intensity = 0;
+ _vibartionPattern[1].duration = VIBRATION_TIME_IN_SEC;
+
+ // Vibrate with a given pattern and level
+ __pVibrator->Start(_vibartionPattern, length, __pSliderSetRepeat->GetValue());
break;
}
case ID_BUTTON_STOP:
{
__pVibrator->Stop();
- __pButtonDefault->SetEnabled(true);
- __pButtonStart->SetEnabled(true);
- __pButtonStop->SetEnabled(false);
break;
}
case ID_BUTTON_DEFAULT:
{
- __pVibrator->Start((__pSliderSetTime->GetValue()) * VIBRATION_TIME_IN_SEC, VIBRATION_TIME_IN_SEC,
- VIBRATION_DURATION);
- __pButtonDefault->SetEnabled(false);
- __pButtonStart->SetEnabled(false);
- __pButtonStop->SetEnabled(true);
+ // Initialise vibration pattern
+ int length = sizeof(_vibartionPattern);
+
+ _vibartionPattern[0].intensity = -1; // System default vibration intensity
+ _vibartionPattern[0].duration = (__pSliderSetTime->GetValue()) * VIBRATION_TIME_IN_SEC;
+ _vibartionPattern[1].intensity = 0;
+ _vibartionPattern[1].duration = VIBRATION_TIME_IN_SEC;
+
+ // Vibrate with a given pattern and system default level
+ __pVibrator->Start(_vibartionPattern, length, __pSliderSetRepeat->GetValue());
break;
}