return eo;
}
+static void
+_minicontroller_close_music()
+{
+ struct appdata *ad = mp_util_get_appdata();
+ MP_CHECK(ad);
+ MP_TIMER_FREEZE(ad->timer);
+ DEBUG_TRACE("CLOSE");
+ if (!mp_util_is_other_player_playing()) {
+ int ret_set = 0;
+ ret_set = preference_set_int(PREF_MUSIC_STATE, PREF_MUSIC_OFF);
+ if (ret_set) {
+ ERROR_TRACE("set preference failed");
+ }
+ }
+ mp_play_control_reset_ff_rew();
+ xD = 0;
+ yD = 0;
+ xDMove = 0;
+ yDMove = 0;
+ xU = 0;
+ yU = 0;
+ ad->is_sdcard_removed = false;
+ if (!hide_from_mp) {
+ elm_exit();
+ }
+}
+
static void _quick_panel_cb(minicontrol_viewer_event_e event_type,
bundle * event_arg)
{
struct appdata *ad = mp_util_get_appdata();
MP_CHECK(ad);
_mp_minicontroller_update_btn(ad);
+
minicontrol_viewer_event_e event_hide =
(minicontrol_viewer_event_e) MINICONTROL_EVENT_REQUEST_HIDE;
if (event_type == event_hide) {
- MP_TIMER_FREEZE(ad->timer);
- DEBUG_TRACE("CLOSE");
- if (!mp_util_is_other_player_playing()) {
- int ret_set = 0;
- ret_set = preference_set_int(PREF_MUSIC_STATE, PREF_MUSIC_OFF);
- if (ret_set) {
- ERROR_TRACE("set preference failed");
- }
- }
- mp_play_control_reset_ff_rew();
- xD = 0;
- yD = 0;
- xDMove = 0;
- yDMove = 0;
- xU = 0;
- yU = 0;
- ad->is_sdcard_removed = false;
- if (!hide_from_mp) {
- elm_exit();
- }
+ _minicontroller_close_music();
}
- if (event_type ==
- (minicontrol_viewer_event_e) MINICONTROL_VIEWER_EVENT_REPORT_ANGLE) {
+ if (event_type == (minicontrol_viewer_event_e) MINICONTROL_VIEWER_EVENT_REPORT_ANGLE) {
char *value = NULL;
int angle = 0;
bundle_get_str(event_arg, "angle", &value);
angle = atoi(value);
DEBUG_TRACE("Angle is : %d", angle);
}
+ if (!event_arg) {
+ /* Closing music-player when minicontroller is swiped in quickpanel */
+ _minicontroller_close_music();
+ }
mp_minicontroller_rotate(ad, angle);
}
hide_from_mp = false;