bool MCSystemPlaySoundOnChannel(const char *p_channel, const char *p_file, MCSoundChannelPlayType p_type, MCObjectHandle *p_object) { bool t_success; t_success = true; const char *t_apk_file = nil;; if (t_success) if (path_to_apk_path(p_file, t_apk_file)) MCAndroidEngineRemoteCall("playSoundOnChannel", "bsssibj", &t_success, p_channel, t_apk_file, p_file, (int32_t) p_type, true, (long) p_object); else MCAndroidEngineRemoteCall("playSoundOnChannel", "bsssibj", &t_success, p_channel, p_file, p_file, (int32_t) p_type, false, (long) p_object); return t_success; }
bool MCAndroidStopTrackingHeading() { bool t_success = true; MCAndroidEngineRemoteCall("stopTrackingHeading", "b", &t_success); return t_success; }
bool MCAndroidStopTrackingAcceleration() { bool t_success = true; MCAndroidEngineRemoteCall("stopTrackingAcceleration", "b", &t_success); return t_success; }
bool MCSystemStopTrackingLocation() { bool t_success = true; MCAndroidEngineRemoteCall("stopTrackingLocation", "b", &t_success); return t_success; }
bool MCAndroidStopTrackingRotationRate() { bool t_success = true; MCAndroidEngineRemoteCall("stopTrackingRotationRate", "b", &t_success); return t_success; }
bool MCSystemGetEventData(MCExecContext &r_ctxt, const char* p_calendar_event_id, MCVariableValue *&r_calendar_event_data) { // TODO - IMPLEMENT SUPPORT FOR API LEVEL 14 MCLog("MCSystemGetEventData: %s", p_calendar_event_id); MCAndroidEngineRemoteCall("getCalendarEventData", "vs", nil, p_calendar_event_id); MCCalendarToArrayData (r_ctxt, s_calendar_event_data, r_calendar_event_data); return true; }
bool MCSystemRemoveEvent(const char* p_calendar_event_id, bool p_reoccurring, char*& r_calendar_event_id_deleted) { // TODO - IMPLEMENT SUPPORT FOR API LEVEL 14 MCLog("MCSystemRemoveCalendarEvent: %s", p_calendar_event_id); MCAndroidEngineRemoteCall("removeCalendarEvent", "ss", &r_calendar_event_id_deleted, p_calendar_event_id); r_calendar_event_id_deleted = s_calendar_event_selected.clone(); return true; }
bool MCStoreReceiveProductDetails(MCStringRef p_purchase_id, MCStringRef &r_result) { MCAutoStringRef t_result; MCAndroidEngineRemoteCall("storeReceiveProductDetails", "xx", &(&t_result), p_purchase_id); return MCStringCopy(*t_result, r_result); }
bool MCStoreProductSetType(MCStringRef p_product_id, MCStringRef p_product_type) { bool t_result; MCAndroidEngineRemoteCall("storeProductSetType", "bxx", &t_result, p_product_id, p_product_type); return t_result; }
bool MCSystemDeleteSoundChannel(const char *p_channel) { bool t_success; t_success = true; if (t_success) MCAndroidEngineRemoteCall("deleteSoundChannel", "bs", &t_success, p_channel); return t_success; }
bool MCStoreRestorePurchases() { bool t_result = false; MCAndroidEngineRemoteCall("storeRestorePurchases", "b", &t_result); return t_result; }
bool MCStoreConsumePurchase(MCStringRef p_product_id) { bool t_result; MCAndroidEngineRemoteCall("storeConsumePurchase", "bx", &t_result, p_product_id); return t_result; }
bool MCStoreMakePurchase(MCStringRef p_product_id, MCStringRef p_quantity, MCStringRef p_payload) { bool t_success = false; MCAndroidEngineRemoteCall("storeMakePurchase", "bxxx", &t_success, p_product_id, p_quantity, p_payload); return t_success; }
bool MCStoreDisablePurchaseUpdates() { bool t_enable = false; MCAndroidEngineRemoteCall("storeSetUpdates", "vb", NULL, t_enable); return true; }
bool MCSystemSetSoundChannelVolume(const char *p_channel, int32_t p_volume) { bool t_success; t_success = true; if (t_success) MCAndroidEngineRemoteCall("setSoundChannelVoulme", "bsi", &t_success, p_channel, p_volume); return t_success; }
bool MCSystemStartTrackingAcceleration(bool p_loosely) { bool t_success = true; if (t_success) MCAndroidEngineRemoteCall("startTrackingAcceleration", "bb", &t_success, p_loosely); return t_success; }
bool MCAndroidStartTrackingRotationRate(bool p_loosely) { bool t_success = true; if (t_success) MCAndroidEngineRemoteCall("startTrackingRotationRate", "bb", &t_success, p_loosely); return t_success; }
bool MCSystemPickDate(MCDateTime *p_current, MCDateTime *p_min, MCDateTime *p_max, bool p_use_cancel, bool p_use_done, MCDateTime *r_result, bool &r_canceled, MCRectangle p_button_rect) { if (s_in_popup_dialog) return false; int32_t t_current, t_min, t_max; bool t_use_min, t_use_max; t_use_min = p_min != nil; t_use_max = p_max != nil; MCExecPoint ep(nil, nil, nil); if (p_current != nil) { MCD_convert_from_datetime(ep, CF_SECONDS, CF_UNDEFINED, *p_current); t_current = ep.getint4(); } else t_current = MCS_time(); if (t_use_min) { MCD_convert_from_datetime(ep, CF_SECONDS, CF_UNDEFINED, *p_min); t_min = ep.getint4(); } if (t_use_max) { MCD_convert_from_datetime(ep, CF_SECONDS, CF_UNDEFINED, *p_max); t_max = ep.getint4(); } s_in_popup_dialog = true; s_dialog_result = kMCDialogResultUnknown; // IM-2012-10-31 [[ BZ 10483 ]] - make sure we have the timezone bias for the date MCS_getlocaldatetime(s_selected_date); MCAndroidEngineRemoteCall("showDatePicker", "vbbiii", nil, t_use_min, t_use_max, t_min, t_max, t_current); while(s_in_popup_dialog) MCscreen -> wait(60.0, True, True); if (s_dialog_result == kMCDialogResultError) return false; r_canceled = s_dialog_result == kMCDialogResultCanceled; if (!r_canceled) { // IM-2012-10-31 [[ BZ 10483 ]] - convert the return value back to UTC MCS_datetimetouniversal(s_selected_date); *r_result = s_selected_date; } return true; }
bool MCSystemCreateEvent(char*& r_result) { // TODO - IMPLEMENT SUPPORT FOR API LEVEL 14 MCLog("MCSystemCreateCalendarEvent", NULL); MCAndroidEngineRemoteCall("createCalendarEvent", "v", nil); s_calendar_event_status = kMCAndroidCalendarEventWaiting; while (s_calendar_event_status == kMCAndroidCalendarEventWaiting) MCscreen->wait(60.0, False, True); MCLog("MCSystemCreateCalendarEvent - finished", NULL); return true; }
static bool purchase_confirm(MCPurchase *p_purchase) { MCAndroidPurchase *t_android_data = (MCAndroidPurchase*)p_purchase->platform_data; bool t_result = false; MCLog("confirming notification: purchaseId=%d, notificationId=%@", p_purchase->id, t_android_data->notification_id); MCAndroidEngineRemoteCall("purchaseConfirmDelivery", "bix", &t_result, p_purchase->id, t_android_data->notification_id); return t_result; }
bool MCSystemShowEvent(const char* p_calendar_event_id, char*& r_result) { // TODO - IMPLEMENT SUPPORT FOR API LEVEL 14 MCLog("MCSystemShowCalendarEvent", NULL); MCAndroidEngineRemoteCall("showCalendarEvent", "vs", nil, p_calendar_event_id); s_calendar_event_status = kMCAndroidCalendarEventWaiting; while (s_calendar_event_status == kMCAndroidCalendarEventWaiting) MCscreen->wait(60.0, False, True); r_result = s_calendar_event_selected.clone(); MCLog("MCSystemShowCalendarEvent - finished", NULL); return true; }
bool MCSystemComposeTextMessage(const char *p_recipients, const char *p_body) { s_text_status = kMCAndroidTextWaiting; MCAndroidEngineRemoteCall("composeTextMessage", "vss", nil, p_recipients, p_body); while (s_text_status == kMCAndroidTextWaiting) MCscreen->wait(60.0, False, True); MCresult -> sets(s_text_status == kMCAndroidTextSent ? "sent" : "cancel"); return true; }
bool MCAndroidStartTrackingHeading(bool p_loosely) { bool t_success = true; if (s_heading_reading == nil) t_success = MCMemoryNew(s_heading_reading); if (t_success) MCAndroidEngineRemoteCall("startTrackingHeading", "bb", &t_success, p_loosely); return t_success; }
bool MCPurchaseSendRequest(MCPurchase *p_purchase) { if (p_purchase->state != kMCPurchaseStateInitialized) return false; MCAndroidPurchase *t_android_data = (MCAndroidPurchase*)p_purchase->platform_data; bool t_success = false; MCAndroidEngineRemoteCall("purchaseSendRequest", "bixx", &t_success, p_purchase->id, t_android_data->product_id, t_android_data->developer_payload); return t_success; }
bool MCStoreCanMakePurchase() { bool t_result = false; s_can_make_purchase_returned = false; s_can_make_purchase = false; MCAndroidEngineRemoteCall("storeCanMakePurchase", "b", &t_result); while (!s_can_make_purchase_returned) MCscreen->wait(60, True, True); return s_can_make_purchase; }
bool MCSystemPlaySoundOnChannel(const char *p_channel, const char *p_file, MCSoundChannelPlayType p_type, MCObjectHandle *p_object) { bool t_success; t_success = true; const char *t_apk_file = nil;; // IM-2013-11-13: [[ Bug 11428 ]] Resolve path to make sure asset paths are valid char *t_resolved_path; t_resolved_path = nil; if (t_success) t_success = nil != (t_resolved_path = MCS_resolvepath(p_file)); if (t_success) if (path_to_apk_path(t_resolved_path, t_apk_file)) MCAndroidEngineRemoteCall("playSoundOnChannel", "bsssibj", &t_success, p_channel, t_apk_file, p_file, (int32_t) p_type, true, (long) p_object); else MCAndroidEngineRemoteCall("playSoundOnChannel", "bsssibj", &t_success, p_channel, t_resolved_path, p_file, (int32_t) p_type, false, (long) p_object); MCCStringFree(t_resolved_path); return t_success; }
bool MCSystemSoundChannelStatus(const char *p_channel, MCSoundChannelStatus& r_status) { bool t_success; t_success = true; if (t_success) { int32_t t_status; MCAndroidEngineRemoteCall("getSoundChannelStatus", "is", &t_status, p_channel); if (t_status >= 0) r_status = (MCSoundChannelStatus) t_status; else t_success = false; } return t_success; }
bool MCSystemSoundChannelVolume(const char *p_channel, int32_t& r_volume) { bool t_success; t_success = true; if (t_success) { int32_t t_volume; MCAndroidEngineRemoteCall("getSoundChannelVolume", "is", &t_volume, p_channel); if (t_volume >= 0) r_volume = t_volume; else t_success = false; } return t_success; }
bool MCSystemAddEvent(MCCalendar p_new_calendar_event_data, char*& r_result) { // TODO - IMPLEMENT SUPPORT FOR API LEVEL 14 MCLog("MCSystemAddCalendarEvent", NULL); MCAndroidEngineRemoteCall("addCalendarEvent", "issssbbbbiisiis", &r_result, p_new_calendar_event_data.mceventid.getstring(), p_new_calendar_event_data.mctitle.getstring(), p_new_calendar_event_data.mcnote.getstring(), p_new_calendar_event_data.mclocation.getstring(), p_new_calendar_event_data.mcalldayset, p_new_calendar_event_data.mcallday, p_new_calendar_event_data.mcstartdateset, p_new_calendar_event_data.mcenddateset, p_new_calendar_event_data.mcalert1, p_new_calendar_event_data.mcalert2, p_new_calendar_event_data.mcfrequency.getstring(), p_new_calendar_event_data.mcfrequencycount, p_new_calendar_event_data.mcfrequencyinterval, p_new_calendar_event_data.mccalendar.getstring()); r_result = s_calendar_event_selected.clone(); return true; }
bool MCSystemPickTime(MCDateTime *p_current, MCDateTime *p_min, MCDateTime *p_max, int32_t p_step, bool p_use_cancel, bool p_use_done, MCDateTime *r_result, bool &r_canceled, MCRectangle p_button_rect) { if (s_in_popup_dialog) return false; int32_t t_hour, t_minute; MCExecPoint ep(nil, nil, nil); MCDateTime t_current; if (p_current != nil) t_current = *p_current; else { ep.setnvalue(MCS_time()); MCD_convert_to_datetime(ep, CF_SECONDS, CF_UNDEFINED, t_current); } // IM-2012-05-09 - make sure we show the correct local hour + minute values MCS_datetimetolocal(t_current); t_hour = t_current.hour; t_minute = t_current.minute; s_in_popup_dialog = true; s_dialog_result = kMCDialogResultUnknown; // IM-2012-10-31 [[ BZ 10483 ]] - make sure we have the timezone bias for the date s_selected_date = t_current; MCAndroidEngineRemoteCall("showTimePicker", "vii", nil, t_hour, t_minute); while (s_in_popup_dialog) MCscreen->wait(60.0, True, True); if (s_dialog_result == kMCDialogResultError) return false; r_canceled = s_dialog_result == kMCDialogResultCanceled; if (!r_canceled) { // IM-2012-10-31 [[ BZ 10483 ]] - convert the return value back to UTC MCS_datetimetouniversal(s_selected_date); *r_result = s_selected_date; } return true; }