mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
[Feature] Simulator add headphone and lineout toggling
Change-Id: I0b019414643e5c9037c0128093488da49e1a4c0d
This commit is contained in:
parent
7ec1151ddd
commit
aca41be3ca
4 changed files with 52 additions and 15 deletions
|
@ -144,6 +144,32 @@ void sim_trigger_screendump(void)
|
|||
queue_post(&sim_queue, SIM_SCREENDUMP, 0);
|
||||
}
|
||||
|
||||
#ifdef HAVE_HEADPHONE_DETECTION
|
||||
static bool is_hp_inserted = true;
|
||||
bool headphones_inserted(void)
|
||||
{
|
||||
return is_hp_inserted;
|
||||
}
|
||||
void sim_trigger_hp(bool inserted)
|
||||
{
|
||||
is_hp_inserted = inserted;
|
||||
DEBUGF("Headphone %s.\n", inserted ? "inserted":"removed");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LINEOUT_DETECTION
|
||||
static bool is_lo_inserted = false;
|
||||
bool lineout_inserted(void)
|
||||
{
|
||||
return is_lo_inserted;
|
||||
}
|
||||
void sim_trigger_lo(bool inserted)
|
||||
{
|
||||
is_lo_inserted = inserted;
|
||||
DEBUGF("Lineout %s.\n", inserted ? "inserted":"removed");
|
||||
}
|
||||
#endif
|
||||
|
||||
static bool is_usb_inserted;
|
||||
void sim_trigger_usb(bool inserted)
|
||||
{
|
||||
|
@ -157,8 +183,10 @@ void sim_trigger_usb(bool inserted)
|
|||
{
|
||||
send_event(SYS_EVENT_USB_EXTRACTED, NULL);
|
||||
queue_post(&sim_queue, SIM_USB_EXTRACTED, 0);
|
||||
DEBUGF("USB %s.\n", inserted ? "inserted":"removed");
|
||||
}
|
||||
is_usb_inserted = inserted;
|
||||
|
||||
}
|
||||
|
||||
int usb_detect(void)
|
||||
|
@ -204,6 +232,8 @@ void sim_trigger_external(bool inserted)
|
|||
queue_post(&sim_queue, SIM_EXT_INSERTED, drive);
|
||||
else
|
||||
queue_post(&sim_queue, SIM_EXT_EXTRACTED, drive);
|
||||
|
||||
DEBUGF("Ext %s\n", inserted ? "inserted":"removed");
|
||||
}
|
||||
|
||||
bool hostfs_present(int drive)
|
||||
|
|
|
@ -29,5 +29,6 @@ void sim_tasks_init(void);
|
|||
void sim_trigger_screendump(void);
|
||||
void sim_trigger_usb(bool inserted);
|
||||
void sim_trigger_external(bool inserted);
|
||||
|
||||
void sim_trigger_hp(bool inserted);
|
||||
void sim_trigger_lo(bool inserted);
|
||||
#endif
|
||||
|
|
|
@ -172,20 +172,6 @@ bool rtc_check_alarm_flag(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_HEADPHONE_DETECTION
|
||||
bool headphones_inserted(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LINEOUT_DETECTION
|
||||
bool lineout_inserted(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SPDIF_POWER
|
||||
void spdif_power_enable(bool on)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue